/* 人文助手 全局样式：现代靛蓝 + 浅灰蓝底，轻盈科技的智能工作平台风 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 对话字体（协同写作页可选，仅影响页面显示；均为 SIL OFL 开源字体，子集化后本地托管于
   static/fonts/——仅含 GB2312 常用 6763 汉字与标点拉丁，单个 1.5~2.5MB，缺字自动回退下一字体。
   浏览器仅在用到时才下载对应字体，默认「仿宋」不产生任何额外流量） */
@font-face {
  font-family: 'Noto Serif SC';          /* 思源宋体（可变字重） */
  src: url('../fonts/noto-serif-sc.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';           /* 思源黑体（可变字重） */
  src: url('../fonts/noto-sans-sc.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'LXGW WenKai';            /* 霞鹜文楷（常规体） */
  src: url('../fonts/wenkai.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --primary: #2b5ce6;
  --primary-hover: #1f49c4;
  --primary-soft: #eaf0fe;
  --accent: #c7000b;              /* 党建红：仅少量点缀 */
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #202634;
  --text-secondary: #6a7488;
  --border: #e5e9f2;
  --success: #16a34a;
  --warning: #b45309;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 4px 8px rgba(16, 24, 40, 0.05), 0 12px 28px rgba(43, 92, 230, 0.1);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 内联 SVG 图标：随文字颜色，统一垂直对齐 */
.ic { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  background: var(--card);
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-logo { width: 38px; height: 38px; flex-shrink: 0; }
.sidebar .brand h1 { font-size: 17px; color: #071a45; letter-spacing: 1.5px; line-height: 1.3; }
.sidebar .brand p { font-size: 11px; color: #53739b; margin-top: 2px; line-height: 1.4; }
.sidebar nav { flex: 1; padding: 14px 10px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 3px;
  border-radius: 9px;
  color: #4b5568;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a .icon { width: 20px; display: flex; align-items: center; justify-content: center; }
.sidebar nav a:hover { background: #f2f5fb; color: var(--primary); text-decoration: none; }
.sidebar nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar .footer {
  padding: 14px 18px; font-size: 12px; color: var(--text-secondary);
  border-top: 1px solid var(--border); line-height: 1.5;
}
.sidebar .footer .ver { margin-top: 4px; font-size: 11px; color: #9aa3b5; letter-spacing: 0.3px; }
.sidebar .footer .ver-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 3px 8px 3px 0;
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 11px; color: #8b95a8; letter-spacing: 0.2px;
  border-radius: 6px; transition: color .12s, background .12s;
}
.sidebar .footer .ver-btn:hover {
  color: var(--primary); background: rgba(43, 92, 230, 0.06);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .page-title { font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
.topbar .user { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; }
.topbar .user a { margin-left: 12px; color: var(--text-secondary); }
.topbar .user a:hover { color: var(--primary); }
.topbar .user .logout-form { display: inline; margin: 0; }
/* 顶栏文字按钮：加内边距扩大可点击区域（约 36px 高），提升可访问性 */
.topbar .user .logout-form button {
  margin-left: 12px; color: var(--text-secondary);
  background: none; border: none; padding: 8px 4px; font: inherit; cursor: pointer;
}
.topbar .user .logout-form button:hover { color: var(--primary); }
.topbar .user .acct-btn {
  margin-left: 12px; color: var(--text-secondary);
  background: none; border: none; padding: 8px 4px; font: inherit; cursor: pointer;
}
.topbar .user .acct-btn:hover { color: var(--primary); }

.content { padding: 26px 28px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.2px; }
.card h3::before { content: ""; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; box-shadow: 0 4px 12px rgba(43, 92, 230, 0.28); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { color: #fff; box-shadow: 0 4px 12px rgba(199, 0, 11, 0.24); }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 7px; min-height: 30px; }
.btn-danger-outline { color: var(--danger); }
.btn-danger-outline:hover { border-color: var(--danger); color: var(--danger); }
/* 纯图标小按钮（如项目设置、新建） */
.btn-icon { padding: 4px 7px; }

input[type="text"], input[type="password"], input[type="date"], input[type="url"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 92, 230, 0.12); }
/* 键盘焦点可见：为链接、按钮等可交互元素提供统一焦点环（输入框已有描边+光晕） */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 6px;
}
input[type="checkbox"] { accent-color: var(--primary); }
textarea { resize: vertical; }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 5px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }

/* 简报生成：日期 + 按钮同一行，按钮贴输入框底对齐，避免被 flex:1 拉歪 */
.digest-gen-row {
  align-items: flex-end;
}
.digest-gen-row > .field {
  margin-bottom: 0;
  flex: 1 1 160px;
  min-width: 160px;
}
.digest-gen-row .digest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: auto;
  padding-bottom: 1px; /* 与 input 底边视觉对齐 */
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}
.tag .tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag.red { background: #fdecec; color: var(--accent); }
.tag.green { background: #e7f6ec; color: var(--success); }
.tag.gray { background: #f1f3f7; color: var(--text-secondary); }
.tag.amber { background: #fdf3e3; color: var(--warning); }

.muted { color: var(--text-secondary); font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.ml6 { margin-left: 6px; } .ml8 { margin-left: 8px; }
.mt6 { margin-top: 6px; }
.fw-normal { font-weight: normal; }
.text-12 { font-size: 12px; }
.overflow-hidden { overflow: hidden; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.flex-start { align-items: flex-start; }
.flex-end { align-items: flex-end; }
.items-center { align-items: center; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grow-0 { flex-grow: 0; }
.shrink-0 { flex-shrink: 0; }
.w-auto { width: auto; }
.max-w-120 { max-width: 120px; }
.max-w-130 { max-width: 130px; }
.min-w-48 { min-width: 48px; }
.min-w-100 { min-width: 100px; }
.ws-nowrap { white-space: nowrap; }
.ws-pre { white-space: pre-wrap; }
.break-all { word-break: break-all; }
.italic { font-style: italic; }
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.hidden-input { display: none; }
.card-title-inline { margin: 0; }
.subhead { font-size: 14px; }
.meta-tiny { min-width: 48px; font-size: 12px; padding-top: 8px; }
.item-static { cursor: default; padding: 8px 4px; }
.item-pick { cursor: pointer; padding: 6px 10px; }
.item-list-sm { max-height: 160px; overflow-y: auto; margin-bottom: 8px; }
.item-list-lg { max-height: 360px; overflow-y: auto; }
.field-check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.field-check input[type="checkbox"] { width: auto; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 840px; }
.modal-sm { max-width: 440px; }
.card-soft { background: #fafbfd; }
.empty-pad { padding: 16px 0; }
.form-actions-end { display: flex; align-items: flex-end; }

/* 图标柔光色块（统计卡 / 功能入口共用） */
.tint-blue { background: var(--primary-soft); color: var(--primary); }
.tint-green { background: #e7f6ec; color: var(--success); }
.tint-amber { background: #fdf3e3; color: var(--warning); }
.tint-purple { background: #f1edfd; color: #6d4fc4; }
.tint-red { background: #fdecec; color: var(--accent); }

/* 提示条 */
.notice { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.notice.info { background: #eef4fe; color: #2456c8; border: 1px solid #d8e4fb; }
.notice.success { background: #e7f6ec; color: var(--success); border: 1px solid #c9ead4; }
.notice.error { background: #fdecec; color: var(--danger); border: 1px solid #f6caca; }
.notice a { font-weight: 600; }

/* 全站配置横幅 */
#config-banner .config-banner-item { margin-bottom: 10px; }
#config-banner .config-banner-item:last-child { margin-bottom: 14px; }

/* 设置页状态卡 / 预设按钮 */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.status-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafbfe;
}
.status-item .tag { margin-bottom: 6px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-list .item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 设置页：左侧二级导航 + 右侧内容（拆分自原单页全部板块堆叠） */
.settings-layout {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px;
  align-items: start;
}
.settings-nav {
  position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow);
}
.settings-nav a {
  padding: 9px 12px; border-radius: 8px; font-size: 13px;
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
}
.settings-nav a:hover { background: #f2f5fb; color: var(--primary); text-decoration: none; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* 窄内容卡片（如修改密码）限宽，避免表单被拉得过宽 */
.settings-card-narrow { max-width: 560px; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* 列表 */
.item-list .item {
  padding: 14px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}
.item-list .item:last-child { border-bottom: none; }
.item-list .item:hover { background: #f7f9fd; }
.item .item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.item .item-title:hover { color: var(--primary); }
.item .item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.item .item-summary { font-size: 13px; color: #4b5563; margin-top: 6px; }

/* 分页 */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 760px; max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
.modal .modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal .modal-head b { font-size: 15px; }
.modal .modal-body { padding: 20px 22px; overflow-y: auto; }
.modal .modal-close {
  cursor: pointer; color: var(--text-secondary);
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.modal .modal-close:hover { background: #f1f3f8; color: var(--text); }

/* 简报完成结果卡 */
.digest-result { margin-bottom: 14px; }

/* 版本更新公告 */
.version-ann-mask { z-index: 200; }
.version-ann-modal { max-width: 560px; }
.version-ann-modal .modal-body { max-height: 50vh; }
.version-ann-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 22px 0;
}
.version-ann-tab {
  padding: 3px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); background: #fff; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.version-ann-tab:hover { border-color: var(--primary); color: var(--primary); }
.version-ann-tab.active {
  background: var(--primary-soft); color: var(--primary);
  border-color: transparent; font-weight: 600;
}
.version-ann-meta { margin-bottom: 12px; font-size: 12px; }
.version-ann-body { font-size: 13px; line-height: 1.75; color: var(--text); }
.version-ann-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* 历史版本更新（侧栏版本号点开） */
.changelog-mask { z-index: 200; }
.changelog-modal {
  max-width: 760px; width: min(760px, 94vw);
  max-height: min(86vh, 820px);
  display: flex; flex-direction: column;
}
.changelog-modal .modal-body {
  flex: 1; min-height: 0; max-height: none;
  padding: 0; display: flex; overflow: hidden;
}
.changelog-layout {
  display: grid; grid-template-columns: 200px 1fr;
  min-height: 0; flex: 1; width: 100%;
}
.changelog-list {
  border-right: 1px solid var(--border); background: #f7f9fd;
  overflow-y: auto; padding: 10px 8px; min-height: 0;
}
.changelog-item {
  display: block; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 4px;
  cursor: pointer; font-family: inherit; color: var(--text);
  transition: background .12s, border-color .12s;
}
.changelog-item:hover { background: #fff; border-color: #e2e8f4; }
.changelog-item.on {
  background: #fff; border-color: #cdd9f5;
  box-shadow: 0 2px 8px rgba(43, 92, 230, 0.08);
}
.changelog-item-ver {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.changelog-item.on .changelog-item-ver { color: var(--primary); }
.changelog-item-date { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.changelog-badge {
  font-size: 10px; font-weight: 600; color: #fff; background: var(--primary);
  border-radius: 999px; padding: 0 6px; line-height: 1.5;
}
.changelog-detail {
  overflow-y: auto; padding: 18px 22px 22px; min-height: 0; min-width: 0;
}
.changelog-detail-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 6px;
}
.changelog-detail-meta { font-size: 12px; margin-bottom: 14px; }
.changelog-empty { padding: 36px 16px; text-align: center; }
.changelog-loading { padding: 36px 16px; text-align: center; color: var(--text-secondary); }
@media (max-width: 640px) {
  .changelog-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .changelog-list {
    display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 10px;
  }
  .changelog-item {
    flex: 0 0 auto; width: auto; min-width: 110px; margin-bottom: 0;
  }
  .changelog-modal { max-height: 92vh; }
}

/* Markdown 渲染正文（公告 / 简报共用，simpleMarkdown 输出） */
.ann-h { font-size: 15px; margin: 14px 0 6px; color: var(--primary); letter-spacing: 0.3px; }
/* 标题分级：Markdown # ~ #### 四级，级大字大；公文序数标题（一、/（一））用正文色，
   党政机关文稿标题为黑体/加粗风格而非主题色 */
.ann-h1 { font-size: 18px; }
.ann-h2 { font-size: 16.5px; }
.ann-h3 { font-size: 15px; }
.ann-h4 { font-size: 14px; }
.gw-h1 { font-size: 16px; font-weight: 700; color: var(--text); }
.gw-h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.ann-p { margin: 0 0 10px; }
.ann-ul, .ann-ol { margin: 0 0 10px 1.3em; padding: 0; }
.ann-ul li, .ann-ol li { margin-bottom: 5px; }
.ann-hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md-body { white-space: normal; }
.md-body strong { color: var(--text); }
.msg-md { line-height: 1.85; }
.msg-md .ann-h { font-size: 14px; margin: 10px 0 4px; }
/* 聊天气泡内的分级尺寸（整体小一号，保持层次对比） */
.msg-md .ann-h1 { font-size: 16.5px; margin: 14px 0 6px; }
.msg-md .ann-h2 { font-size: 15.5px; margin: 12px 0 5px; }
.msg-md .ann-h3 { font-size: 14.5px; margin: 10px 0 4px; }
.msg-md .gw-h1 { font-size: 15px; margin: 12px 0 5px; }
.msg-md .gw-h2 { font-size: 14px; margin: 10px 0 4px; }
.msg-md .ann-p { margin: 0 0 8px; }
.msg-md .ann-ul, .msg-md .ann-ol { margin: 0 0 8px 1.2em; }

/* 党建规范出处 */
.citation-box .citation-line {
  font-size: 13px; line-height: 1.7; word-break: break-all;
  color: var(--text); background: #fff; border: 1px dashed #c5d4ef;
  border-radius: 6px; padding: 10px 12px;
}

/* Toast */
.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
/* toast 内操作按钮（如删除后的「撤销」） */
.toast-action {
  background: none; border: none; color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; margin-left: 12px; padding: 2px 4px; text-decoration: underline;
}

/* 正文展示 */
.article-body { font-size: 14px; line-height: 2; white-space: pre-wrap; word-break: break-word; }
.article-body.speech { font-size: 15px; }
.doc-content { white-space: pre-wrap; line-height: 2; font-size: 14px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stat-card.stat-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat-card.stat-link:hover {
  border-color: #cdd9f5; box-shadow: var(--shadow-hover); text-decoration: none; transform: translateY(-2px);
}
.stat-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; flex-shrink: 0;
}


/* 画像卡·一句话画像：引用式左边条，轻盈不抢戏 */
.mem-portrait {
  border-left: 3px solid #cdd9f5; padding: 2px 0 2px 12px; margin-bottom: 12px;
  font-size: 13px; line-height: 1.7; color: var(--text-secondary);
}


/* Alpine.js 未就绪前隐藏动态区块（此前仅 cowork.html 局部定义，提升为全局规则） */
[x-cloak] { display: none !important; }

/* 文章详情：译文 / 原文分栏 */
.article-trans-block {
  background: #f6faf6; border: 1px solid #d8ebd9; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.article-trans-block .at-label {
  font-size: 12px; color: var(--success); font-weight: 600; margin-bottom: 8px;
}
.article-orig-block {
  background: #fafbfe; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.article-orig-block .at-label {
  font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-bottom: 8px;
}
.article-orig-title { font-style: italic; color: #4b5563; margin-bottom: 8px; }

/* 两栏 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }


/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 32px 24px;
  background:
    radial-gradient(640px 420px at 12% 18%, rgba(43, 92, 230, 0.12), transparent 62%),
    radial-gradient(520px 400px at 88% 84%, rgba(199, 0, 11, 0.06), transparent 60%),
    linear-gradient(160deg, #edf2fe 0%, #f8faff 100%);
}
.login-brand img { width: min(440px, 86vw); height: auto; display: block; }
.login-card {
  width: 400px; max-width: 92vw; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px; padding: 36px 38px;
  box-shadow: 0 24px 64px rgba(31, 73, 196, 0.14);
}
.login-card .btn-primary { width: 100%; padding: 10px; font-size: 15px; margin-top: 6px; border-radius: 9px; }
/* 登录验证码：输入框 + 图片并排，图片点击刷新 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img {
  width: 132px; height: 44px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); flex-shrink: 0;
}


/* 开关 */
.switch-wrap { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text); user-select: none; }
.switch { position: relative; width: 34px; height: 19px; display: inline-block; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #d3d9e4; border-radius: 999px; transition: background 0.18s; }
.switch .slider::before {
  content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(15px); }




/* 流式输出光标：柔和方块（类 codex 风格），对齐文字基线 */
.cursor-blink::after {
  content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 3px;
  background: var(--primary); border-radius: 2px; vertical-align: -0.2em;
  animation: blink 1s infinite;
}
.msg-stream.cursor-blink {
  animation: streamPulse 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.15; } }
@keyframes streamPulse { 0%, 100% { background: #fff; } 50% { background: #fbfcff; } }


.empty { text-align: center; color: var(--text-secondary); padding: 48px 0; font-size: 13px; }
.loading-dot { display: inline-block; width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  /* 侧栏折叠为纯图标 */
  .sidebar { width: 64px; }
  .sidebar .brand { padding: 16px 0; justify-content: center; }
  .sidebar .brand h1, .sidebar .brand p, .sidebar nav a span.txt, .sidebar .footer { display: none; }
  .sidebar nav { padding: 12px 8px; }
  .sidebar nav a { justify-content: center; padding: 10px 0; }
  .sidebar nav a .icon { width: auto; }

  /* 通用间距收紧 */
  .content { padding: 16px 14px; }
  .topbar { padding: 0 16px; }
  .card { padding: 16px; border-radius: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .modal-mask { padding: 12px; }
  .modal { max-height: 92vh; border-radius: 12px; }


  /* 信息流 → 小红书式文字卡片：标题即封面（仿小红书纯文字图片） */
  .feed-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .feed-list .item {
    padding: 0; border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; background: #fff; box-shadow: var(--shadow);
  }
  .feed-list .item:hover { background: #fff; }
  .feed-list .item .item-title {
    display: block; margin: 0; padding: 18px 16px;
    font-size: 16px; font-weight: 700; line-height: 1.65; letter-spacing: 0.3px;
    background: linear-gradient(135deg, #dfe9ff 0%, #f3f7ff 100%); color: #1d3fae;
  }
  .feed-list .item:nth-child(4n+2) .item-title { background: linear-gradient(135deg, #ffe4ee 0%, #fff6fa 100%); color: #b32b63; }
  .feed-list .item:nth-child(4n+3) .item-title { background: linear-gradient(135deg, #dcf3e7 0%, #f2fbf6 100%); color: #14663f; }
  .feed-list .item:nth-child(4n+4) .item-title { background: linear-gradient(135deg, #fdeed6 0%, #fffaf1 100%); color: #96540e; }
  .feed-list .item .item-title:hover { color: inherit; }
  .feed-list .item .item-title .tag { font-weight: 500; }
  .feed-list .item .item-meta { padding: 10px 16px 0; }
  .feed-list .item .item-meta:last-child { padding-bottom: 16px; }
  .feed-list .item .item-summary { padding: 0 16px 16px; margin-top: 8px; }
  /* 卡片内的操作按钮行（如简报历史） */
  .feed-list .item > .flex-between { display: block; }
  .feed-list .item .flex { padding: 12px 16px 16px; }
}

/* ---------------- 密码强度条 ---------------- */
.pwd-meter { margin-top: 6px; }
.pwd-bar { display: flex; align-items: center; gap: 6px; }
.pwd-seg {
  flex: 1; height: 5px; border-radius: 3px;
  background: var(--border); transition: background 0.18s;
}
.pwd-seg.weak { background: var(--danger); }
.pwd-seg.medium { background: var(--warning); }
.pwd-seg.strong { background: var(--success); }
.pwd-label {
  font-size: 12px; color: var(--text-secondary); min-width: 16px; text-align: right;
}
.pwd-label.weak { color: var(--danger); }
.pwd-label.medium { color: var(--warning); }
.pwd-label.strong { color: var(--success); }
.pwd-hint {
  margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-secondary);
}
/* 模态框里的强度条间距稍紧凑 */
.modal .pwd-meter { margin-top: 4px; }

/* ---------------- 简单数据表（设置页任务列表等） ---------------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: #f8fafc;
}
.data-table tr:hover td { background: #fafbff; }
