/* ============================================================
   寻觅集团 OPC · 「墨金」主题
   深藏蓝（墨）× 香槟金 —— 集团级质感
   所有类名与旧版一一对应，只换视觉不改结构。
   ============================================================ */
:root {
  --bg: #f7f6f2;
  --bg-gradient-1: #f2f0ea;
  --bg-gradient-2: #fcfbf8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #161b26;
  --muted: #6f7684;
  --brand: #1c2b4d;          /* 墨蓝：链接/主色 */
  --brand-2: #3a5486;
  --brand-soft: rgba(28, 43, 77, 0.06);
  --gold: #b8892f;           /* 香槟金：点缀/高亮 */
  --gold-2: #e3c878;
  --gold-deep: #8f6c1c;
  --line: rgba(184, 137, 47, 0.22);
  --line-soft: rgba(184, 137, 47, 0.12);
  --border: #e8e4d8;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --silver: #3f4757;
  --glow: 0 0 18px rgba(184, 137, 47, 0.14), 0 0 40px rgba(28, 43, 77, 0.06);
  --shadow-card: 0 1px 2px rgba(22, 27, 38, 0.04), 0 10px 28px rgba(22, 27, 38, 0.06);
  --shadow-float: 0 18px 50px rgba(13, 20, 36, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
::selection { background: rgba(184, 137, 47, 0.25); }

/* 登录页 */
.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 420px;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: #0d1424;
}
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-bg-grid {
  width: 100%;
  height: 100%;
}
.auth-bg-orbs {
  position: absolute;
  inset: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.orb-1 {
  width: 360px; height: 360px;
  top: 10%; left: 8%;
  background: radial-gradient(circle, rgba(212, 175, 55, .30), transparent 70%);
}
.orb-2 {
  width: 300px; height: 300px;
  bottom: 12%; left: 28%;
  background: radial-gradient(circle, rgba(58, 84, 134, .38), transparent 70%);
}
.auth-hero {
  position: relative;
  z-index: 1;
  padding: 60px 8vw;
  color: #ede8da;
}
.auth-hero-logo {
  width: 96px; height: 96px;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .45), 0 12px 40px rgba(0, 0, 0, .45);
  background: #fff;
}
.auth-hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-hero-title {
  font-size: 42px;
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: 1px;
  background: linear-gradient(100deg, #f2e3b3 0%, #d4af37 45%, #9a7b23 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-hero-sub {
  font-size: 18px;
  color: #a7aec0;
  margin: 0 0 28px;
  letter-spacing: .5px;
}
.auth-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, .32);
  background: rgba(255, 255, 255, .05);
  color: #e3c878;
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.hero-badge i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, .8);
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 380px;
  background: rgba(13, 19, 33, 0.88);
  border-radius: 22px;
  padding: 34px;
  border: 1px solid rgba(212, 175, 55, .30);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
  margin-right: 8vw;
  justify-self: end;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, .45);
  box-shadow: 0 0 12px rgba(212, 175, 55, .18);
  background: #fff;
}
.brand span {
  color: var(--ink);
  font-weight: 800;
}
.auth-card .brand span { color: #efe8d6; }
.brand.sm {
  font-size: 15px;
  margin-bottom: 22px;
  line-height: 1.35;
}
.brand.sm .brand-logo { width: 34px; height: 34px; border-radius: 8px; }
.sub { color: var(--muted); margin: 10px 0 22px; font-size: 13px; }
.auth-card .sub { color: #97a0b4; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
}
.auth-card .tab { border-color: rgba(255, 255, 255, .16); color: #a7aec0; }
.tab:hover { border-color: var(--gold); color: var(--gold-deep); }
.auth-card .tab:hover { border-color: rgba(212, 175, 55, .6); color: #e3c878; }
.tab.active {
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #1c2b4d, #0f1830);
  box-shadow: 0 4px 14px rgba(15, 24, 48, .3);
}
.auth-card .tab.active {
  background: linear-gradient(135deg, #dcb662, #a9821f);
  color: #211803;
  box-shadow: 0 4px 16px rgba(212, 175, 55, .35);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
input, textarea, select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: all .2s;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 137, 47, .15);
}
.auth-card input {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: #eef0f5;
}
.auth-card input::placeholder { color: #7d8496; }
.auth-card input:focus {
  border-color: rgba(212, 175, 55, .7);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}
select option { background: #fff; color: var(--ink); }
.btn {
  padding: 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: all .2s;
}
.btn.primary {
  background: linear-gradient(135deg, #1c2b4d, #0f1830);
  color: #f2ecd9;
  box-shadow: 0 6px 18px rgba(15, 24, 48, .28);
  letter-spacing: 1px;
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 24, 48, .38);
}
.auth-card .btn.primary {
  background: linear-gradient(135deg, #dcb662, #a9821f);
  color: #211803;
  box-shadow: 0 6px 18px rgba(212, 175, 55, .35);
}
.btn.ghost {
  background: transparent;
  border: 1px solid #d9d4c4;
  color: var(--ink);
}
.btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  background: rgba(184, 137, 47, .07);
}
.btn.sm { padding: 8px 12px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; }
.auth-card .hint { color: #8a91a3; }
.msg { margin-top: 12px; font-size: 13px; color: var(--bad); min-height: 18px; }
.auth-card .msg { color: #ff9090; }

/* 布局 */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0d1424 0%, #111a30 100%);
  border-right: 1px solid rgba(212, 175, 55, .20);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand span { color: #ede6d4; }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(222, 228, 240, .62);
  font-size: 14px;
  margin-bottom: 4px;
  transition: all .2s;
  letter-spacing: .5px;
}
.nav-item:hover { background: rgba(212, 175, 55, .08); color: #f0e6c8; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, .18), rgba(212, 175, 55, .05));
  color: #eccf85;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #d4af37;
}
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .10); }
/* 多账号切换下拉 */
.account-switcher { position: relative; width: 100%; }
.account-current { display: flex; align-items: center; gap: 8px; width: 100%; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: #e8e4d8; }
.account-current:hover { background: rgba(255, 255, 255, .09); border-color: rgba(212, 175, 55, .4); }
.account-current .caret { margin-left: auto; font-size: 11px; opacity: .6; }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: #131c33; border: 1px solid rgba(212, 175, 55, .30); border-radius: 12px; padding: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 4px; z-index: 50; }
.account-menu.hidden { display: none; }
.account-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.account-item { text-align: left; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; color: #d9dce6; cursor: pointer; font-size: 13px; }
.account-item:hover { background: rgba(255, 255, 255, .08); }
.account-item.on { background: rgba(212, 175, 55, .18); color: #eccf85; }
.account-menu-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 4px 0; }
.account-menu .link { text-align: left; padding: 8px 10px; font-size: 13px; color: #aab1c2; }
.account-menu .link:hover { color: #e3c878; }
.account-menu .link.danger { color: #ff7b7b; }
.badge {
  font-size: 12px;
  background: rgba(212, 175, 55, .14);
  color: #e3c878;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, .38);
}
.link { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.link:hover { color: var(--gold-deep); }
.main { flex: 1; padding: 28px 36px; overflow: auto; background: linear-gradient(180deg, #f8f7f3 0%, #f3f1ea 100%); }
.topbar { margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 23px; color: var(--ink); letter-spacing: 2px; font-weight: 800; }
.page { display: none; }
.page.active { display: block; }

/* 卡片与统计 */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: .5px;
}
.card h3::before {
  content: '';
  flex: 0 0 auto;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #dcb662, #a9821f);
}
.stat {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(22, 27, 38, .10);
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #dcb662, rgba(212, 175, 55, 0));
}
.stat .n {
  font-size: 34px;
  font-weight: 800;
  background: linear-gradient(135deg, #caa64a 0%, #8f6c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat .l { color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: 1px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label.field { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
textarea { width: 100%; min-height: 120px; resize: vertical; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.pill.ok { background: rgba(22, 163, 74, .10); color: var(--ok); border-color: rgba(22, 163, 74, .20); }
.pill.warn { background: rgba(217, 119, 6, .10); color: var(--warn); border-color: rgba(217, 119, 6, .20); }
.pill.bad { background: rgba(220, 38, 38, .10); color: var(--bad); border-color: rgba(220, 38, 38, .20); }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
.note {
  font-size: 12px;
  color: #6f6a5c;
  background: linear-gradient(135deg, rgba(212, 175, 55, .09), rgba(212, 175, 55, .03));
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
}
.pre {
  white-space: pre-wrap;
  background: #f8f7f3;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  max-height: 320px;
  overflow: auto;
  color: var(--silver);
}
.copy-result {
  white-space: pre-wrap;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  font-size: 15px;
  line-height: 1.9;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
}
.copy-actions { margin-top: 10px; display: flex; gap: 8px; }
.copy-actions .adopted { color: var(--ok); border-color: rgba(22, 163, 74, .4); background: rgba(22, 163, 74, .08); }

/* 对话式文案顾问 */
.copy-chat { display: flex; flex-direction: column; min-height: 78vh; }
.copy-chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.avatar-ai {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #1c2b4d, #0f1830);
  color: #e3c878; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .4);
}
.cc-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.cc-sub { font-size: 13px; color: var(--muted); }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 8px 4px 14px; min-height: 320px; max-height: 64vh; scrollbar-width: none; -ms-overflow-style: none; }
.chat-log::-webkit-scrollbar { display: none; }
.bubble { max-width: 86%; padding: 12px 16px; font-size: 14px; line-height: 1.7; border-radius: 16px; }
.bubble.ai { align-self: flex-start; background: #f3f1ea; color: #1f2937; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.user { align-self: flex-end; background: linear-gradient(135deg, #1c2b4d, #0f1830); color: #f2ecd9; border-bottom-right-radius: 4px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; min-height: 0; }
.chip { border: 1px solid #d9d4c4; background: #fff; color: var(--ink); border-radius: 18px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--gold); color: var(--gold-deep); background: rgba(184, 137, 47, .06); }
.chat-input-row { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
.chat-input-row textarea {
  flex: 1;
  min-height: 90px;
  max-height: 160px;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 16px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 137, 47, .12); }
.chat-input-row button { padding: 10px 18px; font-size: 14px; }
.chat-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.intent-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.intent-tags .tag { background: rgba(184, 137, 47, .10); color: var(--gold-deep); border-radius: 12px; padding: 4px 10px; font-size: 12px; }
.intent-tags .tag.muted { background: var(--bg); color: var(--muted); }

.media-box { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.upload-box {
  flex: 1; min-width: 140px;
  border: 2px dashed #d5cfbf;
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  background: #fff;
}
.upload-box:hover { border-color: var(--gold); color: var(--gold-deep); background: rgba(184, 137, 47, .04); }
.upload-preview { max-width: 100%; max-height: 90px; border-radius: 8px; margin-top: 8px; object-fit: cover; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; letter-spacing: .5px; }

/* 客户工作台 */
.col-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow: auto; }
.wc-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.wc-item:hover { border-color: var(--gold); }
.wc-item.active { border-color: var(--gold); background: rgba(184, 137, 47, .06); }
.wc-item-top { display: flex; justify-content: space-between; align-items: center; }
.wc-item-sub { color: var(--muted); font-size: 12px; margin: 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 11px; background: rgba(28, 43, 77, .07); color: var(--brand); padding: 2px 8px; border-radius: 999px; }
.wc-chat { background: #f8f7f3; border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-height: 120px; max-height: 260px; overflow: auto; margin-bottom: 10px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.bubble.them { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.bubble.me { background: linear-gradient(135deg, #1c2b4d, #0f1830); color: #f2ecd9; margin-left: auto; }

/* 配图/空状态 SVG 容器 */
.illustration {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(212, 175, 55, .08), rgba(28, 43, 77, .05));
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.illustration svg { width: 100%; height: 100%; }
.hero-illustration {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 420px;
  height: 420px;
  opacity: .18;
  pointer-events: none;
}

/* ---------- 文案工厂多任务窗口 ---------- */
.session-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 240px); overflow-y: auto; }
.session-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  cursor: pointer;
  transition: all .15s ease;
}
.session-item:hover { border-color: var(--gold); box-shadow: var(--glow); }
.session-item.active { border-color: var(--gold); background: rgba(184, 137, 47, .07); }
.session-item .session-title { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item .session-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.session-item .session-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 4px; }
.session-item:hover .session-actions { display: flex; }
.session-item .session-actions button {
  background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px;
}
.session-item .session-actions button:hover { background: var(--border); color: var(--ink); }

/* 滚动条：细金 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(184, 137, 47, .30); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(184, 137, 47, .5); }
::-webkit-scrollbar-track { background: transparent; }

/* 响应式：小屏登录页单列 + 文案工厂单列 */
@media (max-width: 1100px) {
  #page-copy > .grid { grid-template-columns: 1fr !important; }
  #page-copy .session-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  #page-copy .session-item { min-width: 180px; flex: 1; }
  .auth-view { grid-template-columns: 1fr; place-items: center; padding: 40px 20px; }
  .auth-hero { display: none; }
  .auth-card { margin-right: 0; justify-self: center; width: 100%; max-width: 400px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}

/* ============================================================
   手机适配（<=768px）
   ============================================================ */
@media (max-width: 768px) {
  /* --- 整体从左右分栏改为上下堆叠 --- */
  .app-view { flex-direction: column; min-height: 100vh; }

  /* --- 侧边栏 → 顶部固定条（保持墨蓝） --- */
  .sidebar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(212, 175, 55, .25);
    background: linear-gradient(180deg, #0d1424 0%, #111a30 100%);
    backdrop-filter: saturate(180%) blur(10px);
  }
  .sidebar .brand.sm {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin: 0;
  }
  .sidebar .brand.sm span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* --- 导航：横向滑动的标签条 --- */
  #nav {
    display: flex;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  #nav::-webkit-scrollbar { display: none; }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
    padding: 9px 14px;
    min-height: 40px;
    font-size: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
  }
  .nav-item.active {
    box-shadow: none;
    background: linear-gradient(135deg, #dcb662, #a9821f);
    color: #211803;
  }

  /* --- 账号区：从底部挪到品牌行右侧 --- */
  .side-foot {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    order: -1;
  }
  .account-switcher { width: 100%; }
  .account-menu {
    top: calc(100% + 6px);
    bottom: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  }

  /* --- 主内容区：全宽 + 收窄留白 --- */
  .main { padding: 14px 12px 32px; background: var(--bg); }
  .topbar {
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar h1 { font-size: 19px; }

  /* --- 卡片 / 栅格：一律单列 --- */
  .grid { gap: 12px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .card, .stat { padding: 14px; border-radius: 12px; }
  .card h3 { font-size: 15px; margin-bottom: 10px; }
  .stat .n { font-size: 26px; }

  /* --- 表单：iOS 防自动放大（关键：>=16px） --- */
  input, select, textarea {
    font-size: 16px;
    padding: 12px;
  }
  textarea { min-height: 96px; }
  .btn {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 15px;
  }
  .btn.sm { min-height: 38px; padding: 9px 12px; font-size: 13px; }
  .row { gap: 8px; }
  .row > .btn { flex: 1 1 auto; min-width: 108px; }

  /* --- 表格：横向滚动 --- */
  .table-wrap, .card > table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 13px; min-width: 520px; }
  th, td { padding: 8px 10px; white-space: nowrap; }

  /* --- 聊天气泡 --- */
  .bubble { max-width: 92%; font-size: 14px; }
  .avatar-ai { width: 32px; height: 32px; font-size: 13px; }

  /* --- 媒体 --- */
  .media-box, .upload-preview, video, img.media-box {
    max-width: 100%;
    height: auto;
  }
  .upload-preview { max-height: 140px; }

  /* --- 文案工厂：会话列表横滑 --- */
  #page-copy .session-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  #page-copy .session-item { min-width: 150px; flex: 0 0 auto; }
  .session-item .session-actions { display: flex; opacity: .55; }

  /* --- 登录页 --- */
  .auth-view { padding: 24px 16px; min-height: 100vh; }
  .auth-card { width: 100%; max-width: 100%; padding: 22px 18px; }
  .auth-bg-grid { display: none; }
}

/* 超窄屏（<=380px） */
@media (max-width: 380px) {
  .main { padding: 12px 10px 28px; }
  .card, .stat { padding: 12px; }
  .nav-item { padding: 8px 12px; font-size: 13px; }
  .topbar h1 { font-size: 17px; }
  .row > .btn { min-width: 100%; }
}
