:root {
  --red: #a8231f;
  --red-deep: #8a1a17;
  --red-light: #c2453f;
  --gold: #b9954e;
  --ink: #24211e;
  --ink-2: #56504a;
  --ink-3: #8a8177;
  --line: #e5e0d8;
  --bg: #f4f1ec;
  --card: #ffffff;
  --ok: #2f7a4d;
  --warn: #b07b1e;
  --danger: #b3382f;
  --shadow: 0 2px 10px rgba(70, 50, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(168,35,31,.18), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(185,149,78,.16), transparent 45%),
    linear-gradient(160deg, #92201c 0%, #6f1512 55%, #4d0e0c 100%);
  overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 16px);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 400px; max-width: 100%;
  background: #fff;
  border-radius: 8px;
  padding: 40px 36px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  text-align: center;
  border-top: 5px solid var(--gold);
}
.login-emblem {
  width: 68px; height: 68px; margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--red), var(--red-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(138,26,23,.25);
}
.login-card h1 {
  font-size: 22px; margin: 0 0 8px; letter-spacing: 2px;
  color: var(--red-deep); font-weight: 700;
}
.login-sub { color: var(--ink-3); font-size: 12px; margin: 0 0 26px; letter-spacing: 1px; }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 12px; color: var(--ink-2); margin: 0 0 6px; letter-spacing: 1px; }
.login-form input {
  width: 100%; height: 42px; padding: 0 12px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 4px; background: #fbfaf8;
  font-size: 14px; color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(168,35,31,.1); background: #fff; }
.btn-primary {
  width: 100%; height: 44px; border: 0; border-radius: 4px;
  background: linear-gradient(145deg, var(--red), var(--red-deep));
  color: #fff; font-size: 15px; letter-spacing: 6px; cursor: pointer;
  transition: filter .2s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .65; cursor: default; }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 10px; text-align: center; }
.login-foot { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); color: #a39a90; font-size: 11px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 62px; background: linear-gradient(100deg, #9c1f1b 0%, #7d1512 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 60;
  box-shadow: 0 2px 12px rgba(0,0,0,.14);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 6px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; color: #f6e3b8;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 16px; letter-spacing: 1px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 10px; color: rgba(255,255,255,.65); letter-spacing: 3px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 0 14px; height: 34px; width: 240px;
  color: rgba(255,255,255,.8);
}
.top-search input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: #fff; font-size: 13px;
}
.top-search input::placeholder { color: rgba(255,255,255,.55); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 6px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative; padding: 4px 6px; border-radius: 6px; }
.user-chip:hover { background: rgba(255,255,255,.1); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f3e6cf; color: var(--red-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.4);
}
.u-meta { display: flex; flex-direction: column; line-height: 1.3; }
.u-meta b { font-size: 13px; font-weight: 600; }
.u-meta span { font-size: 10px; color: rgba(255,255,255,.65); }
.user-menu {
  position: absolute; right: 0; top: 48px; min-width: 130px;
  background: #fff; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.16);
  padding: 6px; display: none; z-index: 80;
}
.user-menu.show { display: block; }
.user-menu a { display: block; padding: 9px 12px; color: var(--ink-2); font-size: 13px; border-radius: 4px; }
.user-menu a:hover { background: #faf6f0; color: var(--red); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 62px); }
.sidebar {
  width: 216px; flex: 0 0 216px;
  background: #fff; border-right: 1px solid var(--line);
  padding: 18px 12px 12px; display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.nav-group { font-size: 11px; color: #a79e94; letter-spacing: 3px; padding: 10px 12px 6px; }
.nav-group.admin-only { margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 6px; color: var(--ink-2);
  font-size: 13.5px; cursor: pointer; position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #faf6f1; color: var(--ink); }
.nav-item.active { background: linear-gradient(90deg, rgba(168,35,31,.09), rgba(168,35,31,.03)); color: var(--red); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--red); border-radius: 2px;
}
.nav-item .badge:empty { display: none; }
.badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-style: normal; line-height: 18px; text-align: center;
}
.ic { width: 18px; height: 18px; flex: 0 0 18px; display: inline-block; background-repeat: no-repeat; background-position: center; background-size: 18px 18px; opacity: .75; }
.nav-item.active .ic { opacity: 1; }
.ic-dash { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8231f' stroke-width='1.8'><rect x='3' y='3' width='7' height='7' rx='1.5'/><rect x='14' y='3' width='7' height='7' rx='1.5'/><rect x='3' y='14' width='7' height='7' rx='1.5'/><rect x='14' y='14' width='7' height='7' rx='1.5'/></svg>"); }
.ic-book { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><path d='M5 4h11a2 2 0 012 2v14H7a2 2 0 01-2-2V4z'/><path d='M9 8h6M9 12h6'/></svg>"); }
.ic-task { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><rect x='4' y='4' width='16' height='16' rx='2'/><path d='M8 10l2 2 4-4'/></svg>"); }
.ic-bell { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><path d='M18 16H6l1.5-2V9a4.5 4.5 0 019 0v5L18 16z'/><path d='M10 19a2 2 0 004 0'/></svg>"); }
.ic-file { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><path d='M6 3h8l4 4v14H6z'/><path d='M14 3v4h4'/></svg>"); }
.ic-chat { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><path d='M21 12a8 8 0 01-8 8H7l-4 3V12a8 8 0 018-8h2a8 8 0 018 8z'/></svg>"); }
.ic-ai { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><circle cx='12' cy='12' r='3'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M19 5l-2 2M7 17l-2 2'/></svg>"); }
.ic-user { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><circle cx='12' cy='8' r='3.5'/><path d='M5 20c0-3.6 3-6 7-6s7 2.4 7 6'/></svg>"); }
.ic-dept { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><rect x='4' y='9' width='16' height='11' rx='1.5'/><path d='M8 9V5h8v4'/></svg>"); }
.ic-set { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8177' stroke-width='1.8'><circle cx='12' cy='12' r='3'/><path d='M19 12a7 7 0 00-.1-1l2-1.5-2-3.4-2.3 1a7 7 0 00-1.7-1L14.5 3h-5l-.4 2.6a7 7 0 00-1.7 1l-2.3-1-2 3.4 2 1.5A7 7 0 005 12a7 7 0 00.1 1l-2 1.5 2 3.4 2.3-1a7 7 0 001.7 1l.4 2.6h5l.4-2.6a7 7 0 001.7-1l2.3 1 2-3.4-2-1.5c.1-.3.1-.7.1-1z'/></svg>"); }
.side-foot { color: #b3aaa0; font-size: 11px; text-align: center; padding: 14px 0 4px; letter-spacing: 1px; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 通用组件 ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: 1px; position: relative; padding-left: 12px; }
.page-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: var(--red); border-radius: 2px; }
.page-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; padding-left: 12px; }
.page-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  height: 34px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.btn:hover { border-color: var(--red-light); color: var(--red); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn-ghost-red { background: rgba(168,35,31,.06); border-color: rgba(168,35,31,.2); color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-link { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.btn-link.mute { color: var(--ink-3); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head b { font-size: 14px; letter-spacing: .5px; }
.card-head span { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 16px 18px; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%; background: rgba(168,35,31,.04); }
.stat-ic { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(168,35,31,.08); color: var(--red); font-size: 18px; flex: 0 0 42px; }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--ink); font-family: "DIN Alternate", "Segoe UI", sans-serif; }
.stat-label { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.split-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #faf8f5; white-space: nowrap;
}
tbody td { padding: 12px; border-bottom: 1px solid #f1ede6; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fbf9f6; }
tbody tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.ellip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; line-height: 18px;
  background: #f2eee7; color: var(--ink-2); white-space: nowrap;
}
.tag-red { background: rgba(168,35,31,.1); color: var(--red); }
.tag-gold { background: rgba(185,149,78,.14); color: #8a6a24; }
.tag-green { background: rgba(47,122,77,.1); color: var(--ok); }
.tag-blue { background: rgba(47,90,140,.1); color: #2f5a8c; }
.tag-gray { background: #f0eeea; color: #8c857c; }

.empty { text-align: center; color: #b3aaa0; padding: 28px 10px; font-size: 13px; }

/* 列表项 */
.item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px dashed #eee9e1;
}
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 13.5px; color: var(--ink); font-weight: 600; margin-bottom: 4px; cursor: pointer; }
.item-title:hover { color: var(--red); }
.item-desc { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 11px; color: #a89f95; margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: #d8cec0; }
.tl-item.hot::before { background: var(--red); }
.tl-time { font-size: 11px; color: #a89f95; }
.tl-text { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.6; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30,22,18,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease; backdrop-filter: blur(2px);
}
.modal {
  width: 560px; max-width: 100%; max-height: 88vh; background: #fff; border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.25);
  border-top: 4px solid var(--red);
}
.modal.wide { width: 720px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head b { font-size: 15px; letter-spacing: 1px; }
.modal-head .x { cursor: pointer; color: #a89f95; font-size: 20px; line-height: 1; padding: 2px 6px; }
.modal-head .x:hover { color: var(--red); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #faf8f5; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .5px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px;
  font-size: 13px; color: var(--ink); background: #fcfbf9; outline: none; font-family: inherit;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red-light); background: #fff; box-shadow: 0 0 0 3px rgba(168,35,31,.07); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11px; color: #a89f95; margin-top: 4px; }

.chk-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; padding: 8px; background: #fcfbf9; }
.chk-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.chk-list label:hover { background: #f5f1ea; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(35,28,24,.92); color: #fff; padding: 10px 20px; border-radius: 4px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 300; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(160,45,38,.95); }

/* 沟通 */
.chat-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 0; height: calc(100vh - 190px); min-height: 420px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: #fbf9f6; }
.chat-list-head { padding: 12px 14px; font-size: 12px; color: var(--ink-3); letter-spacing: 2px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.chat-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #f2eee7; }
.chat-item:hover { background: #f6f1ea; }
.chat-item.active { background: #fff; border-left: 3px solid var(--red); }
.chat-item b { font-size: 13px; display: block; margin-bottom: 4px; }
.chat-item span { font-size: 11.5px; color: #a89f95; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-main-head { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; background: #faf8f5; }
.msg { display: flex; gap: 9px; margin-bottom: 14px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg-av { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; background: #eee6d8; color: #7a6a52; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.msg.me .msg-av { background: var(--red); color: #fff; }
.msg-body { max-width: 68%; }
.msg-name { font-size: 11px; color: #a89f95; margin-bottom: 4px; }
.msg.me .msg-name { text-align: right; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.msg.me .bubble { background: #fdf3ee; border-color: #f0d8c8; }
.chat-input { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; align-items: flex-end; background: #fff; }
.chat-input textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; min-height: 40px; max-height: 100px;
  resize: none; font-family: inherit; font-size: 13px; outline: none; background: #fcfbf9;
}
.chat-input textarea:focus { border-color: var(--red-light); background: #fff; }

/* 文件 */
.file-drop {
  border: 1px dashed #d6cbbd; border-radius: 6px; padding: 18px; text-align: center;
  color: var(--ink-3); font-size: 13px; background: #fcfaf7; cursor: pointer; margin-bottom: 14px;
}
.file-drop.hover { border-color: var(--red); background: #fdf6f1; color: var(--red); }
.file-drop input { display: none; }

/* AI */
.ai-box { max-width: 820px; }
.ai-input { display: flex; gap: 10px; }
.ai-input input {
  flex: 1; height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 0 14px; font-size: 14px;
  outline: none; background: #fff;
}
.ai-input input:focus { border-color: var(--red-light); box-shadow: 0 0 0 3px rgba(168,35,31,.07); }
.ai-answer { margin-top: 16px; white-space: pre-wrap; line-height: 1.9; font-size: 13.5px; color: var(--ink-2); }
.ai-hit { border-left: 3px solid var(--gold); background: #fcfaf5; padding: 10px 14px; margin-bottom: 10px; border-radius: 0 4px 4px 0; }
.ai-hit b { font-size: 13px; }
.ai-hit p { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 响应式 */
@media (max-width: 980px) {
  .split-2 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .top-search { width: 180px; }
}
@media (max-width: 760px) {
  .icon-btn { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 62px; bottom: 0; z-index: 70; height: auto;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 8px 0 24px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: none; }
  .main { padding: 16px 14px 30px; }
  .top-search { display: none; }
  .u-meta { display: none; }
  .page-title { font-size: 17px; }
  .modal { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-main { min-height: 420px; }
  .stat { padding: 12px 14px; gap: 10px; }
  .stat-num { font-size: 20px; }
  .tbl-wrap { font-size: 12px; }
}
@media (max-width: 520px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .brand-text b { font-size: 14px; }
  .brand-text span { display: none; }
  .msg-body { max-width: 80%; }
}
