/* 启动占位沿用页面背景；所有样式在同源 CSS 中，避免线上 CSP 拦截内联样式。 */
.startup-screen { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; background: inherit; color: var(--polar-200); }
.startup-spinner { width: 24px; height: 24px; border: 2px solid var(--polar-600); border-top-color: var(--polar-200); border-radius: 50%; animation: startup-spin .7s linear infinite; }
/* 恢复提示不依赖主脚本，延迟十秒出现；登录或订阅台就绪时整个占位会被隐藏。 */
.startup-help { position: absolute; top: calc(50% + 32px); left: 24px; right: 24px; margin: 0; text-align: center; font-size: 13px; line-height: 1.6; visibility: hidden; animation: startup-help-reveal 0s 10s forwards; }
.startup-noscript { position: absolute; bottom: 24px; left: 24px; right: 24px; margin: 0; text-align: center; font-size: 13px; line-height: 1.6; }
@keyframes startup-spin { to { transform: rotate(360deg); } }
@keyframes startup-help-reveal { to { visibility: visible; } }
/* 减少动态效果时保留静态加载指示，恢复提示仍按原延迟出现。 */
@media (prefers-reduced-motion: reduce) { .startup-spinner { animation: none; } }

/* Polar 开源 Web 客户端 2026-09-25 的深色配色与 Metrics 三栏层级。 */
:root{color-scheme:dark;--polar-950:hsl(0 0% 3.5%);--polar-900:hsl(0 0% 6.5%);--polar-800:hsl(0 0% 9.5%);--polar-700:hsl(0 0% 13%);--polar-600:hsl(0 0% 16%);--polar-500:hsl(0 0% 46%);--polar-200:hsl(0 0% 68%);--polar-50:hsl(0 0% 85%);--blue:#2563eb;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}body{margin:0;min-width:320px;background:var(--polar-800);color:#fff}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default}a{color:inherit;text-decoration:none}[hidden]{display:none!important}:focus-visible{outline:2px solid #5892ff;outline-offset:2px}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}.global-sidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;background:var(--polar-950);padding:14px 9px 12px;border-right:1px solid var(--polar-700)}.sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:0 8px 26px}.brand-icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#111;font-weight:800;font-size:19px;letter-spacing:-.09em}.brand-icon span{transform:translateX(-1px)}.side-icon{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--polar-400);font-size:21px}.side-icon:hover{background:var(--polar-700);color:#fff}.global-nav{display:flex;flex-direction:column;gap:3px}.global-link{display:flex;align-items:center;gap:13px;width:100%;height:37px;padding:0 10px;text-align:left;border:1px solid transparent;border-radius:8px;background:transparent;color:#b0b0b0;font-size:14px;font-weight:470}.global-link.selected{background:#222;border-color:#303030;color:#fff}.global-link:not(:disabled):hover{background:#1f1f1f}.global-link:disabled{opacity:1;color:#898989}.nav-symbol{display:inline-grid;place-items:center;width:22px;font-size:18px;color:#929292;font-weight:400}.global-link.selected .nav-symbol{color:#fff}.nav-heading{padding:20px 12px 6px;color:var(--polar-500);font-size:12px;font-weight:600}.sidebar-footer{margin-top:auto;display:grid;gap:11px;padding:0 3px}.observed{color:#666;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px}.environment-label{color:#777;font-size:11px;padding:0 8px}.sidebar-footer select{width:100%;height:36px;border:1px solid #2a2a2a;border-radius:8px;background:#161616;color:#ddd;padding:0 10px;font-size:12px}.account-button{display:flex;align-items:center;gap:10px;width:100%;min-height:39px;padding:5px 6px;border:1px solid transparent;border-radius:8px;background:transparent;color:#d8d8d8;text-align:left;font-size:12px}.account-button:hover{background:#1c1c1c}.account-avatar{display:grid;place-items:center;width:25px;height:25px;border-radius:6px;background:#244bd3;color:#fff;font-size:12px;font-weight:700}.account-chevron{margin-left:auto;color:#777}
/* 第二列列表和主内容容器来自 DashboardBody 的左右分栏关系。 */
.workspace-body{display:flex;flex-direction:row;gap:8px;padding:8px;min-width:0;height:100vh}.dashboards-panel{order:0;flex:0 0 300px;min-width:0;border:1px solid var(--polar-800);border-radius:16px;background:var(--polar-900);overflow:auto}.dashboards-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:16px;border-bottom:1px solid var(--polar-700);font-size:14px;font-weight:500}.dashboards-heading button{width:26px;height:26px;display:grid;place-items:center;border:0;border-radius:7px;background:var(--polar-800);color:#bcbcbc;font-size:18px;line-height:1}.dashboards-heading button:disabled{opacity:.55}.dashboard-list{display:flex;flex-direction:column}.dashboard-list button{min-height:45px;width:100%;padding:0 16px;text-align:left;border:0;border-bottom:1px solid #1f1f1f;background:transparent;color:#e2e2e2;font-size:14px}.dashboard-list button.current{background:var(--polar-800);color:#fff}.dashboard-list button:disabled{color:#bcbcbc}.metrics-panel{order:1;flex:1 1 auto;min-width:0;overflow-y:auto;overflow-x:hidden;border:1px solid var(--polar-800);border-radius:16px;background:var(--polar-900)}.metrics-inner{width:100%;padding:31px 32px 30px}.metrics-header{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:42px;margin-bottom:33px}.heading-row{display:flex;align-items:center;gap:12px}.metrics-header h1{margin:0;font-size:20px;line-height:1.25;font-weight:500;letter-spacing:-.018em}.filters{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.filter-select,.range-control,.more-button{height:40px;border:1px solid var(--polar-700);border-radius:11px;background:var(--polar-800);color:#ededed;box-shadow:0 1px 2px #0004;font-size:14px}.filter-select{max-width:160px;min-width:90px;padding:0 27px 0 12px;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-color:var(--polar-800)}.currency-select{min-width:76px;max-width:84px}.range-control{display:flex;position:relative;align-items:center;width:210px;flex:none;overflow:visible}.calendar-button,.range-button{height:100%;border:0;background:transparent;color:#e6e6e6}.calendar-button{width:44px;border-right:1px solid var(--polar-700);font-size:19px}.range-button{flex:1;min-width:0;padding:0 11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.calendar-button:hover,.range-button:hover{background:var(--polar-700)}.range-popover{position:absolute;top:45px;left:0;z-index:5;min-width:238px;padding:8px;border:1px solid #333;border-radius:12px;background:#151515;box-shadow:0 12px 42px #000a}.preset-list{display:grid;gap:2px}.preset-list button{height:34px;padding:0 10px;border:1px solid transparent;border-radius:5px;text-align:left;background:transparent;color:#a8a8a8;font-size:13px}.preset-list button:hover,.preset-list button.chosen{background:#242424;border-color:#303030;color:#fff}/* Polar 日期按钮与预设列表分别打开面板；日历用同一深色控件层级。 */
.calendar-popover{position:absolute;top:45px;left:0;z-index:6;width:300px;max-width:calc(100vw - 32px);padding:12px;border:1px solid #333;border-radius:12px;background:#151515;box-shadow:0 12px 42px #000a}.calendar-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px;color:#eee;font-size:13px;font-weight:600}.calendar-heading button{width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:#ddd;font-size:22px}.calendar-heading button:hover:not(:disabled){background:#292929}.calendar-heading button:disabled{opacity:.35}.calendar-weekdays,.calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center}.calendar-weekdays{color:#777;font-size:10px;margin-bottom:5px}.calendar-weekdays span{height:24px;display:grid;place-items:center}.calendar-day{height:36px;border:0;border-radius:6px;background:transparent;color:#ddd;font-size:12px}.calendar-day:hover:not(:disabled){background:#303030}.calendar-day.in-range{background:#173366;color:#fff}.calendar-day.anchor{background:#2563eb;color:#fff}.calendar-day.other-month{color:#777}.calendar-day:disabled{opacity:.3;cursor:default}.calendar-selection{padding:10px 2px 2px;border-top:1px solid #303030;color:#999;font-size:11px;text-align:center;margin-top:7px}
.export-control{position:relative}.more-button{width:35px;display:grid;place-items:center;font-size:22px;line-height:1}.more-button:hover{background:#242424}.export-menu{position:absolute;right:0;top:44px;z-index:5;min-width:105px;padding:5px;border:1px solid #333;border-radius:8px;background:#1b1b1b;box-shadow:0 10px 30px #0008}.export-menu button{height:32px;width:100%;padding:0 8px;border:0;border-radius:5px;text-align:left;background:transparent;color:#eee;font-size:12px}.export-menu button:hover{background:#303030}.error-banner{padding:10px 14px;margin:-10px 0 19px;border:1px solid #8d3a3a;border-radius:8px;background:#321b1b;color:#ffc7c7;font-size:13px}
/* Polar 的 MetricGroup 首卡跨两列；每张卡用同一条边线拼成网格。 */
.metrics-grid{display:grid;grid-template-columns:1fr;overflow:hidden;border:1px solid var(--polar-700);border-radius:16px;background:var(--polar-900);clip-path:inset(1px 1px 1px 1px)}.metric-card{position:relative;display:flex;flex-direction:column;min-width:0;min-height:345px;overflow:hidden;border-right:1px solid var(--polar-700);border-bottom:1px solid var(--polar-700);background:transparent}.metric-card:first-child{grid-column:span 1}.metric-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:20px 24px 0}.metric-card h2{min-height:27px;margin:0;color:#f3f3f3;font-size:18px;line-height:1.32;font-weight:460;letter-spacing:-.015em}.metric-menu{width:28px;height:28px;flex:none;margin:-5px -7px 0 0;border:0;border-radius:50%;background:transparent;color:#969696;font-size:18px;opacity:0}.metric-card:hover .metric-menu,.metric-menu:focus-visible{opacity:1}.metric-menu:hover{background:#303030;color:#fff}.metric-value{display:block;padding:13px 24px 0;font-size:clamp(31px,3vw,48px);line-height:1.06;font-weight:350;letter-spacing:-.045em;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.metric-period{display:flex;align-items:center;gap:8px;padding:14px 24px 2px;color:#858585;font-size:13px;min-height:36px}.metric-dot{display:block;width:12px;height:12px;border:2px solid var(--blue);border-radius:50%;flex:none}.metric-chart{display:flex;align-items:center;justify-content:center;flex:1;min-height:180px;position:relative}.metric-chart svg{width:100%;height:200px;display:block}.metric-unavailable{color:#777;font-size:14px;text-align:center;padding:20px}.metric-chart-tooltip{position:absolute;z-index:2;top:9px;right:11px;padding:8px 10px;border:1px solid #414141;border-radius:7px;background:#232323;box-shadow:0 8px 24px #0009;color:#fff;font-size:12px;pointer-events:none}.metric-chart-tooltip strong{display:block;font-size:13px;margin-top:2px}.metric-card[data-unavailable="true"] .metric-value{color:#8e8e8e}.metric-card[data-unavailable="true"] .metric-period{color:#777}.data-note{padding:18px 3px;color:#777;font-size:11px;line-height:1.5}.mobile-head,.mobile-list-button{display:none}
/* Polar Auth 页采用整页居中、448px 浅灰卡片与 60px 品牌图标；当前只呈现可用的管理员表单。 */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #fff; color: #111; }
.login-card { display: flex; flex-direction: column; gap: 32px; width: min(100%, 448px); padding: 48px; border-radius: 24px; background: #f9fafb; }
.login-intro { display: flex; flex-direction: column; gap: 16px; }
.login-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #111; color: #fff; font-size: 37px; font-weight: 700; letter-spacing: -.09em; }
.login-mark span { transform: translateX(-2px); }
.login-heading { display: flex; flex-direction: column; gap: 12px; }
.login-heading h1 { margin: 0; color: #111; font-size: 24px; line-height: 1.3; font-weight: 500; letter-spacing: -.025em; }
.login-heading p { margin: 0; color: #6b7280; font-size: 18px; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form label { color: #4b5563; font-size: 13px; font-weight: 500; }
.login-form input { width: 100%; height: 44px; margin: 0 0 8px; padding: 0 14px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #111; font-size: 14px; }
.login-form input::placeholder { color: #9ca3af; }
.login-form input:focus { outline: 2px solid #2563eb; outline-offset: 1px; }
.login-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 4px; padding: 0 16px; border: 1px solid #111; border-radius: 8px; background: #111; color: #fff; font-size: 14px; font-weight: 500; }
.login-button:hover:not(:disabled) { background: #303030; }
.login-button:disabled { opacity: .62; }
.login-error { padding: 11px 12px; border-radius: 8px; background: #fef2f2; color: #b42318; font-size: 13px; line-height: 1.5; }
.login-footnote { margin: -8px 0 0; color: #9ca3af; font-size: 12px; line-height: 1.5; text-align: center; }
@media (max-width: 520px) { .login-screen { padding: 16px; } .login-card { padding: 32px 24px; } }
/* ProductSelect 按 Polar 的搜索、多选和分组选中方式实现。 */
.product-control{position:relative;width:190px;flex:none}.product-button{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;height:40px;padding:0 12px;border:1px solid var(--polar-700);border-radius:11px;background:var(--polar-800);color:#ededed;box-shadow:0 1px 2px #0004;font-size:14px;text-align:left}.product-button:hover{background:var(--polar-700)}.product-button #product-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filter-chevron{color:#999;font-size:17px}.product-popover{position:absolute;top:45px;left:0;z-index:7;width:280px;max-width:calc(100vw - 32px);padding:5px;border:1px solid #333;border-radius:11px;background:#171717;box-shadow:0 12px 42px #000a}.product-popover input{width:100%;height:37px;padding:0 10px;border:0;border-bottom:1px solid #303030;background:transparent;color:#fff;outline:none;font-size:13px}.product-all-button,.product-option{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:36px;padding:6px 9px;border:0;border-radius:5px;background:transparent;color:#eee;text-align:left;font-size:13px}.product-all-button:hover,.product-option:hover{background:#292929}.product-all-button{font-weight:600}.product-all-button span:last-child{color:#999;font-size:11px;font-weight:400}.product-list{max-height:230px;overflow-y:auto}.product-option span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-check{font-size:16px;color:#fff;opacity:0}.product-option.is-selected .product-check{opacity:1}.product-empty{padding:12px;color:#888;font-size:12px}
/* Polar 卡片有悬停分享入口、操作菜单，以及带主题和复制下载操作的分享对话框。 */
.metric-actions{position:relative;display:flex;align-items:center;gap:4px;margin:-5px -7px 0 0;flex:none}.metric-actions[hidden]{display:none}.metric-actions .metric-menu{margin:0}.metric-share{width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:#aaa;font-size:19px;opacity:0}.metric-card:hover .metric-share,.metric-share:focus-visible{opacity:1}.metric-share:hover{background:#303030;color:#fff}.metric-actions-menu{position:absolute;top:32px;right:0;z-index:8;min-width:136px;padding:5px;border:1px solid #343434;border-radius:8px;background:#1d1d1d;box-shadow:0 12px 32px #0009}.metric-actions-menu button{display:block;width:100%;height:34px;padding:0 9px;border:0;border-radius:5px;background:transparent;color:#eee;text-align:left;font-size:13px}.metric-actions-menu button:hover{background:#333}.mobile-share-action{display:none!important}
.share-dialog{width:min(920px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:0;border:1px solid #353535;border-radius:16px;background:#151515;color:#eee;box-shadow:0 30px 90px #000b}.share-dialog::backdrop{background:#000b}.share-dialog-head{display:flex;align-items:center;justify-content:space-between;padding:17px 20px;border-bottom:1px solid #303030}.share-dialog-head h2{margin:0;font-size:17px;font-weight:500}.share-dialog-head button{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#ccc;font-size:24px}.share-dialog-head button:hover{background:#303030}.share-dialog-body{padding:24px 32px 18px}.share-dialog canvas{display:block;width:100%;height:auto;border-radius:12px}.share-dialog-tools{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:20px}.share-themes,.share-buttons{display:flex;align-items:center;gap:9px}.share-theme{width:33px;height:33px;border:2px solid transparent;border-radius:50%;background:linear-gradient(135deg,#29292b,#080809)}.share-theme.color{background:linear-gradient(135deg,#12285d,#4389ee)}.share-theme.selected{border-color:#3b82f6}.share-buttons button{min-width:90px;height:38px;padding:0 15px;border:1px solid #333;border-radius:9px;background:#222;color:#fff;font-size:13px}.share-buttons button:last-child{border-color:#2563eb;background:#2563eb}.share-buttons button:hover{filter:brightness(1.16)}.share-status{min-height:18px;margin:9px 0 0;color:#999;font-size:12px;text-align:right}
@media(min-width:1024px){.metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card:first-child{grid-column:span 2}}
@media(min-width:1536px){.metrics-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1279px){.app-shell{grid-template-columns:210px minmax(0,1fr)}.dashboards-panel{flex-basis:240px}.metrics-inner{padding:26px 22px}.metrics-header{align-items:flex-start;flex-direction:column}.filters{justify-content:flex-start}.metric-card h2{font-size:16px}}
@media(max-width:950px){.app-shell{grid-template-columns:190px minmax(0,1fr)}.dashboards-panel{display:none}.dashboards-panel.open{display:block;position:fixed;z-index:10;top:68px;left:15px;width:min(310px,calc(100vw - 30px));max-height:70vh;box-shadow:0 20px 60px #000b}.mobile-list-button{display:grid;place-items:center;margin-left:auto;width:30px;height:30px;border:1px solid #333;border-radius:8px;background:#202020;color:#fff}.heading-row{width:100%}.metrics-inner{padding:25px 22px}}
@media(max-width:767px){.metric-share{display:none}.mobile-share-action{display:block!important}.metric-menu{opacity:1}.share-dialog-body{padding:16px}.share-dialog-tools{align-items:flex-start}.share-buttons{flex:1;justify-content:flex-end}.share-buttons button{min-width:68px}.share-status{text-align:left}}
@media(max-width:650px){.app-shell{display:block}.global-sidebar{display:none}.workspace-body{height:auto;min-height:100vh;display:block;padding:0}.metrics-panel{min-height:100vh;border:0;border-radius:0;overflow:visible}.mobile-head{display:flex;align-items:center;gap:10px;min-height:55px;padding:8px 16px;border-bottom:1px solid #242424;font-size:13px;font-weight:600}.mobile-brand{width:26px;height:26px;font-size:15px}.mobile-head button{margin-left:auto;border:0;background:transparent;color:#ddd;font-size:20px}.metrics-inner{padding:22px 16px}.metrics-header{margin-bottom:23px}.metrics-header h1{font-size:20px}.filters{width:100%;gap:7px}.filter-select{height:38px;flex:1 1 100px;max-width:none}.range-control{height:38px;width:calc(100% - 45px);order:3}.product-control{order:2;flex:1 1 120px;width:auto}.currency-select{order:2;flex:0 0 78px}.export-control{order:3;margin-left:auto}.more-button{height:38px}.metrics-grid{grid-template-columns:1fr}.metric-card:first-child{grid-column:span 1}.metric-card{min-height:315px}.metric-value{font-size:30px}.dashboards-panel.open{top:62px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* 浅色中文主题：保留 Polar 三栏和卡片比例，颜色转为中性白与订阅蓝。 */
:root {
  color-scheme: light;
  --polar-950: #ffffff;
  --polar-900: #ffffff;
  --polar-800: #f7f8fa;
  --polar-700: #e5e9f0;
  --polar-600: #d8dee8;
  --polar-500: #667085;
  --polar-200: #475467;
  --polar-50: #182230;
  --blue: #2563eb;
}
body { background: #f4f6f9; color: #182230; }
:focus-visible { outline-color: #2563eb; }
.brand-icon { background: #1d2939; color: #fff; }
.global-sidebar { background: #fff; border-right-color: #e5e9f0; }
.side-icon { color: #667085; }
.side-icon:hover, .account-button:hover { background: #f2f5f9; color: #182230; }
.global-link { color: #475467; }
.global-link:hover, .global-link:not(:disabled):hover { background: #f2f5f9; }
.global-link.selected { background: #eef4ff; border-color: #d8e5ff; color: #1648a3; font-weight: 600; }
.nav-symbol, .global-link.selected .nav-symbol { color: inherit; }
.nav-heading, .environment-label, .observed { color: #667085; }
.sidebar-footer select { background: #fff; border-color: #d8dee8; color: #344054; }
.account-button { color: #344054; }
.account-chevron { color: #98a2b3; }
.dashboards-panel, .metrics-panel { background: #fff; border-color: #e5e9f0; box-shadow: 0 1px 2px #10182808; }
.dashboards-heading { border-bottom-color: #e5e9f0; color: #344054; }
.dashboard-scope { color: #98a2b3; font-size: 11px; font-weight: 400; }
.dashboard-list button { border-bottom-color: #edf0f4; color: #475467; }
.dashboard-list button:hover { background: #f6f8fb; color: #182230; }
.dashboard-list button.current { background: #eef4ff; color: #1648a3; font-weight: 600; box-shadow: inset 3px 0 #2563eb; }
.eyebrow { display: block; margin-bottom: 6px; color: #98a2b3; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.metrics-header h1 { color: #182230; font-size: 23px; font-weight: 600; }
.filter-select, .range-control, .more-button, .product-button {
  background: #fff; border-color: #d8dee8; color: #344054; box-shadow: 0 1px 2px #1018280a;
}
.filter-select { background-color: #fff; }
.product-button:hover, .calendar-button:hover, .range-button:hover, .more-button:hover { background: #f2f5f9; }
.calendar-button, .range-button { color: #344054; }
.range-popover, .calendar-popover, .product-popover, .export-menu, .metric-actions-menu {
  background: #fff; border-color: #e5e9f0; box-shadow: 0 14px 38px #3440541c;
}
.preset-list button, .calendar-heading, .calendar-heading button, .calendar-day,
.product-all-button, .product-option, .export-menu button, .metric-actions-menu button { color: #344054; }
.preset-list button:hover, .preset-list button.chosen, .calendar-heading button:hover:not(:disabled),
.calendar-day:hover:not(:disabled), .product-all-button:hover, .product-option:hover,
.export-menu button:hover, .metric-actions-menu button:hover { background: #eef4ff; border-color: #d8e5ff; color: #1648a3; }
.calendar-day.in-range { background: #e7f0ff; color: #1648a3; }
.calendar-day.anchor { background: #2563eb; color: #fff; }
.calendar-day.other-month { color: #98a2b3; }
.calendar-weekdays, .calendar-selection, .product-all-button span:last-child, .product-empty { color: #667085; }
.calendar-selection, .product-popover input { border-color: #edf0f4; }
.product-popover input { color: #182230; }
.product-check { color: #2563eb; }
.error-banner { background: #fff4f2; border-color: #f6c8c3; color: #b42318; }
.metrics-grid { background: #fff; border-color: #e5e9f0; }
.metric-card { border-color: #e5e9f0; }
.metric-card h2, .metric-value { color: #182230; }
.metric-period, .metric-unavailable, .metric-card[data-unavailable="true"] .metric-period,
.metric-card[data-unavailable="true"] .metric-value, .data-note { color: #667085; }
.metric-card[data-unavailable="true"] { background: #fcfcfd; }
.metric-chart-tooltip { background: #fff; border-color: #d8dee8; color: #182230; box-shadow: 0 8px 24px #34405426; }
.metric-menu, .metric-share { color: #667085; }
.metric-menu:hover, .metric-share:hover { background: #eef4ff; color: #1648a3; }
.share-dialog { background: #fff; border-color: #e5e9f0; color: #182230; box-shadow: 0 30px 90px #10182833; }
.share-dialog::backdrop { background: #10182880; }
.share-dialog-head { border-bottom-color: #e5e9f0; }
.share-dialog-head button { color: #667085; }
.share-dialog-head button:hover { background: #f2f5f9; }
.share-theme { background: linear-gradient(135deg, #fff, #e9eef5); border-color: #d8dee8; }
.share-theme.color { background: linear-gradient(135deg, #e8f0ff, #9abaff); }
.share-buttons button { background: #fff; border-color: #d8dee8; color: #344054; }
.share-buttons button:last-child { color: #fff; }
.share-status { color: #667085; }
.mobile-head { border-bottom-color: #e5e9f0; }
.mobile-head button, .mobile-list-button { color: #344054; }
.mobile-list-button { background: #fff; border-color: #d8dee8; }
.dashboards-panel.open { box-shadow: 0 20px 60px #34405426; }
.product-view {
  padding: 42px; border: 1px solid #e5e9f0; border-radius: 16px; background: #fff;
}
.product-view h2 { margin: 0 0 10px; color: #182230; font-size: 19px; font-weight: 600; }
.product-view p { max-width: 520px; margin: 0 0 12px; color: #667085; font-size: 13px; line-height: 1.7; }
.product-view-list { display: grid; gap: 8px; max-width: 620px; margin-top: 24px; }
.product-view-item { min-height: 44px; padding: 10px 14px; border: 1px solid #e5e9f0; border-radius: 9px; background: #fff; color: #344054; text-align: left; font-size: 13px; }
.product-view-item:hover { background: #eef4ff; border-color: #b9d0ff; color: #1648a3; }
@media (max-width: 650px) {
  .global-sidebar.open { display: flex; position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(270px, 85vw); height: 100vh; box-shadow: 18px 0 42px #34405429; }
  .product-view { padding: 28px 20px; }
}

/* Polar 销售表的浅色行布局；桌面显示完整列，窄屏保持可横向阅读。 */
.orders-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 16px 19px; border: 1px solid #d8e5ff; border-radius: 12px; background: #f5f8ff; color: #344054; font-size: 13px; }
.orders-shortcut button { padding: 8px 11px; border: 1px solid #c4d8ff; border-radius: 8px; background: #fff; color: #1648a3; font-size: 12px; font-weight: 600; white-space: nowrap; }
.orders-shortcut button:hover { background: #e8f0ff; }
.orders-view, .order-detail-view { min-width: 0; }
.orders-toolbar, .related-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.orders-toolbar h2, .related-heading h2 { margin: 0 0 5px; color: #182230; font-size: 17px; font-weight: 600; }
.orders-toolbar p, .related-heading p { margin: 0; color: #667085; font-size: 12px; line-height: 1.5; }
.orders-toolbar label { display: flex; align-items: center; gap: 8px; color: #667085; font-size: 12px; white-space: nowrap; }
.orders-toolbar-actions { display: flex; align-items: center; gap: 9px; }
.orders-toolbar select { height: 36px; min-width: 122px; padding: 0 10px; border: 1px solid #d8dee8; border-radius: 8px; background: #fff; color: #344054; font-size: 12px; }
.orders-toolbar-actions > button, .order-copy-button { height: 36px; padding: 0 12px; border: 1px solid #d8dee8; border-radius: 8px; background: #fff; color: #344054; font-size: 12px; white-space: nowrap; }
.orders-toolbar-actions > button:hover:not(:disabled), .order-copy-button:hover { background: #eef4ff; border-color: #c4d8ff; color: #1648a3; }
.orders-toolbar-actions > button:disabled { opacity: .55; }
.orders-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e5e9f0; border-radius: 12px; background: #fff; }
.orders-table { width: 100%; border-collapse: collapse; min-width: 790px; text-align: left; }
.orders-table th { height: 42px; padding: 10px 16px; border-bottom: 1px solid #e5e9f0; background: #f9fafb; color: #667085; font-size: 11px; font-weight: 600; white-space: nowrap; }
.orders-table td { min-height: 64px; padding: 12px 16px; border-bottom: 1px solid #edf0f4; color: #344054; font-size: 12px; vertical-align: middle; }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.orders-table tbody tr:hover { background: #f8faff; }
.orders-table .amount-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-id-cell, .order-product { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.order-open { align-self: flex-start; padding: 0; border: 0; background: transparent; color: #1648a3; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.order-open:hover { text-decoration: underline; }
.order-id-muted, .order-product small { display: block; max-width: 180px; overflow: hidden; color: #98a2b3; font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.order-status { display: inline-flex; align-items: center; width: fit-content; gap: 6px; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.order-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-status.verified { background: #ecfdf3; color: #027a48; }
.order-status.revoked { background: #fef3f2; color: #b42318; }
.orders-message { min-height: 22px; margin: 10px 2px; color: #667085; font-size: 12px; }
.orders-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #667085; font-size: 12px; }
.orders-pagination > div { display: flex; align-items: center; gap: 10px; }
.orders-pagination button, .order-view-button { min-height: 31px; padding: 0 10px; border: 1px solid #d8dee8; border-radius: 7px; background: #fff; color: #344054; font-size: 11px; }
.orders-pagination button:hover:not(:disabled), .order-view-button:hover { background: #eef4ff; border-color: #c4d8ff; color: #1648a3; }
.orders-pagination button:disabled { opacity: .42; }
.order-action-cell { text-align: right; }
.back-to-sales { margin: 0 0 22px; padding: 0; border: 0; background: transparent; color: #667085; font-size: 12px; }
.back-to-sales:hover { color: #1648a3; }
.order-detail-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.order-detail-heading h2 { margin: 0; color: #182230; font-size: 21px; font-weight: 600; }
.order-copy-button { margin-left: auto; }
.order-detail-summary { padding: 22px 24px; border: 1px solid #e5e9f0; border-radius: 13px; background: #fff; }
.order-detail-summary span { display: block; color: #667085; font-size: 12px; }
.order-detail-summary strong { display: block; margin-top: 8px; color: #182230; font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.order-detail-summary p { margin: 7px 0 0; color: #98a2b3; font-size: 11px; }
.order-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 24px; margin: 18px 0 42px; padding: 0 22px; border: 1px solid #e5e9f0; border-radius: 13px; background: #fff; }
.order-detail-fields > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; padding: 17px 0; border-bottom: 1px solid #edf0f4; }
.order-detail-fields dt { flex: none; color: #667085; font-size: 12px; }
.order-detail-fields dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #344054; font-size: 12px; text-align: right; }
.related-orders { margin-top: 28px; }
/* 订阅列表沿用 Polar 销售表的筛选、行详情与分页信息层级。 */
.sales-tabs{display:flex;gap:4px;margin:0 0 22px;border-bottom:1px solid #e5e9f0}.sales-tabs button{padding:11px 15px;border:0;border-bottom:2px solid transparent;background:transparent;color:#667085;font-size:13px}.sales-tabs button.selected{border-bottom-color:#2563eb;color:#1648a3;font-weight:600}.subscription-filters{display:flex;flex-wrap:wrap;gap:12px;margin:0 0 16px}.subscription-filters label{display:flex;align-items:center;gap:8px;color:#667085;font-size:12px}.subscription-filters select{height:36px;padding:0 10px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#344054;font-size:12px}.subscriptions-view,.subscription-detail-view{min-width:0}.subscriptions-view .orders-table{min-width:850px}.subscription-status-note{display:block;margin-top:4px;color:#98a2b3;font-size:11px}
@media (max-width: 767px) { .orders-toolbar { flex-direction: column; } .orders-toolbar-actions { width: 100%; justify-content: space-between; } .orders-shortcut { align-items: flex-start; flex-direction: column; } .order-detail-fields { grid-template-columns: 1fr; } .orders-pagination { align-items: flex-start; flex-direction: column; } .order-detail-heading { flex-wrap: wrap; } .order-copy-button { margin-left: 0; } }
/* Polar 的 Webhook 投递表格与展开原文采用同一浅色表格层级；Apple 数据只读。 */
.notifications-view,.notification-detail-view{min-width:0}.notification-filters{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin:0 0 18px}.notification-filters label{display:grid;gap:5px;color:#667085;font-size:11px}.notification-filters input{height:36px;min-width:190px;padding:0 10px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#344054;font-size:12px}.notification-filters button{height:36px;padding:0 12px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#344054;font-size:12px}.notification-filters button[type=submit]{border-color:#c4d8ff;color:#1648a3}.notification-filters button:hover{background:#eef4ff}.notification-table{min-width:880px}.notification-table td:nth-child(3),.notification-table td:nth-child(4){overflow-wrap:anywhere}.notification-subtype{padding:5px 9px;border-radius:20px;background:#eef4ff;color:#1648a3;font-size:11px}.notification-note{margin:20px 0;color:#667085;font-size:12px;line-height:1.6}.notification-payload{margin:14px 0;border:1px solid #e5e9f0;border-radius:12px;background:#fff;overflow:hidden}.notification-payload h3{margin:0;padding:14px 17px;border-bottom:1px solid #edf0f4;color:#344054;font-size:13px;font-weight:600}.notification-payload pre{margin:0;padding:16px 17px;max-height:550px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:#344054;font-size:11px;line-height:1.6}
/* 销售汇总、事件多选和导出设置都使用现有浅色列表组件。 */
.sales-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 18px}.sales-summary article{min-width:0;padding:18px;border:1px solid #e5e9f0;border-radius:12px;background:#fff}.sales-summary h3{margin:0;color:#667085;font-size:12px;font-weight:500}.sales-summary strong{display:block;margin:10px 0;color:#182230;font-size:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sales-summary small{display:block;color:#667085;font-size:11px}.sales-summary svg{display:block;width:100%;height:36px;margin-top:10px}.orders-toolbar-actions label{display:flex;align-items:center;gap:6px;color:#667085;font-size:12px}.orders-toolbar-actions select,.notification-filters select{min-height:36px;padding:0 8px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#344054;font-size:12px}.notification-filters select[multiple]{min-width:220px;padding:4px;height:92px}.record-export-dialog{width:min(610px,calc(100vw - 24px));max-height:calc(100vh - 24px);padding:0;border:1px solid #e5e9f0;border-radius:14px;background:#fff;color:#182230;box-shadow:0 24px 64px #10182833}.record-export-dialog::backdrop{background:#10182880}.record-export-body{padding:20px}.record-export-range{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.record-export-range label{display:grid;gap:6px;color:#667085;font-size:12px}.record-export-range input,.record-export-range select{min-width:0;width:100%;height:36px;padding:0 8px;border:1px solid #d8dee8;border-radius:7px;background:#fff;color:#344054}.record-export-body fieldset{margin:20px 0 0;padding:0;border:0}.record-export-body legend{margin-bottom:9px;font-size:13px;font-weight:600}.record-export-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.record-export-columns label{display:flex;align-items:center;gap:7px;font-size:12px;color:#344054}.record-export-body p{min-height:18px;color:#b42318;font-size:12px}.record-export-actions{display:flex;justify-content:flex-end;gap:9px}.record-export-actions button{height:36px;padding:0 13px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#344054}.record-export-actions button[type=submit]{border-color:#2563eb;background:#2563eb;color:#fff}@media(max-width:767px){.sales-summary{grid-template-columns:1fr}.record-export-range,.record-export-columns{grid-template-columns:1fr}.orders-toolbar-actions{flex-wrap:wrap}}
/* Polar 导出弹窗的默认列、重置与全选由同一组勾选框控制。 */
.record-export-column-actions{display:flex;align-items:center;gap:8px;margin:-3px 0 12px;color:#667085;font-size:12px}.record-export-column-actions span{margin-right:auto}.record-export-column-actions button{padding:4px 7px;border:0;border-radius:5px;background:transparent;color:#2563eb;font-size:12px}.record-export-column-actions button:hover{background:#eef4ff}
/* 自定义看板编辑器只组合已有 Apple 指标，顺序由上下按钮明确控制。 */
.dashboards-heading button{width:28px;height:28px;border:0;border-radius:7px;background:#eef4ff;color:#1648a3;font-size:20px}.dashboards-heading button:hover{background:#dbe9ff}.dashboard-list-error{margin:0;padding:12px 16px;color:#b42318;font-size:12px}.dashboard-actions{display:flex;gap:6px;margin-left:12px}.dashboard-actions button{padding:6px 10px;border:1px solid #d8dee8;border-radius:7px;background:#fff;color:#344054;font-size:12px}.dashboard-actions button:hover{background:#f2f5f9}.dashboard-dialog{width:min(670px,calc(100vw - 24px))}.dashboard-name-label{display:grid;gap:6px;color:#667085;font-size:13px}.dashboard-name-label input{height:38px;padding:0 10px;border:1px solid #d8dee8;border-radius:8px;background:#fff;color:#182230}.dashboard-metric-options{display:grid;grid-template-columns:1fr 1fr;gap:14px}.dashboard-selected-metrics,.dashboard-available-metrics{display:flex;flex-direction:column;gap:5px;max-height:300px;overflow:auto;padding:8px;border:1px solid #e5e9f0;border-radius:8px;color:#667085;font-size:12px}.dashboard-metric-row{display:flex;align-items:center;gap:2px;min-height:33px;padding:2px 5px;border-radius:6px;background:#f7f8fa}.dashboard-metric-row span{flex:1;color:#344054}.dashboard-metric-row button{width:24px;height:25px;border:0;border-radius:5px;background:transparent;color:#475467}.dashboard-metric-row button:hover:not(:disabled){background:#e7f0ff}.dashboard-available-metrics button{min-height:32px;padding:4px 7px;border:0;border-radius:5px;background:#fff;color:#344054;text-align:left}.dashboard-available-metrics button:hover:not(:disabled){background:#eef4ff}.dashboard-available-metrics button:disabled{color:#98a2b3}@media(max-width:650px){.dashboard-metric-options{grid-template-columns:1fr}.dashboard-actions{margin-left:auto}}
/* 总览与自定义看板共用指标编辑器，名称栏只对可命名看板显示。 */
.dashboard-overview-edit{margin-left:12px;padding:6px 10px;border:1px solid #d8dee8;border-radius:7px;background:#fff;color:#344054;font-size:12px}.dashboard-overview-edit:hover{background:#f2f5f9}.dashboard-name-label[hidden]{display:none}
/* 空看板是 Polar 支持的暂存状态，后续可通过编辑添加指标。 */
.dashboard-empty{margin:28px 0;padding:45px 20px;border:1px solid #e5e9f0;border-radius:12px;background:#fff;color:#667085;text-align:center;font-size:14px}

/* 分页增加页容量和首末页后允许换行，窄屏也保留所有操作。 */
.orders-pagination > div { flex-wrap: wrap; justify-content: flex-end; }
.orders-pagination label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.orders-pagination select { height: 32px; border: 1px solid var(--polar-700); border-radius: 6px; background: var(--polar-900); color: inherit; padding: 0 6px; }
