/* ==========================================================================
   AWS 账号管理工作台 · 本地离线版
   数据源：资料库节点 Bu8skfoJyf1Nf4DfgfslQL / AWS账号信息.xlsx / 账户需求
   样式为单文件独立样式，不复用 savings-plans-dashboard 的图层体系
   ========================================================================== */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e3e8f0;
  --border-strong: #cdd6e4;
  --text: #1a2438;
  --text-2: #5b6880;
  --text-3: #8b97ac;

  --brand: #2f6bff;
  --brand-soft: #eaf0ff;
  --ok: #0f9d58;
  --ok-soft: #e6f6ee;
  --warn: #e08600;
  --warn-soft: #fdf3e2;
  --danger: #d93a3a;
  --danger-soft: #fdeaea;
  --violet: #7a5af8;
  --violet-soft: #f1ecff;
  --teal: #0f9d9d;
  --teal-soft: #e3f6f6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(26, 36, 56, .05), 0 4px 16px rgba(26, 36, 56, .06);
  --shadow-lg: 0 8px 32px rgba(26, 36, 56, .14);
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.topbar .sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}
.topbar .grow { flex: 1 }
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #2450c8;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* width:100% 是必须的：main 是 .app-main(flex 列) 的子项，桌面端靠 margin:0 auto
   居中，而 auto margin 会让 flex 子项按 fit-content 解析宽度 —— 宽表格(1052px)
   于是把 main 从 676px 撑到 1102px，768~1326px 之间整页横向溢出。
   显式 width:100% 后回到容器宽，宽表格交给 .table-wrap 内部横滑。 */
main { padding: 20px 24px 64px; max-width: 1560px; margin: 0 auto; width: 100%; min-width: 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 620;
  white-space: nowrap;   /* 工具栏放筛选/搜索后标题别被挤换行 */
}
.card-head .hint { font-size: 12px; color: var(--text-3); }
.card-head .grow { flex: 1 }
.card-body { padding: 16px 18px; }

/* ---------- KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, var(--brand));
}
.kpi .label {
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.kpi .value {
  font-size: 27px; font-weight: 680; letter-spacing: -.02em;
  margin-top: 5px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
/* 大单位后补的 GB 小字（2026-11-10） */
.kpi .value small.kpi-sub { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 5px; letter-spacing: 0; }
.kpi .foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.kpi .bar {
  height: 4px; border-radius: 2px; background: var(--border);
  margin-top: 9px; overflow: hidden;
}
.kpi .bar > i { display: block; height: 100%; background: var(--kpi-accent, var(--brand)); }

/* ---------- 网格布局 ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mb16 { margin-bottom: 16px; }

/* 区块小标题（仪表盘分组用） */
.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-3); margin: 6px 2px 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* 4 联小图表里的环形图压缩，避免卡片过高 */
.grid-4 .donut svg { width: 116px; height: 116px; }
.grid-4 .donut .donut-center b { font-size: 19px; }
.grid-4 .donut-wrap { gap: 14px; justify-content: center; }

/* 仪表盘在不同屏宽下优雅降列 */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- 横向条形分布 ---------- */
.dist { display: flex; flex-direction: column; gap: 9px; }
.dist-row { display: grid; grid-template-columns: var(--label-w, 152px) 1fr 62px; gap: 10px; align-items: center; }
.dist-row .name {
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dist-row .name.mono { font-family: var(--mono); font-size: 12px; }
.dist-row .track {
  height: 18px; background: var(--surface-2); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; border: 1px solid var(--border);
}
.dist-row .track > i {
  display: block; height: 100%;
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.dist-row .num {
  font-size: 12px; text-align: right; color: var(--text-2);
  font-variant-numeric: tabular-nums; font-family: var(--mono);
}
.stack { display: flex; height: 100%; width: 100%; }
.stack > i { display: block; height: 100%; }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 10px 2px 2px; font-size: 12px; color: var(--text-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }

/* ---------- 环形图 ---------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; flex: none; }
.donut svg { display: block; transform: rotate(-90deg); }
.donut .donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut .donut-center b { font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.donut .donut-center span { font-size: 11.5px; color: var(--text-3); }
.donut .seg { transition: opacity .15s; cursor: pointer; }
.donut .seg:hover { opacity: .78; }

/* ---------- 表格 ---------- */
.table-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 11px; color: var(--text-3); font-weight: 500; letter-spacing: .02em; }
#force-pw-modal .field { gap: 4px; margin-bottom: 10px; }
#force-pw-modal .field > span { font-size: 11px; color: var(--text-3); font-weight: 500; letter-spacing: .02em; }
#force-pw-modal input {
  font: inherit; font-size: 13px; padding: 6px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none; width: 100%; box-sizing: border-box;
}
.force-pw-note { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin: 0 0 12px; }
.force-pw-error { color: #d4380d; font-size: 12px; min-height: 16px; margin: 8px 0 0; }
select, input[type="search"], input[type="text"], input[type="password"] {
  font: inherit; font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  min-width: 128px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
select:focus, input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="search"] { min-width: 260px; }

/* 日期输入与 select 对齐（Chrome 原生外观与圆角/高度都不一致，需显式覆盖） */
input[type="date"] {
  font: inherit; font-size: 13px;
  height: 34px; padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  outline: none; box-sizing: border-box;
  min-width: 138px;
  -webkit-appearance: none; appearance: none;
  transition: border-color .12s, box-shadow .12s;
}
input[type="date"]:hover { border-color: #b9c4d6; }
input[type="date"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="date"]::-webkit-datetime-edit { padding: 0; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .45; cursor: pointer; padding: 0; margin-left: 2px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .95; }

.btn {
  font: inherit; font-size: 13px;
  padding: 6px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #2455e0; }
.btn.active { background: var(--brand-soft); border-color: var(--brand); color: #2450c8; font-weight: 550; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

.table-wrap { overflow: auto; max-height: 74vh; }
table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
/* 列最小宽度：避免被挤压，内容超出视口时整表可向右滑动（而非折行挤窄） */
thead th:not(:first-child), tbody td:not(:first-child) { min-width: 92px; }
thead th:last-child, tbody td:last-child { min-width: 150px; }
/* 首列（序号）固定，向右滑动时保持定位锚点 */
.table-wrap thead th:first-child { position: sticky; left: 0; z-index: 7; background: #eef2f8; }
.table-wrap tbody td:first-child { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.table-wrap tbody tr:nth-child(even) td:first-child { background: var(--surface-2); }
.table-wrap tbody tr:hover td:first-child { background: #f7faff; }
.table-hscroll-hint {
  text-align: center; font-size: 11.5px; color: var(--text-3);
  padding: 7px 0 2px; letter-spacing: .02em;
  user-select: none;
}
.table-hscroll-hint::before { content: "◇ "; opacity: .6; }

/* 回收对话框说明 */
.rec-note {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--warn-soft, #fff6e6); color: #8a5a00;
  font-size: 12.5px; line-height: 1.6;
}
.rec-note b { color: #6e4700; }
.correct-title { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
thead th {
  position: sticky; top: 0; z-index: 5;
  background: #eef2f8;
  color: var(--text-2);
  font-weight: 600; font-size: 11.5px;
  letter-spacing: .02em;
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  user-select: none;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { background: #e4eaf4; color: var(--text); }
thead th .sort-ind { color: var(--brand); margin-left: 4px; font-size: 10px; }
tbody td {
  padding: 8px 11px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: top;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tbody tr:hover td { background: #f7faff; }
tbody tr:nth-child(even) td { background: var(--surface-2); }
tbody tr:nth-child(even):hover td { background: #f7faff; }
td.mono { font-family: var(--mono); font-size: 11.5px; }
td.wrap { white-space: normal; min-width: 200px; }

.row-actions { display: flex; gap: 4px; }
.icon-btn {
  border: 1px solid transparent; background: transparent;
  border-radius: var(--radius-sm); padding: 2px 6px; cursor: pointer;
  color: var(--text-3); font-size: 12px;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--border); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ---------- 徽标 ---------- */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.65;
  white-space: nowrap;
}
.tag.used      { background: var(--ok-soft);     color: #0b7a44; }
.tag.unused    { background: var(--warn-soft);   color: #a35c00; }
.tag.iam       { background: var(--brand-soft);  color: #2450c8; }
.tag.root      { background: var(--violet-soft); color: #5d3fd3; }
.tag.na        { background: #eef1f6;            color: var(--text-3); }
.tag.sp        { background: var(--teal-soft);   color: #0a7d7d; }
.tag.danger    { background: var(--danger-soft); color: #b52c2c; }

/* 凭证单元格：默认遮蔽，点击揭示 */
.secret {
  font-family: var(--mono); font-size: 11.5px;
  cursor: pointer; user-select: none;
}
.secret .masked {
  display: inline-block;
  padding: 0 7px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, #e8ecf3 0 4px, #dfe4ec 4px 8px);
  color: #9aa5b8; letter-spacing: .12em;
}
.secret.revealed { color: #b8283f; background: var(--danger-soft); border-radius: 3px; }
.secret.revealed .masked { background: none; color: inherit; }
.secret:hover .masked { background: #dbe3ee; color: #6b7c99; }

/* ---------- 风险块 ---------- */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.risk {
  border: 1px solid var(--border);
  border-left: 3px solid var(--rc, var(--warn));
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.risk:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.risk .rt { font-size: 12.5px; font-weight: 600; color: var(--text); }
.risk .rv {
  font-size: 24px; font-weight: 680; letter-spacing: -.02em;
  color: var(--rc, var(--warn)); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.risk .rv small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.risk .rd { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 28, 44, .38);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(620px, 94vw);
  background: var(--surface);
  box-shadow: -8px 0 40px rgba(20, 28, 44, .2);
  transform: translateX(102%);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { margin: 0; font-size: 15px; font-weight: 640; }
.drawer-head .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 40px; }
.drawer-close {
  border: none; background: transparent; font-size: 20px; line-height: 1;
  color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.drawer-close:hover { background: var(--surface-2); color: var(--text); }

.dl { display: grid; grid-template-columns: 132px 1fr; gap: 0; }
.dl dt {
  font-size: 12px; color: var(--text-3);
  padding: 8px 0; border-bottom: 1px solid #f2f5f9;
}
.dl dd {
  margin: 0; padding: 8px 0; font-size: 12.5px;
  border-bottom: 1px solid #f2f5f9;
  word-break: break-all; white-space: pre-wrap;
}
.dl dd.empty { color: var(--text-3); font-style: italic; }
.dl .group-title {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 650; letter-spacing: .06em;
  color: var(--text-3); text-transform: uppercase;
  padding: 18px 0 6px;
}
.dl .group-title:first-child { padding-top: 0; }
.dl .group-title.sec { color: #b8283f; }

/* 抽屉凭证区复制按钮 */
.dl dd .icon-btn,
.dl .group-title .icon-btn {
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 8px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- 空态 ---------- */
.empty-state {
  padding: 44px 20px; text-align: center; color: var(--text-3); font-size: 13px;
}
.empty-state .big { font-size: 30px; margin-bottom: 8px; opacity: .4; }

/* ---------- 底注 ---------- */
.footnote {
  margin-top: 22px; padding: 14px 18px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 12px; color: var(--text-2); background: var(--surface);
}
.footnote b { color: var(--text); }
.footnote ul { margin: 8px 0 0; padding-left: 20px; }
.footnote li { margin: 3px 0; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd5e2; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #aab6c9; }

@media print {
  .topbar, .table-tools, .row-actions { display: none; }
  .table-wrap { max-height: none; }
}

/* ==========================================================================
   追加：登录页 / 对话框 / 操作列 / 系统状态
   ========================================================================== */

.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eef3fb 0%, #f4f6fa 45%, #eaf0ff 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 34px 32px;
}
.login-logo {
  width: 46px; height: 46px; border-radius: 11px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  margin-bottom: 18px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; font-weight: 680; letter-spacing: -.01em; }
.login-sub { margin: 0 0 24px; font-size: 13px; color: var(--text-3); }
.login-field { display: block; margin-bottom: 14px; }
.login-field span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.login-field input { width: 100%; min-width: 0; padding: 9px 12px; }
.login-error { min-height: 20px; font-size: 12.5px; color: var(--danger); margin-bottom: 10px; }
.login-submit { width: 100%; padding: 10px; font-size: 14px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- 顶栏按钮 ---------- */
.topbar .btn { margin-left: 4px; }
#user-pill { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 系统状态 tag ---------- */
.tag.available  { background: #eef1f6;          color: var(--text-3); }
.tag.claiming   { background: var(--brand-soft); color: #2450c8; }
.tag.delivered  { background: var(--ok-soft);    color: #0b7a44; }
.tag.recovered  { background: var(--warn-soft);  color: #a35c00; }
.tag.expelled   { background: #fdeaea;          color: #b3261e; }
.tag.closed      { background: #e8e8ea;          color: #4a4a52; }

/* ---------- 操作列 ---------- */
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cred-btn {
  font: inherit; font-size: 11px; padding: 1px 9px;
  border: 1px solid var(--border-strong); border-radius: 4px;
  background: #fff; color: var(--brand); cursor: pointer;
  white-space: nowrap;
}
.cred-btn:hover { background: var(--brand-soft); border-color: var(--brand); }

/* ---------- 抽屉操作区 ---------- */
.drawer-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ---------- 模态对话框 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 28, 44, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; z-index: 101;
  transform: translate(-50%, -50%) scale(.96);
  width: min(760px, 94vw); max-height: 88vh;
  background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal.small { width: min(430px, 94vw); }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 640; }
.modal-head .drawer-close { margin-left: auto; }
.modal-body { flex: 1; overflow: auto; padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ---------- 账号表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 650; letter-spacing: .06em;
  color: var(--text-3); text-transform: uppercase;
  padding: 8px 0 0;
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field > span { font-size: 11px; color: var(--text-3); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); min-width: 0; outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-field textarea { min-height: 60px; resize: vertical; }
.form-field .mono-input { font-family: var(--mono); font-size: 12.5px; }
/* 字段下方的取值说明（如「当前自动识别：…」），不占输入框空间 */
.form-field .field-hint {
  font-size: 11px; font-style: normal; color: var(--text-3);
  line-height: 1.5; word-break: break-all;
}

/* ---------- 领取账号对话框 ---------- */
.req { color: var(--danger); font-style: normal; font-weight: 700; }
.claim-types { display: grid; gap: 10px; margin: 6px 0 4px; }
.claim-type {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.claim-type:hover { border-color: var(--brand); background: var(--brand-soft); }
.claim-type input { margin: 2px 0 0; accent-color: var(--brand); }
.claim-type-main { display: flex; flex-direction: column; gap: 2px; }
.claim-type-main b { font-size: 13px; font-weight: 640; color: var(--text); }
.claim-type-main small { font-size: 11.5px; color: var(--text-3); }
.claim-type:has(input:checked) {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.claim-note { margin: 10px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.claim-note.ok { color: #166534; }
.claim-note b { color: var(--text); }
.claim-error {
  margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger); font-size: 12px; line-height: 1.5;
}
.claim-cred-box {
  margin-top: 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2);
}
.claim-cred-id {
  padding: 11px 12px; font-family: var(--mono); font-size: 14px; font-weight: 600;
  color: var(--brand); background: rgba(47, 107, 255, 0.07);
  border-bottom: 1px solid var(--border-strong); word-break: break-all;
}
.claim-cred-line {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.claim-cred-line:last-child { border-bottom: none; }
.claim-cred-key { flex: 0 0 auto; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.claim-cred-val {
  font-size: 12.5px; font-family: var(--mono); color: var(--text); word-break: break-all;
}
.claim-cred-val .empty { font-family: inherit; }
/* 业务下拉选择「＋ 自定义…」时出现的手填输入框 */
.claim-custom-input { margin-top: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   追加：SP 利用率 / 覆盖率报告
   ========================================================================== */

/* ---------- 顶栏 tab 导航 ---------- */
.topnav {
  display: flex; gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.topnav .tab {
  border: none; background: transparent;
  padding: 6px 15px; border-radius: 999px;
  font: inherit; font-size: 13px; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.topnav .tab:hover { color: var(--text); }
.topnav .tab.active {
  background: var(--brand); color: #fff;
  font-weight: 550;
}

/* ---------- SP 报告参数区 ---------- */
.sp-params .card-head { border-bottom: none; padding-bottom: 0; }
.sp-param-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.sp-param-row .field { min-width: 130px; }
.sp-param-row input[type="date"] { min-width: 150px; }

/* ---------- SP 摘要 KPI ---------- */
.sp-kpis { margin: 0 0 14px; }
.sp-kpis .kpi { padding: 13px 15px; }
.sp-kpis .kpi .value { font-size: 22px; }
.sp-kpis .kpi .value small { font-size: 13px; }

/* ---------- 趋势图 ---------- */
.sp-chart {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow-x: auto;
}
.sp-chart svg { display: block; width: 100%; min-width: 640px; height: auto; }

/* ---------- 趋势图节点交互 ---------- */
.sp-dot { pointer-events: none; }
.sp-dot.active { filter: drop-shadow(0 0 4px rgba(47,107,255,.55)); }
.sp-dot-hit { cursor: pointer; pointer-events: all; }

/* ---------- 悬浮提示气泡（趋势节点 / 环形图） ---------- */
.sp-float-tip {
  position: fixed;
  z-index: 1200;
  min-width: 190px;
  max-width: 290px;
  background: #1a2438;
  color: #eef2f8;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .32);
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: auto;   /* 允许选中文本、点击复制按钮 */
  user-select: text;
  cursor: default;
}
.sp-float-tip .sp-tip-head {
  font-weight: 600;
  font-size: 12.5px;
  color: #fff;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.sp-float-tip .sp-tip-table { width: 100%; border-collapse: collapse; }
/* 屏蔽全局斑马纹/悬停背景（tbody tr:nth-child(even) 等），避免深色气泡出现浅底白字看不见 */
.sp-float-tip .sp-tip-table tr td,
.sp-float-tip .sp-tip-table tr:hover td,
.sp-float-tip .sp-tip-table tr:nth-child(even) td,
.sp-float-tip .sp-tip-table tr:nth-child(even):hover td { background: transparent; }
.sp-float-tip .sp-tip-table td { padding: 2px 0; }
.sp-float-tip .sp-tip-table td.k {
  color: #98a4ba;
  text-align: left;
  padding-right: 16px;
  white-space: nowrap;
}
.sp-float-tip .sp-tip-table td.v {
  color: #fff;
  text-align: right;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.sp-float-tip .sp-tip-foot {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: #8b97ac;
  font-size: 11px;
}
.sp-float-tip .sp-tip-copy {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 5px 0;
  border: 1px solid rgba(120, 160, 255, .4);
  border-radius: 7px;
  background: rgba(47, 107, 255, .14);
  color: #cfe0ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease;
}
.sp-float-tip .sp-tip-copy:hover { background: rgba(47, 107, 255, .28); }
.sp-float-tip .sp-tip-copy:active { background: rgba(47, 107, 255, .4); }

/* ---------- 覆盖率布局（KPI + 环形图） ---------- */
.sp-cov-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.sp-cov-grid .sp-kpis { grid-column: 1; margin: 0; }
.sp-donut { grid-column: 2; min-width: 220px; }
.sp-donut .donut-wrap { justify-content: flex-end; }

/* ---------- 明细表格里的主单元格 ---------- */
.cell-main { font-weight: 550; color: var(--text); }

@media (max-width: 720px) {
  .sp-cov-grid { grid-template-columns: 1fr; }
  .sp-donut { grid-column: 1; }
  .sp-donut .donut-wrap { justify-content: flex-start; }
  .topnav { order: 9; width: 100%; justify-content: center; }
}

/* ==========================================================================
   追加：左侧侧边栏导航（分组可折叠、可隐藏）
   ========================================================================== */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  width: 224px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width .2s ease, border-color .2s;
}
.sidebar.collapsed { width: 0; border-right: none; }
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; border-bottom: 1px solid var(--border);
  min-height: 54px;
}
.sidebar-brand { font-weight: 660; font-size: 14px; color: var(--text); letter-spacing: -.01em; }
.sidebar-collapse {
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--text-3);
  padding: 4px 8px; border-radius: 6px;
}
.sidebar-collapse:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }

.nav-group { margin-bottom: 4px; }
.nav-group-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: none; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font: inherit; font-size: 12.5px; font-weight: 620; color: var(--text-2);
  letter-spacing: .02em;
}
.nav-group-toggle:hover { background: var(--surface-2); color: var(--text); }
.nav-group-toggle .chevron { transition: transform .15s; font-size: 12px; color: var(--text-3); }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group-items { padding: 2px 0 6px; }
.nav-item {
  width: 100%; display: block; text-align: left;
  border: none; background: transparent; cursor: pointer;
  padding: 8px 12px 8px 20px; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--text);
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active {
  background: var(--brand-soft); color: #2450c8; font-weight: 560;
  border-left-color: var(--brand);
}
/* 功能未启用：置灰且不可进入（开关见 feature_flags.py） */
.nav-item.is-disabled { color: var(--text-3); cursor: not-allowed; }
.nav-item.is-disabled:hover { background: transparent; }
.nav-item.is-disabled.active {
  background: transparent; color: var(--text-3); font-weight: 400;
  border-left-color: transparent;
}
.nav-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 10.5px; line-height: 16px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--border); vertical-align: 1px;
}

.sidebar-expand {
  position: fixed; top: 14px; left: 14px; z-index: 80;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  font-size: 17px; color: var(--text-2);
  box-shadow: var(--shadow);
}
.sidebar-expand:hover { color: var(--brand); border-color: var(--brand); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 720px) {
  .sidebar { width: 180px; }
}

/* ==========================================================================
   追加：报告参数区（数据源/时间/图表目标/明细筛选，蓝图风格）
   ========================================================================== */

.report-parameters { position: relative; z-index: 20; margin: 0; overflow: visible; }

.parameters-header { gap: 12px; }
.parameters-header h2 { font-size: 14.5px; }
.parameters-header .hint { margin-right: 4px; }
.parameters-header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }

.payer-chip { display: inline-flex; align-items: center; gap: 8px; }
.payer-chip span { color: var(--text-3); font-size: 12px; }
.payer-chip strong {
  max-width: 170px; overflow: hidden;
  padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); font: 12px var(--mono);
  text-overflow: ellipsis; white-space: nowrap;
}

.parameters-row {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 14px 0; padding: 4px 0 12px;
}
.parameter-group {
  display: grid; gap: 9px; align-content: end;
  padding: 0 22px 0 0; margin: 0 22px 0 0;
  border-right: 1px solid var(--border);
}
.parameter-group:last-child { padding: 0; margin: 0; border-right: 0; }
.parameter-group h3 {
  color: var(--text-2); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; margin: 0;
}
.parameter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.parameter-fields .form-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--text-3); font-weight: 500;
}
.parameter-fields .form-field select,
.parameter-fields .form-field input {
  font: inherit; font-size: 13px; font-weight: 400;
  padding: 6px 10px; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none;
}
.parameter-fields .form-field select:focus,
.parameter-fields .form-field input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
#sp-source { min-width: 130px; }
#sp-profile { min-width: 150px; }
#sp-granularity { min-width: 96px; }
#sp-target { width: 92px; }
.parameter-fields .checkbox-field {
  display: flex; align-items: center; gap: 6px;
  min-height: 34px; font-size: 12.5px; color: var(--text-2); font-weight: 400;
}
.parameter-fields .checkbox-field input { accent-color: var(--brand); }

.parameters-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 14px; margin: 0 -18px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.parameters-filters h3 {
  flex: none; margin: 0;
  color: var(--text-2); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.parameters-filters .parameter-fields { flex-wrap: nowrap; }
.parameters-filters .form-field select { min-width: 150px; }
#sp-service { min-width: 220px; height: 78px; }
.parameters-filters .link-button { flex: none; margin-left: auto; }

.link-button {
  border: none; background: transparent; cursor: pointer;
  color: var(--brand); font: inherit; font-size: 12.5px;
  padding: 4px 6px; border-radius: 6px;
}
.link-button:hover { background: var(--brand-soft); }

.parameter-footnote {
  margin: 12px 0 0; padding: 0;
  font-size: 11.5px; color: var(--text-3); line-height: 1.6;
}

@media (max-width: 820px) {
  .parameters-row { gap: 12px 0; }
  .parameter-group { padding: 0; margin: 0 12px 12px 0; }
  .parameters-filters .link-button { margin-left: 0; }
}

/* ===== AWS SP 账号推荐 ===== */
.rec-algo {
  margin: 0 0 14px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; line-height: 1.75; color: var(--text-2);
}
.rec-algo b { color: var(--text-1); }

.rec-warn {
  margin: 0 0 14px; padding: 12px 16px;
  background: rgba(214, 132, 42, .10);
  border: 1px solid rgba(214, 132, 42, .45); border-left: 4px solid var(--warn, #d6842a);
  border-radius: 10px;
  font-size: 13px; line-height: 1.7; color: var(--text-1);
}

/* 账号管理页：推荐筛选提示 chip */
.reco-chip {
  align-self: flex-end; margin-bottom: 2px; padding: 7px 12px;
  border: 1px solid rgba(214, 132, 42, .5); border-radius: 999px;
  background: rgba(214, 132, 42, .12); color: var(--text-1);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.reco-chip .chip-x { margin-left: 4px; opacity: .7; }
.reco-chip:hover { background: rgba(214, 132, 42, .2); }

/* 推荐表：无可推荐账号的 Payer 弱化显示 */
#rec-tbody tr.reco-zero { opacity: .55; }
#rec-tbody tr.reco-zero td { border-style: dashed; }

.rec-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.rec-toolbar .rec-meta {
  display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto;
  font-size: 12px; color: var(--text-3);
}
.rec-toolbar .rec-meta b { color: var(--text-1); font-weight: 600; }

#rec-summary .kpi .value { font-size: 26px; }
#rec-summary .kpi .foot { font-size: 11.5px; }

#rec-tbody .prio {
  display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 12.5px;
}
#rec-tbody .prio:empty, #rec-tbody td .empty { color: var(--text-3); }

.btn.small {
  padding: 5px 12px; font-size: 12px; line-height: 1.4;
}
@media (max-width: 1100px) {
  .rec-meta { margin-left: 0; width: 100%; }
}

/* ===== 审计中心 ===== */
.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
  gap: 12px 14px;
}
/* 本页筛选用的是 <label class="form-field">文本<控件>，没有 <span> 包标签，
   因此在这里补回与其它页面一致的小号灰标签样式 */
.audit-filters .form-field {
  min-width: 0;
  font-size: 11px; font-weight: 500; color: var(--text-3);
}
.audit-filters .form-field input,
.audit-filters .form-field select {
  font-size: 13px; font-weight: 400; color: var(--text);
}
.audit-filters .mono-input { font-family: var(--mono); font-size: 12.5px; }
.audit-filters input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.audit-filter-actions {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 1px;
}
.audit-filter-actions .btn { padding: 7px 14px; }

/* 概览卡是纯展示，不该有 KPI 的点击反馈 */
.audit-kpis .kpi { cursor: default; }
.audit-kpis .kpi:hover { transform: none; box-shadow: var(--shadow); }

.btn.tiny { padding: 4px 10px; font-size: 12px; line-height: 1.5; }
.btn.tiny:disabled { opacity: .45; cursor: default; }
.btn.tiny:disabled:hover { background: #fff; border-color: var(--border-strong); }

#audit-tbody td.mono { white-space: nowrap; }
#audit-tbody td:nth-child(6) {
  max-width: 460px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#audit-dist { min-height: 24px; }

/* 详情弹窗 */
.audit-detail-grid {
  display: grid; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.audit-detail-row {
  display: grid; grid-template-columns: 84px 1fr; gap: 10px;
  padding: 8px 12px; background: var(--surface);
  font-size: 13px; align-items: baseline;
}
.audit-detail-row > span { color: var(--text-3); font-size: 12px; }
.audit-detail-row > b { font-weight: 600; word-break: break-all; }
.audit-detail-row .empty { font-weight: 400; font-size: 11.5px; }

.audit-detail-block { margin-top: 14px; }
.audit-detail-block > span {
  display: block; margin-bottom: 5px;
  color: var(--text-3); font-size: 12px;
}
.audit-detail-pre {
  margin: 0; padding: 11px 13px;
  max-height: 340px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  color: var(--text); white-space: pre-wrap; word-break: break-all;
  user-select: text;
}

@media (max-width: 900px) {
  .audit-filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .audit-filter-actions { grid-column: 1 / -1; }
}

/* 抽屉：交付与归属历史 */
.drawer-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.hist-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.hist-sum { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.hist-sum b { color: var(--text); font-weight: 600; }
.hist-empty { font-size: 12px; color: var(--text-3); padding: 6px 0; }
.hist-error { font-size: 12px; color: var(--danger); padding: 6px 0; }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-item { padding: 8px 0; border-top: 1px dashed var(--border); }
.hist-item:first-child { border-top: 0; }
.hist-row { display: flex; align-items: center; gap: 8px; }
.hist-when { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.hist-detail { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.hist-detail b { color: var(--text); font-weight: 600; }
.hist-note { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.hist-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #eef1f6; color: var(--text-3);
}
.hist-tag.hist-base    { background: #eef1f6;            color: var(--text-2); }
.hist-tag.hist-claim   { background: var(--brand-soft);  color: #2450c8; }
.hist-tag.hist-deliver { background: var(--ok-soft);     color: #0b7a44; }
.hist-tag.hist-recover { background: var(--warn-soft);   color: #a35c00; }

/* ==========================================================================
   追加：手机端适配（≤760px；导航变覆盖式抽屉，表格横滑，弹层近全屏）
   ========================================================================== */

/* 侧边栏遮罩（仅手机端由 JS 控制 open） */
.sidebar-mask {
  position: fixed; inset: 0; z-index: 94;
  background: rgba(20, 28, 44, .38);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-mask.open { opacity: 1; pointer-events: auto; }

@media (max-width: 760px) {
  /* ---- 侧边栏 → 覆盖式抽屉 ---- */
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 95;
    width: min(286px, 84vw);
    box-shadow: 0 0 44px rgba(20, 28, 44, .24);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  }
  /* 手机端 collapsed 语义 = 滑出屏幕（桌面端仍是 width:0） */
  .sidebar.collapsed {
    width: min(286px, 84vw);
    transform: translateX(-104%);
    border-right: 1px solid var(--border);
  }
  .sidebar-expand { top: 10px; left: 10px; }

  /* ---- 顶栏 ---- */
  .topbar { padding: 10px 12px 10px 58px; gap: 8px; flex-wrap: wrap; }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { display: none; }
  .topbar .btn { padding: 6px 10px; font-size: 12px; }
  .source-pill { padding: 3px 9px; font-size: 11px; }

  /* main 在桌面端靠 margin:auto + max-width 居中；但它作为 .app-main(flex 列)
     的子项时横向 auto margin 会让宽度按 fit-content 解析，被 width:max-content
     的大表格(2744px)撑爆页面 → 手机端固定为容器宽，表格交给 .table-wrap 内部横滑 */
  main { width: 100%; max-width: none; padding: 12px 12px 48px; }

  /* ---- 卡片 / KPI ---- */
  .card-head { padding: 12px 14px; }
  .card-body { padding: 12px 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { padding: 12px 13px; }
  .kpi .value { font-size: 22px; }
  .kpi .foot { font-size: 10.5px; }
  #rec-summary .kpi .value { font-size: 22px; }
  .risk .rv { font-size: 21px; }

  /* ---- 筛选工具区 ---- */
  .table-tools { padding: 10px 12px; gap: 8px; }
  .table-tools .field { flex: 1 1 44%; }
  .field > select, .field > input,
  .form-field input, .form-field select,
  .audit-filters input, .audit-filters select { width: 100%; min-width: 0; }
  .table-tools input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .reco-chip { align-self: flex-start; }

  /* ---- 表格：自然横滑 + 加大触控目标 ---- */
  .table-wrap { max-height: none; -webkit-overflow-scrolling: touch; }
  tbody td { padding: 10px 10px; }
  .row-actions { flex-wrap: nowrap; }
  .icon-btn { padding: 6px 9px; font-size: 13px; }
  .cred-btn { padding: 5px 10px; font-size: 12px; }

  /* ---- 图表：标签列窄屏封顶（--label-w 是 JS 内联样式，用 min() 封顶） ---- */
  .dist-row { grid-template-columns: min(var(--label-w, 152px), 38%) 1fr 52px; gap: 7px; }
  .grid-4 .donut svg { width: 104px; height: 104px; }

  /* ---- 抽屉 / 模态 近全屏 ---- */
  .drawer { width: 100vw; box-shadow: none; }
  .drawer-head { padding: 14px 14px; }
  .drawer-body { padding: 14px 14px 44px; }
  .drawer-actions { padding: 12px 14px; }
  .dl { grid-template-columns: 104px 1fr; }
  .modal { width: 96vw; max-height: 92vh; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px; }
  .modal-foot .btn { padding: 9px 14px; }

  /* ---- 审计 / 推荐 ---- */
  .audit-filters { grid-template-columns: 1fr 1fr; }
  .audit-filter-actions { grid-column: 1 / -1; }
  .rec-toolbar .rec-meta { margin-left: 0; width: 100%; }

  /* ---- SP 报告参数区：参数组改纵向堆叠 ---- */
  .parameter-group {
    border-right: none; padding: 0 0 10px; margin: 0 0 10px;
    border-bottom: 1px dashed var(--border);
  }
  .parameter-group:last-child { border-bottom: none; margin-bottom: 0; }
  .parameters-filters .parameter-fields { flex-wrap: wrap; }
  .parameters-filters .form-field select { min-width: 0; }
  #sp-service { min-width: 0; width: 100%; height: 64px; }
  .sp-chart svg { min-width: 560px; }

  /* ---- 登录页 ---- */
  .login-view { padding: 16px; }
  .login-card { padding: 26px 20px; }
}

/* ---- 触屏通用：去点按高亮、输入字号≥16px 防 iOS 聚焦缩放 ---- */
@media (pointer: coarse) {
  body { -webkit-tap-highlight-color: transparent; }
  input[type="search"], input[type="text"], input[type="password"],
  input[type="date"], select, textarea { font-size: 16px; }
}

/* ---- 回收向导（一键清空资源 → 凭证重置回收） ---- */
.rw-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 90; display: none; }
.rw-mask.open { display: block; }
.rw-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(880px, 94vw); max-height: 92vh; display: none; flex-direction: column;
  background: var(--panel, #fff); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(2, 6, 23, .35); z-index: 91;
}
.rw-panel.open { display: flex; }
.rw-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line, #e2e8f0); }
.rw-title { font-weight: 700; font-size: 16px; }
.rw-steps { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.rw-step { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.rw-step.on { background: var(--brand, #2563eb); color: #fff; }
.rw-step.done { background: var(--teal, #0d9488); color: #fff; }
.rw-body {
  padding: 14px 18px; overflow: auto;
  min-height: 220px; max-height: calc(92vh - 200px);
}
.rw-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line, #e2e8f0); }
.rw-note { font-size: 13px; color: var(--muted, #475569); line-height: 1.7; margin: 6px 0; }
.rw-warn {
  background: #fef2f2; border: 1px solid var(--danger, #dc2626); color: #991b1b;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.7; margin: 10px 0;
  word-break: break-all;
}
.rw-ok {
  background: #f0fdf4; border: 1px solid #86efac; color: #166534;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.7; margin: 10px 0;
}
.rw-danger { background: var(--danger, #dc2626) !important; border-color: var(--danger, #dc2626) !important; color: #fff !important; }
.rw-danger:disabled { opacity: .45; cursor: not-allowed; }
.rw-progress {
  font-size: 13px; padding: 10px 12px; background: #f8fafc; border-radius: 10px;
  margin: 8px 0; font-variant-numeric: tabular-nums;
}
.rw-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.rw-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.rw-chip.bad { background: #fef2f2; color: #991b1b; }
.rw-chip.warn { background: #fffbeb; color: #92400e; }
.rw-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 12px; }
.rw-table th, .rw-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #e2e8f0); word-break: break-all; }
.rw-table th { color: var(--muted, #64748b); font-weight: 600; white-space: nowrap; }
.rw-sec { font-weight: 700; font-size: 13px; margin: 14px 0 6px; }
.rw-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-top: 10px; cursor: pointer; }
.rw-region { display: inline-flex; align-items: center; gap: 4px; margin: 0 14px 6px 0; font-size: 13px; }
.rw-region input:disabled { opacity: .6; }
.rw-ex-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.rw-reg-group { margin: 2px 0 8px; }
.rw-reg-name { display: inline-block; font-size: 12px; font-weight: 700; color: var(--muted, #64748b); min-width: 74px; }
.rw-reg-cn { color: var(--muted, #94a3b8); font-size: 12px; }
.rw-ex-group { margin: 4px 0; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; padding: 6px 10px; }
.rw-ex-group summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted, #475569); }
.rw-ex-scroll { max-height: 720px; overflow: auto; padding-top: 6px; }
.rw-ex-cat { border-left: 3px solid var(--brand, #2563eb); }
.rw-ex-cat > div { max-height: none; overflow: visible; }
.rw-svc { margin: 4px 0 10px; }
.rw-chip { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; margin-left: 4px; }

/* 手机端：向导近全屏 */
@media (max-width: 760px) {
  .rw-panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; top: 0; left: 0; transform: none; }
  .rw-body { min-height: 200px; max-height: calc(100vh - 210px); }
}

/* 批量选择与批量条（2026-10-21） */
.tag.expelled   { background: #fdeaea; color: #b3261e; }
th.selcol, td.selcol { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
th.selcol input, td.selcol input { cursor: pointer; }
.batch-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 8px; background: var(--brand-soft, #eef4ff); border-radius: 8px; }
.batch-bar.hidden { display: none; }
.batch-bar #batch-count { font-weight: 600; color: var(--brand, #2450c8); }
.batch-bar .batch-tip { margin-left: auto; font-size: 12px; color: var(--text-3, #8a93a6); }

/* 当月新增客户逐条钻取（2026-10-21） */
.dist-row.pickable { cursor: pointer; border-radius: 6px; }
.dist-row.pickable:hover { background: rgba(36, 80, 200, 0.06); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--line, #e6e9f0); text-align: left; white-space: nowrap; }
.mini-table th { color: var(--text-3, #8a93a6); font-weight: 600; background: #f7f9fc; position: sticky; top: 0; }
.mini-table td.mono { font-family: ui-monospace, Consolas, monospace; }


/* ============================================================
   登录页 · 方案 C（玻璃渐变，2026-10-21）
   以 #login-view 前缀覆盖旧的浅色登录样式
   ============================================================ */
#login-view.login-view {
  position: relative; overflow: hidden;
  min-height: 100vh; padding: 40px 20px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3a1f6e 0%, #4a2a83 28%, #4747ac 58%, #2f6bff 100%);
  color: #fff;
}
#login-view::before {
  content: ""; position: absolute; inset: -18%; pointer-events: none;
  background:
    radial-gradient(520px 420px at 18% 22%, rgba(150, 120, 255, .45), transparent 60%),
    radial-gradient(560px 460px at 84% 76%, rgba(90, 170, 255, .42), transparent 62%),
    radial-gradient(380px 320px at 66% 12%, rgba(255, 255, 255, .16), transparent 60%);
  filter: blur(2px);
}
#login-view::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(76% 68% at 50% 46%, #000 40%, transparent 100%);
  mask-image: radial-gradient(76% 68% at 50% 46%, #000 40%, transparent 100%);
}
#login-view .login-shell { position: relative; z-index: 1; width: min(430px, 100%); }

#login-view .login-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
#login-view .login-logo {
  width: 88px; height: 97px; border-radius: 22px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 38px rgba(10, 16, 50, .35); margin: 0;
}
#login-view .login-logo img { width: 74px; height: auto; display: block; }
#login-view .login-name { margin-top: 16px; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: #fff; }
#login-view .login-en { margin-top: 5px; font-size: 9.5px; letter-spacing: 4.5px; color: rgba(255,255,255,.62); font-weight: 600; }

#login-view .login-card {
  width: 100%; max-width: none; padding: 28px 28px 26px;
  border-radius: 22px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .13);
  box-shadow: 0 26px 70px rgba(8, 14, 44, .40), inset 0 1px 0 rgba(255,255,255,.25);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
}
#login-view .login-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; color: #fff; margin: 0; }
#login-view .login-sub { margin: 6px 0 0; font-size: 12.5px; color: rgba(255,255,255,.66); }
#login-view #login-form { margin-top: 22px; }

#login-view .login-field { display: block; margin-bottom: 15px; }
#login-view .login-field span:first-child {
  display: block; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.78); margin-bottom: 7px;
}
#login-view .login-field input {
  width: 100%; height: 46px; padding: 0 13px; border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .13);
  color: #fff; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
  min-width: 0;
}
#login-view .login-field input::placeholder { color: rgba(255,255,255,.58); }
#login-view .login-field input:focus {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .62);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .12);
}
#login-view .login-field input:-webkit-autofill,
#login-view .login-field input:-webkit-autofill:hover,
#login-view .login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(58, 40, 120, .86) inset;
  transition: background-color 9999s ease-out 0s;
}
#login-view .login-pw { display: block; position: relative; }
#login-view .login-pw input { padding-right: 46px; }
#login-view .login-eye {
  position: absolute; right: 5px; top: 5px; width: 36px; height: 36px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  color: rgba(255,255,255,.88); display: flex; align-items: center; justify-content: center;
}
#login-view .login-eye:hover { color: #fff; background: rgba(255,255,255,.12); }
#login-view .login-eye.on { color: #fff; }
#login-view .login-eye svg { width: 17px; height: 17px; stroke: currentColor; fill: none; }

#login-view .login-error {
  display: block; min-height: 0; margin-bottom: 13px; padding: 10px 12px; border-radius: 9px;
  background: rgba(255, 96, 86, .22); border: 1px solid rgba(255, 140, 130, .55);
  color: #ffe3e0; font-size: 12.5px; line-height: 1.5;
  animation: login-shake .3s;
}
#login-view .login-error:empty { display: none; }
@keyframes login-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

#login-view .login-submit {
  width: 100%; height: 47px; padding: 0; margin-top: 6px;
  border: 0; border-radius: 11px; cursor: pointer;
  background: #fff; color: #3f2a86; font-size: 14.5px; font-weight: 700; letter-spacing: 3px;
  box-shadow: 0 12px 30px rgba(6, 12, 40, .30);
  transition: transform .06s, box-shadow .2s, opacity .2s;
}
#login-view .login-submit:hover { box-shadow: 0 14px 34px rgba(6, 12, 40, .38); }
#login-view .login-submit:active { transform: translateY(1px); }
#login-view .login-submit:disabled { opacity: .65; cursor: not-allowed; letter-spacing: 2px; }

#login-view .login-hint { margin: 18px 0 0; font-size: 11.5px; color: rgba(255,255,255,.55); text-align: center; line-height: 1.7; }
#login-view .login-foot { margin: 22px 0 0; text-align: center; font-size: 11.5px; color: rgba(255,255,255,.52); letter-spacing: .3px; }

@media (max-width: 520px) {
  #login-view.login-view { padding: 34px 14px; align-items: flex-start; }
  #login-view .login-card { padding: 22px 18px; border-radius: 18px; }
  #login-view .login-logo { width: 76px; height: 84px; border-radius: 18px; }
  #login-view .login-logo img { width: 64px; }
}

/* 凭证缺失置灰（2026-10-22） */
.icon-btn:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(1); }
.cred-btn:disabled { opacity: .42; cursor: not-allowed; }
.claim-type.disabled { opacity: .5; cursor: not-allowed; background: #f6f7fa; }
.claim-type.disabled b { color: var(--text-3); }

/* ==========================================================================
   网宿云 CDN 流量监控（2026-11-11）
   ========================================================================== */
/* 参数区用两列栅格，避免右侧高个子把左侧「时间窗口」压到底部 */
.cdn-params {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(150px, 190px) minmax(300px, 1fr);
  align-items: start;
  gap: 18px 28px;
  padding: 4px 0 12px;
}
.cdn-params .parameter-group {
  padding: 0; margin: 0; border-right: 0; align-content: start;
}
.cdn-params .parameter-fields { align-items: flex-start; }
#cdn-start, #cdn-end { min-width: 126px; }
#cdn-granularity { min-width: 104px; }

/* 主账号：单账号时禁用，多账号时可切换 */
.cdn-account-picker { min-width: 0; }
.cdn-account-picker .parameter-fields { flex-direction: column; align-items: stretch; gap: 4px; }
.cdn-account-picker select { width: 100%; }
.cdn-account-picker select:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; }
#cdn-account-hint { margin-top: 2px; }

/* 自定义服务组：多选下拉（触发器 + 浮层勾选面板） */
.cdn-group-picker { min-width: 0; }
.cdn-multiselect { position: relative; max-width: 440px; }
.cdn-ms-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: 13px; color: var(--text);
  text-align: left; cursor: pointer;
}
.cdn-ms-trigger:hover { border-color: var(--brand); }
.cdn-ms-trigger.open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.cdn-ms-value {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2);
}
.cdn-ms-value.picked { color: var(--text); font-weight: 500; }
.cdn-ms-caret {
  flex: 0 0 auto; color: var(--text-3); font-size: 10px;
  transition: transform .15s ease;
}
.cdn-ms-trigger.open .cdn-ms-caret { transform: rotate(180deg); }
.cdn-ms-panel {
  position: absolute; z-index: 40;
  left: 0; top: calc(100% + 4px);
  width: max(100%, 380px); max-width: 540px;
  padding: 10px 12px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.cdn-ms-actions {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cdn-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  align-content: start;
  gap: 2px 8px;
  max-height: 232px;
  overflow-y: auto;
}
.cdn-check-item {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 6px; border-radius: 5px;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  min-width: 0;
}
.cdn-check-item:hover { background: var(--brand-soft); }
.cdn-check-item input[type="checkbox"] {
  margin: 0; flex: 0 0 auto; accent-color: var(--brand); cursor: pointer;
}
.cdn-check-name {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cdn-check-count {
  flex: 0 0 auto; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cdn-check-empty {
  grid-column: 1 / -1; padding: 10px 4px;
  font-size: 12px; color: var(--text-3);
}
.cdn-picker-hint {
  margin: 4px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--text-3);
}

/* 趋势图 */
.cdn-chart {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow: hidden;
}
.cdn-chart svg { display: block; width: 100%; height: auto; cursor: crosshair; }

.cdn-tip {
  position: fixed; display: none; z-index: 1200;
  min-width: 190px; max-width: 320px;
  background: #1a2438; color: #eef2f8;
  border-radius: 10px; padding: 9px 11px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .32);
  font-size: 12px; line-height: 1.55;
  pointer-events: none;
}
.cdn-tip .cdn-tip-time {
  font-weight: 600; font-size: 12px; margin-bottom: 5px;
  color: #cfd8e6; letter-spacing: .2px;
}
.cdn-tip-table { width: 100%; border-collapse: collapse; }
.cdn-tip-table td { padding: 2px 0; background: transparent !important; border: 0 !important; }
.cdn-tip-table td.k { color: #aebdd2; padding-right: 10px; white-space: nowrap; }
.cdn-tip-table td.v { text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.cdn-tip-table tr.sum td { border-top: 1px solid rgba(255,255,255,.16) !important; padding-top: 5px; }
.cdn-tip-table tr.sum td.k { color: #e6ecf5; font-weight: 600; }
.cdn-tip-table .cdot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}

/* 图例 */
.cdn-legend { flex-wrap: wrap; gap: 8px 16px; }
.cdn-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.cdn-legend-item i {
  width: 10px; height: 10px; border-radius: 3px; display: block; flex: 0 0 auto;
}
.cdn-legend-item i.dash {
  background: repeating-linear-gradient(90deg, #1a2438 0 3px, transparent 3px 6px);
  opacity: .5;
}
.cdn-legend-item b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 明细表 */
.cdn-code {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  word-break: break-all;
}
.cdn-hist { font-size: 11px; color: var(--text-3); margin-top: 2px; }
/* 历史域名因凭据权限被剔除：必须显眼，否则用户会把少算的数字当成全量 */
.cdn-hist.warn { color: var(--danger, #c0392b); }
.cdn-scope-note {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(192, 57, 43, .28);
  background: rgba(192, 57, 43, .07);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.cdn-scope-note b { color: var(--danger, #c0392b); }
/* 混合口径：数据是完整的，只是靠两套凭据，用中性色 */
.cdn-scope-note.info {
  border-color: rgba(30, 120, 200, .26);
  background: rgba(30, 120, 200, .06);
}
.cdn-scope-note.info b { color: var(--brand); }
.cdn-domain-toggle {
  padding: 2px 6px; font-size: 12px;
}
.cdn-domain-row > td { background: var(--surface-2); padding: 10px 14px !important; }
.cdn-domain-box {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 190px; overflow-y: auto;
}
.cdn-domain {
  font-family: var(--mono); font-size: 11.5px;
  background: #fff; border: 1px solid var(--border); border-radius: 5px;
  padding: 2px 7px; color: var(--text-2);
}
.cdn-domain-more { font-size: 11.5px; color: var(--text-3); align-self: center; }

/* 鉴权配置 */
.cdn-cred-note {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.75; color: var(--text-2);
}
.cdn-cred-note code { font-family: var(--mono); font-size: 11.5px; }
.cdn-cred-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 图表视图切换 */
.cdn-seg {
  display: inline-flex; padding: 2px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.cdn-seg-btn {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text-2);
  padding: 4px 12px; border-radius: 6px; transition: background .12s, color .12s;
}
.cdn-seg-btn:hover { color: var(--text); }
.cdn-seg-btn.active {
  background: #fff; color: var(--brand); font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 36, 56, .1);
}
.cdn-compare {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.cdn-compare input { accent-color: var(--brand); }

/* KPI 环比 */
.cdn-delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.cdn-delta.up { color: #d93a3a; }
.cdn-delta.down { color: #0f9d58; }

/* 图例占比 */
.cdn-legend-pct {
  font-style: normal; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 明细表：迷你趋势线 / 占比数据条 / 点击下钻 */
.cdn-spark-cell { width: 96px; }
.cdn-spark { display: block; width: 88px; height: 22px; opacity: .85; }
.cdn-name { cursor: pointer; }
.cdn-name:hover { color: var(--brand); }
/* 占比数据条：不要用 <td> 当定位祖先——表格单元格上的 position:relative
   在部分场景下不生效，滚动时数据条会以更外层容器为基准而"飞"出去。
   这里用一个 cell 内的 block 包裹，定位稳定。 */
.cdn-share { min-width: 82px; font-variant-numeric: tabular-nums; }
.cdn-share-box { position: relative; height: 18px; display: flex; align-items: center; }
.cdn-share-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  max-width: 100%; border-radius: 3px; opacity: .16;
}
.cdn-share em { position: relative; font-style: normal; padding-left: 4px; }
.cdn-tip-table .cdot-pct { color: #9fb0c9; font-style: normal; font-size: 11px; }

/* 中等宽度：三列（时间/账号/服务组）放不下，服务组换行占满 */
@media (max-width: 1180px) {
  .cdn-params { grid-template-columns: minmax(280px, 340px) minmax(140px, 180px); }
  .cdn-group-picker { grid-column: 1 / -1; }
  .cdn-check-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* 平板宽度：参数卡两列也放不下，直接转单列 */
@media (max-width: 1024px) {
  .cdn-params { grid-template-columns: 1fr; gap: 16px; }
  .cdn-account-picker { max-width: 260px; }
}

@media (max-width: 760px) {
  .cdn-params { grid-template-columns: 1fr; gap: 16px; }
  .cdn-picker-hint { margin-top: 4px; }
  /* 下拉面板在窄屏不要超出屏幕 */
  .cdn-multiselect { max-width: none; }
  .cdn-ms-panel { width: 100%; min-width: 0; max-width: none; }
  .cdn-chart { overflow-x: auto; }
  .cdn-chart svg { min-width: 620px; }
  .cdn-domain-box { max-height: 150px; }
  /* 头部动作区在窄屏换行，避免把卡片顶出视口 */
  #cdn-view .parameters-header { flex-wrap: wrap; }
  #cdn-view .parameters-header .hint { flex: 1 1 100%; margin-right: 0; }
  #cdn-view .parameters-header-actions {
    margin-left: 0; width: 100%; flex-wrap: wrap; gap: 8px 12px;
  }
  #cdn-view .parameters-header-actions .payer-chip strong { max-width: 120px; }
  #cdn-view .card-head { flex-wrap: wrap; row-gap: 8px; }
  #cdn-view .card-head .cdn-seg { order: 3; }
  #cdn-view .card-head .cdn-compare { order: 2; }
  .cdn-spark-cell, .cdn-share { display: none; }
}



/* ============ CDN 运营台（客户与计费 / 告警 / 子账号） ============ */
.biz-search {
  width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
}
.biz-search:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
select.biz-search { cursor: pointer; }
.biz-status {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
}
.biz-status.ok { border-color: rgba(15, 157, 88, .3); background: var(--ok-soft); color: var(--ok); }
.biz-status.warn { border-color: rgba(224, 134, 0, .3); background: var(--warn-soft); color: var(--warn); }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
@media (max-width: 760px) {
  .biz-search { width: 100%; }
}

/* 账号管理工具条与勾选项 */
.biz-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.biz-toolbar .biz-status {
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.field-check input { width: 15px; height: 15px; cursor: pointer; }
.card-body > .table-wrap { margin: 0 -2px; }
@media (max-width: 760px) {
  .biz-toolbar .biz-status { white-space: normal; }
}

/* 账号管理标题行：hint 可收缩，避免把操作按钮挤到下一行 */
.account-head { flex-wrap: nowrap; }
.account-head .hint {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-head .parameters-header-actions { flex: 0 0 auto; }
@media (max-width: 900px) {
  .account-head { flex-wrap: wrap; }
  .account-head .hint { white-space: normal; }
}
