/* 基础变量与重置 */
:root {
  --primary: #315efb;
  --primary-dark: #2449d8;
  --primary-light: #edf2ff;
  --primary-border: #d9e2ff;
  --text: #182034;
  --text-secondary: #58647a;
  --text-muted: #8a94a8;
  --border: #e6eaf0;
  --border-dark: #d6dce7;
  --surface: #ffffff;
  --background: #f5f7fb;
  --sidebar: #111a30;
  --success: #129566;
  --success-bg: #eaf8f1;
  --warning: #c87912;
  --warning-bg: #fff6e5;
  --danger: #d34545;
  --danger-bg: #fff0f0;
  --info: #2672d8;
  --info-bg: #edf5ff;
  --purple: #7357d9;
  --purple-bg: #f2efff;
  --shadow-sm: 0 1px 2px rgba(20, 32, 60, .03), 0 2px 8px rgba(20, 32, 60, .025);
  --shadow-md: 0 12px 32px rgba(24, 38, 70, .1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 236px;
  --topbar-height: 76px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #dce5ff; color: #183591; }
:focus-visible { outline: 3px solid rgba(49, 94, 251, .2); outline-offset: 2px; }

/* 登录 */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 44%) 1fr; background: var(--surface); }
.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 56px clamp(40px, 6vw, 88px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #17347f 0%, #214cb5 54%, #3266d8 100%);
}
.login-brand-panel::before,
.login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand-panel::before { width: 460px; height: 460px; top: -230px; right: -180px; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02); }
.login-brand-panel::after { width: 320px; height: 320px; bottom: -220px; left: -80px; background: rgba(255,255,255,.04); }
.login-brand-content { position: relative; z-index: 1; width: 100%; max-width: 510px; margin: auto; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--primary); flex: 0 0 auto; }
.brand-mark svg { width: 23px; height: 23px; }
.brand-mark-large { width: 52px; height: 52px; margin-bottom: 38px; color: #2454c5; background: #fff; border-radius: 14px; box-shadow: 0 10px 24px rgba(7, 25, 67, .18); }
.brand-mark-large svg { width: 28px; height: 28px; }
.login-eyebrow { margin-bottom: 12px; color: rgba(255,255,255,.65); font-size: 12px; font-weight: 600; letter-spacing: 3px; }
.login-brand-content h1 { font-size: clamp(32px, 3.3vw, 46px); font-weight: 650; line-height: 1.35; letter-spacing: 1px; }
.login-intro { max-width: 440px; margin-top: 20px; color: rgba(255,255,255,.74); font-size: 15px; line-height: 1.9; }
.login-feature-list { display: grid; gap: 24px; margin-top: 52px; }
.login-feature { display: flex; align-items: center; gap: 15px; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #e5edff; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; background: rgba(255,255,255,.08); }
.feature-icon svg { width: 22px; height: 22px; }
.login-feature div { display: grid; gap: 3px; }
.login-feature strong { font-size: 14px; font-weight: 550; }
.login-feature div span { color: rgba(255,255,255,.58); font-size: 12px; }
.login-brand-footer { position: relative; z-index: 1; color: rgba(255,255,255,.42); font-size: 12px; text-align: center; }
.login-form-panel { position: relative; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 48px 28px 70px; background: #fff; }
.login-card { width: 100%; max-width: 400px; }
.login-heading { margin-bottom: 34px; }
.login-badge { display: inline-flex; padding: 4px 10px; margin-bottom: 18px; color: var(--primary); background: var(--primary-light); border-radius: 5px; font-size: 12px; font-weight: 600; }
.login-heading h2 { font-size: 30px; line-height: 1.4; font-weight: 650; letter-spacing: .5px; }
.login-heading p { margin-top: 8px; color: var(--text-muted); font-size: 14px; }
.login-card .form-group { margin-bottom: 20px; }
.login-card .input-with-icon input { height: 48px; padding-left: 42px; padding-right: 42px; }
.login-card .input-with-icon > svg { left: 14px; }
.login-card .btn-lg { margin-top: 8px; }
.login-security-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 26px; color: var(--text-muted); font-size: 12px; }
.login-security-note svg { width: 16px; height: 16px; color: #7c8aa4; }
.login-copyright { position: absolute; bottom: 24px; color: #a3abba; font-size: 12px; }
.login-mobile-brand { display: none; }

/* 主框架 */
.admin-view { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); color: #c0c9da; background: var(--sidebar); box-shadow: 4px 0 20px rgba(15, 25, 45, .04); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; height: var(--topbar-height); padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand .brand-mark { width: 35px; height: 35px; border-radius: 9px; box-shadow: 0 5px 16px rgba(49,94,251,.25); }
.sidebar-brand .brand-mark svg { width: 21px; height: 21px; }
.sidebar-brand > div:nth-child(2) { display: flex; flex-direction: column; }
.sidebar-brand strong { color: #fff; font-size: 18px; font-weight: 600; letter-spacing: 1px; line-height: 1.3; }
.sidebar-brand span { color: #75839e; font-size: 9px; letter-spacing: 2px; }
.sidebar-close { display: none !important; margin-left: auto; color: #9aa8be !important; }
.sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #33405a transparent; }
.nav-section-label { padding: 0 12px; margin: 20px 0 8px; color: #697892; font-size: 11px; font-weight: 500; letter-spacing: 1px; }
.nav-section-label:first-child { margin-top: 0; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 13px; margin: 3px 0; color: #aeb9cd; border-radius: 8px; transition: color .18s, background .18s; }
.nav-item svg { width: 19px; height: 19px; color: #8897b0; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; font-weight: 500; background: linear-gradient(90deg, rgba(49,94,251,.95), rgba(49,94,251,.82)); box-shadow: 0 5px 16px rgba(12, 40, 130, .22); }
.nav-item.active svg { color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 20px; background: #7d9aff; border-radius: 0 3px 3px 0; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 17px 18px; margin: 10px 12px 16px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.025); }
.sidebar-footer-icon { color: #64d3a5; }
.sidebar-footer-icon svg { width: 22px; height: 22px; }
.sidebar-footer > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.sidebar-footer strong { color: #c4cede; font-size: 11px; font-weight: 500; }
.sidebar-footer span { color: #66758f; font-size: 9px; white-space: nowrap; }
.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; height: var(--topbar-height); padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-right { gap: 18px; }
.menu-toggle { display: none !important; margin-right: 10px; }
.breadcrumb { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; color: var(--text-muted); font-size: 10px; }
.breadcrumb svg { width: 11px; height: 11px; }
.page-heading h1 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.current-date { color: var(--text-secondary); font-size: 12px; }
.topbar-divider { width: 1px; height: 26px; background: var(--border); }
.admin-profile { display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; color: #3156bf; background: #e5ecff; border: 1px solid #d7e1fb; border-radius: 50%; font-size: 13px; font-weight: 600; }
.admin-profile-text { display: flex; flex-direction: column; min-width: 72px; }
.admin-profile-text strong { max-width: 120px; overflow: hidden; color: #29334a; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-profile-text span { color: var(--text-muted); font-size: 10px; }
.logout-button { color: var(--text-secondary) !important; }
.logout-button:hover { color: var(--danger) !important; background: var(--danger-bg) !important; }
.page-content { max-width: 1720px; padding: 24px 28px 36px; margin: 0 auto; }
.page-stack { display: grid; gap: 20px; animation: page-in .2s ease-out; }
@keyframes page-in { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* 通用组件 */
.card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 61px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title-wrap { min-width: 0; }
.card-title { display: flex; align-items: center; gap: 8px; color: #202a40; font-size: 15px; font-weight: 600; }
.card-title svg { width: 18px; height: 18px; color: var(--primary); }
.card-subtitle { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-body-flush { padding: 0; }
.content-card .card-header { border-bottom: 0; }
.content-card .card-header:has(+ .card-body-flush) { padding-bottom: 14px; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-intro h2 { font-size: 18px; font-weight: 600; }
.page-intro p { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.page-intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.full-width { width: 100%; }
.mt-16 { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 14px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; transition: background .16s, border-color .16s, color .16s, box-shadow .16s; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 2px 5px rgba(49,94,251,.14); }
.btn-primary:hover:not(:disabled) { border-color: var(--primary-dark); background: var(--primary-dark); }
.btn-secondary { color: var(--text-secondary); border-color: var(--border-dark); background: #fff; }
.btn-secondary:hover:not(:disabled) { color: var(--primary); border-color: #aabdf9; background: #f9fbff; }
.btn-ghost { color: var(--text-secondary); border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--primary); background: var(--primary-light); }
.btn-danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #bb3535; }
.btn-danger-ghost { color: var(--danger); border-color: #f1cccc; background: #fff; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn-success { color: #fff; border-color: var(--success); background: var(--success); }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.btn-lg { min-height: 46px; padding: 11px 20px; font-size: 14px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { min-height: auto; padding: 2px 4px; color: var(--primary); border: 0; background: none; font-size: 12px; }
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn .spinner { width: 14px; height: 14px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }
.btn-secondary .spinner, .btn-ghost .spinner { border-color: #dce2ef; border-top-color: var(--primary); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-secondary); border: 0; border-radius: 7px; background: transparent; }
.icon-button:hover { color: var(--primary); background: var(--primary-light); }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid #dfe5f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea { width: 100%; color: var(--text); border: 1px solid var(--border-dark); border-radius: 7px; background: #fff; outline: none; transition: border .16s, box-shadow .16s; }
input, select { height: 36px; padding: 7px 11px; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m7 10 5 5 5-5' stroke='%23758298' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
textarea { min-height: 86px; padding: 9px 11px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #aab2c1; }
input:focus, select:focus, textarea:focus { border-color: #7995f7; box-shadow: 0 0 0 3px rgba(49,94,251,.09); }
input:disabled, select:disabled, textarea:disabled { color: #8e98a9; background: #f5f6f9; cursor: not-allowed; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); }
input[type="file"] { height: auto; min-height: 40px; padding: 8px; }
input[type="file"]::file-selector-button { padding: 5px 12px; margin-right: 10px; color: var(--primary); border: 1px solid var(--primary-border); border-radius: 5px; background: var(--primary-light); cursor: pointer; }
.form-group { min-width: 0; }
.form-group > label, .form-label { display: block; margin-bottom: 6px; color: #3b465b; font-size: 12px; font-weight: 500; }
.required::before { content: "*"; margin-right: 3px; color: var(--danger); }
.form-help { margin-top: 5px; color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.field-error { min-height: 0; margin-top: 4px; color: var(--danger); font-size: 11px; }
.field-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.input-with-icon { position: relative; }
.input-with-icon > svg { position: absolute; z-index: 1; top: 50%; left: 11px; width: 17px; height: 17px; color: #8c97aa; transform: translateY(-50%); pointer-events: none; }
.input-with-icon > input { padding-left: 36px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #8b96a9; border: 0; border-radius: 5px; background: transparent; transform: translateY(-50%); }
.password-toggle:hover { color: var(--primary); background: var(--primary-light); }
.password-toggle svg { width: 18px; height: 18px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; width: 38px; height: 21px; border-radius: 20px; background: #cbd2df; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(49,94,251,.18); outline-offset: 2px; }
.switch-text { color: var(--text-secondary); font-size: 12px; }

.alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; line-height: 1.6; }
.alert-danger { color: #b13b3b; border-color: #f3d2d2; background: var(--danger-bg); }
.alert-info { color: #34639f; border-color: #d7e5f7; background: var(--info-bg); }
.alert-warning { color: #966018; border-color: #f0dfba; background: var(--warning-bg); }
.alert-success { color: #167c59; border-color: #cbe9db; background: var(--success-bg); }
.alert svg { width: 17px; height: 17px; margin-top: 1px; }

/* 筛选与表格 */
.filter-bar { padding: 16px 20px; border-bottom: 1px solid var(--border); background: #fcfdff; border-radius: var(--radius) var(--radius) 0 0; }
.filter-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-field { min-width: 140px; flex: 1; }
.filter-field.filter-keyword { min-width: 210px; flex: 1.5; }
.filter-field.filter-date { max-width: 170px; }
.filter-field label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 11px; }
.filter-actions { display: flex; gap: 8px; padding-bottom: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 12px; }
.data-table th { height: 43px; padding: 10px 14px; color: #6c778c; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f8f9fc; font-weight: 500; text-align: left; white-space: nowrap; }
.data-table td { min-height: 52px; padding: 13px 14px; color: #3a455a; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fafbfe; }
.data-table .cell-main { color: #253048; font-weight: 500; }
.data-table .cell-sub { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.data-table .cell-note { max-width: 300px; min-width: 160px; white-space: normal; word-break: break-word; }
.data-table .cell-actions { white-space: nowrap; }
.data-table .cell-actions > * { margin-right: 4px; }
.data-table .cell-actions > *:last-child { margin-right: 0; }
.table-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; padding: 36px; color: var(--text-muted); text-align: center; }
.table-state svg { width: 42px; height: 42px; margin-bottom: 12px; color: #c2cad8; }
.table-state strong { margin-bottom: 5px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.table-state p { max-width: 400px; font-size: 11px; }
.table-state .btn { margin-top: 14px; }
.table-state .spinner { margin-bottom: 14px; }
.table-state-error svg { color: #dca0a0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 12px 18px; border-top: 1px solid var(--border); }
.page-info { color: var(--text-muted); font-size: 11px; }
.page-info strong { color: var(--text-secondary); font-weight: 500; }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.page-button { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 11px; }
.page-button:hover:not(:disabled):not(.active) { color: var(--primary); border-color: #b9c8f6; }
.page-button.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.page-button svg { width: 14px; height: 14px; }
.page-size-select { width: 94px; height: 30px; padding-top: 3px; padding-bottom: 3px; margin-left: 5px; font-size: 11px; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { color: #14825d; background: var(--success-bg); }
.badge-warning { color: #aa6b13; background: var(--warning-bg); }
.badge-danger { color: #bd4848; background: var(--danger-bg); }
.badge-info { color: #346fbf; background: var(--info-bg); }
.badge-primary { color: #3b5fc5; background: var(--primary-light); }
.badge-purple { color: #7054bd; background: var(--purple-bg); }
.badge-neutral { color: #748095; background: #f0f2f6; }
.badge-no-dot::before { display: none; }
.quota-progress { min-width: 110px; }
.quota-progress-text { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--text-secondary); font-size: 10px; }
.progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 5px; background: #edf0f5; }
.progress-value { height: 100%; border-radius: inherit; background: var(--primary); }
.progress-value.warning { background: #e2a03e; }
.progress-value.danger { background: var(--danger); }

/* 看板 */
.welcome-strip { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; overflow: hidden; border: 1px solid #dce5fc; border-radius: var(--radius); background: linear-gradient(100deg, #f4f7ff 0%, #fbfcff 70%, #f0f5ff 100%); }
.welcome-strip::after { content: ""; position: absolute; right: 12%; width: 150px; height: 150px; border: 25px solid rgba(49,94,251,.025); border-radius: 50%; pointer-events: none; }
.welcome-strip h2 { font-size: 18px; font-weight: 600; }
.welcome-strip p { margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.welcome-strip .btn { position: relative; z-index: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 20px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.stat-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; color: var(--primary); border-radius: 12px; background: var(--primary-light); }
.stat-icon svg { width: 23px; height: 23px; }
.stat-icon.success { color: var(--success); background: var(--success-bg); }
.stat-icon.warning { color: var(--warning); background: var(--warning-bg); }
.stat-icon.purple { color: var(--purple); background: var(--purple-bg); }
.stat-icon.danger { color: var(--danger); background: var(--danger-bg); }
.stat-content { min-width: 0; }
.stat-label { color: var(--text-secondary); font-size: 11px; }
.stat-value { margin-top: 2px; color: #1d2941; font-size: 26px; font-weight: 650; line-height: 1.3; letter-spacing: -.5px; }
.stat-value small { margin-left: 3px; color: var(--text-muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.stat-foot { margin-top: 3px; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 20px; }
.metric-list { display: grid; gap: 18px; }
.metric-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font-size: 12px; }
.metric-row-header span { color: var(--text-secondary); }
.metric-row-header strong { font-weight: 600; }
.rank-list { display: grid; }
.rank-item { display: grid; grid-template-columns: 30px minmax(90px, 1fr) 90px 85px; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid #edf0f4; }
.rank-item:last-child { border-bottom: 0; }
.rank-number { display: grid; place-items: center; width: 24px; height: 24px; color: #7a8598; border-radius: 6px; background: #f1f3f7; font-size: 11px; font-weight: 600; }
.rank-number.top-1 { color: #9b6912; background: #fff2cf; }
.rank-number.top-2 { color: #65768f; background: #edf1f6; }
.rank-number.top-3 { color: #a76a42; background: #f9eae0; }
.rank-sales { min-width: 0; }
.rank-sales strong { display: block; overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.rank-sales span { color: var(--text-muted); font-size: 10px; }
.rank-metric { text-align: right; }
.rank-metric strong { display: block; font-size: 13px; font-weight: 600; }
.rank-metric span { color: var(--text-muted); font-size: 9px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 9px; background: #fff; text-align: left; transition: border .15s, background .15s, transform .15s; }
.quick-action:hover { color: var(--primary); border-color: #c6d3f8; background: #fafbff; transform: translateY(-1px); }
.quick-action svg { width: 21px; height: 21px; color: var(--primary); }
.quick-action span { font-size: 12px; }

/* 分配设置 */
.allocation-overview { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(480px, 1.4fr); gap: 20px; }
.allocation-run-card { position: relative; overflow: hidden; color: #fff; border: 0; background: linear-gradient(135deg, #244bbc, #3b68db); }
.allocation-run-card::after { content: ""; position: absolute; right: -45px; bottom: -75px; width: 200px; height: 200px; border: 32px solid rgba(255,255,255,.05); border-radius: 50%; }
.allocation-run-card .card-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; height: 100%; padding: 24px; }
.allocation-run-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 16px; border-radius: 11px; background: rgba(255,255,255,.13); }
.allocation-run-card h3 { font-size: 17px; font-weight: 600; }
.allocation-run-card p { margin-top: 7px; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.8; }
.allocation-run-card form { display: flex; align-items: flex-end; gap: 10px; width: 100%; margin-top: 22px; }
.allocation-run-card .form-group { flex: 1; }
.allocation-run-card label { color: rgba(255,255,255,.8); }
.allocation-run-card select { color: #fff; border-color: rgba(255,255,255,.25); background-color: rgba(255,255,255,.1); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m7 10 5 5 5-5' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.allocation-run-card select option { color: var(--text); background: #fff; }
.allocation-run-card .btn { color: #2851bc; border-color: #fff; background: #fff; }
.settings-card .card-body { padding: 20px 22px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.setting-item { min-width: 0; }
.setting-item-full { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.setting-item-full strong { display: block; font-size: 12px; font-weight: 500; }
.setting-item-full p { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.setting-unit { position: relative; }
.setting-unit input { padding-right: 50px; }
.setting-unit span { position: absolute; top: 50%; right: 11px; color: var(--text-muted); font-size: 11px; transform: translateY(-50%); }
.settings-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.settings-jobs { display: flex; gap: 8px; }
.operation-result { padding: 12px 16px; border-top: 1px solid var(--border); background: #fafcff; font-size: 12px; }

/* 弹窗、详情、时间线 */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 20, 36, .48); backdrop-filter: blur(2px); animation: fade-in .15s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { display: flex; flex-direction: column; width: 100%; max-width: 540px; max-height: calc(100vh - 48px); overflow: hidden; border-radius: 13px; background: #fff; box-shadow: 0 22px 70px rgba(12, 25, 52, .25); animation: modal-in .18s ease-out; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 940px; }
@keyframes modal-in { from { opacity: .6; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 19px 22px; border-bottom: 1px solid var(--border); }
.modal-heading h3 { color: #202a40; font-size: 16px; font-weight: 600; }
.modal-heading p { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.modal-close { width: 30px; height: 30px; margin: -3px -5px 0 0; }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fbfcfd; }
.confirm-content { display: flex; align-items: flex-start; gap: 14px; }
.confirm-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; color: var(--warning); border-radius: 50%; background: var(--warning-bg); }
.confirm-icon.danger { color: var(--danger); background: var(--danger-bg); }
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-text h4 { margin-top: 1px; font-size: 14px; font-weight: 600; }
.confirm-text p { margin-top: 7px; color: var(--text-secondary); font-size: 12px; line-height: 1.8; word-break: break-word; }
.detail-section + .detail-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--border); }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.detail-section-title h4 { font-size: 13px; font-weight: 600; }
.detail-section-title span { color: var(--text-muted); font-size: 10px; }
.description-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.description-item { min-width: 0; }
.description-item dt { margin-bottom: 4px; color: var(--text-muted); font-size: 10px; }
.description-item dd { margin: 0; color: #344056; font-size: 12px; word-break: break-word; }
.detail-note { padding: 11px 13px; color: var(--text-secondary); border-radius: 7px; background: #f7f8fa; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.timeline { position: relative; padding-left: 21px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 12px; left: 5px; width: 1px; background: #dfe5ef; }
.timeline-item { position: relative; padding: 0 0 20px 8px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; top: 5px; left: -21px; width: 11px; height: 11px; border: 3px solid #dce5fc; border-radius: 50%; background: var(--primary); box-sizing: content-box; }
.timeline-item.feedback .timeline-dot { border-color: #d9f0e6; background: var(--success); }
.timeline-item.recycle .timeline-dot { border-color: #f5e4c9; background: var(--warning); }
.timeline-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline-header strong { font-size: 12px; font-weight: 600; }
.timeline-header time { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.timeline-meta { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.timeline-content { padding: 10px 12px; margin-top: 8px; color: var(--text-secondary); border: 1px solid #edf0f4; border-radius: 7px; background: #fafbfc; font-size: 11px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.timeline-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.import-dropzone { padding: 22px; border: 1px dashed #bdccef; border-radius: 9px; background: #f8faff; text-align: center; }
.import-dropzone svg { width: 34px; height: 34px; margin: 0 auto 9px; color: var(--primary); }
.import-dropzone strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; }
.import-dropzone p { margin-bottom: 14px; color: var(--text-muted); font-size: 11px; }
.import-result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.import-result-item { padding: 12px; border-radius: 8px; background: #f6f8fc; text-align: center; }
.import-result-item strong { display: block; font-size: 20px; }
.import-result-item span { color: var(--text-muted); font-size: 10px; }
.feedback-detail-note { min-height: 80px; padding: 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }

/* Toast 与初始加载 */
.toast-root { position: fixed; z-index: 200; top: 20px; right: 22px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; color: #354156; border: 1px solid var(--border); border-radius: 9px; background: #fff; box-shadow: var(--shadow-md); pointer-events: auto; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: translateX(0); } }
.toast.leaving { opacity: 0; transform: translateX(10px); transition: .2s; }
.toast-icon { margin-top: 1px; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-message { flex: 1; font-size: 12px; line-height: 1.7; word-break: break-word; }
.toast-close { width: 22px; height: 22px; margin: -2px -4px 0 0; }
.toast-close svg { width: 14px; height: 14px; }
.initial-loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); background: var(--background); }
.initial-loader { width: 34px; height: 34px; margin-bottom: 14px; border: 3px solid #dce3f2; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.initial-loading p { font-size: 12px; }
.sidebar-overlay { position: fixed; z-index: 45; inset: 0; background: rgba(12,20,36,.42); }

/* 响应式 */
@media (min-width: 1500px) {
  .page-content { padding: 28px 34px 40px; }
  .stats-grid { gap: 20px; }
  .stat-card { padding: 23px; }
}
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .allocation-overview { grid-template-columns: 1fr; }
  .allocation-run-card form { max-width: 580px; }
  .filter-field { min-width: 130px; }
  .current-date { display: none; }
}
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: 10px 0 35px rgba(8,18,40,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-toggle { display: inline-grid !important; }
  .main-area { margin-left: 0; }
  .topbar { padding: 0 22px; }
  .login-view { grid-template-columns: minmax(360px, 42%) 1fr; }
  .login-brand-panel { padding: 45px; }
  .login-feature-list { gap: 19px; margin-top: 38px; }
}
@media (max-width: 760px) {
  :root { --topbar-height: 66px; }
  .login-view { display: block; background: #f6f8fc; }
  .login-brand-panel { display: none; }
  .login-form-panel { flex-direction: column; justify-content: flex-start; min-height: 100vh; padding: 28px 22px 64px; background: #f6f8fc; }
  .login-mobile-brand { display: flex; align-items: center; align-self: flex-start; gap: 10px; margin-bottom: 44px; color: #22304b; font-size: 17px; font-weight: 600; }
  .login-card { padding: 25px 22px; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
  .login-heading { margin-bottom: 26px; }
  .login-heading h2 { font-size: 25px; }
  .login-copyright { bottom: 20px; }
  .topbar { padding: 0 14px; }
  .topbar-right { gap: 6px; }
  .topbar-divider, .admin-profile-text { display: none; }
  .admin-profile { margin-right: 2px; }
  .avatar { width: 32px; height: 32px; }
  .page-heading h1 { font-size: 17px; }
  .breadcrumb { display: none; }
  .logout-button { width: 34px; padding: 5px; }
  .logout-button span { display: none; }
  .page-content { padding: 16px 14px 26px; }
  .page-stack { gap: 14px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .welcome-strip { padding: 18px; }
  .welcome-strip h2 { font-size: 16px; }
  .welcome-strip .btn { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { flex-direction: column; align-items: flex-start; gap: 11px; padding: 16px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 10px; }
  .stat-icon svg { width: 20px; height: 20px; }
  .stat-value { font-size: 23px; }
  .stat-foot { max-width: 140px; }
  .card-header { align-items: flex-start; min-height: 56px; padding: 14px 16px; }
  .card-header:has(.card-actions) { flex-wrap: wrap; }
  .card-body { padding: 16px; }
  .filter-bar { padding: 14px 16px; }
  .filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .filter-field, .filter-field.filter-keyword, .filter-field.filter-date { min-width: 0; max-width: none; }
  .filter-field.filter-keyword { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .btn { flex: 1; }
  .data-table th, .data-table td { padding-right: 12px; padding-left: 12px; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 14px; }
  .pagination-controls { width: 100%; flex-wrap: wrap; }
  .page-info { order: 2; }
  .page-size-select { margin-left: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92vh; border-radius: 15px 15px 0 0; }
  .modal-header { padding: 17px 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 13px 18px; }
  .description-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .settings-form { grid-template-columns: 1fr; }
  .setting-item-full, .settings-actions { grid-column: auto; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-jobs .btn { flex: 1; }
  .allocation-run-card form { align-items: stretch; flex-direction: column; }
  .rank-item { grid-template-columns: 28px minmax(80px, 1fr) 65px 70px; gap: 6px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .toast-root { top: 12px; right: 16px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; }
  .stat-foot { font-size: 9px; }
  .description-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: 1fr; }
  .filter-field.filter-keyword, .filter-actions { grid-column: auto; }
  .import-result-summary { gap: 6px; }
  .modal-footer .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== 跟进进度与超期提醒 ===== */
.reminder-button { position: relative; }
.reminder-badge {
  position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  border: 2px solid #fff; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 13px; text-align: center;
}
.nav-badge {
  margin-left: auto; min-width: 18px; padding: 1px 6px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; text-align: center;
}
.nav-badge[hidden], .reminder-badge[hidden] { display: none; }
.reminder-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border: 1px solid #f3d9b8; border-radius: var(--radius);
  background: linear-gradient(90deg, #fff8ec, #fffdf8);
}
.reminder-banner-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: #fff0d8; color: var(--warning); }
.reminder-banner-icon svg { width: 20px; height: 20px; }
.reminder-banner strong { font-size: 13px; }
.reminder-banner p { margin: 3px 0 0; color: var(--text-secondary); font-size: 11px; }
.reminder-banner .btn { margin-left: auto; flex: none; }
.reminder-hint { margin: 0; font-size: 12px; line-height: 1.7; }
.stats-grid-compact .stat-card { padding: 16px; }
.table-sub { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.table-metric { font-size: 13px; font-weight: 600; }
.table-metric-danger { color: var(--danger); }
.progress-row { display: flex; align-items: center; gap: 8px; min-width: 108px; margin-top: 5px; }
.progress-row .progress-track { flex: 1; height: 6px; margin: 0; }
.progress-fill { display: block; height: 100%; border-radius: 5px; background: var(--primary); }
.progress-fill.green { background: var(--success); }
.progress-fill.blue { background: var(--info); }
.progress-number { min-width: 36px; color: var(--text-secondary); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.progress-lead { margin-bottom: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.progress-lead > summary { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; font-size: 12px; list-style: none; }
.progress-lead > summary::-webkit-details-marker { display: none; }
.progress-lead > summary .muted { margin-left: auto; font-size: 10px; }
.progress-lead-arrow { color: var(--text-muted); font-size: 16px; transition: transform .2s; }
.progress-lead[open] .progress-lead-arrow { transform: rotate(90deg); }
.progress-lead[open] > summary { border-bottom: 1px solid var(--border); }
.progress-lead .detail-section { padding: 14px; }
.progress-lead .detail-section + .detail-section { border-top: 1px solid var(--border); }
.reminder-mini { margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.reminder-mini strong { margin: 0 8px; font-size: 12px; }
.reminder-mini span { color: var(--text-secondary); font-size: 11px; }
.reminder-mini p { margin: 6px 0 0; color: var(--text-muted); font-size: 11px; }
@media (max-width: 768px) {
  .reminder-banner { flex-wrap: wrap; }
  .reminder-banner .btn { margin-left: 0; }
  .progress-lead > summary { flex-wrap: wrap; }
}
