/* ==========================================================================
   观境.AI 内容工具台 · 设计系统
   编辑部工作室气质：暖纸底色、墨色文字、紫墨主色、克制的信息密度
   ========================================================================== */

:root {
  --paper: #f7f5ef;
  --paper-deep: #f1eee5;
  --surface: #fffdf8;
  --surface-2: #f6f2e9;
  --ink: #221f1b;
  --ink-2: #5c574d;
  --ink-3: #8c8577;
  --ink-4: #b0a998;
  --line: #e6e0d2;
  --line-2: #d8d1c0;
  --brand: #5b4fc4;
  --brand-ink: #443ba6;
  --brand-soft: #eeeafb;
  --brand-line: #d8d1f4;
  --teal: #146b58;
  --teal-soft: #e3f1ec;
  --amber: #96621a;
  --amber-soft: #f7ecd9;
  --coral: #b04a2f;
  --coral-soft: #f9e6df;
  --blue: #2f5fa8;
  --blue-soft: #e6edf8;
  --rail: #1a1915;
  --rail-2: #23211a;
  --rail-line: #333026;
  --rail-ink: #cfc9ba;
  --rail-ink-2: #8e887a;
  --shadow-sm: 0 1px 2px rgba(34, 31, 27, .04);
  --shadow: 0 1px 2px rgba(34, 31, 27, .04), 0 10px 30px -22px rgba(34, 31, 27, .45);
  --shadow-lg: 0 24px 70px -30px rgba(34, 31, 27, .45);
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 8px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

p { margin: 0; }

a { color: var(--brand-ink); text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

button { cursor: pointer; }

::selection { background: #ded8fb; color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5cebc; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bdb4a0; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.ico { display: inline-block; vertical-align: -2px; flex: 0 0 auto; }

/* ============================================================ 外壳 */

.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid #100f0c;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--rail-line);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #7a6ee6, #4b40b2);
  color: #fff;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(91, 79, 196, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
  flex: 0 0 auto;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #f4f1e8;
  letter-spacing: .01em;
  line-height: 1.2;
}

.brand-sub {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: .19em;
  color: var(--rail-ink-2);
  text-transform: uppercase;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
  scrollbar-width: thin;
}

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

.nav-label {
  font-size: 10px;
  letter-spacing: .16em;
  color: #6f6a5c;
  padding: 0 10px 7px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rail-ink);
  font-size: 13px;
  text-align: left;
  transition: background .16s, color .16s;
  position: relative;
}

.nav-item:hover { background: rgba(255, 255, 255, .055); color: #f8f5ec; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(91, 79, 196, .34), rgba(91, 79, 196, .1));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(138, 128, 232, .22);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2.5px;
  border-radius: 3px;
  background: #9c93f0;
}

.nav-item .ico { color: #a9a292; }
.nav-item.active .ico { color: #c9c2ff; }

.nav-count {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  color: #b9b2a2;
  font-variant-numeric: tabular-nums;
}

.rail-foot {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--rail-line);
  display: grid;
  gap: 10px;
}

.storage-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #8b8573;
  padding: 0 4px;
}

.storage-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58b394;
  box-shadow: 0 0 0 3px rgba(88, 179, 148, .14);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .04);
  color: var(--rail-ink);
  text-align: left;
  transition: background .16s;
}

.user-chip:hover { background: rgba(255, 255, 255, .09); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #37327a;
  color: #ded9ff;
  font-size: 12.5px;
  font-weight: 600;
  flex: 0 0 auto;
}

.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 12.5px; font-weight: 500; color: #f0ece2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10.5px; color: #8d8777; }

.user-chip .ico { margin-left: auto; color: #7f7969; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
  padding: 0 30px;
  background: rgba(247, 245, 239, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.crumb b { color: var(--ink); font-weight: 500; }
.crumb .sep { color: var(--ink-4); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.env-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }

.client-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 5px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.client-cap { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }

.client-select {
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  max-width: 168px;
  padding: 4px 2px;
  outline: none;
  cursor: pointer;
  color: var(--ink);
}

.client-plan {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid var(--brand-line);
  white-space: nowrap;
}

.view {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px 30px 72px;
  animation: rise .34s ease both;
}

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

/* ============================================================ 页头 */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--brand); opacity: .5; }

.page-head h1 { font-size: 25px; line-height: 1.3; letter-spacing: -.02em; }

.page-desc { margin-top: 7px; font-size: 13px; color: var(--ink-2); max-width: 720px; }

.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ============================================================ 按钮 / 表单 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .1s;
}

.btn:hover { border-color: var(--ink-4); background: #fff; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbf9f3;
  box-shadow: 0 6px 16px -10px rgba(34, 31, 27, .9);
}

.btn-primary:hover { background: #37332b; border-color: #37332b; }

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(91, 79, 196, .95);
}

.btn-brand:hover { background: var(--brand-ink); border-color: var(--brand-ink); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }

.btn-danger { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-danger:hover { background: #993d25; border-color: #993d25; }

.btn-sm { height: 29px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
}

.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }

.field > label,
.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field .hint { font-size: 11px; color: var(--ink-3); line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fffefa;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 79, 196, .1);
}

.textarea { resize: vertical; min-height: 84px; line-height: 1.7; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c8577' stroke-width='1.8'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 30px;
}

.search-field { position: relative; }
.search-field .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-field .input { padding-left: 32px; }

/* 分段控件 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.seg-item {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}

.seg-item.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.seg-item:hover:not(.active) { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4.5px 10px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  transition: all .15s;
}

.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fbf9f3; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ============================================================ 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 18px 20px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}

.card-head h3 { font-size: 14px; }
.card-head p { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.card-body { padding: 4px 20px 18px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ============================================================ 徽标 */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.badge-purple { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.badge-teal { background: var(--teal-soft); color: var(--teal); border-color: #c6e3d8; }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #ecd9b8; }
.badge-coral { background: var(--coral-soft); color: var(--coral); border-color: #f0cbbd; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: #d2e0f3; }
.badge-ink { background: #2b2822; color: #f2eee5; }
.badge-muted { background: transparent; color: var(--ink-3); border-color: var(--line); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface);
  white-space: nowrap;
}

.pill-purple { color: var(--brand-ink); background: var(--brand-soft); border-color: var(--brand-line); }
.pill-coral { color: var(--coral); background: var(--coral-soft); border-color: #f0cbbd; }
.pill-teal { color: var(--teal); background: var(--teal-soft); border-color: #c6e3d8; }
.pill-amber { color: var(--amber); background: var(--amber-soft); border-color: #ecd9b8; }
.pill-blue { color: var(--blue); background: var(--blue-soft); border-color: #d2e0f3; }
.pill-ink { color: #f2eee5; background: #2b2822; border-color: #2b2822; }

/* ============================================================ 总览 */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px 14px;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -30px -46px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 79, 196, .09), transparent 70%);
}

.kpi-label { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi-label .ico { color: var(--ink-4); }
.kpi-value { font-size: 29px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.kpi-foot b { color: var(--teal); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.hot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.hot-row:last-child { border-bottom: 0; }
.hot-row:hover .hot-title { color: var(--brand-ink); }

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }

.portfolio-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 13px;
  display: grid;
  gap: 5px;
  transition: border-color .15s, background .15s, transform .15s;
}

.portfolio-item:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.portfolio-item.active { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--surface)); }
.portfolio-top { display: flex; align-items: center; gap: 8px; }
.portfolio-top b { font-size: 12.5px; font-weight: 600; }
.portfolio-meta { font-size: 10.5px; color: var(--ink-3); }
.portfolio-stats { display: flex; gap: 14px; font-size: 10.5px; color: var(--ink-3); }
.portfolio-stats b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.hot-rank { width: 18px; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; text-align: right; flex: 0 0 auto; }
.hot-main { flex: 1; min-width: 0; }
.hot-title { font-size: 13px; font-weight: 500; line-height: 1.5; transition: color .15s; cursor: pointer; }
.hot-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; align-items: center; }

.heatbar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; width: 74px; flex: 0 0 auto; }
.heatbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c9beef, var(--brand)); }
.heatbar.hot i { background: linear-gradient(90deg, #e6b98f, var(--coral)); }

.upcoming {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  align-items: flex-start;
}

.upcoming:last-child { border-bottom: 0; }

.date-tile {
  flex: 0 0 auto;
  width: 42px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px 0 5px;
  background: var(--surface-2);
}

.date-tile b { display: block; font-size: 15px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.date-tile span { font-size: 9px; color: var(--ink-3); letter-spacing: .04em; }

.up-main { min-width: 0; flex: 1; }
.up-main b { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-main span { font-size: 11px; color: var(--ink-3); }

.mini-chart { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding: 6px 0 0; }
.mini-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.mini-bar i {
  display: block;
  width: 100%;
  max-width: 26px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #8f84e2, #cfc8f6);
  min-height: 3px;
  transition: height .5s cubic-bezier(.2, .8, .2, 1);
}
.mini-bar.active i { background: linear-gradient(180deg, var(--brand), #a49be8); }
.mini-bar span { font-size: 9.5px; color: var(--ink-4); }

.recent-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.recent-main { flex: 1; min-width: 0; }
.recent-main b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main span { font-size: 11px; color: var(--ink-3); }
.recent-row .go { opacity: 0; transition: opacity .15s; }
.recent-row:hover .go { opacity: 1; }

/* ============================================================ 热点选题 */

.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 16px;
}

.filterbar .search-field { flex: 1; min-width: 200px; max-width: 340px; }
.filterbar .select { width: auto; min-width: 116px; }
.filterbar .spacer { flex: 1; }

.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.topic-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.topic-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); }

.topic-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topic-cat { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }

.topic-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; letter-spacing: -.005em; }

.topic-summary {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 39px;
}

.topic-meta { display: flex; align-items: center; gap: 9px; font-size: 10.5px; color: var(--ink-3); flex-wrap: wrap; }

.topic-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  margin-top: auto;
}

.topic-foot .heat-num { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.topic-foot .heat-num.hot { color: var(--coral); }
.topic-foot .heat-num.warm { color: var(--amber); }
.topic-foot .heat-num.cool { color: var(--ink-2); }
.topic-foot .heat-label { font-size: 9.5px; color: var(--ink-4); letter-spacing: .08em; }
.topic-actions { margin-left: auto; display: flex; gap: 2px; }

.trend { font-size: 10px; padding: 1.5px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 2px; }
.trend-rising { color: var(--coral); background: var(--coral-soft); }
.trend-hot { color: var(--amber); background: var(--amber-soft); }
.trend-flat { color: var(--ink-3); background: var(--surface-2); }
.trend-falling { color: var(--blue); background: var(--blue-soft); }

/* ============================================================ 工作室 */

.studio-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  width: fit-content;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.studio-tab {
  padding: 6.5px 13px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.studio-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.studio-tab:hover:not(.active) { color: var(--ink); }

.studio-grid { display: grid; grid-template-columns: 366px minmax(0, 1fr); gap: 18px; align-items: start; }

.settings-card { position: sticky; top: 76px; }
.settings-card .card-body { padding-top: 10px; }

.gen-status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.gen-status .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; } 40% { opacity: 1; transform: scale(1.25); } }

.output-card { min-height: 560px; display: flex; flex-direction: column; }

.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.output-title { font-size: 19px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }

.meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.meta-chip {
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 20px;
}

.output-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }

.doc {
  padding: 24px 30px 30px;
  font-size: 14px;
  line-height: 1.9;
  color: #2b2822;
  max-width: 760px;
}

.doc h2 { font-size: 21px; line-height: 1.45; margin: 4px 0 14px; letter-spacing: -.015em; }
.doc h3 {
  font-size: 15.5px;
  margin: 26px 0 10px;
  padding-left: 10px;
  border-left: 2.5px solid var(--brand);
  line-height: 1.5;
}
.doc h4 { font-size: 14px; margin: 20px 0 8px; color: var(--ink-2); }
.doc p { margin: 0 0 13px; }
.doc strong { font-weight: 600; color: #1d1a16; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 21px; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--ink-4); }
.doc blockquote {
  margin: 0 0 16px;
  padding: 11px 15px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  color: #47408a;
  font-size: 13px;
  line-height: 1.75;
}
.doc code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.doc a { text-decoration: underline; text-underline-offset: 2px; }
.doc .table-wrap { margin: 0 0 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.doc th { background: var(--surface-2); text-align: left; padding: 8px 9px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.doc td { padding: 8px 9px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
.doc tr:last-child td { border-bottom: 0; }

.output-foot {
  margin-top: auto;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: linear-gradient(180deg, transparent, rgba(246, 242, 233, .5));
}

/* 空状态 / 骨架 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 54px 28px;
  color: var(--ink-2);
}

.empty-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  margin-bottom: 14px;
}

.empty h4 { font-size: 14px; margin-bottom: 5px; color: var(--ink); }
.empty p { font-size: 12px; color: var(--ink-3); max-width: 340px; line-height: 1.7; }
.empty .btn { margin-top: 16px; }

.skeleton { padding: 22px 24px; }
.sk-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 13px;
  background: linear-gradient(90deg, #efeadd 25%, #f7f3e9 37%, #efeadd 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* 候选标题 / 知识引用 */
.subpanel { border-top: 1px solid var(--line); padding: 14px 22px; }
.subpanel-title { font-size: 11px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.title-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line);
}
.title-option:last-child { border-bottom: 0; }
.title-option button { margin-left: auto; }

.kref { display: flex; gap: 8px; font-size: 11.5px; color: var(--ink-2); padding: 6px 0; line-height: 1.6; }
.kref b { color: var(--brand-ink); font-weight: 500; }

/* ============================================================ 作品库 */

.list-table { width: 100%; border-collapse: collapse; }
.list-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  text-transform: uppercase;
}
.list-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; vertical-align: middle; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tbody tr { transition: background .14s; }
.list-table tbody tr:hover { background: #fbf8f0; }
.list-table .t-title { font-weight: 500; line-height: 1.45; }
.list-table .t-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.list-table .t-actions { text-align: right; white-space: nowrap; }
.list-table .t-actions .icon-btn { width: 26px; height: 26px; }

/* ============================================================ TTS */

.voice-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
  background: var(--surface);
  display: grid;
  gap: 8px;
  transition: border-color .16s, box-shadow .16s;
}

.voice-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.voice-head { display: flex; align-items: center; gap: 10px; }
.voice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6f64d8, #a097e9);
  flex: 0 0 auto;
}
.voice-avatar.male { background: linear-gradient(135deg, #2f5fa8, #6c93cc); }
.voice-name { font-size: 13px; font-weight: 600; }
.voice-sub { font-size: 10.5px; color: var(--ink-3); }
.voice-sample {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.65;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 7px 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.waveform { display: flex; align-items: center; gap: 2px; height: 22px; }
.waveform i { width: 2px; border-radius: 2px; background: #b9b0df; }
.waveform i:nth-child(3n) { height: 60%; }
.waveform i:nth-child(3n+1) { height: 100%; }
.waveform i:nth-child(4n) { height: 38%; }
.waveform i:nth-child(5n) { height: 80%; }

.job-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-main { flex: 1; min-width: 0; }
.job-main b { font-size: 12.5px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-main span { font-size: 10.5px; color: var(--ink-3); }

.progress { height: 5px; border-radius: 4px; background: var(--surface-2); overflow: hidden; width: 100%; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #9a8fe4); border-radius: 4px; transition: width .3s; }

.demo-banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--amber-soft);
  border: 1px solid #ecd9b8;
  color: #6f4a13;
  font-size: 11.5px;
  line-height: 1.65;
  margin-bottom: 14px;
}
.demo-banner .ico { margin-top: 2px; flex: 0 0 auto; }

.timeline-row { display: flex; gap: 10px; padding: 6px 0; font-size: 11.5px; }
.timeline-time { flex: 0 0 74px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 10.5px; padding-top: 1px; }

/* ============================================================ 分镜 */

.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 12px 14px;
  position: relative;
}
.shot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.shot-no {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: #f7f3e8;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.shot-name { font-size: 12.5px; font-weight: 600; }
.shot-dur { margin-left: auto; font-size: 10px; color: var(--ink-3); font-family: var(--mono); }
.shot-frame { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }
.shot-line { margin-top: 6px; font-size: 12px; color: var(--ink); line-height: 1.65; padding-left: 9px; border-left: 2px solid var(--brand-line); }

/* ============================================================ 日历 */

.cal-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-month { font-size: 18px; font-weight: 600; letter-spacing: -.01em; min-width: 116px; }
.cal-month small { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }

.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-week span { padding: 8px 10px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; text-align: left; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-day {
  min-height: 112px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  position: relative;
  transition: background .14s;
  cursor: pointer;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #fbf8ef; }
.cal-day.out { background: #faf8f2; color: var(--ink-4); }
.cal-day.today { background: #f7f4ff; }
.cal-day.today::after { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--brand-line); pointer-events: none; }

.cal-date { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-date b { background: var(--brand); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: 10.5px; font-weight: 500; }
.cal-date b { font-weight: 400; }
.cal-add { opacity: 0; color: var(--ink-3); font-size: 14px; line-height: 1; }
.cal-day:hover .cal-add { opacity: 1; }

.cal-entry {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 2.5px solid var(--brand);
  background: var(--brand-soft);
  color: #423a92;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 3px 5px;
  border-radius: 0 4px 4px 0;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-entry.pub { border-left-color: var(--teal); background: var(--teal-soft); color: #0f5445; }
.cal-entry.ready { border-left-color: var(--amber); background: var(--amber-soft); color: #6f4a13; }
.cal-entry.planned { border-left-color: var(--blue); background: var(--blue-soft); color: #234b86; }

/* ============================================================ 投流 */

.ad-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }

.est-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.est-cell { background: var(--surface); padding: 12px 13px; }
.est-cell span { font-size: 10.5px; color: var(--ink-3); display: block; }
.est-cell b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.est-cell b small { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }

.suggest-list { margin: 0; padding: 0; list-style: none; }
.suggest-list li { display: flex; gap: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.65; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.suggest-list li:last-child { border-bottom: 0; }
.suggest-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: 0 0 auto; }

.ad-card { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; background: var(--surface); display: grid; gap: 6px; }
.ad-card-head { display: flex; align-items: center; gap: 8px; }
.ad-card-head b { font-size: 13px; font-weight: 600; }
.ad-card-meta { display: flex; gap: 12px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.ad-card-meta b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================================ 人设 */

.persona-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 16px 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: box-shadow .18s, transform .18s;
}
.persona-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.persona-head { display: flex; align-items: center; gap: 10px; }
.persona-ava {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex: 0 0 auto;
}
.persona-name { font-size: 14px; font-weight: 600; }
.persona-role { font-size: 11px; color: var(--ink-3); }
.persona-bio { font-size: 12px; color: var(--ink-2); line-height: 1.7; min-height: 40px; }
.persona-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.persona-foot { display: flex; align-items: center; gap: 6px; padding-top: 9px; border-top: 1px dashed var(--line); margin-top: auto; }
.persona-foot .spacer { flex: 1; }

/* ============================================================ 知识库 */

.k-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }

.k-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  transition: background .14s;
}
.k-item:hover { background: var(--surface-2); }
.k-item.active { background: var(--brand-soft); border-color: var(--brand-line); }
.k-item b { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.45; }
.k-item span { font-size: 10.5px; color: var(--ink-3); }

.k-doc { padding: 22px 26px; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.k-doc h4 { color: var(--ink); }
.k-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }

/* ============================================================ 管理 */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }

.provider-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 14px;
}

/* 客户（租户）管理 */
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }

.client-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  transition: border-color .16s, box-shadow .16s;
}

.client-card:hover { box-shadow: var(--shadow); }
.client-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 79, 196, .07); }

.client-card-head { display: flex; align-items: center; gap: 10px; }
.client-card-head b { display: block; font-size: 14px; font-weight: 600; }
.client-card-head span { font-size: 11px; color: var(--ink-3); }

.client-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #7a6ee6, #4b40b2);
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
  flex: 0 0 auto;
}

.client-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.client-stats span { display: block; font-size: 10px; color: var(--ink-3); }
.client-stats b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.client-members { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.member-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--ink-2);
}

.client-actions { display: flex; align-items: center; gap: 5px; padding-top: 10px; border-top: 1px dashed var(--line); flex-wrap: wrap; }

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}
.check:hover { border-color: var(--brand-line); }
.check input { margin-top: 3px; accent-color: var(--brand); }
.check span { display: grid; gap: 1px; }
.check em { font-style: normal; font-size: 10px; color: var(--ink-3); }

.member-list { display: grid; gap: 2px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row b { display: block; font-size: 12.5px; font-weight: 500; }
.member-row span { font-size: 10.5px; color: var(--ink-3); }
.provider-head { display: flex; align-items: center; gap: 9px; }
.provider-head b { font-size: 13px; }
.provider-head .spacer { flex: 1; }
.provider-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.provider-meta b { color: var(--ink-2); font-weight: 500; font-family: var(--mono); font-size: 10.5px; }
.provider-note { font-size: 11px; color: var(--ink-3); line-height: 1.6; }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.switch input { display: none; }
.switch i {
  width: 30px;
  height: 17px;
  border-radius: 20px;
  background: var(--line-2);
  position: relative;
  transition: background .18s;
  flex: 0 0 auto;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(13px); }

.stat-strip { display: flex; gap: 22px; flex-wrap: wrap; padding: 14px 18px; }
.stat-strip div span { font-size: 10.5px; color: var(--ink-3); display: block; }
.stat-strip div b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

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

.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26, 24, 19, .48); backdrop-filter: blur(3px); animation: fade .18s both; }
@keyframes fade { from { opacity: 0; } }

.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .9, .2, 1) both;
  overflow: hidden;
}
.modal-wide { width: min(800px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }

.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fdfbf5; }
.modal-text { font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.modal-wrap.out { animation: fadeOut .16s both; }
@keyframes fadeOut { to { opacity: 0; } }

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

#toastRoot { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 10px;
  background: #26231d;
  color: #f6f2e8;
  font-size: 12.5px;
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: min(540px, 88vw);
}
.toast.in { opacity: 1; transform: none; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #64c39f; flex: 0 0 auto; }
.toast-error .toast-dot { background: #e8836b; }

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

.login { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 100vh; }

.login-brand {
  position: relative;
  overflow: hidden;
  background: #191813;
  color: #efeadf;
  padding: 54px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 82% 8%, rgba(91, 79, 196, .34), transparent 62%),
    radial-gradient(620px 420px at 4% 96%, rgba(20, 107, 88, .26), transparent 66%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 55%, transparent 100%);
}

.login-brand > * { position: relative; }

.login-wordmark { display: flex; align-items: center; gap: 12px; }
.login-wordmark .brand-logo { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
.login-wordmark b { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.login-wordmark span { display: block; font-size: 9px; letter-spacing: .22em; color: #8b8575; margin-top: 2px; }

.login-statement { max-width: 520px; }
.login-statement .eyebrow { color: #a89ff0; }
.login-statement .eyebrow::before { background: #a89ff0; }
.login-statement h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 3.7vw, 50px);
  line-height: 1.26;
  letter-spacing: -.01em;
  font-weight: 600;
  color: #fdefe5;
  margin-bottom: 18px;
}
.login-statement h1 em { font-style: normal; color: #b5acf5; }
.login-statement p { font-size: 13.5px; color: #a7a192; line-height: 1.9; max-width: 430px; }

.login-flow { display: grid; gap: 10px; margin-top: 30px; max-width: 430px; }
.login-flow div { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #b7b1a0; }
.login-flow b { color: #e8e2d4; font-weight: 500; }
.login-flow i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  color: #bdb4f0;
  background: rgba(148, 135, 238, .12);
  border: 1px solid rgba(148, 135, 238, .22);
  flex: 0 0 auto;
}

.login-brand-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: #6f6a5c; letter-spacing: .04em; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 28px;
  background:
    radial-gradient(700px 420px at 100% 0%, rgba(91, 79, 196, .07), transparent 60%),
    var(--paper);
}

.login-box { width: min(372px, 100%); }
.login-box h2 { font-size: 23px; letter-spacing: -.02em; }
.login-box .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; margin-bottom: 22px; }
.login-box .field { margin-bottom: 13px; }
.login-box .input { height: 40px; font-size: 13.5px; }
.login-hint { margin-top: 16px; padding: 11px 13px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; color: var(--ink-3); line-height: 1.8; }
.login-hint b { color: var(--ink-2); font-weight: 500; }
.login-hint button { border: 0; background: transparent; color: var(--brand-ink); font-size: 11px; padding: 0 2px; text-decoration: underline; text-underline-offset: 2px; }

.login-accounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 9px; }
.login-accounts button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 11px;
  text-align: left;
  color: var(--ink-2);
  text-decoration: none;
}
.login-accounts button:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.login-accounts button b { font-size: 11px; font-weight: 600; color: var(--ink); }
.login-accounts button span { font-size: 9.5px; color: var(--ink-3); font-family: var(--mono); }
.login-api { margin-top: 18px; font-size: 10.5px; color: var(--ink-4); display: flex; justify-content: space-between; gap: 10px; }
.login-api button { border: 0; background: transparent; color: var(--ink-3); font-size: 10.5px; text-decoration: underline; text-underline-offset: 2px; }
.login-error { color: var(--coral); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* ============================================================ 工具类 */

.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--ink-3); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; } .mb-16 { margin-bottom: 16px; }
.stretch { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.tag-mini { font-size: 10px; color: var(--ink-3); }

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

@media (max-width: 1280px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1120px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .brand { padding: 18px 0; justify-content: center; }
  .brand-text, .nav-label, .nav-item span, .nav-count, .storage-chip span, .user-meta, .user-chip .ico { display: none; }
  .nav { padding: 12px 9px; }
  .nav-group { margin-bottom: 10px; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item.active::before { display: none; }
  .rail-foot { padding: 12px 9px; }
  .storage-chip { justify-content: center; }
  .user-chip { justify-content: center; padding: 7px 0; }
  .studio-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .ad-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .k-layout { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  .view { padding: 20px 18px 60px; }
  .studio-grid, .ad-grid, .k-layout { grid-template-columns: 1fr; }
  .settings-card { position: static; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .cal-day { min-height: 88px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; border-right: 0; border-top: 1px solid var(--rail-line); }
  .brand, .rail-foot, .nav-label { display: none; }
  .nav { display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .nav-group { display: contents; }
  .nav-item { width: auto; min-width: 52px; flex: 0 0 auto; flex-direction: column; gap: 3px; padding: 6px 9px; font-size: 9.5px; }
  .nav-item span { display: block; font-size: 9.5px; white-space: nowrap; }
  .main { padding-bottom: 66px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { height: 52px; }
  .env-badge { display: none; }
  .client-cap, .client-plan { display: none; }
  .client-select { max-width: 104px; font-size: 11.5px; }
  .client-switch { padding: 2px 6px; }
  .doc { padding: 18px 18px 24px; }
  .est-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 72px; }
  .login-panel { padding: 30px 20px; }
}
