/* ============ 基础 ============ */
:root {
  --ink: #0E1B2C;
  --ink-2: #16283F;
  --text: #1B2A3D;
  --muted: #6B7A90;
  --muted-2: #93A1B5;
  --line: #E6EBF2;
  --line-2: #F0F3F8;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --brand: #E8622C;
  --brand-2: #F08A4B;
  --brand-soft: #FDF0EA;
  --teal: #0F766E;
  --green: #15803D;
  --amber: #B45309;
  --red: #DC2626;
  --blue: #1D4ED8;
  --purple: #6D28D9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 70px rgba(9, 20, 36, .22);
  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
::selection { background: #FADBCB; }

/* ============ 登录 ============ */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; padding: 48px 56px; color: #fff;
  background: radial-gradient(1200px 600px at 10% 0%, #1D3555 0%, #0E1B2C 55%, #0A1420 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .35;
  mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.login-visual::after {
  content: ''; position: absolute; width: 420px; height: 420px; right: -140px; bottom: -120px;
  background: radial-gradient(circle, rgba(232,98,44,.45), transparent 65%); filter: blur(10px);
}
.login-brand { position: relative; display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-2), #D94E1B);
  color: #fff; font-weight: 700; font-size: 18px; letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(232, 98, 44, .35);
}
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #93A7C2; letter-spacing: .08em; text-transform: uppercase; }
.login-copy { position: relative; max-width: 540px; margin-top: -40px; }
.login-copy h1 { font-size: 38px; line-height: 1.34; font-weight: 650; letter-spacing: -.5px; }
.login-copy p { margin-top: 20px; color: #A8B8CD; font-size: 13.5px; letter-spacing: .02em; }
.login-kpis { display: flex; gap: 44px; margin-top: 44px; }
.login-kpis b { display: block; font-size: 30px; font-weight: 650; letter-spacing: -.5px; }
.login-kpis span { font-size: 12px; color: #8FA3BD; }
.login-quote { position: relative; font-size: 13px; color: #A8B8CD; border-left: 2px solid var(--brand); padding-left: 14px; }
.login-quote b { color: #F5C3A8; font-weight: 600; }
.login-panel { display: grid; place-items: center; padding: 48px 40px; background: #fff; }
.login-form { width: 100%; max-width: 356px; }
.login-title { font-size: 25px; font-weight: 650; letter-spacing: -.3px; }
.login-desc { color: var(--muted); font-size: 13px; margin: 6px 0 30px; }
.login-form .field { margin-bottom: 16px; }
.login-hint { text-align: center; color: var(--muted-2); font-size: 12px; margin: 18px 0 12px; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-account {
  border: 1px solid var(--line); background: #FBFCFE; border-radius: 10px; padding: 8px 10px;
  font-size: 12px; text-align: left; transition: .15s; color: var(--text);
}
.demo-account:hover { border-color: #F3C3AE; background: var(--brand-soft); }
.demo-account b { display: block; font-size: 12.5px; font-weight: 600; }
.demo-account span { color: var(--muted); font-size: 11px; }

/* ============ 应用外壳 ============ */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, #101F33 0%, #0C1726 100%);
  color: #C7D3E3; display: flex; flex-direction: column; padding: 18px 14px 14px;
}
.sidebar-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.sidebar .brand-mark { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.sidebar .brand-name { color: #fff; font-size: 14.5px; }
.sidebar .brand-sub { color: #6F84A0; font-size: 10px; }
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; padding: 4px 0; }
.nav::-webkit-scrollbar { width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: #9FB0C7; font-size: 13px; position: relative; transition: .15s; white-space: nowrap;
}
.nav-item svg { width: 16px; height: 16px; opacity: .85; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #E7EEF8; }
.nav-item.active { background: rgba(232, 98, 44, .16); color: #fff; font-weight: 550; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav-item.active svg { color: var(--brand-2); opacity: 1; }
.nav-group { color: #5D7090; padding: 16px 10px 6px; font-size: 10px; letter-spacing: .12em; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; }
.user-card { display: flex; align-items: center; gap: 9px; padding: 6px 8px 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: #1E344F; color: #FFD9C6; font-size: 12.5px; font-weight: 600;
}
.user-card-name { color: #E7EEF8; font-size: 12.5px; font-weight: 550; line-height: 1.3; }
.user-card-role { color: #6F84A0; font-size: 11px; }
.logout-btn {
  width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.09); color: #93A7C2;
  border-radius: 9px; padding: 7px; font-size: 12px; transition: .15s;
}
.logout-btn:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 66px; padding: 0 28px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
}
.topbar-title { min-width: 0; }
.crumb { font-size: 11px; color: var(--muted-2); letter-spacing: .04em; }
.topbar-title h1 { font-size: 17px; font-weight: 620; letter-spacing: -.2px; line-height: 1.3; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.topbar-name { font-size: 12.5px; font-weight: 550; }
.role-chip {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: #EEF2F8; color: #4B5C74; font-weight: 500;
}
.icon-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; width: 34px; height: 34px;
  display: grid; place-items: center; color: #4B5C74; font-size: 15px;
}
.menu-btn { display: none; }
.view { padding: 24px 28px 44px; max-width: 1500px; width: 100%; margin: 0 auto; }
.sidebar-backdrop { display: none; }

/* ============ 通用排版 ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; font-weight: 630; letter-spacing: -.2px; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.section-title { font-size: 13px; font-weight: 620; display: flex; align-items: center; gap: 8px; }
.section-title .muted { font-weight: 400; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-brand { color: var(--brand); }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

/* ============ 卡片与统计 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 18px 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin-top: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.stat-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat-ico {
  position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: #F5F7FB; color: #7C8CA3;
}
.stat-ico svg { width: 17px; height: 17px; }
.stat.brand .stat-ico { background: var(--brand-soft); color: var(--brand); }
.stat.teal .stat-ico { background: #E7F4F2; color: var(--teal); }
.stat.red .stat-ico { background: #FDECEC; color: var(--red); }
.stat.blue .stat-ico { background: #EDF1FE; color: var(--blue); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; background: #fff; color: var(--text); transition: .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, #EC6C35, #D94E1B); color: #fff; box-shadow: 0 6px 16px rgba(217, 78, 27, .22); }
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: #33465E; background: #fff; }
.btn-ghost:hover { border-color: #C9D4E2; background: #FAFBFD; }
.btn-soft { background: var(--brand-soft); color: #B8451A; }
.btn-soft:hover { background: #FBE2D6; }
.btn-danger { background: #FDECEC; color: var(--red); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 44px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-link { background: none; border: none; color: var(--brand); padding: 0; height: auto; font-size: 12.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-icon { width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #5C6E85; }
.btn-icon:hover { background: #F7F9FC; }

/* ============ 表单 ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: #4E6076; font-weight: 500; }
.field > span em { color: var(--red); font-style: normal; margin-left: 2px; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 0 11px; font-size: 13px; color: var(--text); font-family: inherit; transition: .15s; outline: none;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 74px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #F0A783; box-shadow: 0 0 0 3px rgba(232, 98, 44, .12); }
input::placeholder, textarea::placeholder { color: #A3AFBF; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A99AD' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { background: #FDECEC; color: #B91C1C; border-radius: 9px; padding: 8px 11px; font-size: 12.5px; }
.form-note { background: #F7F9FC; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 7px 10px; border-radius: 9px; background: #F7F9FC; color: var(--muted); }
.check-line.done { background: #ECFDF5; color: #047857; }
.check-line b { margin-left: auto; font-size: 11px; font-weight: 600; }

/* ============ 徽标 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 550; line-height: 1.7; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.gray { background: #F1F4F9; color: #64748B; }
.badge.green { background: #ECFDF3; color: #15803D; }
.badge.amber { background: #FFF7E6; color: #B45309; }
.badge.red { background: #FDEDED; color: #DC2626; }
.badge.blue { background: #EEF3FF; color: #1D4ED8; }
.badge.teal { background: #E8F6F4; color: #0F766E; }
.badge.purple { background: #F4EEFF; color: #6D28D9; }
.badge.solid { background: var(--ink); color: #fff; }
.badge.solid::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #F2F5FA; color: #5C6E85; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: #4E6076; font-size: 12px; transition: .15s;
}
.chip:hover { border-color: #C9D4E2; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-count { background: rgba(255,255,255,.18); padding: 0 6px; border-radius: 999px; font-size: 10.5px; }
.chip:not(.active) .chip-count { background: #EFF3F9; color: #64748B; }
.level { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.level.A { background: #ECFDF3; color: #15803D; }
.level.B { background: #EEF3FF; color: #1D4ED8; }
.level.C { background: #FFF7E6; color: #B45309; }
.level.D { background: #F3F4F6; color: #6B7280; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: .06em; color: var(--muted-2);
  font-weight: 600; padding: 10px 14px; background: #FAFBFD; border-bottom: 1px solid var(--line);
  white-space: nowrap; text-transform: uppercase;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #FAFCFF; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 550; color: var(--text); }
.cell-sub { font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.cell-strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #F5F7FA; }

/* ============ 工具条 ============ */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.search { position: relative; flex: 1; min-width: 180px; max-width: 300px; }
.search input { height: 34px; padding-left: 32px; font-size: 12.5px; background: #FAFBFD; }
.search svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: #93A1B5; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-select { height: 32px; font-size: 12px; border-radius: 8px; padding: 0 26px 0 9px; background-color: #fff; width: auto; min-width: 92px; }

/* ============ 进度 / 图表 ============ */
.progress { height: 7px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #F08A4B, #D94E1B); transition: width .4s; }
.progress.teal > i { background: linear-gradient(90deg, #2DD4BF, #0F766E); }
.progress.blue > i { background: linear-gradient(90deg, #60A5FA, #1D4ED8); }
.progress.green > i { background: linear-gradient(90deg, #4ADE80, #15803D); }
.progress.red > i { background: linear-gradient(90deg, #F87171, #DC2626); }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.target-box { background: #FAFBFD; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.target-box .row-between { font-size: 12px; }
.target-box .progress { margin-top: 8px; }

.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-stage { display: grid; grid-template-columns: 56px 1fr 74px; gap: 10px; align-items: center; }
.funnel-label { font-size: 12px; color: #4E6076; }
.funnel-bar-wrap { height: 30px; background: #F5F7FB; border-radius: 8px; overflow: hidden; position: relative; }
.funnel-bar { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #F3A077, #E8622C); display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: 11px; font-weight: 600; min-width: 34px; transition: width .5s; }
.funnel-bar.s2 { background: linear-gradient(90deg, #F7B58F, #EE7A42); }
.funnel-bar.s3 { background: linear-gradient(90deg, #7DD3C7, #0F766E); }
.funnel-bar.s4 { background: linear-gradient(90deg, #93B4F7, #1D4ED8); }
.funnel-bar.s5 { background: linear-gradient(90deg, #C4B5FD, #6D28D9); }
.funnel-value { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.funnel-value small { color: var(--muted-2); font-weight: 400; font-size: 10.5px; margin-left: 3px; }
.funnel-rate { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted-2); padding-left: 66px; margin-top: -2px; }
.funnel-rate b { color: var(--teal); font-weight: 600; }

.rate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rate-item { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; background: #FCFDFF; }
.rate-name { font-size: 11.5px; color: var(--muted); }
.rate-val { font-size: 21px; font-weight: 650; letter-spacing: -.5px; margin: 3px 0 6px; }
.rate-val small { font-size: 11px; color: var(--muted-2); font-weight: 400; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; flex: 1; }
.bar { width: 9px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #F5A276, #E8622C); min-height: 2px; transition: height .4s; }
.bar.b2 { background: linear-gradient(180deg, #7DD3C7, #0F766E); }
.bar.b3 { background: linear-gradient(180deg, #A5B4FC, #4F46E5); }
.bar-x { font-size: 10px; color: var(--muted-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 124px; height: 124px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ''; position: absolute; inset: 22px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut-center b { font-size: 20px; font-weight: 650; display: block; line-height: 1.2; }
.donut-center span { font-size: 10px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.donut-legend .row { font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.status-bars { display: flex; flex-direction: column; gap: 9px; }
.status-bar { display: grid; grid-template-columns: 62px 1fr 34px; gap: 10px; align-items: center; font-size: 11.5px; }
.status-bar .progress { height: 6px; }
.status-bar .num { text-align: right; color: var(--muted); font-size: 11px; }

/* ============ 时间线 ============ */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 66px 1fr; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 70px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.tl-time { font-size: 10.5px; color: var(--muted-2); text-align: right; padding-top: 3px; line-height: 1.5; }
.tl-body { position: relative; padding-left: 14px; }
.tl-body::before { content: ''; position: absolute; left: -2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #D7DFEA; border: 2px solid #fff; box-shadow: 0 0 0 1px #D7DFEA; }
.tl-item.accent .tl-body::before { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tl-title { font-size: 12.5px; font-weight: 550; }
.tl-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ============ 空状态 / 加载 ============ */
.empty { padding: 44px 20px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, #F2F5F9 25%, #E9EEF5 37%, #F2F5F9 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.loading-page { display: flex; flex-direction: column; gap: 16px; }
.loading-page .skeleton { height: 90px; }

/* ============ 弹窗 / 抽屉 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(11, 22, 38, .46);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp .2s ease;
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 20px 22px 0; display: flex; gap: 12px; align-items: flex-start; }
.modal-title { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-close { margin-left: auto; background: #F4F6FA; border: none; width: 28px; height: 28px; border-radius: 8px; color: #64748B; font-size: 15px; line-height: 1; flex: none; }
.modal-close:hover { background: #E9EDF5; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(11, 22, 38, .38); backdrop-filter: blur(2px); animation: fadeIn .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 96vw; background: #fff; z-index: 95;
  display: flex; flex-direction: column; box-shadow: -24px 0 60px rgba(9, 20, 36, .18); animation: drawerIn .24s cubic-bezier(.22,.61,.36,1);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.drawer-body::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 6px; }
.drawer-body::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background: #DCE3EC; border-radius: 3px; }
.drawer-foot { padding: 12px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; background: #FCFDFF; }
.drawer-title { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.drawer-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ============ Toast ============ */
.toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #16283F; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(9, 20, 36, .3); animation: toastIn .2s ease; display: flex; gap: 8px; align-items: center;
  max-width: 86vw;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.err { background: #B91C1C; }
.toast.ok { background: #0F5132; }
.toast i { width: 6px; height: 6px; border-radius: 50%; background: #7EE2B8; }
.toast.err i { background: #FCA5A5; }

/* ============ 业务组件 ============ */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 22px 24px; color: #fff;
  background: radial-gradient(900px 300px at 100% 0%, #24405F 0%, #132338 55%, #0E1B2C 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.hero::after {
  content: ''; position: absolute; width: 300px; height: 300px; right: -60px; top: -140px;
  background: radial-gradient(circle, rgba(232,98,44,.35), transparent 64%);
}
.hero h2 { font-size: 20px; font-weight: 620; letter-spacing: -.3px; }
.hero p { color: #9DB0C7; font-size: 12.5px; margin-top: 4px; }
.hero-targets { display: flex; gap: 24px; margin-top: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-target { flex: 1; min-width: 190px; }
.hero-target .row-between { font-size: 11.5px; color: #A8B8CD; }
.hero-target .progress { background: rgba(255,255,255,.12); margin-top: 8px; height: 6px; }
.hero-target .progress > i { background: linear-gradient(90deg, #F6A16F, #E8622C); }
.hero-target b { color: #fff; font-size: 12px; }
.hero-target em { font-style: normal; color: #FFC7A8; font-weight: 600; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero .btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #E8EFF8; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.14); }
.hero .btn-primary { background: linear-gradient(135deg, #F08A4B, #E8622C); }

.alert-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px; background: #FCFDFF; border: 1px solid var(--line-2); }
.alert-item + .alert-item { margin-top: 8px; }
.alert-ico { width: 28px; height: 28px; border-radius: 8px; background: #FFF4E8; color: #B45309; display: grid; place-items: center; flex: none; }
.alert-ico.high { background: #FDECEC; color: #DC2626; }
.alert-title { font-size: 12.5px; font-weight: 550; }
.alert-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.visit-card { border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 14px; background: #fff; display: flex; gap: 12px; }
.visit-card.overdue { border-color: #FBD5D5; background: #FFFCFC; }
.visit-main { flex: 1; min-width: 0; }
.visit-title { font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.visit-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.visit-note { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; }

.house-status-line { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; align-items: center; gap: 6px; flex: none; font-size: 10.5px; color: var(--muted-2); padding-right: 4px; }
.step-dot { width: 20px; height: 20px; border-radius: 50%; background: #EEF1F6; color: #93A1B5; display: grid; place-items: center; font-size: 10px; font-weight: 600; flex: none; }
.step.done { color: var(--teal); }
.step.done .step-dot { background: #E7F4F2; color: var(--teal); }
.step.current { color: var(--brand); font-weight: 600; }
.step.current .step-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.step-line { width: 14px; height: 1px; background: #E2E8F0; margin: 0 2px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #F5F7FA; cursor: zoom-in; }
.photo-box {
  border: 1.5px dashed #CBD5E1; border-radius: 12px; min-height: 96px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11.5px; background: #FAFBFD; cursor: pointer; transition: .15s; text-align: center; padding: 10px;
}
.photo-box:hover { border-color: var(--brand); background: var(--brand-soft); color: #B8451A; }
.photo-box.filled { border-style: solid; border-color: var(--line); padding: 0; overflow: hidden; background: #F5F7FA; }
.photo-box.filled img { width: 100%; height: 100%; min-height: 96px; max-height: 150px; object-fit: cover; }
.photo-box svg { width: 22px; height: 22px; }
.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: inline-flex; background: #F2F5FA; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; border-radius: 8px; padding: 5px 11px; font-size: 12px; color: var(--muted); }
.seg button.active { background: #fff; color: var(--text); font-weight: 550; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.kv-list { display: flex; flex-direction: column; }

.money-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.money-row:last-child { border-bottom: none; }
.money-row.total { border-top: 1px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 12px; font-weight: 650; font-size: 15px; color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; white-space: nowrap; }
.tab.active { color: var(--text); font-weight: 550; border-bottom-color: var(--brand); }
.tab-count { font-size: 10px; background: #F1F4F9; padding: 0 5px; border-radius: 6px; margin-left: 4px; }

.role-note { font-size: 11.5px; color: var(--muted); background: #F7F9FC; border: 1px dashed #DCE3EC; border-radius: 10px; padding: 10px 12px; }

.sync-flow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sync-node { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #FCFDFF; }
.sync-node h4 { font-size: 12.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.sync-node ul { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.sync-arrow { color: var(--brand); font-size: 18px; }
.sync-node.platform { background: #F7F9FC; }

.audio-cell audio { height: 30px; max-width: 200px; }
.detail-list { display: flex; flex-direction: column; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.list-row:last-child { border-bottom: none; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; background: #F4F7FB; border-radius: 7px; padding: 4px 8px; font-size: 11px; color: #4E6076; }
.import-hint { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: #F7F9FC; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; color: var(--muted); white-space: pre-wrap; }

/* ============ 图标尺寸兜底 ============ */
.section-title svg, .sync-node h4 svg, .chip svg, .tag svg, .check-line svg, .photo-box svg, .empty svg, .alert-ico svg, .file-chip svg, .list-row svg {
  width: 15px; height: 15px; flex: none;
}
.photo-box svg, .empty svg { width: 22px; height: 22px; }
.alert-ico svg, .stat-ico svg { width: 16px; height: 16px; }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-copy h1 { font-size: 32px; }
  .drawer { width: 560px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: 20px 0 50px rgba(9,20,36,.2); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(11,22,38,.4); z-index: 35; }
  .view { padding: 20px 20px 40px; }
  .topbar { padding: 0 20px; }
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 40px 24px; min-height: 100vh; }
}
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-user .role-chip { display: none; }
}
@media (max-width: 640px) {
  .view { padding: 16px 14px 36px; }
  .topbar { padding: 0 14px; height: 58px; gap: 10px; }
  .topbar-title h1 { font-size: 15.5px; }
  .crumb { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 22px; }
  .stat-ico { width: 28px; height: 28px; border-radius: 8px; }
  .stat-ico svg { width: 14px; height: 14px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 14px 16px; }
  .toolbar { padding: 12px 14px; }
  .search { max-width: none; width: 100%; }
  .page-actions { gap: 6px; }
  .page-actions .btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 18px; }
  .hero-targets { gap: 14px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .modal { border-radius: 16px; max-height: 92vh; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 94vh; }
  .funnel-stage { grid-template-columns: 48px 1fr 66px; }
  .table-wrap { border-radius: 0 0 16px 16px; }
  .topbar-name { display: none; }
  .topbar-user { padding-left: 0; border-left: none; }
  .topbar .page-actions .btn-primary { padding: 0 10px; }
  .upload-row { grid-template-columns: 1fr 1fr; }
  .rate-grid { grid-template-columns: 1fr 1fr; }
  .bars { gap: 8px; height: 130px; }
  .bar { width: 6px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .donut-legend { width: 100%; }
  .page-head { margin-bottom: 14px; }
}
