:root {
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .26));
  --glass-border: rgba(255, 255, 255, .7);
  --glass-shadow: 0 8px 32px rgba(180, 80, 10, .16), inset 0 1px 0 rgba(255, 255, 255, .92);
  --text: #2b1f18;
  --muted: #7a6252;
  --primary: #e05e00;
  --primary-strong: #b84a00;
  --primary-soft: rgba(224, 94, 0, .12);
  --danger: #d63b3b;
  --ok: #2f9e63;
  --warn: #c07c10;
  --radius: 22px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(255, 176, 93, .55), transparent 60%),
    radial-gradient(900px 560px at -12% 28%, rgba(255, 122, 0, .34), transparent 58%),
    radial-gradient(1000px 640px at 55% 118%, rgba(255, 94, 58, .30), transparent 60%),
    linear-gradient(160deg, #fff6ec 0%, #ffe9d2 45%, #ffd9be 100%);
}

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

/* ===== 液态玻璃基础 ===== */
.glass,
.card,
.topbar,
.table-wrap,
.filter-bar,
.modal,
.flash,
.panel,
.stat,
.timeline-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.table-wrap,
.stat,
.stats {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ===== 顶栏 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 58px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0 18px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
  background: linear-gradient(120deg, #d95a00, #ff7a1a 55%, #f44e3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand-logo { width: 28px; height: 28px; flex: none; border-radius: 8px; box-shadow: 0 2px 10px rgba(210, 90, 0, .25); }
.topbar nav {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: #5d4b3d;
  padding: 6px 10px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background .18s, color .18s;
}
.topbar nav a:hover {
  background: rgba(255, 255, 255, .94);
  color: var(--primary-strong);
  box-shadow: 0 4px 14px rgba(210, 90, 0, .18);
  text-decoration: none;
}
.topbar .userbox {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  color: #5d4b3d;
  white-space: nowrap;
}
.topbar .userbox .user-name { font-weight: 700; margin-right: 8px; }
.topbar .userbox a { color: #7a6252; padding: 6px 10px; border-radius: 9px; }
.topbar .userbox a:hover { background: rgba(255, 255, 255, .75); color: var(--text); text-decoration: none; }
.low-perf-toggle {
  border: 1px solid rgba(224, 94, 0, .25);
  background: rgba(255, 255, 255, .5);
  color: #a3551f;
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
}
.low-perf-toggle:hover { background: rgba(255, 255, 255, .9); }

/* ===== 手机端抽屉 ===== */
.menu-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 13px;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 2px 10px rgba(180, 80, 10, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #c25a00; transition: transform .25s ease, opacity .2s ease; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(90, 40, 10, .38);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  width: min(300px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .5));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-left: 1px solid rgba(255, 255, 255, .8);
  box-shadow: -18px 0 50px rgba(180, 80, 10, .24), inset 1px 0 0 rgba(255, 255, 255, .95);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .38s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .38s;
}
.drawer.open { transform: translateX(0); visibility: visible; transition: transform .38s cubic-bezier(.2, .8, .3, 1); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .8); }
.drawer-head .brand { display: flex; align-items: center; gap: 10px; line-height: 1; font-size: 15px; }
.drawer-close { width: 30px; height: 30px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .7); color: #6b5547; font-size: 13px; cursor: pointer; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; }
.drawer nav a {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 12px rgba(180, 80, 10, .1);
  color: #574438;
  font-weight: 600;
}
.drawer nav a:hover { background: rgba(255, 255, 255, .95); color: var(--primary-strong); text-decoration: none; }
.drawer-ai {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .74), rgba(255, 242, 230, .56));
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 24px rgba(180, 80, 10, .12);
}
.drawer-ai-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #8a4a1f;
}
.drawer-ai-head .ai-logo-mini { width: 20px; height: 20px; }
.drawer-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 90px;
  max-height: 30vh;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .9);
}
.drawer-ai-messages .ai-msg { max-width: 92%; }
.drawer-ai-quick-row { display: flex; gap: 6px; }
.drawer-ai-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.drawer-ai-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(224, 94, 0, .22);
  background: rgba(255, 255, 255, .85);
  font-size: 13px;
  outline: none;
}
.drawer-ai-input-row input[type="text"]:focus { border-color: rgba(224, 94, 0, .5); }
.drawer-ai-attach {
  border: 1px solid rgba(224, 94, 0, .22);
  background: rgba(255, 255, 255, .8);
  color: #574438;
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
  font-size: 13px;
}
.ai-quick-row { display: flex; gap: 6px; padding: 0 12px 6px; }
.ai-summarize-btn {
  border: 1px solid rgba(224, 94, 0, .22);
  background: rgba(255, 255, 255, .6);
  color: #9a4a10;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-summarize-btn:hover { background: rgba(255, 255, 255, .95); color: var(--primary-strong); }
.ai-summarize-btn:disabled { opacity: .45; cursor: not-allowed; }
.drawer-user {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(255, 241, 227, .62));
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 24px rgba(180, 80, 10, .12);
}
.drawer-user-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drawer-user-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-user-row .low-perf-toggle { flex: none; padding: 5px 8px; font-size: 11px; }
.drawer-user-links { display: flex; gap: 8px; }
.drawer-user-links a {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #7a4a24;
  white-space: nowrap;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 10px rgba(180, 80, 10, .08);
}
.drawer-user-links a:hover { background: rgba(255, 255, 255, .95); color: var(--primary-strong); text-decoration: none; }

.container { max-width: 1680px; margin: 16px auto 40px; padding: 0 24px; }
.app-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 34px; }

/* ===== 卡片 ===== */
.card { border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 480px; margin: 48px auto; }
.card h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: .2px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card-sub { margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.flex.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(224, 94, 0, .25);
  background: rgba(255, 255, 255, .55);
  color: #7a4a24;
  padding: 8px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, box-shadow .18s, transform .12s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 10px rgba(180, 80, 10, .08);
}
.btn:hover { background: rgba(255, 255, 255, .95); box-shadow: 0 5px 16px rgba(180, 80, 10, .16); text-decoration: none; color: var(--primary-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, #ff7a1a, #e05e00);
  border-color: rgba(180, 70, 0, .35);
  color: #fff;
  box-shadow: 0 6px 18px rgba(224, 94, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover { background: linear-gradient(135deg, #ff8a33, #d95a00); color: #fff; }
.btn.danger { background: rgba(214, 59, 59, .1); border-color: rgba(214, 59, 59, .3); color: #c0392b; }
.btn.danger:hover { background: rgba(214, 59, 59, .18); color: #a93226; }
.btn.ok { background: rgba(47, 158, 99, .1); border-color: rgba(47, 158, 99, .3); color: #238450; }
.btn.ok:hover { background: rgba(47, 158, 99, .18); color: #1d7045; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ===== 徽标 ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(120, 100, 90, .1);
  color: #6d5a4c;
  white-space: nowrap;
}
.badge.orange { background: rgba(224, 94, 0, .14); color: #c75a00; }
.badge.ok { background: rgba(47, 158, 99, .14); color: #238450; }
.badge.warn { background: rgba(192, 124, 16, .14); color: #a3640c; }
.badge.danger { background: rgba(214, 59, 59, .14); color: #c0392b; }
.badge.blue { background: rgba(70, 100, 200, .12); color: #465fc0; }

/* ===== 统计 ===== */
.stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat .num { font-size: 26px; font-weight: 800; background: linear-gradient(120deg, #e05e00, #ff8a33); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat a { color: var(--muted); }
.stat a:hover { color: var(--primary); }

/* ===== 工作台紧凑排布 ===== */
.stats { gap: 10px; margin-bottom: 10px; }
.stat { padding: 11px 14px; border-radius: 15px; }
.stat .num { font-size: 22px; }
.dash-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-grid .card { margin-bottom: 0; padding: 12px 14px; }
.dash-grid .card h3 { font-size: 14.5px; }
.dash-grid .card { display: flex; flex-direction: column; }
.dash-grid .table { min-width: 0; }
.dash-grid .table { table-layout: fixed; width: 100%; }
.dash-table .col-seq { width: 92px; }
.dash-table .col-title { width: 40%; }
.dash-table .col-unit { width: 96px; }
.dash-table .col-status { width: 66px; }
.dash-table .col-op { width: 58px; }
.dash-table .col-time { width: 82px; }
.dash-table .col-note { width: 84px; }
.dash-grid .table th { padding: 5px 8px; font-size: 11.5px; }
.dash-grid .table td { padding: 5px 8px; font-size: 11.5px; }
.dash-grid .table td:not(.actions) { overflow: hidden; text-overflow: ellipsis; }
.dash-grid .title-cell {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-grid .title-cell a {
  display: block;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-grid .title-cell .sub {
  display: block;
  max-width: 170px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-grid .table-wrap { margin-bottom: 0; border-radius: 12px; }
.dash-grid .table-wrap { flex: 1; }
.dash-empty { padding: 20px 8px; }
.dash-empty .big { font-size: 26px; }
.time-center { text-align: center; }
.time-center .two-line { display: inline-flex; align-items: center; }
.dash-grid .table th.actions { text-align: right; }
.dash-flow-h {
  padding: 12px 14px;
}
.dash-flow-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto 26px auto;
  gap: 12px 10px;
}
.dash-flow-track .flow-step {
  position: relative;
  padding: 12px 14px;
  min-height: 64px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(224, 94, 0, .2);
  box-shadow: 0 4px 14px rgba(180, 80, 10, .1), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.dash-flow-track .flow-step .tl-title { font-weight: 700; font-size: 13px; color: #9a4a10; }
.dash-flow-track .flow-step .tl-detail { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.dash-flow-track .step-1 { grid-column: 1; grid-row: 1; }
.dash-flow-track .step-2 { grid-column: 2; grid-row: 1; }
.dash-flow-track .step-3 { grid-column: 3; grid-row: 1; }
.dash-flow-track .step-4 { grid-column: 2; grid-row: 3; }
.dash-flow-track .step-5 { grid-column: 4; grid-row: 3; }
.dash-flow-line {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  align-self: center;
  margin: 0 3%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(224, 94, 0, .2), #ff8a33 45%, #e05e00);
}
.dash-flow-line::after {
  content: "";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-left: 12px solid #e05e00;
}
.welcome-card { padding: 12px 16px !important; margin-bottom: 8px !important; }
.welcome-card h2 { font-size: 17px; margin: 0 !important; }
.welcome-card .card-sub { margin: 2px 0 0 !important; }

/* ===== 表格 ===== */
.table-wrap { border-radius: 16px; overflow: hidden; overflow-x: auto; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid rgba(224, 94, 0, .12); vertical-align: middle; }
.table th { background: rgba(224, 94, 0, .07); color: #8a4a1f; font-size: 12px; font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .55); }
.table .actions { white-space: nowrap; text-align: right; }
.table .title-cell { max-width: 360px; }
.table .title-cell a { font-weight: 600; color: var(--text); }
.table .title-cell a:hover { color: var(--primary); }
.two-line { display: flex; flex-direction: column; line-height: 1.35; }
.two-line .sub { color: var(--muted); font-size: 12px; }
.no-wrap { white-space: nowrap; }

/* ===== 筛选条 ===== */
.filter-bar { border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 0 1 auto; }
.filter-bar .field.grow { flex: 1 1 200px; }
.filter-bar .field.date-range { flex: 1 1 240px; }
.filter-bar .field input, .filter-bar .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.filter-bar label { font-size: 12px; color: var(--muted); font-weight: 600; }
.date-range-inputs { display: flex; align-items: center; gap: 6px; }
.date-range-inputs input { flex: 1 1 100px; min-width: 0; }
.date-range-inputs span { color: var(--muted); font-size: 12px; flex: none; }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 600; color: #5d4b3d; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid rgba(224, 94, 0, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-shadow: inset 0 1px 3px rgba(180, 80, 10, .06);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(224, 94, 0, .6);
  box-shadow: 0 0 0 3px rgba(224, 94, 0, .12);
  background: rgba(255, 255, 255, .92);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox input { width: auto; margin: 0; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; grid-column: 1 / -1; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ===== 详情页 ===== */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.detail-grid .side { display: flex; flex-direction: column; gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; }
.info-item { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(224, 94, 0, .14); }
.info-item .k { font-size: 11px; color: var(--muted); font-weight: 700; }
.info-item .v { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.opinion-box { margin-top: 14px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(224, 94, 0, .22); background: rgba(255, 255, 255, .5); white-space: pre-wrap; }
.opinion-box .k { font-size: 11px; color: #b05714; font-weight: 700; }
.preview-box { margin-top: 16px; }
.preview-frame { width: 100%; height: 68vh; border: 1px solid rgba(224, 94, 0, .18); border-radius: 14px; background: rgba(255,255,255,.6); }

/* ===== 时间线 ===== */
.timeline-card { border-radius: 18px; padding: 18px; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, rgba(224,94,0,.5), rgba(224,94,0,.12)); border-radius: 2px; }
.timeline-item { position: relative; padding: 0 0 18px 12px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a45, #e05e00);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(224, 94, 0, .3);
}
.timeline-item .tl-title { font-weight: 700; font-size: 13.5px; }
.timeline-item .tl-time { color: var(--muted); font-size: 12px; }
.timeline-item .tl-detail { margin-top: 2px; font-size: 13px; color: #5d4b3d; white-space: pre-wrap; }

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(90, 40, 10, .4);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
}
.modal { width: min(560px, 94vw); max-height: 90vh; overflow-y: auto; border-radius: 20px; padding: 22px; }
.modal h3 { margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }

/* ===== 折叠面板 ===== */
details.panel { border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
details.panel summary { cursor: pointer; font-weight: 700; color: #8a4a1f; }
details.panel[open] summary { margin-bottom: 12px; }

/* ===== Flash ===== */
.flash { border-radius: 14px; padding: 11px 16px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flash.success { border-color: rgba(47, 158, 99, .4); color: #1d7045; }
.flash.danger { border-color: rgba(214, 59, 59, .4); color: #a93226; }
.flash.info { border-color: rgba(70, 100, 200, .35); color: #465fc0; }
.flash-close { border: 0; background: transparent; font-size: 15px; color: inherit; cursor: pointer; opacity: .7; }

/* ===== 登录 ===== */
.login-logo { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 14px; display: block; box-shadow: 0 10px 30px rgba(210, 90, 0, .3); }
.login-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .5px; background: linear-gradient(120deg, #d95a00, #f44e3a); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0 0 4px; }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { padding: 11px; font-size: 15px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 4px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(224, 94, 0, .18);
}
.wecom-scan-btn { margin-top: 8px; }

/* ===== 签名板 ===== */
.signature-pad-wrap { margin-top: 6px; }
.signature-pad {
  width: 100%;
  height: 220px;
  border: 1px dashed rgba(224, 94, 0, .45);
  border-radius: 14px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.sig-tools { display: flex; gap: 8px; margin-top: 8px; }
.signature-mode-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.signature-mode-btns .btn.active { background: var(--primary-soft); border-color: rgba(224, 94, 0, .5); color: var(--primary-strong); }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(224, 94, 0, .18);
  color: #7a4a24;
  font-size: 13px;
  text-align: center;
}
.pagination .current { background: linear-gradient(135deg, #ff7a1a, #e05e00); color: #fff; border-color: transparent; font-weight: 700; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }

/* ===== 低性能模式 ===== */
body.low-perf { background: linear-gradient(160deg, #fff6ec, #ffdfc4) !important; }
body.low-perf .glass,
body.low-perf .card,
body.low-perf .topbar,
body.low-perf .table-wrap,
body.low-perf .filter-bar,
body.low-perf .modal,
body.low-perf .flash,
body.low-perf .panel,
body.low-perf .stat,
body.low-perf .timeline-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(255, 255, 255, .88) !important;
}

/* ===== AI 助手 ===== */
body.has-ai { padding-left: 344px; padding-top: 72px; transition: padding-left .25s ease; }
body.has-ai.ai-collapsed { padding-left: 0; }
.ai-widget { position: fixed; left: 18px; top: 72px; bottom: 14px; z-index: 55; width: 310px; }
.ai-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 248, 240, .96));
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 24px 70px rgba(140, 60, 10, .35), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: transform .28s cubic-bezier(.2, .8, .3, 1);
}
body.ai-collapsed .ai-panel { transform: translateX(-115%); }
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff9a45, #e05e00);
  border-radius: 19px 19px 0 0;
}
.ai-title { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.ai-logo-mini { width: 22px; height: 22px; border-radius: 7px; flex: none; box-shadow: 0 2px 6px rgba(140, 60, 10, .25); }
.btn .ai-logo-mini { width: 18px; height: 18px; border-radius: 6px; }
.ai-collapse {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .25);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background .18s;
}
.ai-collapse:hover { background: rgba(255, 255, 255, .4); }
.ai-open-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 16px 9px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-left: 0;
  border-radius: 0 16px 16px 0;
  background: linear-gradient(180deg, #ff9a45, #e05e00);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  box-shadow: 0 10px 28px rgba(224, 94, 0, .35);
  z-index: 56;
}
body.ai-collapsed .ai-open-tab { display: flex; }
.ai-open-tab:hover { background: linear-gradient(180deg, #ff8a33, #d95a00); }
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 0;
}
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.assistant { justify-content: flex-start; }
.ai-msg-body {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.user .ai-msg-body {
  background: linear-gradient(135deg, #ff8a33, #e05e00);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(224, 94, 0, .25);
}
.ai-msg.assistant .ai-msg-body {
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(224, 94, 0, .16);
  color: #3b2f28;
  border-bottom-left-radius: 5px;
  box-shadow: 0 3px 10px rgba(140, 60, 10, .08);
}
.ai-msg.typing .ai-msg-body { color: #a08270; font-style: italic; }
.ai-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(224, 94, 0, .14);
  background: rgba(255, 255, 255, .75);
}
.ai-attach {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(224, 94, 0, .22);
  border-radius: 11px;
  background: rgba(255, 255, 255, .7);
  color: #c25a00;
  font-size: 17px;
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.ai-attach:hover { background: rgba(255, 255, 255, 1); transform: translateY(-1px); }
.ai-input-row input {
  margin: 0;
  flex: 1;
}
.ai-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}
.ai-panel.dragging {
  border-color: rgba(224, 94, 0, .8);
  box-shadow: 0 0 0 3px rgba(224, 94, 0, .25), 0 24px 70px rgba(140, 60, 10, .35);
}

@media (max-width: 1180px) {
  body.has-ai { padding-left: 0; }
}
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .topbar .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .drawer { overflow-y: auto; }
  .drawer-ai { display: flex; flex: 1; min-height: 0; max-height: none; }
  .drawer-ai-messages { flex: 1; min-height: 90px; max-height: none; }
  .ai-widget { display: none; }
  .ai-open-tab { display: none !important; }
  .dash-flow-track { gap: 10px 6px; }
  .dash-flow-track .step-1 { grid-column: 1 / 3; }
  .dash-flow-track .step-2 { grid-column: 3 / 5; }
  .dash-flow-track .step-3 { grid-column: 5 / 7; }
  .dash-flow-track .step-4 { grid-column: 2 / 4; }
  .dash-flow-track .step-5 { grid-column: 4 / 6; }
  .dash-flow-track .flow-step { padding: 8px 10px; min-height: 0; text-align: center; }
  .dash-flow-track .flow-step .tl-title { font-size: 12px; }
  .dash-flow-track .flow-step .tl-detail { font-size: 10.5px; }
}
@media (max-width: 640px) {
  .topbar .userbox .user-name, .topbar .userbox .low-perf-toggle { display: none; }
  .container { padding: 0 14px; }
  .card { padding: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .filter-bar .field.grow, .filter-bar .field.date-range { grid-column: 1 / -1; }
  .filter-bar .btn { width: 100%; }
}
