/* ==========================================================================
   康乐饭店 · 总经理 AI 管理助手 — 设计系统
   风格：稳重、清晰、酒店经营管理；非花哨科技风
   ========================================================================== */

:root {
  /* 颜色 */
  --bg: #f4f1ea;              /* 暖米白底 */
  --surface: #ffffff;         /* 卡片 */
  --surface-2: #faf8f3;       /* 次级底 */
  --ink: #26221b;             /* 主文字（深褐黑） */
  --ink-soft: #4a453c;
  --muted: #7a7366;           /* 次级文字 */
  --brand: #1f3a5f;           /* 藏青（主色） */
  --brand-deep: #152843;
  --brand-tint: #eef2f6;      /* 藏青浅底 */
  --gold: #a9813f;            /* 暖金（点缀） */
  --gold-soft: #efe5cd;       /* 暖金浅底 */
  --border: #e3dccb;
  --border-strong: #d2c9b6;
  --danger: #9c3b2e;          /* 警示 */
  --danger-tint: #f7ece9;
  --success: #2f6b4f;
  --success-tint: #e9f2ec;
  --warn: #8a6a1f;
  --warn-tint: #f6efdb;

  /* 字体 */
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* 圆角 / 阴影 / 间距 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(30, 26, 20, 0.05), 0 2px 8px rgba(30, 26, 20, 0.04);
  --shadow-lift: 0 4px 16px rgba(30, 26, 20, 0.10);
  --sp: 8px;

  --nav-w: 208px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #f4e6c4;
  font-size: 22px; font-weight: 700;
  border-radius: 8px;
  flex: 0 0 auto;
}
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.role-badge {
  background: var(--brand); color: #fff;
  padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 1px;
}
.today-tag { font-size: 13px; color: var(--muted); }

/* ---------- 布局 ---------- */
.layout { display: flex; flex: 1; min-height: 0; }

.side-nav {
  width: var(--nav-w);
  flex: 0 0 auto;
  padding: 18px 12px;
  background: var(--brand-deep);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: #cfd8e2;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--gold); color: #fff; font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }

.content { flex: 1; padding: 24px; min-width: 0; }

/* ---------- 通用组件 ---------- */
.page { display: none; animation: fadeIn .22s ease; }
.page.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 18px; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; margin: 0 0 12px;
}
.card-title .bar { width: 4px; height: 16px; background: var(--gold); border-radius: 2px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .5px;
  white-space: nowrap;
}
.tag-demo { background: var(--warn-tint); color: var(--warn); }
.tag-rule { background: var(--brand-tint); color: var(--brand); }
.tag-danger { background: var(--danger-tint); color: var(--danger); }
.tag-success { background: var(--success-tint); color: var(--success); }

/* 网格 */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #916e33; }

/* ---------- 首页：驾驶舱 ---------- */
.dash-hero {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px;
  background: linear-gradient(120deg, var(--brand-deep), var(--brand));
  color: #fff;
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}
.dash-hero .date-big { font-size: 15px; color: #e7d9b8; font-weight: 600; letter-spacing: 1px; }
.dash-hero .tip { margin-top: 8px; font-size: 15px; color: #f3ecdc; line-height: 1.7; }
.dash-hero .tip strong { color: #f6d488; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 26px; }
.timeline li::before {
  content: ""; position: absolute; left: 7px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--gold-soft);
}
.timeline li::after {
  content: ""; position: absolute; left: 11px; top: 18px; bottom: -2px;
  width: 1px; background: var(--border);
}
.timeline li:last-child::after { display: none; }
.tl-time { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .5px; }
.tl-title { font-weight: 700; font-size: 15px; margin-top: 1px; }
.tl-desc { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.tl-owner { color: var(--muted); font-size: 12px; margin-top: 3px; }

.dept-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.dept-card .dept-name { font-weight: 700; font-size: 14px; }
.dept-card .dept-point { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; line-height: 1.55; }
.dept-card .dept-src { color: var(--muted); font-size: 11px; margin-top: 6px; }

.item-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.item-row:last-child { border-bottom: none; }
.item-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; }
.dot-warn { background: var(--gold); }
.dot-danger { background: var(--danger); }
.dot-info { background: var(--brand); }
.item-body { flex: 1; min-width: 0; }
.item-body .item-title { font-weight: 600; font-size: 14px; }
.item-body .item-desc { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.item-body .item-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- AI 问答 ---------- */
.qa-panel { max-width: 860px; }
.qa-input-wrap { display: flex; gap: 10px; }
.qa-input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-family: inherit; font-size: 15px;
  color: var(--ink);
  background: var(--surface);
}
.qa-input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.preset-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.preset-chip {
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.preset-chip:hover { border-color: var(--gold); color: var(--brand); background: var(--gold-soft); }

.answer-box { margin-top: 18px; }
.answer-question { font-weight: 700; color: var(--brand); font-size: 14px; }
.answer-text { margin-top: 8px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.8; white-space: pre-wrap; }
.answer-src {
  margin-top: 12px; padding: 10px 14px;
  background: var(--brand-tint);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--brand);
}
.answer-src .src-label { font-weight: 700; }
.answer-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* ---------- 部门管理 ---------- */
.dept-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dept-tab {
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.dept-tab:hover { border-color: var(--gold); }
.dept-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.task-section { margin-bottom: 16px; }
.task-section h4 {
  margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--brand);
  display: flex; align-items: center; gap: 8px;
}
.task-section h4 .num { background: var(--gold); color: #fff; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-list li {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-bottom: 8px;
  font-size: 13.5px;
}
.task-list li .t-time { color: var(--brand); font-weight: 700; font-size: 12px; }
.task-list li .t-name { font-weight: 600; }
.task-list li .t-desc { color: var(--ink-soft); font-size: 13px; }
.task-list li .t-owner { color: var(--muted); font-size: 12px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.kb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kb th, table.kb td {
  text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.kb th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
table.kb tr:last-child td { border-bottom: none; }

/* ---------- 日报复盘 ---------- */
.report-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.section-block { margin-bottom: 16px; }
.section-block h5 {
  margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--brand);
  display: flex; align-items: center; gap: 6px;
}
.placeholder {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
}
.notice {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.7;
}
.notice-warn { background: var(--warn-tint); color: #6b5313; border: 1px solid #e8d8a8; }

/* ---------- 页脚 ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  background: var(--surface);
}

/* ---------- 数据状态徽章 ---------- */
.data-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  white-space: nowrap;
}
.status-connecting { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); }
.status-connected { background: var(--success-tint); color: var(--success); border: 1px solid #bfd9c8; }
.status-offline { background: var(--warn-tint); color: var(--warn); border: 1px solid #e8d8a8; }
.tag-warn { background: var(--warn-tint); color: var(--warn); }

/* ---------- 执行数据状态提示条 ---------- */
.exec-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 16px;
  background: var(--warn-tint); border: 1px solid #e8d8a8; border-radius: var(--r-md);
  font-size: 13px;
}
.exec-banner .exec-status { font-weight: 700; color: var(--warn); }
.exec-banner .exec-note { color: var(--ink-soft); }

/* ---------- 时间线来源 ---------- */
.tl-src { color: var(--muted); font-size: 11px; margin-top: 3px; }

/* ---------- 来源列表 / 未命中 ---------- */
.src-list { margin: 6px 0 0; padding-left: 16px; }
.src-list li { font-size: 12.5px; color: var(--brand); margin: 2px 0; }
.answer-notfound {
  padding: 10px 14px; margin-top: 8px;
  background: var(--warn-tint); border: 1px solid #e8d8a8; border-radius: var(--r-sm);
  color: var(--warn); font-weight: 700; font-size: 14px;
}

/* ---------- 报告字段 ---------- */
.report-ref { color: var(--muted); font-size: 12px; margin-top: 6px; }
.report-fields { margin: 0; padding-left: 18px; }
.report-fields li { margin: 4px 0; }

/* ---------- 部门卡片 point 行数限制 ---------- */
.dept-point {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 日报填报模块（手机优先：大按钮、大输入框） ---------- */
.daily-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.daily-tab {
  flex: 1; padding: 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 15px; font-weight: 600; cursor: pointer; color: var(--ink-soft);
  font-family: inherit;
}
.daily-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.reporter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.reporter-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; text-align: left;
  font-family: inherit; font-size: inherit; transition: border-color .15s, box-shadow .15s;
}
.reporter-card:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); }
.reporter-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.reporter-role { font-size: 13px; color: var(--muted); }

.form-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.form-title { font-size: 17px; font-weight: 700; }
.form-date { color: var(--muted); font-size: 14px; }

.ref-tips {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 16px;
}
.ref-tips-title { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.ref-tips-note { color: var(--warn); font-size: 12px; margin-bottom: 6px; font-weight: 600; }
.ref-tips-body { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

.form-section { margin-bottom: 20px; }
.form-section h4 { font-size: 15px; margin: 0 0 10px; color: var(--ink); }
.form-section h4 .muted { font-size: 12px; color: var(--muted); font-weight: 400; }
.field-label { display: block; font-size: 13px; color: var(--ink-soft); margin: 10px 0 4px; }
.field-input {
  width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  box-sizing: border-box; font-family: inherit; resize: vertical; background: #fff;
}

.summary-row, .plan-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.summary-row .input-time { width: 38%; min-width: 130px; flex: 0 0 auto; }
.summary-row .input-content { flex: 1; }
.summary-row input, .plan-row input {
  padding: 12px; font-size: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  box-sizing: border-box; font-family: inherit; background: #fff;
}
.plan-row input { flex: 1; }
.btn-del {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1;
}
.btn-del:hover { color: var(--danger); border-color: var(--danger); }

.attach-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.att-item { font-size: 13px; color: var(--ink-soft); padding: 6px 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.att-item.att-pending { color: var(--muted); }

.form-actions { display: flex; gap: 12px; margin-top: 20px; }
.form-actions .btn { flex: 1; }
.btn-lg { padding: 14px 16px; font-size: 16px; }

.submit-ok { font-size: 17px; font-weight: 700; color: var(--success); }
.submit-time { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.date-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.date-current { flex: 1; text-align: center; font-size: 16px; font-weight: 700; }

.status-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.status-chip { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.st-ok { background: var(--success-tint); color: var(--success); }
.st-draft { background: var(--warn-tint); color: var(--warn); }
.st-none { background: var(--surface-2); color: var(--muted); }

.others-group { margin-top: 12px; }
.others-group h5 { margin: 0 0 6px; font-size: 14px; color: var(--brand); }
.others-item { padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 6px; font-size: 14px; line-height: 1.6; }
.others-who { display: inline-block; font-weight: 700; color: var(--ink); margin-right: 8px; }

.per-item { border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 10px; overflow: hidden; }
.per-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px;
  background: var(--surface); border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: inherit; flex-wrap: wrap;
}
.per-head:hover { background: var(--surface-2); }
.per-name { font-weight: 700; font-size: 15px; }
.per-counts { color: var(--muted); font-size: 12px; margin-left: auto; }
.per-detail { padding: 4px 14px 14px; border-top: 1px dashed var(--border); }
.per-section { margin-top: 12px; }
.per-section h6 { margin: 0 0 6px; font-size: 13px; color: var(--brand); }
.per-slot { font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.per-time { display: inline-block; font-weight: 700; color: var(--ink-soft); margin-right: 8px; }
.att-link { display: inline-block; margin: 2px 6px 2px 0; font-size: 13px; color: var(--brand); text-decoration: none; }
.att-link:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* 日报手机适配 */
@media (max-width: 640px) {
  .reporter-grid { grid-template-columns: 1fr 1fr; }
  .summary-row { flex-wrap: wrap; }
  .summary-row .input-time { width: 100%; min-width: 0; flex: 1 1 100%; }
  .form-actions { flex-direction: column; }
  .per-head { flex-wrap: wrap; }
}

/* ---------- 附件查看（汇总卡片「查看附件」+ 详情附件区） ---------- */
.per-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.per-head-row .per-head { flex: 1; min-width: 200px; }
.btn-view-att { padding: 10px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.per-att { padding: 4px 14px 14px; border-top: 1px dashed var(--border); }
.per-att-slot { padding: 8px 0; }

.att-loading, .att-empty, .att-error { font-size: 13px; color: var(--muted); padding: 8px 0; }
.att-error { color: var(--danger); }

.att-thumb { display: inline-block; vertical-align: top; margin: 0 10px 10px 0; }
.att-thumb a { display: block; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.att-thumb img { display: block; width: 96px; height: 96px; object-fit: cover; cursor: zoom-in; }
.att-thumb-name { font-size: 11px; color: var(--muted); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }

.att-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 8px; }
.att-file-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 150px; }
.att-file-name { font-size: 14px; font-weight: 600; }
.att-file-type { font-size: 12px; color: var(--muted); }
.att-download { padding: 8px 12px; font-size: 13px; }

/* 提交后附件上传结果反馈 */
.upload-feedback { margin-top: 8px; font-size: 13px; }
.upload-ok { color: var(--success); font-weight: 600; }
.upload-warn { color: var(--warn); margin-top: 4px; }
.upload-fail { color: var(--danger); margin-top: 4px; }

/* ---------- 二级菜单（驾驶舱/部门内容切换，手机端横向滑动） ---------- */
.sub-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.sub-tab:hover { border-color: var(--brand); color: var(--ink); }
.sub-tab.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .layout { flex-direction: column; }
  .side-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 10px;
    gap: 6px;
  }
  .nav-item { flex: 0 0 auto; padding: 9px 14px; font-size: 13px; }
  .content { padding: 14px; }
  .grid-6, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .qa-input-wrap { flex-direction: column; }
  .footer { flex-direction: column; }
}
@media (max-width: 460px) {
  .grid-6, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   登录会话（登录页 / 顶栏用户区 / 退出 / 403 横幅）
   ========================================================================== */

/* 顶栏：登录人姓名/账号 */
.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--gold-soft);
  color: var(--brand);
  border: 1px solid #e2d2ae;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* 顶栏：退出登录 */
.btn-logout {
  background: transparent;
  border: 1px solid #d8cfc0;
  color: var(--brand);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-logout:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }

/* 403 无权限 / 加载错误横幅 */
.error-banner {
  background: var(--danger-tint);
  border: 1px solid #e3bfb6;
  border-left: 4px solid var(--danger);
  color: var(--danger);
  border-radius: var(--r-sm, 8px);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5ded2);
  border-radius: var(--r-lg, 14px);
  padding: 30px 28px 26px;
  box-shadow: 0 8px 30px rgba(90, 70, 40, 0.08);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand h2 { font-size: 19px; margin: 0; color: var(--brand); }
.login-sub { color: var(--muted, #8a8378); font-size: 13px; margin: 0 0 18px; }
.login-notice {
  background: var(--warn-tint);
  border: 1px solid #e8d8a8;
  color: #6b5313;
  border-radius: var(--r-sm, 8px);
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.login-error {
  background: var(--danger-tint);
  border: 1px solid #e3bfb6;
  color: var(--danger);
  border-radius: var(--r-sm, 8px);
  padding: 8px 12px;
  margin: 10px 0 0;
  font-size: 13px;
}
.login-card .field-label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--muted, #8a8378); font-weight: 600; }
.login-card .field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px; /* 防 iOS 聚焦缩放 */
  border: 1px solid #d8cfc0;
  border-radius: var(--r-sm, 8px);
  background: #fff;
  color: var(--text, #2b2b26);
}
.login-card .field-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.login-btn { width: 100%; margin-top: 20px; font-size: 16px; padding: 12px; }
.login-exp { width: 100%; margin-top: 10px; }
