/* ============ 基础 ============ */
:root {
  color-scheme: light;
  --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; }
/* 窄屏（登录页左侧品牌区隐藏时）在表单顶部展示同一句品牌主张 */
.login-narrow-head { display: none; }
.login-narrow-head .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; flex: none; }
.login-narrow-head b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; }
.login-narrow-head p { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.login-narrow-head p + p { margin-top: 2px; color: var(--muted-2); }

/* ============ 应用外壳 ============ */
.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; }
/* 子项允许收缩，否则内部的宽表格（含 min-width）会把整个栅格撑出页面 */
.grid > * { min-width: 0; }
.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: 7px; min-width: 0; }
.field > span { font-size: 12px; color: #43556D; font-weight: 600; letter-spacing: .01em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field > span em { color: var(--brand); font-style: normal; font-size: 13px; line-height: 1; }
.field > span .muted { font-weight: 400; }
/* 注意：input:not([type]) 必须保留 —— 模板里大量 <input> 未写 type，
   仅靠 input[type=text] 匹配不到，会退回浏览器原生方正边框 */
.input, input:not([type]), input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=email], select, textarea {
  width: 100%; height: 40px; border: 1px solid #E1E8F1; background: #FCFDFF; border-radius: 11px;
  padding: 0 12px; font-size: 13px; color: var(--text); font-family: inherit; line-height: 1.4;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; outline: none;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .02) inset;
}
.input:hover, input:not([type]):hover, input[type=text]:hover, input[type=password]:hover, input[type=tel]:hover, input[type=number]:hover,
input[type=date]:hover, input[type=datetime-local]:hover, input[type=time]:hover, select:hover, textarea:hover {
  /* 用 background-color 而非 background 简写：简写会把 select 下拉箭头的背景图/不重复设置一起重置，
     导致聚焦或悬停时箭头图标被平铺成橙色斜纹（手机上尤其明显） */
  border-color: #C9D5E4; background-color: #fff;
}
.input:focus, input:not([type]):focus, input[type=text]:focus, input[type=password]:focus, input[type=tel]:focus, input[type=number]:focus,
input[type=date]:focus, input[type=datetime-local]:focus, input[type=time]:focus, select:focus, textarea:focus {
  border-color: #EFA27D; background-color: #fff; box-shadow: 0 0 0 4px rgba(232, 98, 44, .10);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #A6B3C4; }
input:disabled, select:disabled, textarea:disabled { background: #F4F6F9; color: #8B98AA; cursor: not-allowed; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #FCFDFF inset; -webkit-text-fill-color: var(--text); }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1.2 5.5 5.8 10 1.2' stroke='%23808FA4' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1.2 5.5 5.8 10 1.2' stroke='%23D95E24' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator {
  opacity: .42; cursor: pointer; transition: opacity .15s;
}
input[type=date]:hover::-webkit-calendar-picker-indicator, input[type=datetime-local]:hover::-webkit-calendar-picker-indicator, input[type=time]:hover::-webkit-calendar-picker-indicator { opacity: .8; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=file] { width: 100%; font-size: 12px; color: var(--muted); background: #FCFDFF; border: 1px dashed #D8E1EC; border-radius: 11px; padding: 9px 10px; cursor: pointer; transition: .15s; }
input[type=file]:hover { border-color: #F0B394; background: var(--brand-soft); }
input[type=file]::file-selector-button {
  margin-right: 10px; border: 1px solid #E1E8F1; background: #fff; color: #43556D; border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: #EFA27D; color: var(--brand); }
select option { background-color: #fff; color: #1B2A3D; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.field:has(input:user-invalid) > span { color: #B91C1C; }
.field input:user-invalid, .field select:user-invalid { border-color: #F3B3B3; background: #FFFCFC; }
.field-hint, .field > span.field-hint { font-size: 11px; color: var(--muted-2); line-height: 1.5; font-weight: 400; letter-spacing: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
.form-section { display: flex; flex-direction: column; gap: 13px; }
.form-section + .form-section { border-top: 1px dashed var(--line); padding-top: 18px; }
.form-section-head { display: flex; align-items: flex-start; gap: 10px; }
.form-section-head > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.form-section-head b { font-size: 13px; font-weight: 620; color: var(--text); }
.form-section-head span:not(.form-step):not(.tag) { font-size: 11.5px; color: var(--muted-2); }
.form-section-head .tag { margin-left: auto; flex: none; }
.form-step {
  width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  background: var(--brand-soft); color: #C2541F; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.form-error { background: #FDECEC; color: #B91C1C; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; border: 1px solid #FBD5D5; }
.form-note { background: #F7F9FC; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.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; }

/* ============ 门店选择器 ============ */
.picker { position: relative; }
.picker-trigger {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid #E1E8F1; background: #FCFDFF; border-radius: 11px; color: var(--text);
  font-size: 13px; text-align: left; transition: border-color .16s, box-shadow .16s, background .16s;
}
.picker-trigger:hover { border-color: #C9D5E4; background: #fff; }
.picker-trigger[aria-expanded=true] { border-color: #EFA27D; background: #fff; box-shadow: 0 0 0 4px rgba(232, 98, 44, .10); }
.picker-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-text.placeholder { color: #A6B3C4; }
.picker-chevron { width: 12px; height: 8px; color: #808FA4; flex: none; transition: transform .18s, color .18s; }
.picker-trigger[aria-expanded=true] .picker-chevron { transform: rotate(180deg); color: #D95E24; }
.picker-panel {
  margin-top: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .10); overflow: hidden; animation: pickerIn .16s ease;
}
@keyframes pickerIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.picker-search { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-bottom: 1px solid var(--line-2); background: #FAFBFD; }
.picker-search svg { width: 14px; height: 14px; color: #93A1B5; flex: none; }
.picker-search input { height: 30px; border: none; background: transparent; box-shadow: none; padding: 0; font-size: 12.5px; }
.picker-search input:focus { border: none; box-shadow: none; background: transparent; }
.picker-list { max-height: min(216px, 38vh); overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.picker-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border: none; border-radius: 8px; background: transparent; text-align: left; transition: background .12s;
}
.picker-item:hover { background: #F5F8FC; }
.picker-item.active { background: var(--brand-soft); }
.picker-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.picker-item-main b { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item-main span { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-check { width: 18px; height: 18px; border-radius: 50%; background: #0F766E; color: #fff; display: grid; place-items: center; flex: none; }
.picker-check svg { width: 11px; height: 11px; }
.picker-empty { padding: 16px 10px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ============ 图片上传 ============ */
.uploader {
  border: 1.5px dashed #D5DFEB; border-radius: 13px; padding: 12px; background: #FAFBFE;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .16s, background .16s;
}
.uploader.dragging { border-color: var(--brand); background: var(--brand-soft); }
.uploader.has-photos { background: #FCFDFF; }
.uploader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.uploader-grid:empty { display: none; }
.uploader-item { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #EEF2F7; }
.uploader-item img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s; }
.uploader-item:hover img { transform: scale(1.03); }
.uploader-cover {
  position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 6px;
  background: rgba(12, 24, 39, .72); color: #FFD9C6; font-size: 10px; font-weight: 600; backdrop-filter: blur(4px);
}
.uploader-setcover {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 6px; border: none;
  background: rgba(12, 24, 39, .6); color: #fff; font-size: 10px; opacity: 0; transition: .15s; backdrop-filter: blur(4px);
}
.uploader-item:hover .uploader-setcover { opacity: 1; }
.uploader-remove {
  position: absolute; right: 5px; top: 5px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(12, 24, 39, .62); color: #fff; font-size: 10px; line-height: 1; display: grid; place-items: center;
  opacity: .9; transition: .15s; backdrop-filter: blur(4px);
}
.uploader-item:hover .uploader-remove { opacity: 1; }
.uploader-remove:hover { background: #DC2626; }
.uploader-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 86px; border: 1.5px dashed #D5DFEB; border-radius: 11px; background: #fff;
  color: #5C6E85; transition: .16s; padding: 12px;
}
.uploader.has-photos .uploader-add { flex-direction: row; gap: 8px; min-height: 46px; padding: 8px 14px; }
.uploader.has-photos .uploader-add span { display: none; }
.uploader.has-photos .uploader-add svg { width: 16px; height: 16px; }
.uploader-add svg { width: 20px; height: 20px; color: #8FA0B5; transition: .16s; }
.uploader-add b { font-size: 12.5px; font-weight: 600; color: #3E5068; }
.uploader-add span { font-size: 10.5px; color: var(--muted-2); }
.uploader-add:hover, .uploader.dragging .uploader-add { border-color: #F0A783; background: var(--brand-soft); }
.uploader-add:hover svg, .uploader.dragging .uploader-add svg { color: var(--brand); }
.house-thumb { width: 42px; height: 42px; border-radius: 9px; flex: none; }
.house-thumb.placeholder { display: grid; place-items: center; color: #A9B6C6; background: #F2F5FA; }
.house-thumb.placeholder svg { width: 18px; height: 18px; }

/* ---- 门店店招（长条形横幅）：列表卡片 + 表单上传 ---- */
.store-media {
  position: relative; aspect-ratio: 16 / 5; margin: -1px -1px 0; overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: #F3F6FA; border-bottom: 1px solid var(--line-2);
}
.store-media img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s; }
.store-media:hover img { transform: scale(1.02); }
.store-media-empty {
  height: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: #A3B0C2; font-size: 11.5px; letter-spacing: .02em;
}
.store-media-empty svg { width: 14px; height: 14px; }

.signboard { border: 1.5px dashed #D5DFEB; border-radius: 13px; background: #FAFBFE; padding: 10px; transition: border-color .16s, background .16s; }
.signboard:hover { border-color: #C9D5E4; background: #FCFDFF; }
.signboard-add {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 16px 12px; border: none; background: none; border-radius: 10px;
}
.signboard-add svg { width: 20px; height: 20px; color: #8FA0B5; transition: .16s; }
.signboard-add b { font-size: 12.5px; font-weight: 600; color: #3E5068; }
.signboard-add span { font-size: 10.5px; color: var(--muted-2); text-align: center; line-height: 1.5; }
.signboard-add:hover svg { color: var(--brand); }
.signboard-preview { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #EEF2F7; }
.signboard-preview img { display: block; width: 100%; aspect-ratio: 16 / 5; object-fit: cover; cursor: zoom-in; }
.signboard-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.signboard-btn {
  height: 26px; padding: 0 10px; border-radius: 7px; border: none; font-size: 11.5px;
  background: rgba(12, 24, 39, .66); color: #fff; backdrop-filter: blur(6px); transition: .15s;
}
.signboard-btn:hover { background: rgba(12, 24, 39, .84); }
.signboard-btn.danger:hover { background: #DC2626; }
.signboard-uploading { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; }
.signboard-bar { height: 6px; border-radius: 999px; background: #E7EEF7; overflow: hidden; }
.signboard-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #FFB27A, #F0763C); transition: width .2s ease; }
.signboard-uploading-text { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.signboard-uploading-text b { font-variant-numeric: tabular-nums; color: #B8451A; }
.field-error { font-size: 11.5px; color: #DC2626; line-height: 1.55; }

/* ---- 页脚备案号 ---- */
.app-footer { padding: 6px 24px 26px; text-align: center; font-size: 11.5px; color: var(--muted-2); letter-spacing: .02em; }
.app-footer a { color: var(--muted-2); text-decoration: none; border-bottom: 1px dotted #C9D4E2; transition: color .15s, border-color .15s; }
.app-footer a:hover { color: var(--brand); border-color: var(--brand); }
.h5-icp { padding: 4px 0 10px; text-align: center; font-size: 11px; color: var(--muted-2); }
.h5-icp a { color: var(--muted-2); text-decoration: none; border-bottom: 1px dotted #C9D4E2; }
.h5-icp a:hover { color: var(--brand); }

/* ============ 徽标 ============ */
.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); }
/* 搜索框：胶囊形 + 内嵌放大镜，与工具条上的 chip / 标签保持同一视觉语言 */
.search { position: relative; flex: 1 1 240px; min-width: 180px; max-width: 420px; }
/* 一级页面（房源/经纪人/门店）工具条统一：控件同高、同圆角，避免搜索框孤零零一块 */
.toolbar .filter-select { height: 34px; border-radius: 999px; padding: 0 30px 0 12px; background-position: right 13px center; }
.toolbar .chip { height: 34px; }
.search input {
  height: 34px; padding: 0 14px 0 34px; font-size: 12.5px;
  background: #F5F8FC; border: 1px solid #E4EBF4; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.search input::placeholder { color: #A3B0C2; }
.search input:hover { background: #fff; border-color: #D3DEEB; }
/* 搜索框聚焦不再使用橙色高亮（桌面端与移动端统一为中性描边） */
.search input:focus { background: #fff; border-color: #C9D5E4; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: #8E9DB1; transition: color .16s ease; pointer-events: none;
}
.search:focus-within svg { color: #6F819A; }
.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, .52);
  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 15px; display: flex; gap: 12px; align-items: flex-start; }
.modal-body { padding: 2px 22px 18px; overflow-y: auto; }
.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-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, .44); 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; }

/* ============ 响应式 ============ */
/* 保存后高亮定位 */
@keyframes cardFlash {
  0% { box-shadow: 0 0 0 0 rgba(232, 98, 44, 0); }
  22% { box-shadow: 0 0 0 3px rgba(232, 98, 44, .38); }
  70% { box-shadow: 0 0 0 3px rgba(232, 98, 44, .18); }
  100% { box-shadow: 0 0 0 0 rgba(232, 98, 44, 0); }
}
.card-flash { animation: cardFlash 1.9s ease; }

/* ============ 系统设置 ============ */
.setting-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.setting-fixed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; height: 40px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #DCE4EE; transition: background .18s ease; flex: none; }
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .22); transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, #F08A4B, #D94E1B); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(232, 98, 44, .18); }
.switch-text { font-size: 12px; color: #4E6076; }
.event-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.event-chips .chip { cursor: pointer; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; font-size: 12px; color: #4E6076; background: #F7F9FC; }

@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; }
  .login-narrow-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 26px; }
}
@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; }
  /* 顶栏：窄屏改为两行，标题独占第一行、页头按钮整体换到第二行，避免按钮压住标题 */
  .topbar { height: auto; min-height: 62px; padding: 10px 20px; flex-wrap: wrap; row-gap: 8px; align-items: center; }
  .topbar-title { flex: 1 1 140px; }
  .topbar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-user { order: 2; margin-left: auto; flex: none; }
  .page-actions { order: 3; flex: 1 1 100%; margin-left: 0; justify-content: flex-start; gap: 6px; }
  /* 窄屏表格改为横向滚动，避免列被压缩成竖排文字 */
  table.data { min-width: 780px; }
}
@media (max-width: 640px) {
  /* iOS 聚焦 <16px 控件会自动放大页面，导致弹窗错位/花屏 */
  input:not([type=file]):not([type=checkbox]):not([type=radio]):not([type=hidden]),
  select, textarea, .input { font-size: 16px; }
  .field > span { font-size: 12.5px; }
  .filter-select { height: 34px; }
  table.data .filter-select { height: 32px; }
  .search input { font-size: 16px; }
  .picker-trigger { font-size: 16px; min-height: 44px; }
  .picker-item-main b { font-size: 14px; }
  .picker-item-main span { font-size: 12px; }
  .modal, .drawer { -webkit-overflow-scrolling: touch; }
  .view { padding: 16px 14px 36px; }
  .topbar { padding: 9px 14px 10px; height: auto; min-height: 56px; 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; }
}
