/* ============================================================
   办公室管理系统 v2 — 全局样式
   ============================================================ */

:root {
  /* ============ 主色（Semi / Arco 风） ============ */
  --primary: #0064FA;
  --primary-hover: #004FCC;
  --primary-active: #003D9E;
  --primary-light: #E6F0FF;
  --primary-bg: #F2F7FF;

  /* ============ 语义色 ============ */
  --success: #00B42A;
  --success-bg: #E8FFEA;
  --warning: #FF7D00;
  --warning-bg: #FFF7E8;
  --danger: #F53F3F;
  --danger-hover: #CB272D;
  --danger-bg: #FFECE8;
  --info: #722ED1;
  --info-bg: #F5E8FF;

  /* ============ 中性色 ============ */
  --text-strong: #1D2129;       /* 标题 / 关键 */
  --text: #1D2129;              /* 正文（保持深色保证可读） */
  --text-secondary: #4E5969;    /* 副文本 */
  --text-tertiary: #86909C;     /* 辅助文本 */
  --text-placeholder: #C9CDD4;  /* 占位 */
  --border: #E5E6EB;
  --border-strong: #C9CDD4;
  --bg: #F7F8FA;
  --bg-soft: #F2F3F5;
  --bg-white: #FFFFFF;

  /* ============ 导航配色（顶栏 + 边栏，随 data-theme 配色风格整套切换） ============ */
  --nav-bg: #FFFFFF;                 /* 顶栏 / 边栏底色 */
  --nav-border: var(--border);       /* 边栏右分隔线 / 顶栏底边 */
  --nav-logo: var(--primary);        /* 顶栏 logo 文字 */
  --nav-user: var(--text-secondary); /* 顶栏用户名（常规） */
  --nav-user-strong: var(--text);    /* 顶栏用户名（加粗部分） */
  --nav-item: var(--text-secondary); /* 边栏菜单文字 */
  --nav-item-hover-bg: var(--primary-light);
  --nav-item-hover-text: var(--text);
  --nav-active-bg: linear-gradient(90deg, var(--primary-light) 0%, var(--primary-bg) 100%);
  --nav-active-text: var(--primary);
  --nav-active-bar: var(--primary);

  /* ============ 布局尺寸 ============ */
  --sidebar-width: 220px;
  --header-height: 56px;

  /* ============ 圆角分级 ============ */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* ============ 间距分级 ============ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* ============ 阴影分级（比旧版更轻更"贴"） ============ */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, .06);
  --shadow: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

  /* ============ 字体（系统字体优先链，无需下载） ============ */
  --font-family-base:
    'HarmonyOS Sans SC',
    'PingFang SC',
    'Microsoft YaHei UI',
    'Microsoft YaHei',
    -apple-system, BlinkMacSystemFont,
    'Segoe UI', 'Roboto', 'Inter',
    'Noto Sans SC',
    sans-serif;

  /* ============ 过渡 ============ */
  --transition-fast: all .15s ease;
  --transition: all .2s ease;
  --transition-slow: all .3s ease;
}

/* ============================================================
   配色风格 — :root[data-theme] 一套同时决定「主色 + 顶栏/边栏」
   共三套：blue 蓝天蓝 / green 微信绿 / eye 护眼（柔和深色）
   特异性 (0,2,0) 高于 :root (0,1,0)，确保覆盖默认
   默认 data-theme="blue"
   ============================================================ */

/* —— 蓝色（蓝天蓝：明亮天蓝主色 + 深天蓝导航） —— */
:root[data-theme="blue"] {
  --primary: #2F88FF;
  --primary-hover: #1C6FE0;
  --primary-active: #155CC0;
  --primary-light: #E1EFFF;
  --primary-bg: #F2F8FF;

  --nav-bg: #0E4C96;
  --nav-border: rgba(255, 255, 255, .10);
  --nav-logo: #EAF3FF;
  --nav-user: rgba(234, 243, 255, .74);
  --nav-user-strong: #FFFFFF;
  --nav-item: rgba(234, 243, 255, .74);
  --nav-item-hover-bg: rgba(255, 255, 255, .12);
  --nav-item-hover-text: #FFFFFF;
  --nav-active-bg: linear-gradient(90deg, rgba(125, 180, 255, .36) 0%, rgba(125, 180, 255, .12) 100%);
  --nav-active-text: #FFFFFF;
  --nav-active-bar: #7DB4FF;
}

/* —— 绿色（清新翠绿：亮绿主色 + 翠绿导航，比旧版浅而不暗） —— */
:root[data-theme="green"] {
  --primary: #14C06A;
  --primary-hover: #10A85C;
  --primary-active: #0C8F4D;
  --primary-light: #DEF7E9;
  --primary-bg: #F1FCF6;

  --nav-bg: #138A53;
  --nav-border: rgba(255, 255, 255, .14);
  --nav-logo: #ECFBF3;
  --nav-user: rgba(236, 251, 243, .82);
  --nav-user-strong: #FFFFFF;
  --nav-item: rgba(236, 251, 243, .82);
  --nav-item-hover-bg: rgba(255, 255, 255, .15);
  --nav-item-hover-text: #FFFFFF;
  --nav-active-bg: linear-gradient(90deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .06) 100%);
  --nav-active-text: #FFFFFF;
  --nav-active-bar: #7DF0B4;
}

/* —— 护眼（柔和深色模式：整体暗、低亮度，弱光久看不累眼） —— */
:root[data-theme="eye"] {
  --primary: #4C8DFF;
  --primary-hover: #6BA1FF;
  --primary-active: #3C7BE6;
  --primary-light: #1E3350;
  --primary-bg: #16243B;

  --success: #3DD068;  --success-bg: #163020;
  --warning: #FFA53C;  --warning-bg: #3A2A12;
  --danger: #F86A6A;   --danger-hover: #E25555; --danger-bg: #3A1C1C;
  --info: #A98BE8;     --info-bg: #2A1F3A;

  --text-strong: #E6E9EF;
  --text: #E6E9EF;
  --text-secondary: #A9B2C0;
  --text-tertiary: #7A8494;
  --text-placeholder: #5A6472;
  --border: #2A2F3A;
  --border-strong: #3C434F;
  --bg: #14171F;
  --bg-soft: #1B1F29;
  --bg-white: #1E222C;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, .4);
  --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);

  --nav-bg: #11141C;
  --nav-border: rgba(255, 255, 255, .06);
  --nav-logo: #E6E9EF;
  --nav-user: rgba(230, 233, 239, .66);
  --nav-user-strong: #F2F4F8;
  --nav-item: rgba(230, 233, 239, .66);
  --nav-item-hover-bg: rgba(255, 255, 255, .06);
  --nav-item-hover-text: #FFFFFF;
  --nav-active-bg: rgba(76, 141, 255, .18);
  --nav-active-text: #9FC0FF;
  --nav-active-bar: #4C8DFF;
}

/* —— 暖米（轻奢商务：墨绿深边栏 + 米色正文背景 + 青绿主色 + 金色点缀） —— */
:root[data-theme="warm"] {
  --primary: #2E9E78;
  --primary-hover: #248768;
  --primary-active: #1C6E54;
  --primary-light: #DCF0E8;
  --primary-bg: #EBF6F1;

  --success: #2E9E78;  --success-bg: #E4F4EC;
  --warning: #C8861E;  --warning-bg: #FBF0DA;
  --danger: #C7493B;   --danger-hover: #AC3B2F; --danger-bg: #FAE7E3;
  --info: #8A6FB0;     --info-bg: #F0EAF7;

  /* 暖米背景 + 白卡片 + 暖色边框/文字 */
  --text-strong: #2A2A24;
  --text: #2A2A24;
  --text-secondary: #6B655A;
  --text-tertiary: #9A9387;
  --text-placeholder: #C4BCAC;
  --border: #E8E1D2;
  --border-strong: #D6CCB8;
  --bg: #F4EFE3;
  --bg-soft: #EFE9DB;
  --bg-white: #FFFFFF;

  --shadow-xs: 0 1px 2px rgba(60, 50, 30, .05);
  --shadow-sm: 0 2px 4px rgba(60, 50, 30, .07);
  --shadow: 0 2px 8px rgba(60, 50, 30, .07), 0 1px 2px rgba(60, 50, 30, .05);
  --shadow-md: 0 4px 12px rgba(60, 50, 30, .09);
  --shadow-lg: 0 12px 32px rgba(60, 50, 30, .14);

  /* 墨绿深色边栏 + 金色选中 */
  --nav-bg: #1F2A24;
  --nav-border: rgba(255, 255, 255, .08);
  --nav-logo: #F3EEE2;
  --nav-user: rgba(243, 238, 226, .74);
  --nav-user-strong: #FFFFFF;
  --nav-item: rgba(243, 238, 226, .76);
  --nav-item-hover-bg: rgba(255, 255, 255, .08);
  --nav-item-hover-text: #FFFFFF;
  --nav-active-bg: linear-gradient(90deg, rgba(201, 168, 106, .30) 0%, rgba(201, 168, 106, .06) 100%);
  --nav-active-text: #F1E6CC;
  --nav-active-bar: #C9A86A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--font-family-base);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Layout ---- */

#app { height: 100%; display: flex; flex-direction: column; }

.layout { display: flex; flex: 1; overflow: hidden; }

/* ---- Header ---- */

.header {
  height: var(--header-height);
  background: var(--nav-bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 0 rgba(15, 23, 42, .02);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
  transition: background .2s ease, color .2s ease;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { font-size: 18px; font-weight: 600; color: var(--nav-logo); white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user { font-size: 13px; color: var(--nav-user); }
.header-user strong { color: var(--nav-user-strong); }

/* ---- Sidebar ---- */

.sidebar {
  width: var(--sidebar-width);
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 12px 0;
  transition: background .2s ease;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--nav-item);
  font-size: 14px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: var(--nav-item-hover-bg);
  color: var(--nav-item-hover-text);
}

.sidebar-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-left-color: var(--nav-active-bar);
  font-weight: 600;
}
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ---- Main Content ---- */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ---- Cards ---- */

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ---- Page header ---- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-title { font-size: 20px; font-weight: 600; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:hover { background: var(--bg); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* 按钮 loading 态：内联 spinner + 禁用，防重复提交 */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 15px; height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: btn-spin .6s linear infinite;
}
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success).is-loading::after { color: var(--primary); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---- 骨架屏（加载占位） ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.4s ease infinite;
}
.skeleton-row { height: 16px; margin-bottom: 12px; }
.skeleton-row:last-child { margin-bottom: 0; }
.skeleton-row.w-60 { width: 60%; }
.skeleton-row.w-40 { width: 40%; }
.skeleton-row.w-80 { width: 80%; }
.skeleton-block { height: 88px; border-radius: var(--radius); margin-bottom: 16px; }
.skeleton-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---- Forms ---- */

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-white);
  transition: var(--transition);
}

.form-control::placeholder { color: var(--text-placeholder); }

.form-control:hover { border-color: var(--border-strong); }

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-row .form-group { margin-bottom: 0; }

/* ---- Tables ---- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  position: sticky;
  top: 0;
}

tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--bg-soft); }

/* ---- Status badges ---- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-expired { background: var(--danger-bg); color: var(--danger); }
.badge-normal { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--primary-bg); color: var(--primary); }

/* ---- Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .15s;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .2s;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ---- Toast ---- */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideRight .2s;
  max-width: 380px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }

/* ---- 主题切换调色盘 ---- */
.theme-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; }
.theme-btn span { font-size: 12px; line-height: 1; }
.theme-pop {
  position: fixed;
  z-index: 9000;
  width: 300px;
  padding: 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: fadeIn .15s ease;
}
.theme-pop-title { font-size: 12px; color: var(--text-tertiary); margin: 2px 2px 8px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  cursor: pointer;
  transition: var(--transition);
}
.theme-opt:hover { border-color: var(--primary); background: var(--primary-bg); }
.theme-opt.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.theme-opt-name { font-size: 13px; font-weight: 500; color: var(--text); }
.theme-opt.active .theme-opt-name { color: var(--primary); }
.theme-dots { display: flex; gap: 3px; flex-shrink: 0; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .25); }

/* ---- Dashboard cards grid ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.success .stat-value { color: var(--success); }

/* ---- Dashboard 数据驾驶舱 ---- */
.dash-hero {
  background: linear-gradient(120deg, var(--primary-bg) 0%, var(--bg-white) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}
.dash-hero-greet { font-size: 22px; font-weight: 700; color: var(--text-strong); }
.dash-hero-date { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }
.dash-brief {
  margin-top: 12px; font-size: 14px; color: var(--text-secondary);
  line-height: 1.7; padding: 10px 14px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius); border-left: 3px solid var(--primary);
}
.dash-brief b { color: var(--text-strong); font-weight: 600; }
.dash-brief b.dash-em, .dash-em { color: var(--danger); }

.dash-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.dash-kpi-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 16px; text-align: center;
  box-shadow: var(--shadow-xs); transition: all .2s ease; position: relative;
}
.dash-kpi-card.dash-clickable { cursor: pointer; }
.dash-kpi-card.dash-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-light); }
.dash-kpi-val { font-size: 30px; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.dash-kpi-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.dash-kpi-card.primary .dash-kpi-val { color: var(--primary); }
.dash-kpi-card.danger .dash-kpi-val { color: var(--danger); }
.dash-kpi-card.warning .dash-kpi-val { color: var(--warning); }

.dash-cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; }

.dash-trips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dash-trip-chip {
  font-size: 12px; color: var(--text-secondary); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dash-week { display: flex; flex-direction: column; gap: 4px; }
.dash-day { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.dash-day:last-child { border-bottom: none; }
.dash-day-date {
  flex: 0 0 110px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  padding-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.dash-today .dash-day-date { color: var(--primary); }
.dash-today-tag {
  font-size: 11px; font-weight: 600; color: #fff; background: var(--primary);
  border-radius: 4px; padding: 1px 6px;
}
.dash-day-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-evt {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 13px; padding: 6px 10px; border-radius: var(--radius);
  background: var(--bg); border-left: 3px solid var(--border-strong);
}
.dash-evt-meeting { border-left-color: var(--primary); }
.dash-evt-publicity { border-left-color: var(--info); }
.dash-evt-type {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 4px; padding: 0 6px;
}
.dash-evt-time { font-weight: 600; color: var(--text-secondary); }
.dash-evt-title { color: var(--text-strong); font-weight: 500; }
.dash-evt-meta { color: var(--text-tertiary); font-size: 12px; }

.dash-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; height: 120px; padding: 8px 4px 0; }
.dash-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.dash-bar-num { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.dash-bar {
  width: 70%; max-width: 36px; min-height: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 4px 4px 0 0; transition: height .3s ease;
}
.dash-bar-lbl { font-size: 12px; color: var(--text-tertiary); }

.dash-risk { display: flex; flex-direction: column; gap: 8px; }
.dash-risk-item {
  display: flex; align-items: flex-start; gap: 10px; font-size: 13px;
  color: var(--text-secondary); padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.dash-risk-item b { color: var(--text-strong); font-weight: 700; }
.dash-risk-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--text-tertiary); }
.dash-risk-item.danger { background: var(--danger-bg); border-color: #FBC4C4; }
.dash-risk-item.danger .dash-risk-dot { background: var(--danger); }
.dash-risk-item.warning { background: var(--warning-bg); border-color: #FFD591; }
.dash-risk-item.warning .dash-risk-dot { background: var(--warning); }
.dash-risk-item.info { background: var(--primary-bg); border-color: var(--primary-light); }
.dash-risk-item.info .dash-risk-dot { background: var(--primary); }
.dash-risk-sub { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
  .dash-day { flex-direction: column; gap: 6px; }
  .dash-day-date { flex-basis: auto; }
}

/* ---- Login page（品牌融合式） ---- */

.login-shell {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--primary-active) 0%, var(--primary) 60%, var(--primary-hover) 120%);
}

.login-brand {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100vh;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overflow-y: auto;
  padding: clamp(32px, 6vw, 72px) clamp(24px, 7vw, 96px);
  color: #fff;
  background: linear-gradient(135deg, var(--primary-active) 0%, var(--primary) 60%, var(--primary-hover) 120%);
}

.login-unified {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  min-height: min(680px, calc(100vh - 96px));
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 420px);
  gap: clamp(32px, 7vw, 96px);
  align-items: center;
}

.login-brand-inner {
  position: relative;
  text-align: center;
  padding: 0;
}

.login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 24px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .18));
}

.login-logo-fallback {
  display: none;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .4);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 2px;
}

.login-brand-org {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.login-brand-dept {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 6px;
  opacity: .94;
  margin-bottom: 22px;
}

.login-brand-slogan {
  font-size: 15px;
  letter-spacing: 1px;
  opacity: .82;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .28);
  display: inline-block;
}

/* 柔和装饰光斑（纯 CSS，不引图） */
.login-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  pointer-events: none;
}
.login-deco-1 { width: 340px; height: 340px; top: -120px; right: -90px; }
.login-deco-2 { width: 220px; height: 220px; bottom: -70px; left: -60px; background: rgba(255,255,255,.07); }
.login-deco-3 { width: 130px; height: 130px; top: 50%; left: 12%; background: rgba(255,255,255,.06); }

.login-form-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.login-card {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  color: #fff;
  box-shadow: 0 18px 60px rgba(0, 32, 92, .28);
  backdrop-filter: blur(14px);
  animation: slideUp .25s ease;
}

.login-card-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.login-card-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, .78);
  margin-bottom: 28px;
}

.login-card .form-label {
  color: rgba(255, 255, 255, .88);
}

.login-card .form-control {
  background: rgba(255, 255, 255, .96);
  border-color: rgba(255, 255, 255, .18);
  color: var(--text-strong);
}

.login-card .form-control:hover {
  border-color: rgba(255, 255, 255, .72);
}

.login-card .form-control:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .24);
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 15px;
  margin-top: 4px;
}

.login-card .login-submit {
  background: #fff;
  border-color: #fff;
  color: var(--primary-active);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 43, 128, .18);
}

.login-card .login-submit:hover {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .92);
}

.login-card .btn.is-loading::after {
  color: var(--primary-active);
}

.login-toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, .76);
}

.login-toggle a,
.login-toggle-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.login-toggle-link:hover { text-decoration: underline; }

.login-error {
  background: rgba(255, 236, 232, .96);
  color: var(--danger);
  border: 1px solid rgba(245, 63, 63, .45);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-error.show { display: block; }

@media (max-width: 860px) {
  .login-brand {
    align-items: flex-start;
    padding: 28px 18px 36px;
  }
  .login-unified {
    width: min(430px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .login-brand .login-logo,
  .login-brand .login-logo-fallback { width: 64px; height: 64px; margin-bottom: 14px; }
  .login-brand-org { font-size: 24px; }
  .login-brand-dept { font-size: 16px; margin-bottom: 14px; }
  .login-brand-slogan { font-size: 13px; padding-top: 12px; }
  .login-form-panel { width: 100%; }
  .login-card { max-width: none; padding: 24px; }
  .login-card-title { font-size: 22px; }
  .login-card-sub { margin-bottom: 22px; }
}

/* ---- Toolbar ---- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar .form-control {
  width: auto;
  min-width: 180px;
}

/* ---- Empty state ---- */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

.subpage-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-white);
  padding: 18px;
  box-shadow: var(--shadow);
}

.action-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.action-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.7;
}

.office-form-sheet {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.office-form-sheet table {
  width: 100%;
}

.office-form-sheet th,
.office-form-sheet td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  white-space: normal;
  vertical-align: middle;
}

.office-form-sheet th {
  width: 110px;
  background: var(--bg);
  color: var(--text);
  position: static;
}

.office-form-sheet .cell-input {
  width: 100%;
  border: none;
  outline: none;
  min-height: 36px;
  font: inherit;
  background: transparent;
}

.office-form-sheet textarea.cell-input {
  min-height: 86px;
  resize: vertical;
}

.request-items-editor {
  display: grid;
  gap: 10px;
}

.request-item-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 120px 120px auto;
  gap: 10px;
  align-items: end;
}

.request-item-row.pickup {
  grid-template-columns: minmax(0, 2fr) 100px 120px auto;
}

.request-sheet-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.signature-pad-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.supply-pick-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.supply-pick-row {
  display: grid;
  grid-template-columns: 1fr 220px 80px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.supply-pick-row:last-child { border-bottom: none; }
.supply-pick-row:hover { background: var(--primary-bg); }
.supply-pick-row.picked { background: var(--primary-light); }
.supply-pick-name { font-weight: 500; }
.supply-pick-spec { color: var(--text-tertiary); font-weight: normal; margin-left: 6px; font-size: 12px; }
.supply-pick-meta { color: var(--text-secondary); font-size: 12px; }
.supply-pick-action { color: var(--primary); font-size: 12px; text-align: right; }
.supply-pick-selected { margin-top: 4px; }

.signature-pad {
  width: 100%;
  height: 180px;
  display: block;
  border: 1px dashed #b9c7e6;
  border-radius: 6px;
  touch-action: none;
  background: #fcfdff;
}

.signature-tools {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.signature-tip {
  color: var(--text-secondary);
  font-size: 12px;
}

.section-block {
  margin-bottom: 18px;
}

.section-block-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.helper-text {
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 768px) {
  .request-item-row,
  .request-item-row.pickup {
    grid-template-columns: 1fr;
  }
}

/* ---- Animations ---- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ---- Floorplan (办公室分配) ---- */

.floorplan-card {
  padding: 0 !important;
  overflow: hidden;
  margin-bottom: 12px;
}

.floorplan-viewport {
  width: 100%;
  height: calc(100vh - 220px);
  overflow: hidden;
  cursor: grab;
  background: #eef1f5;
  position: relative;
}

.floorplan-viewport:active {
  cursor: grabbing;
}

.floorplan-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.floorplan-img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.floorplan-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floorplan-label {
  position: absolute;
  background: rgba(0, 100, 250, 0.18);
  border: 1.5px solid rgba(0, 100, 250, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--primary-active);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  text-shadow: 0 0 3px rgba(255,255,255,0.8);
  letter-spacing: 0.3px;
}

.floorplan-label:hover {
  background: rgba(0, 100, 250, 0.35);
  border-color: rgba(0, 100, 250, 0.9);
  box-shadow: 0 1px 4px rgba(0, 100, 250, 0.3);
  z-index: 10;
}

/* ---- 采购申请物品清单框 ---- */

.purchase-items-box {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
  background: #fafbfc;
  min-height: 180px;
}

.purchase-items-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.purchase-item-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.purchase-item-row .form-group {
  margin-bottom: 0;
}

/* ---- Tabs (后勤等聚合页面) ---- */

.tabs {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--bg-white);
  color: var(--primary);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ---- Duban ---- */

.duban-subheader {
  margin-bottom: 14px;
  min-height: 40px;
}

.duban-tabs {
  margin-bottom: 18px;
  padding: 4px;
  background: #edf2fb;
  border: 1px solid #d9e3f5;
  border-radius: 12px;
}

.duban-tabs .tab {
  padding: 10px 22px;
  color: #516074;
  font-weight: 500;
}

.duban-tabs .tab.active {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 115, 232, .12);
}

.duban-filter-card {
  padding: 18px 18px 6px;
  border-color: #dde4ee;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.duban-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.duban-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.duban-filter-card .form-label {
  margin-bottom: 8px;
  color: #475467;
}

.duban-filter-card .form-control {
  height: 40px;
  border-color: #d6dee8;
  background: #fff;
}

.duban-table-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.duban-table-wrap {
  max-height: calc(100vh - 280px);
}

.duban-table-wrap table {
  min-width: 1380px;
}

.duban-table th,
.duban-table td {
  vertical-align: top;
}

.duban-table th {
  background: #334155;
  color: #fff;
  border-bottom-color: #334155;
}

.duban-table td {
  padding-top: 12px;
  padding-bottom: 12px;
  background: #fff;
}

.duban-table tbody tr:nth-child(even) td {
  background: #fbfcff;
}

.duban-table tbody tr:hover td {
  background: #f2f7ff;
}

.duban-table .wrap-cell {
  white-space: pre-wrap;
  min-width: 180px;
  line-height: 1.65;
}

.duban-table .wide-cell {
  min-width: 360px;
}

.duban-row-actions {
  min-width: 164px;
}

.duban-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.duban-status.is-progress {
  background: #e8f0fe;
  color: #1a73e8;
}

.duban-status.is-warning {
  background: #fff4d6;
  color: #b06000;
}

.duban-status.is-danger {
  background: #fde8e7;
  color: #c5221f;
}

.duban-status.is-success {
  background: #e6f4ea;
  color: #137333;
}

.duban-status.is-muted {
  background: #f1f3f4;
  color: #5f6368;
}

.duban-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.duban-chart-card {
  margin-bottom: 0;
  border-color: #dde4ee;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.duban-chart-box {
  height: 320px;
}

.duban-mini-table-wrap {
  max-height: 420px;
}

.duban-mini-table-wrap table {
  min-width: 1080px;
}

.duban-attach-list {
  display: grid;
  gap: 10px;
}

.duban-attach-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #dde4ee;
  border-radius: 10px;
  padding: 12px;
  background: #fbfcff;
}

.duban-attach-name {
  font-weight: 500;
  word-break: break-all;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .modal { width: 95%; max-width: none; }
  .duban-filter-grid { grid-template-columns: 1fr; }
  .duban-chart-grid { grid-template-columns: 1fr; }
  .duban-attach-item { align-items: flex-start; flex-direction: column; }
}

/* 会议页 - 周视图 */
.meeting-week-table th,
.meeting-week-table td { vertical-align: top; padding: 10px; }
.meeting-week-table td { min-height: 60px; }
.meeting-cell-item {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.meeting-cell-item:last-child { margin-bottom: 0; }
.meeting-cell-time { font-weight: 600; color: var(--text); }
.meeting-cell-name { color: var(--primary-active); margin: 2px 0; }
.meeting-cell-meta { color: var(--text-secondary); font-size: 12px; }
.meeting-week-table th { background: var(--bg-soft); text-align: center; }
.meeting-week-table td { min-width: 140px; }
.meeting-row-am td { background: var(--bg-white); }
.meeting-row-pm td { background: var(--bg); }
.meeting-day-cell { font-weight: 600; text-align: center; vertical-align: middle !important; background: var(--primary-light) !important; }
.meeting-period-cell { font-weight: 600; text-align: center; color: var(--text-secondary); }

.trip-analytics-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trip-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trip-stat-pill {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--primary-light) 100%);
  border: 1px solid var(--primary-light);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  box-shadow: 0 10px 24px rgba(0, 100, 250, 0.08);
}

.trip-stat-pill span {
  color: var(--text-secondary);
  font-size: 14px;
}

.trip-stat-pill strong {
  font-size: 40px;
  line-height: 1;
  color: var(--primary-active);
}

.trip-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.trip-analytics-grid-charts {
  align-items: stretch;
}

.trip-analytics-note {
  min-height: 0;
}

@media (max-width: 768px) {
  .trip-stats-strip,
  .trip-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   AI Assistant 悬浮窗
   ============================================================ */
#ai-assistant-root { position: fixed; right: 24px; bottom: 24px; z-index: 9999; font-size: 14px; }

#ai-fab {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #00B4D8); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 100, 250, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
#ai-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 100, 250, 0.45); }
#ai-fab.opened { transform: scale(0.92); }

#ai-panel {
  position: absolute; right: 0; bottom: 72px;
  width: 420px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 120px);
  background: var(--bg-white); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* 全屏态：铺满视口（留 16px 边距），覆盖悬浮窗定位 */
#ai-panel.ai-full {
  position: fixed; inset: 16px;
  width: auto; height: auto; max-width: none; max-height: none;
}

.ai-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: linear-gradient(135deg, var(--primary-active), var(--primary)); color: #fff;
}
.ai-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ai-title .ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.ai-title .ai-sub { margin-left: 8px; font-size: 12px; font-weight: 400; opacity: 0.85; }
.ai-actions { display: flex; gap: 6px; }
.ai-actions button {
  background: rgba(255, 255, 255, 0.15); border: none; color: #fff;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.ai-actions button:hover { background: rgba(255, 255, 255, 0.28); }
#ai-close { font-size: 18px; line-height: 1; padding: 2px 9px; }

.ai-msg-list {
  flex: 1; overflow-y: auto; padding: 14px; background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg { display: flex; }
.ai-msg-bubble {
  max-width: 88%; padding: 10px 12px; border-radius: 10px;
  line-height: 1.55; word-break: break-word; white-space: normal;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.ai-msg-bubble ul { margin: 6px 0 0; padding-left: 20px; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-user .ai-msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 2px; }
.ai-msg-bot .ai-msg-bubble { background: var(--bg-white); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 2px; }
.ai-msg-tip .ai-msg-bubble { background: var(--primary-bg); color: var(--primary); border: 1px dashed var(--primary-light); }

.ai-sources { margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.ai-sources summary { cursor: pointer; user-select: none; color: var(--primary); }
.ai-sources ul { margin: 6px 0 0; padding-left: 18px; }
.ai-sources li { margin: 2px 0; }
.ai-tag {
  display: inline-block; padding: 0 6px; margin-right: 4px;
  background: #e0e7ff; color: #3730a3; border-radius: 4px; font-size: 11px;
}

/* bot 消息列：气泡 + 来源卡片纵向堆叠（来源在下方，不在侧边） */
.ai-msg-bot .ai-msg-col { display: flex; flex-direction: column; max-width: 88%; }
.ai-msg-bot .ai-msg-col .ai-msg-bubble { max-width: 100%; }

/* 参考来源卡片 */
.ai-cite {
  margin: 6px 0 2px 0;
  padding: 8px 10px;
  background: var(--primary-bg, #f2f7ff);
  border: 1px solid var(--primary-light, #e6f0ff);
  border-radius: 8px;
  font-size: 12px;
  width: 100%;
}
.ai-cite-head { color: var(--primary, #0064fa); font-weight: 600; margin-bottom: 6px; }
.ai-cite-item {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0; border-top: 1px dashed rgba(0,100,250,.12);
}
.ai-cite-item:first-of-type { border-top: none; }
.ai-cite-tag {
  flex-shrink: 0; padding: 0 6px; border-radius: 4px;
  background: var(--primary, #0064fa); color: #fff; font-size: 11px;
}
.ai-cite-name { color: var(--text-strong, #1d2129); font-weight: 500; word-break: break-all; }
.ai-cite-meta { color: var(--text-secondary, #86909c); }
.ai-cite-link {
  margin-left: auto; flex-shrink: 0; color: var(--primary, #0064fa);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ai-cite-link:hover { text-decoration: underline; }
.ai-cite-attach {
  flex-basis: 100%; margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed var(--border, #e5e6eb); display: flex; flex-direction: column; gap: 3px;
}
.ai-cite-attach .ai-cite-link {
  margin-left: 0; white-space: normal; font-size: 12px;
  color: var(--warning, #ff7d00); font-weight: 600;
}

.ai-input-wrap {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--bg-white);
}
#ai-input {
  flex: 1; resize: none; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border-strong); font-size: 13px; font-family: inherit; outline: none;
  color: var(--text); background: var(--bg-white);
  transition: border-color .15s ease;
}
#ai-input:focus { border-color: var(--primary); }
.ai-send-btn {
  background: var(--primary); color: #fff; border: none; padding: 0 16px;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}
.ai-send-btn:hover { background: var(--primary-hover); }
.ai-send-btn:disabled { background: #94a3b8; cursor: not-allowed; }

@media (max-width: 600px) {
  #ai-panel { width: calc(100vw - 24px); height: 70vh; right: -8px; }
  #ai-assistant-root { right: 16px; bottom: 16px; }
}

/* ============================================================
   制度一致性审查（审查报告页）
   ============================================================ */
.cf-scan-info {
  margin: 4px 0 12px; color: var(--text-secondary); font-size: 13px;
}
.conflict-summary {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.cf-stat {
  flex: 1; min-width: 92px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius, 8px);
  padding: 12px 14px; text-align: center;
}
.cf-num { font-size: 24px; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.cf-lbl { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.sev-high-text { color: var(--danger); }
.sev-medium-text { color: var(--warning); }
.sev-low-text { color: var(--info); }

.cf-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.cf-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px); padding: 16px;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,.04));
}
.cf-card.cf-dimmed { opacity: .6; }
.cf-card-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.cf-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.cf-chip-type { background: var(--primary-light); color: var(--primary); }
.cf-chip-scope { background: var(--bg-soft); color: var(--text-secondary); }
.sev-high { background: var(--danger-bg); color: var(--danger); }
.sev-medium { background: var(--warning-bg); color: var(--warning); }
.sev-low { background: var(--info-bg); color: var(--info); }
.cf-chip-status { background: var(--bg-soft); color: var(--text-secondary); }
.cf-chip-status.status-confirmed { background: var(--danger-bg); color: var(--danger); }
.cf-chip-status.status-dismissed { background: var(--bg-soft); color: var(--text-tertiary); }
.cf-chip-status.status-open { background: var(--warning-bg); color: var(--warning); }

.cf-point {
  background: var(--primary-bg); border-left: 3px solid var(--primary);
  padding: 10px 12px; border-radius: 6px; color: var(--text-strong);
  font-size: 14px; line-height: 1.6; margin-bottom: 12px;
}
.cf-cols { display: flex; gap: 12px; align-items: stretch; }
.cf-col {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; min-width: 0;
}
.cf-vs { display: flex; align-items: center; color: var(--text-tertiary); font-size: 18px; }
.cf-policy {
  font-weight: 600; color: var(--primary); cursor: pointer;
  font-size: 14px; word-break: break-all;
}
.cf-policy:hover { text-decoration: underline; }
.cf-clause-no { font-size: 12px; color: var(--text-tertiary); margin: 4px 0; }
.cf-clause-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.cf-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

@media (max-width: 700px) {
  .cf-cols { flex-direction: column; }
  .cf-vs { justify-content: center; }
}

/* ============ 宣传 · 素材库 ============ */
.pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pa-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pa-card-head { display: flex; align-items: center; gap: 8px; }
.pa-ver { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.pa-latest { background: var(--primary-light); color: var(--primary); }
.pa-name { font-size: 15px; font-weight: 600; word-break: break-word; }
.pa-meta { font-size: 12px; color: var(--text-secondary); }
.pa-sub { color: var(--border-strong); }
.pa-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pa-t-image { background: #E6F0FF; color: #0064FA; }
.pa-t-video { background: #FFE8E6; color: #F53F3F; }
.pa-t-word  { background: #E8F3FF; color: #165DFF; }
.pa-t-ppt   { background: #FFF3E8; color: #FF7D00; }
.pa-t-other { background: var(--bg-soft); color: var(--text-secondary); }

/* ============ 宣传 · 时间线（照片墙 + 蛇形时间轴） ============ */
/* 蛇形：奇数行照片在线上方（.tl-up）、偶数行照片在线下方（.tl-down）；
   两行之间用「侧边圆角竖线」相连。横线与连接器都贴在两侧、照片居中内缩，
   连接线永不压到照片。所有元素绝对定位，圆点恒落在该行横线 --line-y 上。 */
.tl-wrap { position: relative; padding: 10px 6px 18px; }
.tl-row { position: relative; display: flex; align-items: flex-start; height: 176px; padding: 0 22px; }
.tl-row.tl-down { justify-content: flex-end; } /* 下行右对齐：照片从右往左填满，空位落在左侧远离折线处 */

.tl-node {
  position: relative; flex: 0 0 calc(100% / var(--cols)); max-width: calc(100% / var(--cols));
  height: 176px; z-index: 1;
}

/* 照片墙封面卡（绝对定位，上行靠上 / 下行靠下） */
.tl-card {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: calc(100% - 18px); max-width: 196px; height: 120px;
  border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; background: var(--bg-soft);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.tl-up .tl-card { top: 8px; }
.tl-down .tl-card { top: 46px; }
.tl-node:hover .tl-card { transform: translateX(-50%) translateY(-4px); box-shadow: var(--shadow-lg); }
.tl-cover { width: 100%; height: 100%; }
.tl-cover img, .tl-cover video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tl-cover-empty {
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  background: linear-gradient(135deg, var(--primary-bg), #fff); color: var(--primary);
}
.tl-card-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 7px;
  color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .74));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tl-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; padding-left: 3px;
  pointer-events: none;
}
.tl-wx {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center;
  font-size: 13px; box-shadow: var(--shadow-sm);
}
.tl-count {
  position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .55); color: #fff;
  border-radius: 10px; padding: 1px 7px; font-size: 11px; line-height: 1.5;
}

/* 时间轴圆点（恒落在 --line-y）+ 日期 */
.tl-dot {
  position: absolute; left: 50%; top: calc(var(--line-y) - 8px); transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 4px var(--bg-white); z-index: 2;
}
.tl-editing .tl-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-bg); }
.tl-editing .tl-card { outline: 2px dashed var(--warning); outline-offset: 2px; }
.tl-date { position: absolute; left: 0; right: 0; font-size: 12px; color: var(--text-tertiary); text-align: center; font-variant-numeric: tabular-nums; }
.tl-up .tl-date { top: 152px; }
.tl-down .tl-date { top: 8px; }

/* 横轴线（贴两侧、z-index:0 永不压照片） */
.tl-line { position: absolute; left: 14px; right: 14px; top: var(--line-y); height: 2px; margin-top: -1px; background: var(--border-strong); z-index: 0; }

/* 侧边圆角连接器：把本行横线接到下一行横线（高度由 JS 计算） */
.tl-turn { position: absolute; width: 16px; border: 2px solid var(--border-strong); box-sizing: border-box; z-index: 0; }
.tl-turn-right { right: 6px; border-left: none; border-radius: 0 14px 14px 0; }
.tl-turn-left  { left: 6px;  border-right: none; border-radius: 14px 0 0 14px; }

/* 附件 / 推文（编辑表单复用） */
.pt-atts { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-att { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-soft); border-radius: var(--radius); padding: 2px 8px; font-size: 12px; }
.pt-links { display: flex; flex-direction: column; gap: 4px; }
.pt-link { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pt-link-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.pt-link-row .lr-title { flex: 0 0 34%; }
.pt-link-row .lr-url { flex: 1; }
.pt-att-existing { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
