:root {
  --primary: #1a5fb4;
  --primary-light: #3584e4;
  --primary-dark: #12447f;
  --accent: #2ec27e;
  --danger: #e01b24;
  --warning: #e5a50a;
  --info: #3584e4;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1c2536;
  --text-2: #5e6c84;
  --text-3: #97a0af;
  --border: #e3e8f0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(28, 37, 54, .08), 0 4px 14px rgba(28, 37, 54, .05);
  --shadow-lg: 0 8px 30px rgba(28, 37, 54, .12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

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

.sidebar {
  width: 216px; flex: 0 0 216px;
  background: linear-gradient(175deg, #12447f 0%, #1a5fb4 55%, #2b6fc4 100%);
  color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }

.sidebar .brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar .brand .logo {
  display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .logo-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; letter-spacing: -.5px; flex: 0 0 38px;
}
.sidebar .brand .logo-text { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.sidebar .brand .logo-sub { font-size: 10.5px; opacity: .68; margin-top: 1px; letter-spacing: .2px; }

.nav { padding: 10px 0; flex: 1; }
.nav-group { padding: 12px 18px 5px; font-size: 10.5px; letter-spacing: 1px; color: rgba(255,255,255,.45); font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9.5px 18px; color: rgba(255,255,255,.86);
  font-size: 13.5px; transition: .16s; border-left: 3px solid transparent; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; border-left-color: #7fd4a8; font-weight: 600; }
.nav-item .ico { width: 17px; text-align: center; font-size: 14.5px; flex: 0 0 17px; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600; min-width: 18px; text-align: center;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 11px 22px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .page-title { font-size: 16.5px; font-weight: 700; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-btn { display: none; }

.content { padding: 18px 22px 40px; flex: 1; max-width: 1500px; width: 100%; }

/* ========== 顶部用户 ========== */
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 20px; background: #f2f5fa; cursor: pointer; transition: .16s;
}
.user-chip:hover { background: #e8eef7; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}
.avatar.lg { width: 52px; height: 52px; flex: 0 0 52px; font-size: 19px; }
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .udept { font-size: 11px; color: var(--text-3); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 176px; padding: 6px; display: none; z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px;
}
.dropdown-menu a:hover { background: #f2f5fa; color: var(--primary); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ========== 卡片 ========== */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: #fbfcfe;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; flex: 1; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ========== 统计卡 ========== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 15px 17px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 13px; transition: .18s; position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .s-ico {
  width: 44px; height: 44px; border-radius: 11px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: #eaf1fb; color: var(--primary);
}
.stat-card .s-val { font-size: 23px; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; }
.stat-card .s-label { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.stat-card.g .s-ico { background: #e6f6ee; color: #1d8a56; }
.stat-card.o .s-ico { background: #fdf3e0; color: #b8810a; }
.stat-card.r .s-ico { background: #fdeaea; color: #c01c24; }
.stat-card.p .s-ico { background: #f1ecfd; color: #6b46c1; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .16s; font-family: inherit; white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--primary-light); color: #fff; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: #f6f8fc; border-color: #c8d4e4; color: var(--primary); }
.btn.success { background: var(--accent); }
.btn.success:hover { background: #26a86c; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #c8171f; }
.btn.warn { background: var(--warning); }
.btn.warn:hover { background: #cc9108; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.lg { padding: 11px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ========== 表单 ========== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11.5px; color: var(--text-3); }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: 8.5px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
  transition: .16s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(53,132,228,.12); }
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%235e6c84' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.checkbox-group, .radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 20px; font-size: 13px;
  cursor: pointer; transition: .16s; background: #fff; user-select: none;
}
.check-item:hover { border-color: var(--primary-light); background: #f6faff; }
.check-item.checked { background: #eaf1fb; border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.check-item input { margin: 0; accent-color: var(--primary); }

/* ========== 表格 ========== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th {
  background: #f7f9fc; color: var(--text-2); font-weight: 600; text-align: left;
  padding: 10px 13px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px;
}
table td { padding: 10px 13px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
table tbody tr:hover { background: #fafcff; }
table tbody tr:last-child td { border-bottom: none; }
table .num { text-align: right; font-variant-numeric: tabular-nums; }
table .ctr { text-align: center; }
table .nowrap { white-space: nowrap; }

/* ========== 标签 ========== */
.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px;
  border-radius: 11px; font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.tag.blue { background: #e8f0fd; color: #1a5fb4; }
.tag.green { background: #e6f6ee; color: #1a7f4e; }
.tag.red { background: #fdeaea; color: #c01c24; }
.tag.orange { background: #fdf3e0; color: #a8730a; }
.tag.gray { background: #eef1f6; color: #5e6c84; }
.tag.purple { background: #f1ecfd; color: #6b46c1; }
.tag.teal { background: #e2f6f4; color: #14746b; }

/* ========== 列表项 ========== */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 17px;
  border-bottom: 1px solid #f0f3f8; transition: .14s; cursor: pointer;
}
.list-item:hover { background: #fafcff; }
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.list-item .li-right { text-align: right; flex: 0 0 auto; }

/* ========== 审批时间轴 ========== */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: #e3e8f0;
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -24px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid #cdd6e3; display: flex; align-items: center;
  justify-content: center; font-size: 9px; color: #fff;
}
.tl-item.done .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-item.reject .tl-dot { background: var(--danger); border-color: var(--danger); }
.tl-item.current .tl-dot { background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,95,180,.15); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(26,95,180,.15); } 50% { box-shadow: 0 0 0 7px rgba(26,95,180,.06); } }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tl-comment {
  margin-top: 6px; padding: 7px 11px; background: #f5f8fc; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2); border-left: 3px solid #cdd6e3;
}

/* ========== 标签页 ========== */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); overflow-x: auto;
  -webkit-overflow-scrolling: touch; margin-bottom: 15px; }
.tab {
  padding: 9px 15px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; transition: .16s; font-weight: 500;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab .cnt { font-size: 11px; color: var(--text-3); margin-left: 3px; }

/* ========== 徽标/分数环 ========== */
.score-ring {
  width: 108px; height: 108px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; margin: 0 auto;
  background: conic-gradient(var(--sc, var(--accent)) calc(var(--p) * 1%), #edf1f7 0);
  position: relative;
}
.score-ring::after {
  content: ''; position: absolute; inset: 9px; background: #fff; border-radius: 50%;
}
.score-ring .sr-val { position: relative; z-index: 1; font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.score-ring .sr-label { position: relative; z-index: 1; font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ========== 提示 ========== */
.alert {
  padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 14px; display: flex; gap: 9px; align-items: flex-start; line-height: 1.6;
}
.alert.info { background: #eaf1fb; color: #12447f; border: 1px solid #cfe0f7; }
.alert.ok { background: #e6f6ee; color: #14683f; border: 1px solid #c2e8d3; }
.alert.warn { background: #fdf3e0; color: #8a6008; border: 1px solid #f7e0b5; }
.alert.err { background: #fdeaea; color: #a3161d; border: 1px solid #f8cccc; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999;
  display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; width: 92%; max-width: 440px; }
.toast {
  background: #1c2536; color: #fff; padding: 11px 20px; border-radius: 24px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .28s ease;
  max-width: 100%; word-break: break-word; text-align: center;
}
.toast.ok { background: #1a7f4e; }
.toast.err { background: #c01c24; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,28,42,.5); z-index: 9000;
  display: none; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 13px; width: 100%; max-width: 600px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: modalIn .24s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 15px 19px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; font-size: 15px; font-weight: 700; }
.modal-head .close { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 21px;
  line-height: 1; padding: 0 4px; }
.modal-head .close:hover { color: var(--danger); }
.modal-body { padding: 19px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 13px 19px; border-top: 1px solid var(--border);
  display: flex; gap: 9px; justify-content: flex-end; }

/* ========== 智能审核问题卡 ========== */
.issue {
  border: 1px solid var(--border); border-left: 4px solid #cdd6e3;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.issue.error { border-left-color: var(--danger); background: #fffafa; }
.issue.warning { border-left-color: var(--warning); background: #fffdf8; }
.issue.info { border-left-color: var(--info); background: #fafcff; }
.issue .is-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.issue .is-title { font-size: 13.5px; font-weight: 700; }
.issue .is-desc { font-size: 12.8px; color: var(--text-2); line-height: 1.65; }
.issue .is-sug { font-size: 12.5px; color: #14683f; background: #f2faf6; padding: 7px 10px;
  border-radius: 5px; margin-top: 7px; line-height: 1.6; }
.issue .is-loc { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* ========== 报价选择器 ========== */
.qcat { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 11px; overflow: hidden; }
.qcat-head {
  padding: 11px 15px; background: #f7f9fc; font-size: 13.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.qcat-head .arrow { margin-left: auto; transition: .2s; color: var(--text-3); }
.qcat.open .qcat-head .arrow { transform: rotate(90deg); }
.qcat-body { display: none; padding: 8px; }
.qcat.open .qcat-body { display: block; }
.qitem { padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; transition: .14s;
  display: flex; align-items: center; gap: 9px; }
.qitem:hover { background: #f2f6fd; }
.qitem .qi-name { flex: 1; font-size: 13px; }
.qitem .qi-price { font-size: 12px; color: var(--accent); font-weight: 700; }

.quote-line { border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 9px; background: #fbfcfe; }
.quote-line .ql-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.quote-line .ql-name { font-size: 13px; font-weight: 700; flex: 1; }
.quote-line .ql-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.quote-line .ql-grid .field label { font-size: 11.5px; }
.quote-line .ql-grid input, .quote-line .ql-grid select { padding: 6px 9px; font-size: 12.5px; }

.total-box { background: linear-gradient(135deg, #f7f9fc, #eef3fa); border-radius: var(--radius);
  padding: 15px 17px; border: 1px solid var(--border); }
.total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.total-row.big { font-size: 19px; font-weight: 800; color: var(--danger); padding-top: 10px;
  border-top: 1px dashed #cdd6e3; margin-top: 6px; }
.total-row .cn { font-size: 12px; color: var(--text-2); font-weight: 400; }

/* ========== 报告明细两栏 ========== */
.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }

/* ========== 空状态 ========== */
.empty { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty .e-ico { font-size: 40px; opacity: .35; margin-bottom: 10px; }
.empty .e-text { font-size: 13.5px; }

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #0d2f5c 0%, #1a5fb4 48%, #2b8ac4 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.11), transparent 68%);
  top: -190px; right: -150px;
}
.login-page::after {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,194,126,.14), transparent 68%);
  bottom: -180px; left: -130px;
}
.login-box {
  background: rgba(255,255,255,.98); border-radius: 17px; padding: 38px 34px;
  width: 100%; max-width: 408px; box-shadow: 0 22px 60px rgba(8,20,40,.3);
  position: relative; z-index: 1;
}
.login-box .lb-logo {
  width: 58px; height: 58px; border-radius: 15px; margin: 0 auto 15px;
  background: linear-gradient(135deg, #1a5fb4, #2b8ac4); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 25px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(26,95,180,.32);
}
.login-box h1 { font-size: 19px; margin: 0 0 5px; text-align: center; font-weight: 700; letter-spacing: .3px; }
.login-box .lb-sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin-bottom: 24px; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn { margin-top: 6px; height: 42px; font-size: 15px; }
.login-foot { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 20px; line-height: 1.7; }

.demo-accounts { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 14px; }
.demo-accounts .da-title { font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; text-align: center; }
.demo-accounts .da-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.demo-accounts .da-item {
  font-size: 11.5px; padding: 3px 9px; border-radius: 11px; background: #f2f5fa;
  color: var(--text-2); cursor: pointer; transition: .15s; border: 1px solid transparent;
}
.demo-accounts .da-item:hover { background: #e8f0fd; color: var(--primary); border-color: #cfe0f7; }

/* ========== 底部移动导航 ========== */
.tabbar { display: none; }

/* ========== 工具类 ========== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.bold { font-weight: 700; }
.hide { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nowrap { white-space: nowrap; }
.pointer { cursor: pointer; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* ========== 响应式：平板 ========== */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}

/* ========== 响应式：手机 ========== */
@media (max-width: 820px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    transform: translateX(-100%); transition: transform .26s ease; width: 244px;
    box-shadow: 6px 0 28px rgba(10,20,40,.24);
  }
  .sidebar.open { transform: none; }
  .sidebar-mask {
    position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 199;
    display: none; backdrop-filter: blur(1px);
  }
  .sidebar-mask.show { display: block; }

  .topbar { padding: 9px 13px; }
  .topbar .menu-btn { display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; background: #f2f5fa; border: none;
    font-size: 17px; cursor: pointer; color: var(--text); flex: 0 0 34px; }
  .topbar .page-title { font-size: 15.5px; }
  .user-chip .uname, .user-chip .udept { display: none; }
  .user-chip { padding: 3px; background: transparent; }

  .content { padding: 13px 12px calc(78px + var(--safe-bottom)); }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 13px; gap: 10px; }
  .stat-card .s-ico { width: 38px; height: 38px; flex: 0 0 38px; font-size: 17px; border-radius: 9px; }
  .stat-card .s-val { font-size: 19.5px; }
  .stat-card .s-label { font-size: 11px; }

  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }

  .card-body { padding: 14px 13px; }
  .card-head { padding: 11px 13px; }
  .card-head h3 { font-size: 14px; }

  .table-wrap table { font-size: 12.5px; min-width: 560px; }
  table th, table td { padding: 9px 10px; }

  .btn-row { gap: 7px; }
  .btn { padding: 8px 13px; font-size: 13px; }
  .btn.sm { padding: 5px 9px; font-size: 12px; }
  .btn.block-sm { width: 100%; }

  .modal { max-width: 100%; max-height: 92vh; border-radius: 13px 13px 0 0; }
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }

  .issue { padding: 11px 12px; }
  .score-ring { width: 92px; height: 92px; }
  .score-ring .sr-val { font-size: 23px; }

  /* 底部导航 */
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: rgba(255,255,255,.97); border-top: 1px solid var(--border);
    padding: 5px 0 calc(5px + var(--safe-bottom)); backdrop-filter: blur(10px);
    box-shadow: 0 -2px 14px rgba(28,37,54,.06);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 2px; color: var(--text-3); font-size: 10.5px; position: relative; transition: .15s;
  }
  .tabbar a .tb-ico { font-size: 19px; line-height: 1; }
  .tabbar a.active { color: var(--primary); font-weight: 600; }
  .tabbar a .tb-badge {
    position: absolute; top: 1px; right: 50%; margin-right: -20px;
    background: var(--danger); color: #fff; font-size: 9.5px; padding: 0 5px;
    border-radius: 8px; font-weight: 600; min-width: 16px; text-align: center; line-height: 15px;
  }

  .list-item { padding: 12px 13px; gap: 10px; }
  .list-item .li-title { font-size: 13px; }
  .tabs { margin-bottom: 12px; }
  .tab { padding: 8px 12px; font-size: 13px; }

  .quote-line .ql-grid { grid-template-columns: 1fr 1fr; }
  .login-box { padding: 30px 22px; }
  .login-box h1 { font-size: 17.5px; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 10px 11px; }
  .stat-card .s-val { font-size: 17.5px; }
  .stat-card .s-ico { width: 34px; height: 34px; flex: 0 0 34px; font-size: 15px; }
  .quote-line .ql-grid { grid-template-columns: 1fr; }
}

/* ========== 打印 ========== */
@media print {
  .sidebar, .topbar, .tabbar, .btn-row, .no-print { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}
