/* =====================================================================
   伊尔莱德企业知识库 · 统一样式
   原则：商务、克制、无多余装饰；所有颜色走变量，方便整体换肤
   ===================================================================== */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #667085;
  --ink-4: #98A2B3;
  --line: #E4E7EC;
  --line-soft: #EFF1F4;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --brand: #163B63;
  --brand-2: #1E5A94;
  --brand-soft: #EAF1F8;
  --ok: #067647;
  --ok-bg: #ECFDF3;
  --warn: #B54708;
  --warn-bg: #FFFAEB;
  --bad: #B42318;
  --bad-bg: #FEF3F2;
  --info: #175CD3;
  --info-bg: #EFF8FF;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .12), 0 2px 8px rgba(16, 24, 40, .06);
  --font: "Inter", -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* 跨端基线：iOS 横屏不放大字号、点按无灰块、按钮无 300ms 延迟 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-2); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #CFE0F2; }

.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 20px; height: 20px; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: #FAFBFC; border-color: #D0D5DD; color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #1D4C7C 0%, #163B63 100%);
  border-color: #153A61; color: #fff;
  box-shadow: 0 1px 2px rgba(22, 59, 99, .2);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #1A4470 0%, #0F2F52 100%);
  border-color: #0F2F52; color: #fff;
}
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: #F2F4F7; color: var(--ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--bad); border-color: #F3C6C1; }
.btn-danger:hover { background: var(--bad-bg); border-color: #E9A7A0; color: var(--bad); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #8FB3D9; box-shadow: 0 0 0 3px rgba(30, 90, 148, .10); }
.input::placeholder { color: var(--ink-4); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

.hint { font-size: 12.5px; color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 1;
  background: #F2F4F7; color: var(--ink-2);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- 登录页：整屏光场 ---------------- */

.login-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 56px 48px 92px;
  background: #070D16;
}

/* 底色：上浅下深，像一间只开了一盏灯的房间 */
.stage-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(88% 66% at 22% -8%, rgba(32, 62, 96, .55) 0%, transparent 62%),
    linear-gradient(168deg, #0A1420 0%, #08111C 46%, #060B12 100%);
}

/* 灯具：顶部一条发光灯带 */
.lamp {
  position: absolute; left: 33%; top: 9%; width: 220px; height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(255, 247, 230, 0) 0%, rgba(255, 247, 230, .85) 14%,
    #FFFDF6 50%, rgba(255, 247, 230, .85) 86%, rgba(255, 247, 230, 0) 100%);
  box-shadow:
    0 0 16px 3px rgba(255, 246, 223, .55),
    0 0 54px 14px rgba(255, 246, 223, .20),
    0 0 130px 38px rgba(255, 246, 223, .07);
  animation: lampBreathe 9s ease-in-out infinite;
}
@keyframes lampBreathe {
  0%, 100% { opacity: .86; }
  50% { opacity: 1; }
}

/* 主光束：从灯带向下张开的一个光锥 */
.light-cone {
  position: absolute; left: 33%; top: 9%; width: 900px; height: 82%;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(255, 246, 225, .20) 0%, rgba(255, 246, 225, .10) 26%,
    rgba(255, 246, 225, .035) 58%, rgba(255, 246, 225, 0) 88%);
  -webkit-clip-path: polygon(38% 0%, 62% 0%, 100% 100%, 0% 100%);
  clip-path: polygon(38% 0%, 62% 0%, 100% 100%, 0% 100%);
  /* 左右边缘再淡一档，光才不会像一块斜切的玻璃 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  filter: blur(26px);
  animation: coneBreathe 13s ease-in-out infinite;
}
.light-core {
  position: absolute; left: 33%; top: 9%; width: 420px; height: 70%;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(255, 250, 238, .22) 0%, rgba(255, 250, 238, .07) 46%, rgba(255, 250, 238, 0) 82%);
  -webkit-clip-path: polygon(42.5% 0%, 57.5% 0%, 94% 100%, 6% 100%);
  clip-path: polygon(42.5% 0%, 57.5% 0%, 94% 100%, 6% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  filter: blur(22px);
  animation: coneBreathe 11s ease-in-out infinite reverse;
}
@keyframes coneBreathe {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}

/* 地面光斑：光落在地上的那一片 */
.floor-glow {
  position: absolute; left: 33%; bottom: -8%; width: 780px; height: 42%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(255, 246, 225, .12) 0%, rgba(255, 246, 225, .04) 42%, transparent 68%);
  filter: blur(24px);
}

/* 地面：透视网格，把"一间厂房"的空间感做出来 */
.floor {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 62%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.55) 16%, #000 48%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.55) 16%, #000 48%, #000 100%);
}

/* 光里的微尘 */
.dust span {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 236, .95) 0%, rgba(255, 248, 236, 0) 70%);
  animation-name: dustFloat;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes dustFloat {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  18% { opacity: var(--o, .35); }
  80% { opacity: var(--o, .35); }
  100% { transform: translate3d(16px, -86px, 0); opacity: 0; }
}

/* 暗角：把注意力收在光里 */
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 11, 18, .58) 0%, rgba(6, 11, 18, .16) 40%, transparent 56%),
    radial-gradient(125% 88% at 24% 16%, transparent 38%, rgba(3, 7, 12, .58) 100%);
}

/* 内容 */
.login-content {
  position: relative; z-index: 3;
  width: 100%; max-width: 1160px;
  display: grid;
  grid-template-columns: 1fr 368px;
  align-items: center;
  gap: 72px;
}

.brand-block { color: #fff; animation: rise .9s cubic-bezier(.22,.61,.36,1) both; }
.brand-name {
  font-size: 40px; font-weight: 500; line-height: 1.16;
  letter-spacing: .26em; color: #fff;
}
.brand-en {
  margin-top: 14px; font-size: 10.5px; letter-spacing: .58em;
  color: rgba(255, 255, 255, .40); text-transform: uppercase;
}
.brand-rule {
  width: 46px; height: 1px; background: rgba(255, 255, 255, .30);
  margin: 30px 0 26px; transform-origin: left center;
  animation: ruleGrow 1.2s cubic-bezier(.22,.61,.36,1) .3s both;
}
.brand-line {
  margin: 0 0 12px; font-size: 15.5px; font-weight: 300;
  letter-spacing: .09em; line-height: 1.9; color: rgba(255, 255, 255, .74);
}
.brand-line:last-child { margin-bottom: 0; }

/* 登录卡：白卡浮在光场上 */
.login-card {
  color-scheme: light;
  background: #fff;
  border-radius: 14px;
  padding: 32px 30px 26px;
  box-shadow: 0 30px 72px rgba(0, 0, 0, .46), 0 2px 6px rgba(0, 0, 0, .18);
  animation: rise .9s cubic-bezier(.22,.61,.36,1) .14s both;
}
.login-card h1 {
  font-size: 20px; font-weight: 600; margin: 0 0 6px;
  letter-spacing: .06em; color: var(--ink);
}
.card-sub {
  margin: 0 0 26px; font-size: 12.5px; color: var(--ink-4); letter-spacing: .04em;
}

.login-alert {
  display: none; align-items: flex-start; gap: 8px;
  padding: 9px 11px; margin-bottom: 16px; border-radius: 7px;
  background: var(--bad-bg); color: var(--bad); font-size: 12.5px;
  border: 1px solid #F5D2CE; letter-spacing: .02em;
}
.login-alert.show { display: flex; }

.login-card .field { margin-bottom: 18px; }
.login-card .field > span {
  font-size: 11.5px; font-weight: 400; color: var(--ink-4);
  letter-spacing: .12em; margin-bottom: 7px;
}
.login-card .input {
  height: 42px; border: 0; border-bottom: 1px solid #E1E5EA;
  border-radius: 0; padding: 0; background: transparent;
  font-size: 14.5px; letter-spacing: .02em;
}
.login-card .input:focus { border-bottom-color: var(--brand); box-shadow: none; }
.login-card .input::placeholder { color: #C2C9D2; }

.login-btn {
  width: 100%; height: 44px; margin-top: 10px;
  border: 1px solid var(--brand); border-radius: 7px;
  background: var(--brand); color: #fff;
  font-size: 14px; letter-spacing: .22em;
  transition: background .18s, border-color .18s;
}
.login-btn:hover { background: #0F2F52; border-color: #0F2F52; }
@media (hover: none) {
  .login-btn:hover { background: var(--brand); border-color: var(--brand); }
}
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

.demo-tip {
  display: none; margin-top: 22px; padding: 9px 11px; border-radius: 7px;
  background: #F7F8FA; color: var(--ink-3); font-size: 12px; line-height: 1.7;
  border: 1px solid var(--line-soft); letter-spacing: .02em;
}
.demo-tip b { font-weight: 600; color: var(--ink-2); }

/* 页脚 */
.stage-foot {
  position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 48px;
  font-size: 11.5px; color: rgba(255, 255, 255, .28); letter-spacing: .1em;
}
.stage-foot .mode { color: rgba(214, 178, 92, .75); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ruleGrow { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* 系统开启"减少动态效果"时，全部静止 */
@media (prefers-reduced-motion: reduce) {
  .lamp, .light-cone, .light-core, .dust span,
  .brand-block, .brand-rule, .login-card, .view.active,
  .appbar::before, .content::before, .admin::before,
  .chat-view::before, .chat-hero::before { animation: none !important; }
  .dust { display: none; }
  .stat:hover { transform: none; }
}

/* ---------------- 应用框架 ---------------- */

.app {
  display: flex; flex-direction: column;
  height: 100vh;
  height: 100dvh;   /* iOS / 鸿蒙随地址栏动态收缩，避免输入框被顶出屏幕 */
  overflow: hidden;
}

.appbar {
  position: relative;
  height: 60px; flex: none;
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
  z-index: 20;
}
/* 顶栏顶部的一道细光：与登录页的灯带同源，只有 2px */
.appbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(224, 238, 255, .9) 50%, rgba(255, 255, 255, 0) 100%) no-repeat,
    linear-gradient(90deg, #163B63 0%, #2C6BA6 11%, rgba(44, 107, 166, 0) 48%);
  background-size: 220px 2px, 100% 2px;
  background-position: -220px 0, 0 0;
  animation: barSweep 11s cubic-bezier(.4, 0, .2, 1) infinite;
  pointer-events: none;
}
/* 光沿着顶条走一遍，再停一会儿——节拍慢到不会注意到它在动 */
@keyframes barSweep {
  0% { background-position: -220px 0, 0 0; }
  52%, 100% { background-position: 100% 0, 0 0; }
}
.appbar .mark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.appbar .mark .wordmark {
  font-size: 15px; font-weight: 600; letter-spacing: .2em;
  color: var(--ink); line-height: 1; white-space: nowrap;
}
.appbar .mark .mark-rule { width: 1px; height: 13px; background: var(--line); flex: none; }
.appbar .mark .mark-sub {
  font-size: 10.5px; letter-spacing: .22em; color: var(--ink-4);
  line-height: 1; white-space: nowrap;
}

.nav { display: flex; gap: 3px; margin-left: 12px; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 7px;
  color: var(--ink-3); font-size: 13.5px; font-weight: 500;
}
.nav a:hover { background: #F5F6F8; color: var(--ink); }
.nav a { transition: background .14s, color .14s; }
.nav a.active {
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(22, 59, 99, .05);
}

.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px 0 4px; border-radius: 20px;
  background: #F5F6F8; font-size: 13px; color: var(--ink-2);
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(150deg, #2C6BA6 0%, #163B63 100%); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.mode-badge {
  display: none; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 6px;
  background: var(--warn-bg); color: var(--warn);
  font-size: 11.5px; font-weight: 500; border: 1px solid #F3E3C3;
  white-space: nowrap;
}
.mode-badge.show { display: inline-flex; }

.main { flex: 1; min-height: 0; display: flex; }
.view { display: none; flex: 1; min-height: 0; min-width: 0; }
.view.active { display: flex; animation: viewIn .24s cubic-bezier(.22, .61, .36, 1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
/* 行悬停时左侧亮一道细线，比整行变色更克制 */
table.tbl tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--brand-2); }

/* ---------------- 资料库 ---------------- */

.sidebar {
  width: 232px; flex: none;
  border-right: 1px solid rgba(255, 255, 255, .06);
  /* 深色侧栏：与登录页的深色场景同源，顶部留一小片灯光 */
  background:
    radial-gradient(300px 200px at 50% -8%, rgba(84, 148, 208, .20), transparent 72%),
    linear-gradient(180deg, #102A44 0%, #0B1C2E 100%);
  padding: 20px 12px 16px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.side-title { font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .38); letter-spacing: .12em; padding: 0 10px; margin: 4px 0 8px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li button {
  position: relative;
  width: 100%; height: 34px; padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 7px; background: transparent;
  color: rgba(255, 255, 255, .72); font-size: 13.5px; text-align: left;
  transition: background .14s, color .14s;
}
.cat-list li button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.cat-list li button.active { background: rgba(255, 255, 255, .10); color: #fff; font-weight: 500; }
/* 选中项左侧一道 2px 光条，比整块变色轻 */
.cat-list li button.active::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 2px; height: 15px; transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #CFE4F8 0%, #7FB3E8 100%);
  box-shadow: 0 0 8px rgba(143, 196, 240, .55);
}
.cat-list li button { min-width: 0; }
/* 深色底上的小图标 */
.sidebar .icon-btn { color: rgba(255, 255, 255, .45); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.sidebar .icon-btn.danger:hover { background: rgba(220, 90, 80, .18); color: #FFB4AC; }
.cat-list .cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list .count { margin-left: auto; font-size: 12px; color: rgba(255, 255, 255, .34); flex: none; }
.cat-list li button.active .count { color: rgba(255, 255, 255, .8); }

.quota {
  margin: auto 2px 0; padding: 13px 12px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
}
.quota-head { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, .58); margin-bottom: 7px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 3px; transition: width .4s;
  background: linear-gradient(90deg, #5E9FD6 0%, #9CCBF2 100%);
}
.quota-note { margin-top: 8px; font-size: 11.5px; color: rgba(255, 255, 255, .34); }

.content {
  position: relative; isolation: isolate;
  flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 44px;
  background: radial-gradient(1000px 340px at 86% -8%, rgba(30, 90, 148, .05), transparent 72%);
}
/* 环境光：一团很大的柔光在左上缓慢移动，40 秒一个来回 */
.content::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -10%; top: -260px; width: 70%; height: 620px;
  background: radial-gradient(closest-side, rgba(44, 107, 166, .14), rgba(44, 107, 166, .05) 54%, transparent 78%);
  animation: ambientDrift 40s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .65; }
  to { transform: translate3d(90px, 70px, 0) scale(1.12); opacity: 1; }
}

.content-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.content-head > div:first-child { min-width: 0; }
.content-head h2 {
  font-size: 19px; font-weight: 600; margin: 0; letter-spacing: .01em;
  display: flex; align-items: center; gap: 9px;
}
.content-head h2::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, #2C6BA6 0%, #163B63 100%);
}
.content-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.content-head .spacer { flex: 1; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; width: 280px; }
.search .i { position: absolute; left: 11px; top: 10px; color: var(--ink-4); }
.search input { height: 34px; padding-left: 33px; }

.card {
  background: var(--card); border: 1px solid #E6EAF0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 14px 30px -24px rgba(16, 24, 40, .3);
}

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13.5px; }
table.tbl td { white-space: nowrap; }
table.tbl td:first-child { white-space: normal; }
table.tbl th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3);
  letter-spacing: .08em; padding: 12px 16px;
  background: linear-gradient(180deg, #FBFCFD 0%, #F6F8FA 100%);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #F8FAFC; }
.cell-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-ico {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .045);
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  background: #F2F4F7; color: var(--ink-3); text-transform: uppercase;
}
.file-ico.pdf { background: #FEF3F2; color: #B42318; }
.file-ico.docx { background: var(--info-bg); color: var(--info); }
.file-ico.pptx { background: #FFF4ED; color: #C4320A; }
.file-ico.xlsx { background: var(--ok-bg); color: var(--ok); }
.file-ico.html { background: #F4F3FF; color: #5925DC; }
.name { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.meta { font-size: 11.5px; color: var(--ink-4); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: .35; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-3); display: grid; place-items: center;
}
.icon-btn:hover { background: #F2F4F7; color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty .i { width: 28px; height: 28px; color: var(--ink-4); margin-bottom: 10px; }
.empty b { display: block; font-size: 14px; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }

/* 首次进入时表格没有数据，表头留着反而空——直接收起 */
table.tbl.no-head { min-width: 0; }
table.tbl.no-head thead { display: none; }

/* 首次进入的空态：一张小场景 + 两个动作 + 三条说明 */
.empty.rich { max-width: 470px; margin: 0 auto; padding: 44px 20px 40px; }
.empty-art { width: 220px; margin: 0 auto 4px; }
.empty-art svg { display: block; width: 100%; height: auto; }
.empty.rich b { font-size: 15.5px; margin-bottom: 7px; }
.empty.rich p { margin: 0 0 20px; font-size: 13px; color: var(--ink-3); line-height: 1.78; }
.empty-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.empty-tips {
  list-style: none; margin: 24px 0 0; padding: 16px 0 0;
  border-top: 1px dashed var(--line); display: grid; gap: 9px; text-align: left;
}
.empty-tips li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.empty-tips .i {
  width: 13px; height: 13px; padding: 0; margin-top: 3px;
  background: none; border-radius: 0; color: var(--brand-2); flex: none; box-sizing: border-box;
}

@media (max-width: 560px) {
  .empty.rich { padding: 28px 12px 26px; }
  .empty-art { width: 170px; }
  .empty.rich p { font-size: 12.5px; }
}

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-3); }
.pager .pages { display: flex; gap: 6px; }

/* ---------------- AI 问答 ---------------- */

.chat-view {
  position: relative; isolation: isolate;
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background:
    radial-gradient(880px 320px at 50% -12%, rgba(30, 90, 148, .055), transparent 70%),
    var(--bg);
}
.chat-view::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: -240px; width: 900px; height: 560px;
  margin-left: -450px;
  background: radial-gradient(closest-side, rgba(44, 107, 166, .11), rgba(44, 107, 166, .035) 56%, transparent 78%);
  animation: chatLight 30s ease-in-out infinite alternate;
}
@keyframes chatLight {
  from { transform: translate3d(-40px, 0, 0) scale(1); opacity: .7; }
  to { transform: translate3d(40px, 30px, 0) scale(1.1); opacity: 1; }
}
.chat-scroll { flex: 1; overflow-y: auto; padding: 26px 24px 8px; }
.chat-inner { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
/* 首屏引导独占视野时居中，避免上方一小块、下方一大片空白 */
.chat-inner.hero-only { justify-content: center; min-height: 100%; }

.chat-hero { position: relative; text-align: center; padding: 40px 0 10px; }
.chat-hero::before {
  content: ""; position: absolute; left: 50%; top: 4px;
  width: 320px; height: 200px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(44, 107, 166, .12), transparent 76%);
  pointer-events: none;
  animation: heroHalo 10s ease-in-out infinite;
}
@keyframes heroHalo {
  0%, 100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.07); }
}
.chat-hero .glyph {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 13px;
  background: linear-gradient(150deg, #2C6BA6 0%, #163B63 100%); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(22, 59, 99, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.chat-hero h3 { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.chat-hero p { color: var(--ink-3); font-size: 13.5px; margin: 0 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-size: 13px;
}
.chip:hover { border-color: #B9CFE5; background: #FBFDFF; color: var(--brand); }

.msg { display: flex; gap: 10px; }
.msg .ava { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.msg.user { flex-direction: row-reverse; }
.msg.user .ava { background: #EDF0F3; color: var(--ink-2); }
.msg.bot .ava { background: var(--brand); color: #fff; }
.bubble {
  max-width: 640px; padding: 12px 15px; border-radius: 10px;
  font-size: 14px; line-height: 1.78; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble { background: var(--brand-soft); color: #14395C; border-top-right-radius: 3px; }
.msg.bot .bubble { background: var(--card); border: 1px solid var(--line); border-top-left-radius: 3px; box-shadow: var(--shadow); }
.msg.bot .bubble a { text-decoration: underline; text-underline-offset: 2px; }
.msg.bot .bubble strong { font-weight: 600; }
.cite {
  display: inline-block; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 4px; background: var(--brand-soft); color: var(--brand);
  font-size: 10.5px; line-height: 15px; text-align: center;
  vertical-align: 2px; margin: 0 1px; font-weight: 600;
}
.msg-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--ink-4); }

.sources { margin-top: 12px; display: grid; gap: 8px; }
.source {
  display: flex; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #FCFDFE;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.source:hover { border-color: #B9CFE5; background: #F8FBFE; }
.source .no {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.source .st { font-size: 12.8px; font-weight: 500; color: var(--ink); line-height: 1.5; }
.source .sc { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

.typing { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); animation: bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

.composer-wrap { flex: none; padding: 10px 24px 20px; background: linear-gradient(to bottom, rgba(247,248,250,0), var(--bg) 28%); }
.composer {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 8px 8px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .05), 0 14px 30px -26px rgba(16, 24, 40, .4);
}
.composer:focus-within { border-color: #8FB3D9; box-shadow: 0 0 0 3px rgba(30, 90, 148, .09); }
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none;
  max-height: 160px; min-height: 24px; line-height: 1.6; padding: 7px 0; background: transparent;
}
.send {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 9px;
  background: linear-gradient(180deg, #1D4C7C 0%, #163B63 100%);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 6px -2px rgba(22, 59, 99, .45);
}
.send:hover:not(:disabled) { filter: brightness(1.08); }
.send:disabled { background: #C7D3DF; cursor: not-allowed; }
.composer-foot { max-width: 780px; margin: 8px auto 0; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-4); }

/* ---------------- 管理后台 ---------------- */

.admin {
  position: relative; isolation: isolate;
  flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 44px;
  background: radial-gradient(1000px 340px at 86% -8%, rgba(30, 90, 148, .05), transparent 72%);
}
.admin::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -10%; top: -260px; width: 70%; height: 620px;
  background: radial-gradient(closest-side, rgba(44, 107, 166, .13), rgba(44, 107, 166, .045) 54%, transparent 78%);
  animation: ambientDrift 46s ease-in-out infinite alternate;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden; padding: 15px 16px 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover {
  transform: translateY(-1px);
  border-color: #D7E2EC;
  box-shadow: 0 12px 26px -20px rgba(16, 24, 40, .45);
}
.stat::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, rgba(44, 107, 166, .55) 0%, rgba(44, 107, 166, 0) 70%);
}
.stat.bad::after { background: linear-gradient(90deg, rgba(180, 35, 24, .5) 0%, rgba(180, 35, 24, 0) 70%); }
.stat .k { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.stat-ico {
  width: 24px; height: 24px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2);
}
.stat.bad .stat-ico { background: var(--bad-bg); color: var(--bad); }
.stat .v { font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin-top: 9px; line-height: 1.2; }
.stat .v small { font-size: 12.5px; font-weight: 400; color: var(--ink-4); margin-left: 3px; }
.stat .s { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

.panel { padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  margin: -2px 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 {
  font-size: 14.5px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.panel-head .spacer { flex: 1; }
.panel-head .hint { margin: 0; }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.check .st { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.check.ok .st { background: var(--ok); }
.check.bad .st { background: var(--bad); }
.check .cs {
  margin-left: auto; font-size: 11.5px; color: var(--ink-4);
  max-width: 58%; text-align: right; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.check.bad { border-color: #F3C6C1; background: #FFFCFC; }

.log-row { cursor: pointer; }
.log-lv { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
.log-lv.error { color: var(--bad); }
.log-lv.warn { color: var(--warn); }
.log-lv.info { color: var(--ink-3); }
.detail-box {
  margin-top: 12px; padding: 12px; border-radius: 8px;
  background: #0F1B2A; color: #CFE0F2; font-family: var(--mono);
  font-size: 11.8px; line-height: 1.7; white-space: pre-wrap;
  max-height: 300px; overflow: auto;
}

/* ---------------- 弹层 ---------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16, 24, 40, .38);
  display: none; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px);
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; font-weight: 600; margin: 0; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: #FBFCFD; }

.drop {
  border: 1.5px dashed #CBD5E1; border-radius: 10px;
  padding: 26px 18px; text-align: center; background: #FBFCFD;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--brand-2); background: #F6FAFE; }
.drop .i { width: 22px; height: 22px; color: var(--ink-4); margin-bottom: 8px; }
.drop b { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 3px; }
.drop span { font-size: 12px; color: var(--ink-4); }
.file-picked { display: none; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.file-picked.show { display: flex; }

.preview-frame { width: 100%; height: min(72vh, 720px); border: 1px solid var(--line); border-radius: 8px; background: #F7F8FA; }
.preview-note { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }

.progress-line { height: 3px; background: #EDF0F3; border-radius: 2px; overflow: hidden; margin-top: 12px; }
.progress-line > i { display: block; height: 100%; width: 30%; background: var(--brand-2); border-radius: 2px; animation: slide 1.1s infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  background: #101828; color: #fff; font-size: 13px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .24);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
  max-width: min(560px, calc(100vw - 40px));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #7A1C14; }

/* ---------------- 响应式 ---------------- */

/* 中屏：光场不变，只是内容收窄、卡片与品牌并排更紧 */
@media (max-width: 1120px) {
  .login-stage { padding: 48px 36px 88px; }
  .login-content { grid-template-columns: 1fr 340px; gap: 48px; }
  .brand-name { font-size: 32px; letter-spacing: .24em; }
  .brand-line { font-size: 14.5px; }
  .lamp { width: 190px; }
  .light-cone { width: 760px; }
  .light-core { width: 360px; }
  .floor-glow { width: 660px; }
}

/* 窄屏：改成上下排布，光场仍然铺满整屏 */
@media (max-width: 860px) {
  .login-stage { padding: 44px 24px 92px; align-content: center; }
  .login-content {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 400px;
  }
  .brand-block { text-align: left; }
  .brand-name { font-size: 26px; letter-spacing: .2em; }
  .brand-en { letter-spacing: .42em; margin-top: 9px; }
  .brand-rule { margin: 18px 0 16px; width: 34px; }
  .brand-line { font-size: 13px; line-height: 1.85; }
  .login-card { padding: 28px 24px 22px; }
  .lamp { top: 6%; width: 150px; }
  .light-cone { top: 6%; height: 92%; width: 640px; }
  .light-core { top: 6%; height: 78%; width: 300px; }
  .floor-glow { width: 560px; }
  .stage-foot { padding: 0 24px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: 10.5px; }
}

/* 中小屏：资料表让出"更新时间"一列，保证行操作按钮不被挤出卡片 */
@media (max-width: 1200px) {
  #view-docs table.tbl { min-width: 620px; }
  #view-docs table.tbl th:nth-child(5),
  #view-docs table.tbl td:nth-child(5) { display: none; }
  #view-docs table.tbl th,
  #view-docs table.tbl td { padding-left: 12px; padding-right: 12px; }
}

/* 窄屏：面板标题允许换行，长说明落到下一行 */
@media (max-width: 700px) {
  .panel-head { flex-wrap: wrap; }
  .panel-head .hint { flex: 1 1 100%; }
  .panel-head .search { width: 100% !important; }
  .panel-head .select { width: 120px !important; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* 手机：顶栏收紧，标题与操作分行 */
@media (max-width: 560px) {
  .appbar { gap: 8px; padding: 0 10px; }
  .appbar .mark .wordmark { font-size: 14.5px; letter-spacing: .12em; }
  .nav { margin-left: 2px; gap: 0; }
  .nav a { padding: 0 9px; }
  .mode-badge { padding: 0 7px; }
  #userName { display: none; }
  .user-chip { padding: 0 5px; gap: 0; }
  .content-head > div:first-child { flex: 1 1 100%; }
  .content-head .spacer { display: none; }
  .toolbar .search { width: 100%; }
}

/* 手机：只保留品牌 + 表单，动效减到最省 */
@media (max-width: 560px) {
  .login-stage { padding: 36px 20px 84px; }
  .brand-name { font-size: 22px; letter-spacing: .18em; }
  .brand-line { display: none; }
  .brand-rule { margin: 14px 0 0; }
  .login-card { padding: 26px 22px 20px; }
  .login-card h1 { margin-bottom: 22px; }
  .light-cone { width: 520px; }
  .light-core { width: 240px; }
  .floor-glow { width: 460px; }
}

/* 矮屏：压缩留白，保证表单完整可见 */
@media (max-height: 720px) and (min-width: 861px) {
  .login-stage { padding: 30px 48px 40px; }
  .brand-name { font-size: 32px; }
  .brand-rule { margin: 20px 0 18px; }
  .login-card { padding: 26px 28px 22px; }
  .stage-foot { display: none; }
}
@media (max-height: 620px) {
  .brand-line { display: none; }
  .brand-rule { margin-bottom: 0; }
}

/* 应用界面（与登录页无关） */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content, .admin { padding: 18px 16px 32px; }
  .appbar { gap: 10px; padding: 0 14px; }
  .appbar .mark .mark-rule, .appbar .mark .mark-sub { display: none; }
  .nav a span { display: none; }
  .composer-wrap { padding: 8px 14px 14px; }
  .name { max-width: 180px; }
}

/* =====================================================================
   细节打磨：滚动条、聚焦态、搜索框、空态、日志行
   ===================================================================== */

/* 滚动条：细、浅、不抢视线（Chrome / Edge / Safari / 鸿蒙） */
* { scrollbar-width: thin; scrollbar-color: #D3DAE3 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #D8DEE6; border-radius: 8px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #C0C9D4; background-clip: content-box; }

/* 键盘操作才显示焦点环，鼠标点击不出现 */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid rgba(30, 90, 148, .5);
  outline-offset: 2px;
}

/* 搜索框：聚焦时图标跟着变深，边界更清楚 */
.search:focus-within .i { color: var(--brand-2); }
.search .i { transition: color .15s; }

/* 资料行操作按钮：悬停给出浅底，避免"三个小图标悬空" */
.row-actions .icon-btn:hover { background: #EEF2F6; }

/* 空态：给个柔和的底，不再是一片空白 */
/* 只有"简单空态"的那一枚图标带底；按钮和说明里的图标保持原样 */
.empty > .i {
  width: 34px; height: 34px; padding: 8px;
  border-radius: 10px; background: var(--brand-soft);
  color: var(--brand-2); box-sizing: content-box;
}

/* 自检项：正常项也带一点底色，读起来有层次 */
.check { background: #FCFDFE; }
.check.ok { border-color: #DDEBE2; background: #FCFEFD; }
.check.ok .st { box-shadow: 0 0 0 3px rgba(6, 118, 71, .1); }
.check.bad .st { box-shadow: 0 0 0 3px rgba(180, 35, 24, .1); }

/* 日志行：可点的地方要有反馈 */
.log-row:hover td { background: #F8FAFC; }
.log-row.open td { background: var(--brand-soft); }

/* 推荐问题：轻描边 + 悬停上浮 */
.chip { transition: border-color .15s, background .15s, color .15s, transform .15s; }
.chip:hover { transform: translateY(-1px); }

/* 弹窗：标题左侧一道短光条，与页面标题呼应 */
.modal-head h3::before {
  content: ""; display: inline-block; vertical-align: -1px;
  width: 3px; height: 14px; margin-right: 9px; border-radius: 2px;
  background: linear-gradient(180deg, #2C6BA6 0%, #163B63 100%);
}

/* =====================================================================
   触屏设备（iOS / 鸿蒙 / 安卓 / 平板）
   ===================================================================== */

/* iOS 在输入框字号小于 16px 时会自动放大页面，这里统一提到 16px */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  .login-card .input { font-size: 16px; height: 46px; }
  .login-btn { height: 48px; }
  .btn { height: 38px; }
  .icon-btn { width: 32px; height: 32px; }
  .cat-list li button { height: 38px; }
  .dd-item { height: 40px; }

  /* 触屏没有 hover：行内操作与分类管理必须常显，否则等于没有入口 */
  .row-actions { opacity: 1; }
  .cat-list li.has-acts .cat-acts { display: flex; background: #102A44; }
  .cat-list li.has-acts .count { visibility: hidden; }
  .cat-list li.has-acts button { padding-right: 54px; }
}

/* 横屏手机：高度只有 400 左右，压掉文案，只留字标 + 表单 */
@media (max-height: 560px) and (orientation: landscape) {
  .login-stage { padding: 16px 24px; }
  .login-content { grid-template-columns: 1fr; max-width: 380px; gap: 12px; }
  .brand-line, .brand-rule, .brand-en { display: none; }
  .brand-name { font-size: 19px; letter-spacing: .2em; }
  .login-card { padding: 18px 22px 16px; }
  .login-card h1 { font-size: 17px; margin-bottom: 14px; }
  .card-sub { margin-bottom: 14px; }
  .login-card .field { margin-bottom: 12px; }
  .stage-foot { display: none; }
}

/* 刘海屏横屏：左右让出安全区 */
@media (orientation: landscape) {
  .login-content {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* 超小屏（iPhone SE 一代 / 老安卓 320px） */
@media (max-width: 360px) {
  .login-stage { padding: 24px 14px 76px; }
  .login-card { padding: 22px 18px 16px; }
  .brand-name { font-size: 19px; }
  .modal-mask { padding: 12px; }
  .content, .admin { padding: 14px 12px 28px; }
}

@media print {
  .appbar, .sidebar, .composer-wrap, .row-actions { display: none !important; }
}

/* =====================================================================
   用户菜单 / 个人主页 / 分类管理 / 参考文献
   ===================================================================== */

.user-wrap { position: relative; }
.user-chip { border: 0; cursor: pointer; }
.user-chip:hover { background: #EEF1F4; }
.user-chip .avatar { pointer-events: none; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 228px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 70;
}
.dropdown.show { display: block; animation: pop .12s ease-out; }
.dropdown-head {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.dropdown-head b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-head span { font-size: 11.5px; color: var(--ink-4); }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; border-radius: 50%; }
.avatar.xl { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.dd-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 10px; border: 0; border-radius: 7px;
  background: none; font-size: 13.5px; color: var(--ink-2); text-align: left;
}
.dd-item:hover { background: #F5F6F8; color: var(--ink); }
.dd-item .i { color: var(--ink-4); }
.dd-item:hover .i { color: var(--ink-3); }
.dd-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }

.profile-top { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.profile-top b { display: block; font-size: 16px; font-weight: 600; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.profile-stats > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px; text-align: center; }
.profile-stats b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.profile-stats span { font-size: 11.5px; color: var(--ink-4); }
.panel-sect { margin-top: 20px; }
.panel-sect h4 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 9px; }

/* 分类项操作 */
.cat-list li { position: relative; }
.cat-list .cat-acts {
  position: absolute; right: 3px; top: 5px; display: none; gap: 1px;
  padding-left: 12px;
  background: linear-gradient(90deg, rgba(16, 42, 68, 0) 0%, #12293F 34%);
}
.cat-list li:hover .cat-acts { display: flex; }
.cat-list li.has-acts:has(button.active) .cat-acts {
  background: linear-gradient(90deg, rgba(38, 62, 86, 0) 0%, #263E56 34%);
}
.cat-list li:hover .count { visibility: hidden; }
.cat-list .cat-acts .icon-btn { width: 24px; height: 24px; }
.cat-list .cat-acts .icon-btn .i { width: 13px; height: 13px; }

/* 参考文献 */
.refs { margin-top: 13px; }
.refs-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 7px;
}
.refs-head .i { width: 13px; height: 13px; }
.ref {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #FCFDFE; cursor: pointer; transition: border-color .15s, background .15s;
}
.ref + .ref { margin-top: 7px; }
.ref:hover { border-color: #B9CFE5; background: #F8FBFE; }
.ref .no {
  width: 18px; height: 18px; flex: none; border-radius: 5px; margin-top: 1px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.ref .ref-body { min-width: 0; flex: 1; }
.ref .ref-title { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.ref .ref-snip {
  font-size: 12px; color: var(--ink-3); line-height: 1.62; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ref .ref-cat { font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.ref .ref-open { margin-left: auto; align-self: center; color: var(--brand-2); font-size: 12px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.ref .ref-open .i { width: 12px; height: 12px; }
.ref.suggest { background: #FFFDF7; border-color: #F0E2C4; }
.ref.suggest:hover { background: #FFF9EC; border-color: #E4CFA4; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .content, .admin { padding: 18px 16px 32px; }
  .appbar { gap: 10px; padding: 0 14px; }
  .appbar .mark span { display: none; }
  .nav a span { display: none; }
  .composer-wrap { padding: 8px 14px 14px; }
  .name { max-width: 180px; }
  .profile-stats { grid-template-columns: 1fr 1fr 1fr; }
  .dropdown { width: 200px; }
}
