/* ==========================================================================
   果子短剧 · 内容管理后台
   深色简洁设计系统
   ========================================================================== */

:root {
  /* 底色层级 */
  --bg:            #080b10;
  --bg-soft:       #0b0f15;
  --sidebar:       #0a0e14;
  --panel:         #0f151d;
  --panel-2:       #131b25;
  --panel-3:       #17212d;
  --border:        #1c2733;
  --border-soft:   #16202a;
  --border-strong: #263547;

  /* 文字 */
  --text:          #e8eef7;
  --text-2:        #a9b8cc;
  --text-3:        #71829a;
  --text-4:        #4d5c70;

  /* 品牌 */
  --accent:        #ff4d6d;
  --accent-2:      #ff7a59;
  --accent-soft:   rgba(255, 77, 109, .12);
  --accent-line:   rgba(255, 77, 109, .35);

  /* 语义色 */
  --ok:            #2fd48b;
  --ok-soft:       rgba(47, 212, 139, .12);
  --warn:          #f5b642;
  --warn-soft:     rgba(245, 182, 66, .12);
  --danger:        #ff5f5f;
  --danger-soft:   rgba(255, 95, 95, .12);
  --info:          #4d8dff;
  --info-soft:     rgba(77, 141, 255, .12);
  --purple:        #a07bff;
  --purple-soft:   rgba(160, 123, 255, .12);

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;

  --shadow:        0 8px 28px rgba(0, 0, 0, .35);
  --shadow-sm:     0 2px 10px rgba(0, 0, 0, .25);

  --sidebar-w:     236px;
  --topbar-h:      64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #202c3a;
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #2c3c4e; }

/* 图标 */
.ic {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-sm { width: 14px; height: 14px; stroke-width: 1.9; }

/* ==========================================================================
   Layout
   ========================================================================== */

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 18px;
  border-bottom: 1px solid var(--border-soft);
  min-height: var(--topbar-h);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(255, 77, 109, .28);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text i {
  font-size: 11px;
  font-style: normal;
  color: var(--text-4);
  letter-spacing: .5px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 20px;
}
.nav::-webkit-scrollbar { width: 0; }

.nav-group { margin-bottom: 16px; }

.nav-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  margin-bottom: 2px;
  color: var(--text-4);
  font-size: 11px;
  letter-spacing: .9px;
  text-transform: uppercase;
  font-weight: 600;
}
.nav-label .ic { width: 15px; height: 15px; stroke-width: 1.8; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: #111a24; color: var(--text); }

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(255, 77, 109, .16), rgba(255, 77, 109, .02));
  color: #fff;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-item.is-active .ic { color: var(--accent); }

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2a3949;
  margin-left: 3px;
  flex: 0 0 auto;
  transition: background .16s ease;
}
.nav-item.is-active .nav-dot { background: var(--accent); }
.nav-item:hover .nav-dot { background: #3c5166; }

.nav-top { font-size: 13.5px; }
.nav-top .ic { width: 17px; height: 17px; }

.sidebar-foot {
  border-top: 1px solid var(--border-soft);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.foot-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12.5px;
  transition: color .16s;
}
.foot-link:hover { color: var(--danger); }
.foot-link .ic { width: 15px; height: 15px; }
.ver { color: var(--text-4); font-size: 11px; font-family: var(--mono); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(16px, 2.4vw, 28px);
  background: rgba(8, 11, 16, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title .sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  transition: all .16s;
}
.ghost-link:hover { border-color: var(--border-strong); color: var(--text); background: var(--panel); }
.ghost-link .ic { width: 14px; height: 14px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: none;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); }

.user-chip { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: border-color .16s;
}
.user-btn:hover { border-color: var(--border-strong); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(140deg, #33465c, #1b2734);
  flex: 0 0 auto;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-meta b { font-size: 12.5px; font-weight: 600; }
.user-meta i { font-size: 10.5px; font-style: normal; color: var(--text-4); }
.user-btn > .ic { color: var(--text-4); }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 208px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .16s ease;
  z-index: 80;
}
.user-chip.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dd-head { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.dd-head span { display: block; font-size: 13px; font-weight: 600; }
.dd-head em { display: block; font-size: 11px; font-style: normal; color: var(--text-4); margin-top: 2px; }

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
}
.dropdown-menu a:hover { background: #1a2431; color: var(--text); }
.dropdown-menu a .ic { width: 15px; height: 15px; }

/* ==========================================================================
   Content
   ========================================================================== */

.content {
  flex: 1;
  padding: clamp(18px, 2.4vw, 28px);
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h2 {
  margin: 0 0 3px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: .2px;
}
.page-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page-foot {
  padding: 18px clamp(16px, 2.4vw, 28px) 26px;
  color: var(--text-4);
  font-size: 11.5px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.page-foot .dot { opacity: .5; }

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head h3 .ic { color: var(--text-3); width: 16px; height: 16px; }
.card-head .hint { color: var(--text-4); font-size: 11.5px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 109, .10), transparent 70%);
  pointer-events: none;
}

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--text-3); font-size: 12.5px; letter-spacing: .2px; }
.stat-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  color: var(--text-2);
}
.stat-ico .ic { width: 16px; height: 16px; }
.stat-ico.accent { background: var(--accent-soft); color: var(--accent); }
.stat-ico.ok { background: var(--ok-soft); color: var(--ok); }
.stat-ico.warn { background: var(--warn-soft); color: var(--warn); }
.stat-ico.info { background: var(--info-soft); color: var(--info); }
.stat-ico.purple { background: var(--purple-soft); color: var(--purple); }

.stat-value {
  font-size: 27px;
  font-weight: 660;
  letter-spacing: -.4px;
  margin: 10px 0 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.stat-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-4); }
.stat-foot .up { color: var(--ok); display: inline-flex; align-items: center; gap: 3px; }
.stat-foot .down { color: var(--danger); }

/* ==========================================================================
   表格
   ========================================================================== */

.table-wrap { width: 100%; overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

table.tbl thead th {
  text-align: left;
  padding: 11px 14px;
  color: var(--text-4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .7px;
  text-transform: uppercase;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

table.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .14s ease; }
table.tbl tbody tr:hover { background: #0d141c; }

table.tbl .cell-title { color: var(--text); font-weight: 550; }
table.tbl .num { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
table.tbl .muted { color: var(--text-4); font-size: 12px; }

.tbl-cover {
  width: 44px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-3);
  border: 1px solid var(--border);
}

.cell-flex { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-flex .stack { min-width: 0; }
.cell-flex .stack b {
  display: block;
  font-weight: 550;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.cell-flex .stack i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-4);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.link-btn {
  background: none;
  border: 0;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .14s;
}
.link-btn:hover { background: var(--panel-3); color: var(--text); }
.link-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn.ok:hover { background: var(--ok-soft); color: var(--ok); }
.link-btn .ic { width: 14px; height: 14px; }

/* ==========================================================================
   徽章
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.7;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(47, 212, 139, .22); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 182, 66, .22); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(255, 95, 95, .22); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: rgba(77, 141, 255, .22); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(160, 123, 255, .22); }
.badge-muted { background: #18222d; color: var(--text-3); border-color: var(--border); }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { border-color: var(--border-strong); background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6347);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 14px rgba(255, 77, 109, .24);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), #ff6347); }

.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-soft); border-color: rgba(255, 95, 95, .3); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 95, 95, .2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ==========================================================================
   表单
   ========================================================================== */

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }

.field label,
.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.field label .req { color: var(--accent); margin-left: 3px; }
.field .tip { font-size: 11.5px; color: var(--text-4); margin-top: 5px; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  background: #0b1119;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, .10);
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.7; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371829a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 18px;
}
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 680px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  background: var(--bg-soft);
}
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; }
.filter-bar .search-box { position: relative; flex: 1 1 220px; max-width: 320px; }
.filter-bar .search-box .ic {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  width: 15px;
  height: 15px;
}
.filter-bar .search-box .input { padding-left: 34px; width: 100%; }
.filter-spacer { flex: 1; }

/* 复选框组 */
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0b1119;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .14s;
  user-select: none;
}
.check-item:hover { border-color: var(--border-strong); }
.check-item input { accent-color: var(--accent); margin: 0; }
.check-item:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: #1e2a38;
  border: 1px solid var(--border);
  position: relative;
  transition: all .18s;
  flex: 0 0 auto;
}
.switch .track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #5d6f85;
  transition: all .18s;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent-line); }
.switch input:checked + .track::after { left: 19px; background: var(--accent); }
.switch span { font-size: 12.5px; color: var(--text-2); }

/* 上传 */
.upload-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0b1119;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all .16s;
}
.upload-box:hover { border-color: var(--accent-line); background: #0d1520; }
.upload-preview {
  width: 56px;
  height: 74px;
  border-radius: 6px;
  background: var(--panel-3);
  object-fit: cover;
  flex: 0 0 auto;
}
.upload-meta { min-width: 0; }
.upload-meta b { display: block; font-size: 12.5px; font-weight: 550; }
.upload-meta i { font-style: normal; font-size: 11.5px; color: var(--text-4); word-break: break-all; }

/* ==========================================================================
   分页
   ========================================================================== */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.pager-info { color: var(--text-4); font-size: 12px; }
.pager-info b { color: var(--text-2); font-weight: 600; }
.pager-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-family: var(--mono);
}
.pager-links a:hover { background: var(--panel-3); color: var(--text); }
.pager-links .cur {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
  font-weight: 600;
}
.pager-links .gap { color: var(--text-4); }

/* ==========================================================================
   空态
   ========================================================================== */

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-4);
}
.empty .ic { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; stroke-width: 1.2; }
.empty p { margin: 0; font-size: 13px; }

/* ==========================================================================
   弹窗
   ========================================================================== */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, .72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  z-index: 200;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal-mask.open { display: flex; opacity: 1; }

.modal {
  width: min(100%, 680px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transform: translateY(10px) scale(.99);
  transition: transform .2s ease;
  overflow: hidden;
}
.modal-mask.open .modal { transform: translateY(0) scale(1); }
.modal.wide { width: min(100%, 900px); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.modal-close:hover { background: var(--panel-3); color: var(--text); }

.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  min-width: 200px;
  max-width: 340px;
  animation: toastIn .22s ease;
  pointer-events: auto;
}
.toast.ok { border-color: rgba(47, 212, 139, .3); }
.toast.ok .ic { color: var(--ok); }
.toast.err { border-color: rgba(255, 95, 95, .3); }
.toast.err .ic { color: var(--danger); }
.toast .ic { width: 16px; height: 16px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   图表（纯 CSS / SVG）
   ========================================================================== */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 168px;
  padding-top: 12px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  width: 100%;
  max-width: 42px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), rgba(255, 77, 109, .18));
  min-height: 3px;
  transition: height .4s ease;
  position: relative;
}
.bar:hover { filter: brightness(1.12); }
.bar-label { font-size: 10.5px; color: var(--text-4); font-family: var(--mono); white-space: nowrap; }
.bar-value { font-size: 10.5px; color: var(--text-3); }

.spark { width: 100%; height: 68px; display: block; }

.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-4);
  font-weight: 600;
  flex: 0 0 auto;
}
.rank-row:nth-child(1) .rank-no { color: var(--accent); }
.rank-row:nth-child(2) .rank-no { color: var(--warn); }
.rank-row:nth-child(3) .rank-no { color: #c98bff; }
.rank-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.rank-val { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* 两列布局 */
.cols-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .cols-2 { grid-template-columns: 1fr; } }

/* ==========================================================================
   登录页
   ========================================================================== */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 18% 12%, rgba(255, 77, 109, .12), transparent 42%),
              radial-gradient(circle at 84% 82%, rgba(77, 141, 255, .10), transparent 46%),
              var(--bg);
}

.login-grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}

.login-card {
  width: min(100%, 392px);
  background: rgba(15, 21, 29, .88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 30px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  position: relative;
  z-index: 2;
  backdrop-filter: blur(12px);
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 19px; }
.login-brand h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .2px; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--text-4); letter-spacing: .4px; }

.login-card .field { margin-bottom: 14px; }
.login-card .input { padding: 11px 13px; font-size: 13.5px; }

.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 132px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--panel-3);
  flex: 0 0 auto;
  object-fit: cover;
}

.login-submit { margin-top: 20px; padding: 11px; font-size: 14px; }

.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-4);
}

.login-err {
  display: none;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 95, 95, .25);
  color: #ffb0b0;
  font-size: 12.5px;
}
.login-err.show { display: block; }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .main { margin-left: 0; }
  .icon-btn.only-mobile { display: grid; }
  .ghost-link span { display: none; }
  .ghost-link { padding: 7px 9px; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 58px; }
  .content { padding: 14px; }
  .topbar { gap: 9px; padding: 0 14px; }
  .topbar .ghost-link { display: none; }
  .user-btn { padding: 3px; border-radius: 50%; }
  .user-btn > .ic { display: none; }
  .user-btn .avatar { width: 30px; height: 30px; }
  .topbar-title h1 { font-size: 15.5px; }
  .user-meta { display: none; }
  .stat-value { font-size: 23px; }
  .page-head h2 { font-size: 17px; }
  .filter-bar .search-box { max-width: none; flex: 1 1 100%; }
  .filter-bar .input, .filter-bar .select { min-width: 0; width: 100%; }
  .modal-body { padding: 16px; }
  .modal { border-radius: 14px; }

  /* 手机端表格：只保留 标题列 + 操作列，避免横向撑破 */
  .table-wrap { overflow-x: visible; }
  table.tbl { min-width: 0; width: 100%; table-layout: fixed; }
  table.tbl thead th:nth-child(n+3):not(:last-child),
  table.tbl tbody td:nth-child(n+3):not(:last-child) { display: none; }
  table.tbl thead th, table.tbl tbody td { padding: 10px 7px; word-break: break-word; }
  table.tbl thead th:first-child, table.tbl tbody td:first-child { width: 30px; }
  table.tbl thead th:last-child, table.tbl tbody td:last-child { width: 88px; }
  .cell-flex { gap: 8px; }
  .cell-flex .stack { min-width: 0; width: 100%; }
  .cell-flex .stack b, .cell-flex .stack i {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }
  .tbl-cover { width: 36px; height: 46px; }
  .row-actions { flex-wrap: wrap; }
  .link-btn { padding: 4px 5px; font-size: 12px; }
  .link-btn .ic { width: 15px; height: 15px; }
  .bars { gap: 5px; height: 140px; }
  .bar-col .bar-value { font-size: 9px; }
  .bar-label { font-size: 9px; }
  .pager { justify-content: center; }
}

body.nav-open { overflow: hidden; }
.nav-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 50;
  display: none;
}
.nav-mask.open { display: block; }
