/* ============================================================
   iptongji — 网站流量统计系统 · 前端设计系统 v3
   设计语言：墨青 × 黄铜 · 暖青灰阶 · 细边浅影分层 · 静态高级感
   签名动效：顶部渐变色线 · 卡片渐变色带滑入 · KPI 阶梯入场
   图标：统一 1.6 描边内联 SVG（stroke = currentColor）
   兼容：无 :has、无 @container、无 CSS 嵌套；含 reduced-motion 降级
   ============================================================ */

:root {
    /* 主色：墨青（沉稳大气，取代亮蓝） */
    --brand-950: #042b34;
    --brand-900: #073a47;
    --brand-800: #0a4b5a;
    --brand-700: #0c5f6e;
    --brand-600: #11788c;
    --brand-500: #1b95aa;
    --brand-100: #d6ebee;
    --brand-050: #edf6f8;
    --brand:      #0c5f6e;
    --brand-ring: rgba(12, 95, 110, .18);

    /* 点缀：黄铜（精致感，用于强调 / hover 色带 / 细节） */
    --brass-700: #8c5f16;
    --brass-600: #a8761d;
    --brass-500: #c08f2c;
    --brass-300: #e6c184;
    --brass-050: #faf1de;

    /* 中性：暖青灰阶（带微青底，与主色同族，非纯冷灰） */
    --ink-900: #0c1a1d;
    --ink-800: #1b2a2d;
    --ink-700: #33454a;
    --ink-600: #4d6065;
    --ink-500: #5f7175;
    --ink-400: #6b7e83;
    --ink-300: #8a9b9f;
    --ink-200: #c8d2d3;
    --ink-100: #e1e7e7;

    /* 面与背景 */
    --bg:        #f3f6f5;
    --surface:   #ffffff;
    --surface-2: #f8faf9;
    --surface-3: #eef2f1;
    --line:      #e5eae9;
    --line-2:    #d6dedd;
    --line-3:    #c5d0ce;

    /* 状态（中式语义：涨=红 / 跌=绿） */
    --up:   #b5303c;
    --down: #0c7a5f;
    --ok:   #0c7a5f;
    --slow: #ab7417;

    /* 圆角 */
    --radius:    14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --radius-pill: 999px;

    /* 阴影：克制浅影，靠细边分层（不用重玻璃 / 大模糊） */
    --sh-sm: 0 1px 1px rgba(12, 26, 29, .05), 0 2px 5px rgba(12, 26, 29, .06);
    --sh-md: 0 1px 2px rgba(12, 26, 29, .05), 0 8px 18px rgba(12, 26, 29, .10), 0 3px 6px rgba(12, 26, 29, .06);
    --sh-lg: 0 2px 4px rgba(12, 26, 29, .07), 0 18px 36px rgba(12, 26, 29, .14), 0 8px 16px rgba(12, 26, 29, .08);
    --sh-brand: 0 8px 22px rgba(12, 95, 110, .26);
    /* 厚重面板配方：贴壁近影 + 扩散落影 + 顶部受光内高光 + 微内描 */
    --panel-shadow: 0 1px 1px rgba(12, 26, 29, .05), 0 6px 14px -6px rgba(12, 26, 29, .16), 0 16px 32px -14px rgba(12, 26, 29, .2);
    --panel-edge: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(12, 26, 29, .02);
    --panel-edge-hover: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(12, 26, 29, .035);
    --shadow-ring: 0 0 0 3px var(--brand-ring);

    /* 字体三层：展示衬线 / 界面无衬线 / 数据等宽 */
    --font-display: 'Instrument Serif', 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
    --font: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Menlo, Consolas, ui-monospace, monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--ink-700);
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg);
    /* 极淡的墨青 / 黄铜光晕打底，制造静态纵深，不干扰读数 */
    background-image:
        radial-gradient(1180px 460px at 8% -6%, rgba(12, 95, 110, .045), transparent 62%),
        radial-gradient(980px 440px at 100% 2%, rgba(192, 143, 44, .035), transparent 58%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-600); }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--brand-100); color: var(--brand-950); }

/* 数据统一等宽 + 紧字距，读数的精确感 */
.num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* 内联 SVG 图标统一基线（替代 emoji） */
.icon-svg {
    width: 1em; height: 1em; flex-shrink: 0;
    stroke: currentColor; fill: none;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* 滚动渐显（由 charts.js 的 reveal 加 .in） */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
    opacity: 1; transform: none;
    transition: opacity .5s var(--ease), transform .5s var(--ease);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}
/* ---------- 顶部栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}
/* 签名动效①：顶部栏底部 1px 渐变色线（墨青 → 黄铜） */
.topbar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(12, 95, 110, .42), rgba(192, 143, 44, .38), transparent);
}
.topbar-inner {
    max-width: 1240px; margin: 0 auto; height: 66px;
    display: flex; align-items: center; gap: 18px; padding: 0 32px;
}
.logo {
    display: flex; align-items: center; gap: 11px;
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600; color: var(--ink-900); letter-spacing: -.01em;
}
.logo:hover { color: var(--ink-900); }
.logo-mark {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: transparent;
    overflow: hidden; box-shadow: 0 1px 3px rgba(12, 26, 29, .16);
}
.logo-mark svg { display: block; width: 100%; height: 100%; }
.logo small {
    font-family: var(--font);
    font-weight: 500; color: var(--ink-400); font-size: 12px;
    letter-spacing: .14em; text-transform: uppercase; margin-left: 4px;
}
.topbar .spacer { flex: 1; }
.topbar-meta {
    font-size: 12px; color: var(--ink-500); font-weight: 500;
    padding: 5px 13px; border-radius: var(--radius-pill);
    background: var(--surface-2); border: 1px solid var(--line);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13.5px; font-weight: 600; letter-spacing: -.01em;
    padding: 9px 17px; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-700);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease),
                background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); color: var(--ink-900); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-ring); }
.btn-primary {
    border-color: transparent; color: #fff;
    background: linear-gradient(150deg, var(--brand-600), var(--brand-800));
    box-shadow: 0 2px 8px rgba(12, 95, 110, .2);
}
.btn-primary:hover {
    color: #fff; transform: translateY(-1px);
    background: linear-gradient(150deg, var(--brand-700), var(--brand-950));
    box-shadow: var(--sh-brand);
}
.btn-primary:active { transform: translateY(0); }

/* ---------- 容器 & 布局骨架 ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 34px 32px 40px; }
.layout { display: flex; gap: 30px; align-items: flex-start; }
.sidebar { width: 232px; flex-shrink: 0; position: sticky; top: 90px; }
.main { flex: 1; min-width: 0; }
.main > section { margin-bottom: 22px; }
.main > section:last-of-type { margin-bottom: 0; }

/* ---------- 侧栏 ---------- */
.sidebar-card {
    background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--radius); box-shadow: var(--panel-edge), var(--panel-shadow); overflow: hidden;
}
.sidebar-select {
    width: 100%; padding: 15px 16px; font-family: var(--font);
    font-size: 14px; font-weight: 600; color: var(--ink-900);
    border: none; border-bottom: 1px solid var(--line);
    background: var(--surface-2); cursor: pointer; appearance: none;
    transition: background .2s var(--ease);
}
.sidebar-select:hover { background: var(--surface-3); }
.sidebar-select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-ring); }
.sidebar nav { padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; color: var(--ink-500);
    transition: background .18s var(--ease), color .18s var(--ease);
}
/* 签名动效：侧栏 active 左侧 2px 竖条（墨青 → 黄铜） */
.sidebar nav a::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, var(--brand-600), var(--brass-500));
    transform: scaleY(0); transform-origin: center;
    transition: transform .26s var(--ease);
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--ink-800); text-decoration: none; }
.sidebar nav a.active {
    background: var(--brand-050); color: var(--brand-800); font-weight: 600;
}
.sidebar nav a.active::before { transform: scaleY(1); }
.sidebar nav a .ico {
    font-size: 15px; width: 20px; text-align: center; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-600);
}
.sidebar nav a .ico .icon-svg { width: 16px; height: 16px; }
/* ---------- 卡片 ---------- */
.card {
    position: relative;
    background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--radius); box-shadow: var(--panel-edge), var(--panel-shadow);
    transition: box-shadow .26s var(--ease), border-color .26s var(--ease);
}
/* 签名动效②：卡片 hover 顶部 2px 渐变色带滑入（墨青 → 黄铜） */
.card::before {
    content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand-600), var(--brass-500));
    transform: scaleX(0); transform-origin: left; opacity: 0;
    transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.card:hover { box-shadow: var(--panel-edge-hover), var(--sh-lg); border-color: var(--line-3); }
.card:hover::before { transform: scaleX(1); opacity: 1; }
.card-head {
    display: flex; align-items: baseline; gap: 11px;
    padding: 18px 24px 15px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
    border-bottom: 1px solid var(--line-2);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -1px 0 rgba(255, 255, 255, .5);
}
.card-head h3 {
    position: relative; padding-left: 11px;
    font-size: 15px; font-weight: 600; color: var(--ink-900); letter-spacing: -.015em;
    min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.card-head h3::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 13px; border-radius: 2px;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-800));
}
.card-head .sub { font-size: 12.5px; color: var(--ink-400); font-weight: 500; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.card-head .spacer { flex: 1; }
.card-head .btn { font-size: 12.5px; padding: 5px 12px; border-radius: var(--radius-xs); margin-left: auto; }
.card-body { padding: 20px 24px; }

/* ---------- 图表容器 ---------- */
.chart-box { height: 280px; width: 100%; border-radius: var(--radius-xs); box-shadow: inset 0 1px 3px rgba(12, 26, 29, .04); }
.chart-box.tall { height: 344px; }
.chart-box.sm { height: 200px; }
.chart-full { margin-bottom: 22px; }

/* ---------- 页首 ---------- */
/* flex-wrap 全局开启：桌面端内容短不会换行；窄屏下长站点名/徽标自然换行 */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 13px; margin-bottom: 26px; }
/* 站点名与域名为等宽/无空格长串时不可断行，flex 项默认 min-width:auto 会撑破移动端视口；
   min-width:0 允许收缩 + anywhere 将断行计入 min-content（老浏览器以 word-break 兜底） */
.page-head h1, .page-head .sub {
    min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.page-head h1 {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600; color: var(--ink-900);
    letter-spacing: -.02em; line-height: 1.14;
}
.page-head .sub { font-size: 13px; color: var(--ink-400); font-weight: 500; }
.page-head .spacer { flex: 1; }
.tz {
    font-size: 12px; color: var(--ink-500); font-weight: 500;
    padding: 4px 12px; border-radius: var(--radius-pill);
    background: var(--surface-2); border: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */
.foot {
    text-align: center; color: var(--ink-400); font-size: 12.5px;
    padding: 34px 0 6px; letter-spacing: .02em;
}
.foot::before {
    content: ''; display: block; width: 60px; height: 1px; margin: 0 auto 16px;
    background: linear-gradient(90deg, transparent, var(--line-3), transparent);
}
/* ---------- KPI 卡片（首页含图标 / 看板纯文字 两变体共用） ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--radius); box-shadow: var(--panel-edge), var(--panel-shadow);
    padding: 20px 22px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
    transition: box-shadow .26s var(--ease), border-color .26s var(--ease), transform .26s var(--ease);
}
/* 签名动效③：KPI 阶梯入场 */
.kpi > * { opacity: 0; animation: rise .5s var(--ease) both; }
.kpi > *:nth-child(1) { animation-delay: 0ms; }
.kpi > *:nth-child(2) { animation-delay: 70ms; }
.kpi > *:nth-child(3) { animation-delay: 140ms; }
/* 签名动效⑤：KPI hover 顶部细色带淡入 */
.kpi::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand-600), var(--brass-500));
    opacity: 0; transition: opacity .28s var(--ease);
}
.kpi:hover { box-shadow: var(--panel-edge-hover), var(--sh-lg); border-color: var(--line-3); transform: translateY(-2px); }
.kpi:hover::before { opacity: 1; }

/* 变体 A：图标 + 内容（首页） */
.kpi-icon {
    width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
    background: var(--brand-050); color: var(--brand-700);
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px var(--brand-100);
}
.kpi-icon .ico { line-height: 1; display: inline-flex; }
.kpi-icon .icon-svg { width: 21px; height: 21px; }
.kpi-content { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
/* 变体 B：无图标（看板 JS 注入）→ 子项整行堆叠 */
.kpi > .label, .kpi > .value, .kpi > .delta { flex-basis: 100%; }

.kpi .label {
    font-size: 11px; color: var(--ink-400); font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; margin-bottom: 7px;
}
.kpi .value {
    font-family: var(--font-display);
    font-size: 29px; font-weight: 600; color: var(--ink-900);
    letter-spacing: -.03em; line-height: 1.04;
    font-variant-numeric: tabular-nums;
    display: flex; align-items: baseline; gap: 5px;
    min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.kpi .value .unit {
    font-family: var(--font);
    font-size: 13px; font-weight: 500; color: var(--ink-400); letter-spacing: 0;
}
.kpi .delta { font-size: 12.5px; margin-top: 8px; font-weight: 650; }
.kpi .delta.up { color: var(--up); }
.kpi .delta.down { color: var(--down); }
.kpi .vs { color: var(--ink-400); margin-left: 5px; font-weight: 500; }
.kpi .delta .delta-arr {
    width: 9px; height: 9px; margin-right: 4px; vertical-align: middle;
    fill: currentColor; stroke: none;
}

/* 变体 C：左侧指标徽标（IP/PV/UV）+ 右侧三行（今日/昨日/上周同期） */
.kpi.kpi-multi { padding: 16px 18px; gap: 0 12px; align-items: center; }
.kpi-icon-txt {
    width: 38px; height: 38px; border-radius: 10px;
    font-family: var(--font-display); font-size: 16px; font-weight: 600;
    letter-spacing: .01em;
}
.kpi-multi-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px 8px; width: 100%;
}
.kpi-m-head {
    font-size: 10.5px; color: var(--ink-400); font-weight: 600;
    letter-spacing: .02em; white-space: nowrap; line-height: 1.2;
}
.kpi-m-val {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600; color: var(--ink-900);
    letter-spacing: -.02em; line-height: 1.2;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-m-deltas {
    display: flex; flex-wrap: wrap; gap: 3px 10px;
    margin-top: 8px;
}
.kpi-m-deltas .delta { font-size: 11.5px; margin-top: 0; font-weight: 650; white-space: nowrap; }
/* 窄视口（仍为 4 列栅格）：数值降号防溢出 */
@media (min-width: 1101px) and (max-width: 1280px) {
    .kpi-m-val { font-size: 14px; }
}

/* ---------- 分段范围控件 ---------- */
.range-tabs {
    display: inline-flex; gap: 3px; padding: 4px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.range-tabs button {
    position: relative; border: none; background: transparent; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--ink-500);
    padding: 6px 14px; border-radius: var(--radius-xs);
    transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.range-tabs button:hover { color: var(--ink-800); }
.range-tabs button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand-ring); }
/* 签名动效⑦：active 项淡青底 + 底部铜条 */
.range-tabs button.active {
    background: var(--brand-050); color: var(--brand-800);
    box-shadow: inset 0 0 0 1px var(--brand-100);
}
.range-tabs button.active::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
    border-radius: 2px; background: var(--brass-500);
}
/* ---------- 搜索栏 ---------- */
.search-bar { position: relative; display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; flex-wrap: wrap; }
/* 搜索图标（内联 SVG，由 HTML 提供） */
.search-ico {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--ink-300); pointer-events: none;
    transition: color .2s var(--ease);
}
.search-bar:focus-within .search-ico { color: var(--brand-600); }
.search-input {
    flex: 1; min-width: 240px;
    padding: 11px 16px 11px 41px; font-size: 13.5px; font-family: var(--font); color: var(--ink-800);
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--sh-sm);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-input::placeholder { color: var(--ink-300); }
/* 签名动效⑨：focus 时墨青边 + ring */
.search-input:focus {
    outline: none; border-color: var(--brand-500);
    box-shadow: var(--sh-sm), var(--shadow-ring);
}
.search-filters {
    display: inline-flex; gap: 4px; padding: 4px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.filter-btn {
    border: none; background: transparent; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--ink-500);
    padding: 7px 15px; border-radius: var(--radius-xs);
    transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.filter-btn:hover { color: var(--ink-800); }
.filter-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand-ring); }
.filter-btn.active {
    background: var(--brand-050); color: var(--brand-800);
    box-shadow: inset 0 0 0 1px var(--brand-100);
}

/* ---------- 站点卡片网格 ---------- */
.sites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.site-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--radius); box-shadow: var(--panel-edge), var(--panel-shadow);
    padding: 22px 24px; display: flex; flex-direction: column; gap: 16px;
    transition: box-shadow .26s var(--ease), border-color .26s var(--ease), transform .26s var(--ease);
}
/* 签名动效②：站点卡左侧渐变色带滑入 */
.site-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--brand-600), var(--brass-500));
    transform: scaleY(0); transform-origin: top; opacity: 0;
    transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.site-card:hover { box-shadow: var(--panel-edge-hover), var(--sh-lg); border-color: var(--line-3); transform: translateY(-2px); }
.site-card:hover::before { transform: scaleY(1); opacity: 1; }

.site-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-info { flex: 1; min-width: 0; }
.site-info .name {
    font-size: 15.5px; font-weight: 600; color: var(--ink-900);
    letter-spacing: -.015em; display: flex; align-items: center; gap: 9px;
    overflow-wrap: anywhere; word-break: break-word;
}

.status-dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block;
    background: var(--ok); box-shadow: 0 0 0 3px rgba(12, 122, 95, .16);
}
.status-dot.slow { background: var(--slow); box-shadow: 0 0 0 3px rgba(171, 116, 23, .16); }

.site-stats-grid { display: flex; flex-direction: column; gap: 7px; }
.site-stats-grid .stat {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius-xs); padding: 9px 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    transition: background .2s var(--ease);
}
.site-card:hover .site-stats-grid .stat { background: var(--surface-3); }
.site-stats-grid .stat .l {
    font-size: 10.5px; color: var(--ink-400); font-weight: 650;
    letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0;
}
.site-stats-grid .stat .v {
    font-family: var(--mono);
    font-size: 15.5px; font-weight: 700; color: var(--ink-900);
    letter-spacing: -.02em; text-align: right;
}
/* 数值后较上周同期徽标：仅箭头 + 数值 + % */
.site-stats-grid .stat .v .wow {
    font-family: var(--font);
    font-size: 11px; font-weight: 650; letter-spacing: 0;
    margin-left: 7px;
}
.site-stats-grid .stat .v .wow.up { color: var(--up); }
.site-stats-grid .stat .v .wow.down { color: var(--down); }

.site-card-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto;
}
.trend-spark { flex: 1; height: 34px; }
.enter {
    font-size: 13px; color: var(--brand); font-weight: 650; white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px; transition: gap .22s var(--ease), color .2s var(--ease);
}
.enter:hover { color: var(--brand-600); text-decoration: none; gap: 9px; }

.empty-state {
    grid-column: 1 / -1; text-align: center; color: var(--ink-400);
    padding: 56px 20px; font-size: 14px; font-weight: 500;
    background: var(--surface); border: 1px dashed var(--line-3); border-radius: var(--radius);
}
/* ---------- 维度分布网格 ---------- */
.dims-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ---------- 响应式（保留原有栅格降级与移动端优化） ---------- */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .charts-grid { grid-template-columns: 1fr; }
    .dims-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sites { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .container { padding: 24px 20px 32px; }
}
@media (max-width: 640px) {
    html { font-size: 14px; }
    .kpis { grid-template-columns: 1fr; }
    .dims-grid { grid-template-columns: 1fr; }
    .sites { grid-template-columns: 1fr; }
    .container { padding: 18px 14px 26px; }
    .page-head { flex-wrap: wrap; gap: 8px; }
    .page-head h1 { font-size: 23px; }
    .page-head .spacer { display: none; }
    .topbar-inner { padding: 0 16px; height: 60px; gap: 12px; }
    .logo { font-size: 17px; }
    .logo-mark { width: 28px; height: 28px; }
    .logo small { display: none; }
    .topbar-meta { font-size: 11px; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-input { min-width: 0; }
    .search-filters { justify-content: flex-start; flex-wrap: wrap; }
    .card-head { flex-wrap: wrap; gap: 8px; padding: 15px 16px 12px; }
    .card-head .spacer { display: none; }
    .card-body { padding: 14px 16px; }
    .chart-box { height: 220px; }
    .chart-box.tall { height: 258px; }
    .chart-box.sm { height: 180px; }
    .kpi { padding: 16px 18px; }
    .kpi-icon { width: 40px; height: 40px; }
    .kpi-icon .icon-svg { width: 19px; height: 19px; }
    .kpi .value { font-size: 25px; }
    .kpi.kpi-multi { padding: 14px 16px; }
    .kpi-icon-txt { width: 40px; height: 40px; font-size: 17px; }
    .kpi-m-val { font-size: 17px; }
    .range-tabs { flex-wrap: wrap; }
    .range-tabs button { flex: 1; text-align: center; min-width: 0; padding: 6px 8px; font-size: 12px; }
    .sidebar nav a { padding: 8px 11px; font-size: 12.5px; }
    .foot { padding: 20px 8px 6px; font-size: 11.5px; }
}

/* ---------- 打印 ---------- */
@media print {
    .topbar, .sidebar, .search-bar, .range-tabs, .foot { display: none !important; }
    body { background: #fff; }
    .card, .kpi, .site-card { box-shadow: none; border-color: #ccc; }
}
/* [EOF] */