/* 素材台 · 视觉与工作台面板一致（深色玻璃拟态 + 整页壁纸） */
[hidden] { display: none !important; }

:root {
  --bg: #151517;
  --surface: #1b1b1c;
  --surface2: #232324;
  --line: rgba(255, 255, 255, .06);
  --line2: rgba(255, 255, 255, .12);
  --text: #f9fafb;
  --muted: #adb2b8;
  --accent: #7aaaff;
  --accent-solid: #3b6ae0;
  --ok: #22c55e;
  --warn: #f7ad31;
  --bad: #f25a5a;
  --dim: #81858c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html {
  background: #111113;
  background-image: linear-gradient(rgba(10, 10, 12, .5), rgba(10, 10, 12, .66)), url("/wallpaper.jpg");
  background-size: cover;
  background-position: center 18%;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body {
  background: transparent;
  color: var(--text);
  font: 14px/1.6 "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { color: transparent; }

/* ---------- 主框架（左导航 + 右主区，与工作台同一个骨架） ---------- */
#app { display: flex; width: 100%; min-height: 100vh; }

/* ---------- 左侧导航（与工作台 nav 同一套） ---------- */
.side {
  width: 240px; flex: none;
  border-right: 1px solid rgba(255, 255, 255, .08);
  background: rgba(17, 17, 19, .58);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  min-height: 100vh;
}
.brand { text-align: center; padding: 2px 6px 16px; min-width: 0; }
.brand .logo {
  display: block; width: 68px; height: 68px; margin: 0 auto 12px;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
}
.brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.brand small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.tabs { display: flex; flex-direction: column; gap: 2px; padding: 0; flex-wrap: nowrap; }
.tab {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  font-size: 14.5px; text-align: left;
  padding: 10px 12px; border-radius: 9px;
  box-shadow: none;
}
.tab:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.tab.on { background: rgba(86, 134, 254, .16); color: var(--accent); font-weight: 600; }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }

.navfoot {
  margin-top: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.who { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 右侧主区 ---------- */
.main { flex: 1; min-width: 0; overflow: auto; padding: 22px 26px 40px; }
.phead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.phead h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .01em; }
.phead .sub { font-size: 12px; color: var(--muted); }
.spacer { flex: 1; }
.wrap { max-width: 1200px; }

h3, h4 {
  font-size: 13px; color: var(--muted); font-weight: 600;
  letter-spacing: .04em; margin: 22px 0 10px;
}
h5 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 22px 0 10px; }

/* ---------- 工具条 ---------- */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
.bar .grow { flex: 1 1 220px; }
.grow { flex: 1 1 auto; min-width: 0; }
.input, select.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(38, 38, 42, .55);
  color: var(--text);
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: rgba(122, 170, 255, .75); box-shadow: 0 0 0 3px rgba(122, 170, 255, .16); }
select.input option { background: #232324; color: var(--text); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(38, 38, 42, .55);
  color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
.chip:hover { border-color: rgba(122, 170, 255, .5); color: var(--text); }
.chip.on { background: rgba(86, 134, 254, .22); border-color: rgba(122, 170, 255, .7); color: var(--accent); font-weight: 600; }

/* ---------- 卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  background: rgba(26, 26, 29, .62);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; width: 100%; color: var(--text); min-width: 0;
  transition: border-color .12s ease, transform .12s ease;
}
button.card:hover { border-color: rgba(122, 170, 255, .55); transform: translateY(-1px); }
.card h3 { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 600; color: var(--text); letter-spacing: 0; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.card .foot {
  margin-top: auto; display: flex; gap: 8px; align-items: center;
  justify-content: space-between; font-size: 12.5px; color: var(--muted);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: rgba(34, 197, 94, .16); color: #4ade80;
  white-space: nowrap;
}
.tag.clay { background: rgba(242, 90, 90, .16); color: #ff8f8f; }
.tag.amber { background: rgba(247, 173, 49, .16); color: #fbbf24; }
.tag.plain { background: rgba(129, 133, 140, .18); color: #c3c7cd; }

/* ---------- 按钮 ---------- */
.btn, .act {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(38, 38, 42, .55);
  color: var(--text);
  font-size: 13.5px; padding: 6px 12px; border-radius: 10px;
  min-height: 38px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover, .act:hover { border-color: var(--accent); color: var(--accent); background: rgba(122, 170, 255, .10); }
.btn:disabled, .act:disabled { opacity: .5; cursor: default; }
.btn.primary, .act.primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; font-weight: 600; }
.btn.primary:hover, .act.primary:hover { filter: brightness(1.1); color: #fff; background: var(--accent-solid); }
.btn.danger, .act.danger { border-color: rgba(242, 90, 90, .35); color: #fca5a5; }
.btn.danger:hover, .act.danger:hover { border-color: var(--bad); background: rgba(242, 90, 90, .14); color: #fff; }
.btn.small, .act.small { padding: 5px 10px; min-height: 32px; font-size: 12.5px; }

.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.warn {
  font-size: 12.5px; color: #fbbf24;
  background: rgba(247, 173, 49, .10);
  border: 1px solid rgba(247, 173, 49, .28);
  padding: 9px 11px; border-radius: 10px; line-height: 1.6;
}
.note {
  font-size: 13px; color: #cfd3d6;
  background: rgba(122, 170, 255, .09);
  border: 1px solid rgba(122, 170, 255, .22);
  padding: 9px 11px; border-radius: 10px; line-height: 1.6;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; color: var(--muted); padding: 44px 16px; font-size: 13.5px;
  border: 1px dashed var(--line2); border-radius: 14px;
  background: rgba(26, 26, 29, .38);
}

/* ---------- 面板（运营台） ---------- */
.panel {
  background: rgba(26, 26, 29, .62);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex; flex-direction: column; gap: 10px;
}
.panel.wide { max-width: none; }
.panel h3 { margin: 0; font-size: 15px; color: var(--text); letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.panel .num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-solid); color: #fff; font-size: 12px;
  display: grid; place-items: center; flex: none;
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 指标卡（运营台顶部，与工作台 .kpi 同款） ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.kpi {
  background: rgba(26, 26, 29, .62);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  min-width: 0;
}
.kpi b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

/* ---------- 表格（自带玻璃底，压在壁纸上也读得清） ---------- */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px; table-layout: fixed;
  background: rgba(26, 26, 29, .62);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
}
.table th, .table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table thead th { border-bottom: 1px solid var(--line2); }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tbody tr:hover { background: rgba(255, 255, 255, .035); }
.table td.wrap-cell { white-space: normal; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ---------- 弹层：卡头 / 卡身 / 底栏 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 6, 8, .56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mask[hidden] { display: none; }
.sheet {
  width: min(640px, 100%); max-height: min(84vh, 780px);
  background: rgba(26, 26, 29, .92);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet .h { padding: 18px 20px 12px; border-bottom: 1px solid var(--line2); }
.sheet .h h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.4; color: var(--text); }
.sheet .h .sub { font-size: 12px; color: var(--muted); }
.sheet .b { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet .f {
  padding: 14px 20px; border-top: 1px solid var(--line2);
  display: flex; gap: 10px; justify-content: flex-end;
  background: rgba(0, 0, 0, .22);
}
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

/* 链接盒子 */
.linkbox {
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 9px;
  background: rgba(0, 0, 0, .26);
}
.linkbox .lnk { font-family: var(--mono); font-size: 12.5px; color: #e3e6ea; word-break: break-all; line-height: 1.55; }
.linkacts { display: flex; gap: 8px; flex-wrap: wrap; }

/* 成片列表 */
.vlist { display: flex; flex-direction: column; gap: 6px; }
.vrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* 收录记录里挂出来的子包 */
.subpkgs { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px; }
.subpkg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.subpkg .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.subpkg .hint { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; width: 100%; }
.login .box {
  width: min(380px, 100%);
  background: rgba(26, 26, 29, .78);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px; padding: 28px 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  display: flex; flex-direction: column; gap: 12px;
}
.login .logo {
  width: 68px; height: 68px; margin: 0 auto 4px; display: block;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
}
.login h1 { font-size: 21px; margin: 0; text-align: center; font-weight: 700; }
.login p { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.login .btn { min-height: 44px; font-size: 15px; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #f9fafb; color: #111113;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .18s ease;
  max-width: min(560px, 90vw); text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.toast.on { opacity: .95; }

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  #app { flex-direction: column; }
  .side {
    width: auto; min-height: 0;
    flex-direction: row; align-items: center; gap: 4px;
    overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line2);
    padding: 8px 12px;
    position: sticky; top: 0; z-index: 30;
  }
  .brand { display: none; }
  .tabs { flex-direction: row; flex: 1 1 auto; min-width: 0; }
  .tab { width: auto; padding: 9px 12px; white-space: nowrap; }
  .navfoot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 8px; padding: 0; }
  .who { display: none; }
  .main { padding: 14px 14px 80px; }
  .phead { margin-bottom: 12px; gap: 8px; }
  .phead h1 { font-size: 17px; }
  .phead .sub { display: none; }
  .wrap { max-width: none; }
  .row2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpi { padding: 11px 12px; }
  .kpi b { font-size: 22px; }
  .grid { grid-template-columns: 1fr; }
  .mask { padding: 0; align-items: flex-end; }
  .sheet { width: 100%; max-height: 90vh; border-radius: 18px 18px 0 0; }
  .sheet .f { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .sheet .f .btn { flex: 1; }
  .btn, .act { min-height: 44px; font-size: 14px; }
  .table { font-size: 12.5px; }
  .hide-sm { display: none !important; }

  /* 表格在手机上切成一段一段，不许挤成一条线 */
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table colgroup { display: none; }
  .table thead { display: none; }
  .table tr { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .table tbody tr:hover { background: transparent; }
  .table td {
    border: 0; padding: 3px 0; white-space: normal;
    display: flex; gap: 10px; align-items: baseline;
    overflow: visible; text-overflow: clip;
  }
  .table td::before { content: attr(data-label); flex: 0 0 64px; color: var(--muted); font-size: 12px; }
  .table td:first-child { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
  .table td:first-child::before { content: none; }
  .table td:empty { display: none; }
  .subpkgs { padding: 2px 0 0; }
  .subpkg { flex-wrap: wrap; gap: 6px; }
  .subpkg .nm { flex: 1 1 100%; white-space: normal; }
  .subpkg .hint { flex: 1 1 100%; white-space: normal; word-break: break-all; }
}
