/* ==================== 报价单管理系统 · v2 ==================== */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e6ebf3;
  --border-strong: #d8e0ec;
  --text: #0f172a;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0d9488;
  --success: #15803d;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --violet: #7c3aed;
  --sidebar: #0b1220;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -20px rgba(15, 23, 42, .18);
  --shadow-lg: 0 30px 80px -30px rgba(15, 23, 42, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.flex-spacer { flex: 1; }
.muted { color: var(--text-sub); }
.req { color: var(--danger); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.money, .money-strong { font-variant-numeric: tabular-nums; }
.money-strong { font-weight: 700; }
.text-danger { color: var(--danger) !important; }
.text-warn { color: var(--warn) !important; }
.danger-text { color: var(--danger) !important; }
::selection { background: #bfdbfe; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 9px; border: 1px solid transparent; font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: all .16s ease; background: #fff; color: var(--text); line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #2f6ded, #2563eb); color: #fff; box-shadow: 0 6px 16px -8px rgba(37, 99, 235, .65); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #2563eb, #1d4ed8); box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .7); }
.btn-outline { border-color: var(--border-strong); background: #fff; color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: #bfdbfe; color: var(--primary); background: #f8fbff; }
.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #166534; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-sub); transition: all .15s; }
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn-dark { color: #94a3b8; }
.icon-btn-dark:hover { background: rgba(255,255,255,.08); color: #fff; }
.link-btn { border: none; background: none; color: var(--primary); font-size: 12.5px; font-weight: 500; padding: 3px 6px; border-radius: 6px; transition: background .15s; }
.link-btn:hover { background: var(--primary-soft); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-soft); }

/* 表单 */
.input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 9px; font-size: 13.5px; background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: #93b4f8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
textarea.input { resize: vertical; min-height: 38px; line-height: 1.6; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.search-input { max-width: 280px; }
.mini-select { min-height: 28px; padding: 3px 26px 3px 8px; font-size: 12px; border-radius: 7px; width: auto; max-width: 150px; }
.form-grid { display: grid; gap: 14px 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-item > label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.form-item .input { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); margin-top: 14px; cursor: pointer; }

/* 登录 */
.login-wrap { min-height: 100vh; background: #eef2f8; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); min-height: 100vh; }
.login-brand { position: relative; overflow: hidden; background: linear-gradient(150deg, #0b1220 0%, #0f1d3a 55%, #12305f 100%); color: #fff; padding: 52px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.3), transparent 65%); top: -180px; right: -160px; pointer-events: none; }
.login-brand::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(148,163,184,.18); bottom: -120px; left: -100px; pointer-events: none; }
.login-brand-top { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; position: relative; z-index: 1; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; font-size: 19px; box-shadow: 0 8px 20px -8px rgba(37,99,235,.8); overflow: hidden; flex-shrink: 0; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.login-brand-copy { position: relative; z-index: 1; max-width: 560px; }
.login-brand-copy h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.28; letter-spacing: -.5px; margin-bottom: 18px; }
.login-brand-copy > p { color: #b6c4da; font-size: 14px; line-height: 1.85; max-width: 480px; }
.login-points { list-style: none; margin-top: 34px; display: grid; gap: 13px; }
.login-points li { display: flex; align-items: center; gap: 10px; color: #d6e0f0; font-size: 13.5px; }
.login-points .dot { width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,.12); }
.login-brand-foot { color: #7688a3; font-size: 12px; letter-spacing: .3px; position: relative; z-index: 1; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #f7f9fc; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow); }
.login-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 24px; }
.login-card h2 { font-size: 23px; letter-spacing: -.3px; }
.login-sub { color: var(--text-sub); font-size: 13px; margin: 6px 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.login-form .input { min-height: 42px; margin-bottom: 7px; }
.login-form .btn { margin-top: 10px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 12px; }
.login-tip { color: var(--text-muted); font-size: 12px; margin-top: 8px; text-align: center; }

/* 应用框架 */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: linear-gradient(180deg, #0b1220, #0d172a); color: #cbd5e1; display: flex; flex-direction: column; z-index: 95; border-right: 1px solid rgba(255,255,255,.04); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 20px; }
.sidebar-brand-text { min-width: 0; }
.brand-name { color: #fff; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.brand-sub { color: #64748b; font-size: 9.5px; letter-spacing: 2.4px; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: none; border-radius: 10px; background: transparent; color: #94a3b8; font-size: 13.5px; font-weight: 500; text-align: left; transition: all .15s; position: relative; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(148,163,184,.09); color: #e2e8f0; }
.nav-item.active { background: linear-gradient(90deg, rgba(37,99,235,.22), rgba(37,99,235,.08)); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: #60a5fa; }
.sidebar-foot { padding: 14px 14px 18px; border-top: 1px solid rgba(148,163,184,.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1d4ed8, #0ea5e9); color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar-user-text { flex: 1; min-width: 0; }
.sidebar-user-text > div:first-child { color: #e2e8f0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #64748b; font-size: 11px; }
.sidebar-mask { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 90; }
.main { margin-left: 236px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 60; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
#page-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.content { max-width: 1440px; margin: 0 auto; padding: 28px; }

/* 页面通用 */
.page { animation: page-in .2s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.5px; line-height: 1.25; }
.page-desc { color: var(--text-sub); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 工作台 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.07), transparent 70%); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-sub); font-size: 12.5px; font-weight: 500; }
.kpi-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin: 10px 0 3px; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 13px; font-weight: 500; color: var(--text-sub); margin-left: 4px; }
.kpi-hint { font-size: 11.5px; color: var(--text-muted); }
.kpi-delta { font-size: 11.5px; font-weight: 600; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; grid-auto-flow: dense; }
.dashboard-grid > .card { padding-bottom: 18px; min-width: 0; }
.dashboard-grid .chart-card { grid-column: span 2; }
.dashboard-grid .span-2 { grid-column: span 2; }
.dashboard-grid > .card:last-child { grid-column: span 3; }
.trend-chart { display: flex; align-items: flex-end; gap: 18px; height: 230px; padding: 20px 22px 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.trend-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 8px; }
.trend-bar { width: min(46px, 80%); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); min-height: 3px; transition: height .3s ease; box-shadow: 0 8px 18px -10px rgba(37,99,235,.6); }
.trend-bar.zero { background: #e2e8f0; box-shadow: none; }
.trend-amount { font-size: 11px; color: var(--text-sub); margin-top: 8px; white-space: nowrap; }
.trend-label { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.chart-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; }
.status-breakdown { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 4px; }
.status-row { display: grid; grid-template-columns: 8px 1fr 76px 34px; align-items: center; gap: 9px; padding: 8px 6px; background: none; border: none; border-radius: 8px; text-align: left; }
.status-row:hover { background: #f8fafc; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, #94a3b8); }
.status-row-name { font-size: 12.5px; color: var(--text-sub); }
.status-row-track { height: 5px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.status-row-track i { display: block; height: 100%; background: var(--sc, #94a3b8); border-radius: 99px; }
.status-row-count { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.recent-quote-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 100px 120px; align-items: center; gap: 14px; width: 100%; padding: 11px 20px; background: none; border: none; border-top: 1px solid #f1f5f9; text-align: left; }
.recent-quote-row:hover { background: #f8fafc; }
.recent-quote-main { display: flex; flex-direction: column; min-width: 0; }
.recent-quote-main b { font-size: 13px; font-weight: 700; }
.recent-quote-main span { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-quote-amount { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.recent-quote-time { font-size: 11.5px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.timeline { padding: 14px 20px 0; }
.timeline-item { position: relative; display: flex; gap: 12px; padding: 0 0 16px 4px; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 15px; bottom: 0; width: 1px; background: #eef2f7; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, #94a3b8); margin-top: 6px; flex-shrink: 0; position: relative; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.timeline-body { min-width: 0; font-size: 12.5px; color: var(--text-sub); }
.timeline-type { display: inline-block; font-weight: 700; color: var(--text); margin-right: 6px; }
.timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.timeline.compact .timeline-item { padding-bottom: 14px; }
#top-customers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 20px 0; }
.top-customer { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 13px; position: relative; overflow: hidden; }
.top-customer .rank { position: absolute; right: 10px; top: 8px; font-size: 11px; color: #cbd5e1; font-weight: 700; }
.top-customer-name { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.top-customer-amount { display: block; font-size: 14px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.top-customer-track { display: block; height: 4px; background: #e2e8f0; border-radius: 99px; margin-top: 9px; overflow: hidden; }
.top-customer-track i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 99px; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.kpi-skeleton { height: 124px; }
.chart-skeleton { height: 220px; margin: 20px; }
.detail-skeleton { height: 90px; }

/* 状态色 */
.status-draft { --sc: #64748b; --sbg: #f1f5f9; }
.status-sent { --sc: #2563eb; --sbg: #eff6ff; }
.status-accepted { --sc: #15803d; --sbg: #ecfdf5; }
.status-rejected { --sc: #dc2626; --sbg: #fef2f2; }
.status-expired { --sc: #b45309; --sbg: #fffbeb; }
.status-void { --sc: #94a3b8; --sbg: #f8fafc; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: var(--sc); background: var(--sbg); white-space: nowrap; }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sc); }
.mini-tag { display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 600; color: var(--warn); background: var(--warn-soft); vertical-align: 1px; white-space: nowrap; }
.evt-created { --sc: #64748b; }
.evt-updated { --sc: #2563eb; }
.evt-sent { --sc: #2563eb; }
.evt-accepted { --sc: #15803d; }
.evt-rejected { --sc: #dc2626; }
.evt-void { --sc: #94a3b8; }
.evt-restored { --sc: #b45309; }
.evt-viewed { --sc: #7c3aed; }

/* 列表与表格 */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: none; background: none; color: var(--text-sub); font-size: 13px; font-weight: 500; white-space: nowrap; position: relative; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); font-weight: 700; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px 2px 0 0; }
.tab-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; background: #f1f5f9; color: var(--text-sub); font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary); }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; }
.list-card { overflow: hidden; }
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 16px 18px; flex-wrap: wrap; border-bottom: 1px solid #f1f5f9; }
.filter-bar .input { width: auto; }
.filter-bar .search-input { flex: 1; max-width: 300px; min-width: 180px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: #fff; color: var(--text-sub); font-size: 12px; padding: 4px 10px; border-radius: 99px; transition: all .15s; white-space: nowrap; }
.chip:hover { border-color: #bfdbfe; color: var(--primary); }
.chip.active { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); font-weight: 600; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; background: #f8fafc; color: var(--text-sub); font-weight: 600; font-size: 11.5px; white-space: nowrap; border-bottom: 1px solid var(--border); letter-spacing: .2px; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .r { text-align: right; }
.data-table .c { text-align: center; }
.data-table .empty-cell { text-align: center; color: var(--text-muted); padding: 36px 14px !important; }
.row-title { font-weight: 600; font-size: 13px; }
.row-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.version-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; background: #f1f5f9; color: var(--text-sub); font-size: 10.5px; font-weight: 700; font-family: var(--mono); }
.view-count { font-size: 12px; color: var(--text-sub); }
.view-cell { white-space: nowrap; }
.row-actions { white-space: nowrap; }
.quotes-table tbody tr { cursor: pointer; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border-top: 1px solid #f1f5f9; }
.page-info { color: var(--text-sub); font-size: 12.5px; }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-icon { font-size: 42px; margin-bottom: 10px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--text-sub); font-size: 13px; margin-bottom: 18px; }
.empty-tip { text-align: center; color: var(--text-muted); font-size: 13px; padding: 26px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-green { background: var(--success-soft); color: var(--success); }
.tag-amber { background: var(--warn-soft); color: var(--warn); }
.term-content { max-width: 520px; color: var(--text-sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 编辑器 */
.editor-page-head { align-items: center; }
.editor-head-left { display: flex; align-items: center; gap: 12px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 18px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 82px; }
.form-card { padding-bottom: 20px; }
.form-card > .form-grid, .form-card > .terms-grid, .form-card > .items-table-wrap { padding: 16px 20px 0; }
.terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.items-table-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 1180px; }
.items-table th { text-align: left; padding: 8px; background: #f8fafc; color: var(--text-sub); border: 1px solid var(--border); font-weight: 600; font-size: 11px; white-space: nowrap; }
.items-table td { padding: 5px; border: 1px solid var(--border); vertical-align: middle; }
.items-table .input { padding: 6px 8px; font-size: 12.5px; border-radius: 6px; min-height: 32px; }
.items-table .num-input { text-align: right; }
.items-table .c { text-align: center; }
.line-subtotal { font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-subtotal-detail { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; }
.img-cell { text-align: center; }
.img-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); display: block; margin: 0 auto 3px; }
.img-add-btn { width: 46px; height: 46px; border: 1px dashed var(--border-strong); border-radius: 7px; background: #f8fafc; color: var(--text-muted); font-size: 11px; }
.img-add-btn:hover { border-color: var(--primary); color: var(--primary); }
.totals-card { padding: 18px 20px 20px; }
.totals-card .card-head { padding: 0 0 12px; }
.total-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-sub); font-size: 13px; }
.total-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.total-row.grand { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 12px; font-size: 15px; }
.total-row.grand span { color: var(--text); font-weight: 600; }
.total-row.grand b { color: var(--danger); font-size: 21px; font-weight: 800; }
.total-words { background: #f8fafc; border-radius: 9px; padding: 9px 11px; margin-top: 10px; font-size: 12px; color: var(--text-sub); word-break: break-all; }
.editor-actions { display: flex; gap: 9px; margin-top: 16px; }
.editor-actions .btn { flex: 1; }
.save-hint { color: var(--text-muted); font-size: 11.5px; margin-top: 10px; text-align: center; }
.tips-card { padding: 18px 20px; }
.tips-card h3 { font-size: 13px; margin-bottom: 10px; }
.tips-card ul { list-style: none; display: grid; gap: 8px; }
.tips-card li { position: relative; padding-left: 15px; color: var(--text-sub); font-size: 12px; line-height: 1.6; }
.tips-card li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: #93c5fd; }
.notice { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; font-size: 12.5px; line-height: 1.7; }
.notice b { color: #78350f; }

/* 设置 */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid > .card { padding-bottom: 20px; }
.settings-grid > .card > .form-grid { padding: 16px 20px 0; }
.settings-grid > .card:last-child { grid-column: span 2; }
.logo-upload { display: flex; align-items: center; gap: 14px; }
.logo-preview { width: 92px; height: 64px; border: 1px dashed var(--border-strong); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; background: #f8fafc; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.has-image { border-style: solid; background: #fff; }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hint { color: var(--text-muted); font-size: 11px; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-top: 1px solid #f1f5f9; }
.security-row:first-of-type { border-top: none; }
.security-row b { font-size: 13px; }
.security-row p { font-size: 12px; margin-top: 3px; }

/* 预览与文档 */
.preview-toolbar { max-width: 900px; margin: 0 auto 16px; display: flex; align-items: center; gap: 10px; }
.quote-doc { max-width: 900px; margin: 0 auto 48px; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); padding: 44px 48px; color: #111827; }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid #1e3a8a; margin-bottom: 20px; }
.doc-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-logo { max-width: 120px; max-height: 52px; object-fit: contain; }
.doc-company { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.doc-company-sub { color: #6b7280; font-size: 11px; margin-top: 3px; }
.doc-head-right { text-align: right; flex-shrink: 0; }
.doc-title { font-size: 16px; font-weight: 700; letter-spacing: 6px; color: #1e3a8a; }
.doc-no { font-family: var(--mono); color: #6b7280; font-size: 11.5px; margin-top: 5px; }
.doc-banner { padding: 8px 12px; border-radius: 6px; font-size: 12.5px; text-align: center; margin-bottom: 16px; font-weight: 600; }
.doc-banner-draft { background: #f1f5f9; color: #475569; }
.doc-banner-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.doc-banner-success { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; margin-bottom: 18px; font-size: 12.5px; }
.doc-meta > div { display: flex; gap: 8px; }
.doc-meta .k { color: #6b7280; width: 68px; flex-shrink: 0; }
.doc-meta .span-2 { grid-column: span 2; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 14px; }
.doc-table th { background: #f1f5f9; border: 1px solid #d1d5db; padding: 7px 6px; font-weight: 700; }
.doc-table td { border: 1px solid #d1d5db; padding: 7px 6px; vertical-align: top; }
.doc-table .r { text-align: right; }
.doc-table .c { text-align: center; }
.doc-prod-img { max-width: 54px; max-height: 54px; border-radius: 4px; display: block; margin-bottom: 4px; }
.doc-params { color: #6b7280; font-size: 10px; line-height: 1.45; margin-top: 2px; }
.doc-totals { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.doc-totals-inner { width: 280px; font-size: 12.5px; }
.doc-totals-inner .row { display: flex; justify-content: space-between; padding: 3px 0; color: #4b5563; }
.doc-totals-inner .grand { border-top: 1.5px solid #111827; margin-top: 5px; padding-top: 8px; font-size: 15px; color: #111827; font-weight: 800; }
.doc-words { background: #f8fafc; padding: 8px 12px; border-radius: 5px; font-size: 12px; margin-bottom: 16px; word-break: break-all; }
.doc-terms, .doc-bank { font-size: 12.5px; margin-bottom: 7px; line-height: 1.7; }
.doc-terms .k, .doc-bank .k { color: #6b7280; margin-right: 6px; }
.doc-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 30px 0 20px; font-size: 12.5px; color: #374151; }
.doc-signatures > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.doc-signatures i { display: inline-block; flex: 1; border-bottom: 1px solid #9ca3af; min-width: 100px; height: 20px; }
.doc-signatures small { color: #6b7280; margin-left: 8px; }
.doc-footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #e5e7eb; display: flex; justify-content: space-between; gap: 20px; color: #6b7280; font-size: 10.5px; }
.quote-doc.template-compact { padding: 30px 36px; }
.quote-doc.template-compact .doc-prod-img, .quote-doc.template-compact .doc-params { display: none; }
.quote-doc.template-compact .doc-table td { padding: 5px; }
.quote-doc.template-compact .doc-signatures { margin: 20px 0 14px; }

/* 详情抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 120; display: flex; justify-content: flex-end; backdrop-filter: blur(2px); }
.drawer { width: 720px; max-width: 100%; height: 100%; background: #f8fafc; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(15,23,42,.2); animation: drawer-in .22s ease; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { background: #fff; padding: 22px 24px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-eyebrow { font-size: 11.5px; color: var(--text-muted); letter-spacing: .3px; }
.drawer-head h2 { font-size: 20px; letter-spacing: -.3px; margin-top: 4px; }
.drawer-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.drawer-actions { background: #fff; padding: 12px 24px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; }
.detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.detail-stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.detail-stat span { display: block; font-size: 11px; color: var(--text-muted); }
.detail-stat b { display: block; font-size: 15px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.detail-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.detail-block h3 { font-size: 13px; margin-bottom: 12px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.meta-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-grid span { font-size: 11px; color: var(--text-muted); }
.meta-grid b { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.detail-items-table { font-size: 12px; }
.detail-items-table th, .detail-items-table td { padding: 8px 10px; }
.terms-list { display: grid; gap: 10px; }
.terms-list > div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 12.5px; }
.terms-list span { color: var(--text-muted); }
.terms-list p { white-space: pre-wrap; word-break: break-word; }
.internal-note p { color: var(--warn); background: var(--warn-soft); padding: 7px 9px; border-radius: 6px; }
.share-row { display: flex; gap: 8px; }
.share-row .input { font-size: 12px; color: var(--text-sub); }
.version-list { display: grid; gap: 8px; }
.version-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; }
.version-item .version-badge { margin-top: 2px; }
#detail-tab-content .timeline { padding: 0; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 480px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: modal-in .18s ease; }
@keyframes modal-in { from { transform: translateY(8px) scale(.99); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-lg { width: 900px; }
.modal-sm { width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; }
.modal-close { border: none; background: none; font-size: 16px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-body .form-grid { margin-bottom: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-text { color: var(--text); font-size: 13.5px; line-height: 1.7; }
.qr-body { text-align: center; }
.qr-canvas-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.qr-canvas-wrap canvas { border: 1px solid var(--border); border-radius: 10px; }
.qr-tip { color: var(--text-sub); font-size: 12.5px; margin-bottom: 14px; }
.qr-url-row { display: flex; gap: 8px; margin-bottom: 14px; }
.qr-url-row .input { font-size: 12px; color: var(--text-sub); }
.img-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.upload-hint { color: var(--text-muted); font-size: 11px; }
#customer-modal, #product-modal, #term-modal { z-index: 160; }
#confirm-modal, #reason-modal { z-index: 170; }

/* 产品选择 */
.toolbar-compact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pick-card { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; text-align: left; transition: all .13s; position: relative; min-width: 0; }
.pick-card:hover { border-color: #bfdbfe; box-shadow: 0 6px 18px -12px rgba(37,99,235,.4); }
.pick-card.selected { border-color: var(--primary); background: #f8fbff; }
.pick-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: #f1f5f9; flex-shrink: 0; }
.pick-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 10px; }
.pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pick-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-model { color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-price { color: var(--danger); font-weight: 700; font-size: 12px; margin-top: 2px; }
.pick-check { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; opacity: 0; }
.pick-card.selected .pick-check { opacity: 1; }
.pick-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.pick-count { color: var(--text-sub); font-size: 12.5px; }
.customer-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; }
.customer-pick-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px; border: none; border-bottom: 1px solid #f1f5f9; background: none; text-align: left; border-radius: 8px; }
.customer-pick-row:hover { background: #f8fafc; }
.customer-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.customer-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.customer-pick-main b { font-size: 13px; }
.customer-pick-main span { font-size: 11.5px; color: var(--text-sub); }
.customer-pick-meta { font-size: 11px; color: var(--text-muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 16px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 300; max-width: 80vw; box-shadow: 0 16px 30px -12px rgba(15,23,42,.45); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* 移动端扫码页 */
.m-wrap { max-width: 640px; margin: 0 auto; padding-bottom: 40px; }
.m-header { background: linear-gradient(150deg, #0b1220, #12305f); color: #fff; padding: 26px 20px 22px; border-radius: 0 0 20px 20px; }
.m-header-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.m-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; }
.m-company { font-size: 16px; font-weight: 700; }
.m-title { font-size: 12px; opacity: .72; letter-spacing: 3px; }
.m-status-banner { margin: 12px 14px 0; padding: 9px 13px; border-radius: 10px; font-size: 12.5px; text-align: center; font-weight: 600; }
.m-status-ok { background: var(--primary-soft); color: var(--primary); }
.m-status-warn { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.m-status-success { background: var(--success-soft); color: var(--success); border: 1px solid #bbf7d0; }
.m-meta { background: #fff; margin: -12px 14px 0; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 13px; border: 1px solid var(--border); }
.m-meta-row { display: flex; padding: 3px 0; }
.m-meta-row .k { color: var(--text-sub); width: 92px; flex-shrink: 0; }
.m-meta-row .v { flex: 1; word-break: break-all; }
.m-section-title { margin: 18px 20px 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.m-item { background: #fff; margin: 10px 14px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.m-item-img { width: 100%; height: 170px; object-fit: cover; display: block; background: #f1f5f9; }
.m-item-body { padding: 12px 14px; }
.m-item-name { font-size: 14px; font-weight: 700; }
.m-item-model { color: var(--text-sub); font-size: 12px; margin-top: 2px; }
.m-item-params { color: var(--text-sub); font-size: 12px; margin-top: 6px; line-height: 1.55; background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.m-item-row { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.5px; }
.m-item-row .k { color: var(--text-sub); }
.m-item-subtotal { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: baseline; }
.m-item-subtotal .v { color: var(--danger); font-weight: 800; font-size: 16px; }
.m-summary { background: #fff; margin: 14px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 14px 16px; }
.m-summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--text-sub); }
.m-summary-row b { color: var(--text); }
.m-summary-grand { border-top: 1.5px solid var(--text); margin-top: 8px; padding-top: 10px; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; }
.m-summary-grand .v { color: var(--danger); font-size: 22px; }
.m-words { background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: 12px; color: var(--text-sub); word-break: break-all; }
.m-contact { background: #fff; margin: 14px; border-radius: 12px; border: 1px solid var(--border); padding: 14px 16px; font-size: 12.5px; color: var(--text-sub); display: grid; gap: 6px; }
.m-footer { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 18px; padding: 0 20px; line-height: 1.7; }
.m-print-btn { position: fixed; right: 16px; bottom: 20px; border-radius: 99px; padding: 10px 16px; box-shadow: 0 12px 26px -10px rgba(15,23,42,.5); }
.m-error { text-align: center; padding: 80px 30px; }
.m-error-icon { font-size: 52px; }
.m-error h2 { font-size: 18px; margin: 16px 0 8px; }
.m-error p { color: var(--text-sub); font-size: 13px; }

/* 打印 */
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .preview-toolbar, .drawer-mask, .modal-mask, .toast, .sidebar-mask, .no-print { display: none !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .page { display: none !important; }
  #page-preview { display: block !important; }
  .quote-doc { max-width: 100% !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; }
  .doc-table th, .doc-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #page-preview .quote-doc.template-compact { padding: 0 !important; }
  .m-wrap { max-width: 100% !important; }
  .m-header { background: #0b1220 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .m-print-btn, .m-status-banner { display: none !important; }
}

/* 响应式 */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid .chart-card, .dashboard-grid .span-2, .dashboard-grid > .card:last-child { grid-column: span 2; }
  #top-customers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three .span-3 { grid-column: span 2; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 24px; background: #eef2f8; min-height: 100vh; }
  .login-mobile-brand { display: flex; }
  .content { padding: 20px; }
  .topbar { padding: 0 20px; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > .card:last-child { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .chart-card, .dashboard-grid .span-2, .dashboard-grid > .card:last-child { grid-column: span 1; }
  #top-customers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { width: 100%; }
  .form-grid.two, .form-grid.three, .terms-grid { grid-template-columns: 1fr; }
  .span-2, .span-3, .form-grid.three .span-3 { grid-column: span 1; }
  .doc-meta .span-2 { grid-column: span 1; }
  .card-head { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .content { padding: 14px; }
  .topbar { padding: 0 14px; height: 58px; }
  .page-subtitle { display: none; }
  .page-head h1 { font-size: 22px; }
  .page-head { margin-bottom: 16px; }
  .kpi-grid { gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .login-panel { padding: 16px; }
  .login-card { padding: 30px 22px; border-radius: 16px; }
  .filter-bar { padding: 12px 14px; gap: 8px; }
  .filter-bar .search-input { flex-basis: 100%; max-width: 300px; }
  .filter-bar .input { flex: 1; }
  .tabs { margin-bottom: 10px; }
  .tab { padding: 9px 10px; font-size: 12.5px; }
  .recent-quote-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .recent-quote-time { display: none; }
  .recent-quote-amount { grid-column: 2; grid-row: 2; font-size: 12px; }
  .trend-chart { gap: 8px; padding: 14px 14px 6px; height: 200px; }
  .trend-bar { width: 60%; }
  #top-customers { grid-template-columns: 1fr 1fr; }
  .pick-grid { grid-template-columns: 1fr; max-height: 60vh; }
  .drawer-head, .drawer-actions, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; width: 100%; }
  .modal-lg { width: 100%; }
  .doc-signatures { grid-template-columns: 1fr; gap: 16px; }
  .doc-footer { flex-direction: column; gap: 6px; }
  .quote-doc { padding: 24px 18px; }
  .doc-head { flex-direction: column; gap: 12px; }
  .doc-head-right { text-align: left; }
  .doc-meta { grid-template-columns: 1fr; }
  .doc-meta .span-2 { grid-column: span 1; }
  .doc-table { font-size: 10.5px; }
  .doc-table th, .doc-table td { padding: 5px 4px; }
  .doc-totals-inner { width: 240px; }
  .doc-words { font-size: 11px; }
  .settings-grid { gap: 12px; }
}
