:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --sidebar: #0f1f3d;
  --sidebar-soft: #1a2b4d;
  --shadow: 0 14px 36px rgba(15, 23, 42, .07);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; position: fixed; inset: 0 auto 0 0; background: linear-gradient(180deg, #0e1d38 0%, #12264a 100%); color: #fff; display: flex; flex-direction: column; padding: 24px 16px; z-index: 30; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 8px 18px rgba(37,99,235,.35); }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.brand-sub { font-size: 12px; color: #a9b8d5; margin-top: 3px; }
.nav-list { display: flex; flex-direction: column; gap: 7px; margin-top: 24px; }
.nav-item { border: 0; width: 100%; color: #becce5; background: transparent; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; transition: .2s ease; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(59,130,246,.35), rgba(59,130,246,.14)); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav-icon { width: 23px; font-size: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.connection-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #d9e3f4; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.12); }
.connection-pill.online .status-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.13); }
.version { font-size: 11px; color: #8093b6; margin-top: 9px; }
.workspace { margin-left: 248px; width: calc(100% - 248px); min-height: 100vh; }
.topbar { height: 86px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.global-search { width: min(360px, 32vw); height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); }
.global-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
kbd { font-size: 10px; padding: 3px 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: #94a3b8; }
.main-content { padding: 26px 30px 50px; max-width: 1600px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.hero-card { min-height: 180px; padding: 30px 34px; color: #fff; border-radius: 22px; background: radial-gradient(circle at 85% 10%, rgba(147,197,253,.36), transparent 30%), linear-gradient(135deg, #1d4ed8, #2563eb 58%, #3b82f6); display: flex; align-items: center; justify-content: space-between; gap: 28px; box-shadow: 0 18px 40px rgba(37,99,235,.2); }
.hero-card h2 { margin: 8px 0 9px; max-width: 760px; line-height: 1.36; font-size: 25px; }
.hero-card p { margin: 0; color: #dceaff; font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; color: #bfdbfe; }
.primary-btn, .ghost-btn, .text-btn, .back-btn, .icon-btn { border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 700; transition: .18s ease; }
.primary-btn { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.hero-card .primary-btn { background: #fff; color: var(--primary-dark); box-shadow: none; white-space: nowrap; }
.ghost-btn { background: #fff; color: #334155; border: 1px solid var(--line); }
.ghost-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.text-btn, .back-btn { background: transparent; color: var(--primary); padding: 7px 8px; }
.text-btn:hover, .back-btn:hover { background: var(--primary-soft); }
.icon-btn { background: transparent; padding: 8px; font-size: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 20px 0; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 30px; font-weight: 850; margin: 12px 0 8px; letter-spacing: -.02em; }
.metric-value.small { font-size: 20px; margin-top: 17px; }
.metric-value.warning { color: var(--warning); }
.metric-note { font-size: 12px; color: #94a3b8; }
.dashboard-grid, .system-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.span-2 { grid-column: span 2; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 800; }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.content-list { display: flex; flex-direction: column; gap: 10px; }
.content-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: #fff; transition: .18s ease; cursor: pointer; }
.content-card:hover { border-color: #bfdbfe; box-shadow: 0 8px 20px rgba(37,99,235,.07); transform: translateY(-1px); }
.content-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.content-card h4 { margin: 0; font-size: 14px; line-height: 1.45; }
.content-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-meta { margin-top: 10px; display: flex; gap: 8px 14px; flex-wrap: wrap; color: #94a3b8; font-size: 11px; }
.compact .content-card { padding: 12px 14px; }
.compact .content-card p { -webkit-line-clamp: 1; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { background: #f1f5f9; color: #475569; border-radius: 7px; padding: 4px 7px; font-size: 10px; }
.review-list { display: flex; flex-direction: column; gap: 9px; }
.review-item { border-left: 3px solid #f59e0b; padding: 10px 10px 10px 12px; background: #fffbeb; border-radius: 0 10px 10px 0; cursor: pointer; }
.review-item.danger { border-color: #ef4444; background: #fef2f2; }
.review-item strong { display: block; font-size: 12px; line-height: 1.5; }
.review-item span { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }
.topic-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.topic-mini { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-soft); cursor: pointer; }
.topic-mini:hover { border-color: #bfdbfe; }
.topic-mini strong { display: block; font-size: 13px; line-height: 1.5; }
.topic-mini span { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; }
.status-stack { display: flex; flex-direction: column; gap: 2px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-row strong { text-align: right; font-size: 12px; }
.toolbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.search-row { display: flex; gap: 10px; }
.wide-search { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); display: flex; align-items: center; gap: 8px; padding: 0 12px; flex: 1; color: var(--muted); }
.wide-search input { width: 100%; border: 0; background: transparent; outline: 0; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)) auto; gap: 12px; margin-top: 14px; }
.filter-row.compact-filters { grid-template-columns: repeat(2, minmax(180px, 260px)); }
.filter-row label, .settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.filter-row select, .filter-row input, .settings-form input { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; outline: 0; color: var(--text); }
.filter-row select:focus, .filter-row input:focus, .settings-form input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px #dbeafe; }
.align-end { align-self: end; }
.library-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.content-results-panel { min-height: 620px; }
.view-switch { border: 1px solid var(--line); border-radius: 9px; display: flex; overflow: hidden; }
.switch-btn { border: 0; background: #fff; padding: 7px 10px; color: var(--muted); font-size: 11px; }
.switch-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.content-list.table-mode .content-card { border-radius: 0; border-width: 0 0 1px; box-shadow: none; padding: 14px 4px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.plain-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 2; }
.callout { margin-top: 18px; background: var(--primary-soft); color: #1e40af; border-radius: 12px; padding: 13px; font-size: 11px; line-height: 1.7; }
.back-btn { margin: 0 0 14px; }
.detail-shell { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.detail-main, .detail-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.detail-title { margin: 0; font-size: 23px; line-height: 1.4; }
.detail-subtitle { color: var(--muted); font-size: 12px; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.detail-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; font-size: 15px; }
.detail-text { white-space: pre-wrap; line-height: 1.8; font-size: 13px; color: #334155; overflow-wrap: anywhere; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-box { background: var(--surface-soft); border-radius: 11px; padding: 12px; }
.info-box span { display: block; color: var(--muted); font-size: 10px; }
.info-box strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.review-actions button { width: 100%; }
.discussion-layout { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(420px, 1.15fr); gap: 18px; }
.discussion-list { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 260px); overflow: auto; padding-right: 4px; }
.discussion-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; cursor: pointer; }
.discussion-card:hover, .discussion-card.active { border-color: #93c5fd; background: #f8fbff; }
.discussion-card h4 { margin: 0; font-size: 13px; line-height: 1.5; }
.discussion-card p { margin: 7px 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
.discussion-detail-panel { min-height: 580px; }
.timeline { display: flex; flex-direction: column; gap: 12px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-left: 34px; }
.timeline-dot { position: absolute; left: 3px; top: 5px; width: 16px; height: 16px; border: 4px solid #dbeafe; background: var(--primary); border-radius: 50%; z-index: 1; }
.timeline-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #fff; }
.timeline-role { font-size: 10px; font-weight: 800; color: var(--primary); }
.timeline-card p { margin: 7px 0 0; color: #334155; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.topic-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topic-toolbar h2 { margin: 0; font-size: 20px; }
.topic-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.topic-search { max-width: 380px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.topic-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow); cursor: pointer; transition: .18s ease; }
.topic-card:hover { transform: translateY(-2px); border-color: #bfdbfe; }
.topic-card h3 { margin: 12px 0 8px; font-size: 15px; line-height: 1.5; }
.topic-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; min-height: 38px; }
.topic-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.topic-stats div { background: var(--surface-soft); border-radius: 9px; padding: 9px; text-align: center; }
.topic-stats strong { display: block; font-size: 14px; }
.topic-stats span { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.settings-form .check-row, .settings-form .button-row { grid-column: 1 / -1; }
.check-row { flex-direction: row !important; align-items: center; }
.password-row { display: flex; gap: 8px; }
.password-row input { flex: 1; min-width: 0; }
.button-row { display: flex; gap: 10px; }
.security-note { margin-top: 14px; font-size: 11px; color: #92400e; background: #fffbeb; border-radius: 10px; padding: 11px; line-height: 1.6; }
.status-big { font-size: 20px; font-weight: 850; margin: 14px 0; }
.status-stack.mini .status-row { padding: 8px 0; }
.full { width: 100%; margin-top: 14px; }
.rule-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.rule-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.rule-card strong, .rule-card span, .rule-card small { display: block; }
.rule-card span { margin-top: 8px; font-size: 13px; }
.rule-card small { margin-top: 5px; color: var(--muted); line-height: 1.5; }
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-row { display: grid; grid-template-columns: 145px 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 11px; }
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--muted); }
.log-row strong { color: var(--primary); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 36px; color: #93c5fd; }
.empty-state h3 { color: #334155; margin: 12px 0 6px; }
.skeleton { border-radius: 10px; min-height: 18px; background: linear-gradient(90deg, #f1f5f9 25%, #e8eef5 37%, #f1f5f9 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.toast { position: fixed; right: 28px; top: 96px; z-index: 100; padding: 11px 16px; border-radius: 11px; color: #fff; background: #0f172a; box-shadow: 0 12px 30px rgba(15,23,42,.2); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; max-width: 420px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #991b1b; }
.toast.success { background: #166534; }
.mobile-only, .mobile-overlay { display: none; }
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .system-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-2 { grid-column: span 2; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-row { grid-template-columns: repeat(3, minmax(120px,1fr)); }
  .library-layout { grid-template-columns: 1fr; }
  .filter-help-panel { display: none; }
  .rule-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px rgba(15,23,42,.2); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; width: 100%; }
  .mobile-only { display: inline-flex; }
  .mobile-overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 25; opacity: 0; pointer-events: none; transition: .2s; }
  .mobile-overlay.show { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 18px; }
  .topbar-right .global-search { display: none; }
  .main-content { padding: 20px 18px 40px; }
  .detail-shell, .discussion-layout { grid-template-columns: 1fr; }
  .discussion-list { max-height: none; }
  .topic-toolbar { flex-direction: column; align-items: stretch; }
  .topic-search { max-width: none; }
}
@media (max-width: 640px) {
  .topbar { height: 76px; }
  .topbar p { display: none; }
  .topbar h1 { font-size: 19px; }
  .topbar-right .ghost-btn { display: none; }
  .hero-card { padding: 23px; flex-direction: column; align-items: flex-start; }
  .hero-card h2 { font-size: 21px; }
  .metric-grid, .dashboard-grid, .system-grid, .topic-grid, .topic-preview-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .filter-row, .filter-row.compact-filters, .settings-form, .rule-grid { grid-template-columns: 1fr; }
  .settings-form .check-row, .settings-form .button-row { grid-column: auto; }
  .search-row, .button-row { flex-direction: column; }
  .topic-grid { gap: 12px; }
  .info-grid { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; gap: 4px; }
  .toast { left: 18px; right: 18px; top: 84px; }
}


/* V1.1.0 聊天内容时间线 */
.content-list.timeline-mode { display: block; }
.chat-day { margin: 0 0 24px; }
.chat-day-head { position: sticky; top: 80px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(248,250,252,.96); backdrop-filter: blur(8px); color: #334155; }
.chat-day-head span { font-size: 12px; font-weight: 850; }
.chat-day-head small { color: var(--muted); }
.chat-timeline { position: relative; }
.chat-timeline::before { content: ""; position: absolute; left: 76px; top: 9px; bottom: 9px; width: 2px; background: #dbeafe; }
.chat-event { position: relative; display: grid; grid-template-columns: 58px 20px minmax(0,1fr); gap: 10px; padding: 7px 0; cursor: pointer; }
.chat-event-time { padding-top: 12px; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-event-dot { position: relative; z-index: 1; align-self: start; width: 12px; height: 12px; margin: 13px 0 0 4px; border: 3px solid #dbeafe; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px #fff; }
.chat-event-dot.resource { background: #7c3aed; border-color: #ede9fe; }
.chat-event-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; transition: .16s ease; }
.chat-event:hover .chat-event-card { border-color: #93c5fd; box-shadow: 0 8px 24px rgba(37,99,235,.08); transform: translateY(-1px); }
.chat-event-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chat-event-top > div { min-width: 0; }
.chat-event-top strong { display: block; font-size: 12px; color: #0f172a; }
.chat-event-top div > span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.chat-event-card h4 { margin: 10px 0 6px; font-size: 14px; line-height: 1.55; }
.chat-event-card p { margin: 0; color: #475569; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-message-chain { position: relative; display: flex; flex-direction: column; gap: 12px; }
.mini-message-chain::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.mini-chain-item { position: relative; display: grid; grid-template-columns: 14px minmax(0,1fr); gap: 10px; }
.mini-chain-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 4px; border: 3px solid #dbeafe; border-radius: 50%; background: var(--primary); }
.mini-chain-item strong, .mini-chain-item small { display: block; }
.mini-chain-item strong { font-size: 12px; }
.mini-chain-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mini-chain-item p { margin: 5px 0 0; color: #475569; font-size: 11px; line-height: 1.65; }
.sender-id-box { padding: 9px 10px; border-radius: 9px; background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px !important; word-break: break-all; }
.field-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
@media (max-width: 640px) {
  .chat-day-head { top: 76px; }
  .chat-timeline::before { left: 48px; }
  .chat-event { grid-template-columns: 32px 18px minmax(0,1fr); gap: 7px; }
  .chat-event-time { font-size: 9px; }
  .chat-event-card { padding: 12px; }
  .chat-event-top { flex-direction: column; }
}

/* V1.2.0：附件预览、人工修改、返回位置恢复与悬浮回顶 */
.pagination.pagination-top { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.detail-section-head, .side-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-section-head h3, .side-section-head h3 { margin: 0; }
.detail-section-head span { color: var(--muted); font-size: 11px; }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.resource-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.resource-image-link { display: block; background: #eef2f7; aspect-ratio: 16 / 10; overflow: hidden; }
.resource-image { display: block; width: 100%; height: 100%; object-fit: contain; background: #eef2f7; }
.resource-file-icon { min-height: 130px; display: grid; place-items: center; background: linear-gradient(135deg,#eff6ff,#eef2ff); color: var(--primary); font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.resource-card-body { padding: 13px; }
.resource-card-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.resource-card-body > span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.resource-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 8px 11px; font-size: 11px; }
.resource-loading, .resource-empty { grid-column: 1 / -1; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.7; }
.resource-empty.error { color: var(--danger); background: var(--danger-soft); border-color: #fecaca; }
.manual-editor { display: none; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.manual-editor.open { display: flex; flex-direction: column; gap: 12px; }
.manual-editor label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; }
.manual-editor input, .manual-editor textarea, .manual-editor select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 11px; color: var(--text); outline: 0; resize: vertical; }
.manual-editor input:focus, .manual-editor textarea:focus, .manual-editor select:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px #dbeafe; }
.manual-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.manual-editor-actions button { flex: 1; min-width: 120px; }
.floating-top-btn { position: fixed; right: 28px; bottom: 28px; z-index: 90; width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; display: none; place-items: center; align-content: center; gap: 0; color: #fff; background: rgba(37,99,235,.62); box-shadow: 0 10px 28px rgba(15,23,42,.22); backdrop-filter: blur(8px); opacity: .72; user-select: none; touch-action: none; cursor: grab; font-weight: 900; line-height: 1; }
.floating-top-btn.show { display: grid; }
.floating-top-btn:hover { opacity: .95; }
.floating-top-btn.dragging { cursor: grabbing; opacity: .9; }
.floating-top-btn span { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; }
@media (max-width: 760px) {
  .resource-grid { grid-template-columns: 1fr; }
  .floating-top-btn { width: 52px; height: 52px; right: 18px; bottom: 18px; }
}
