/* 万星门店工作台 · 基础样式（配色 / 布局 / 动效） */
:root {
  --bg: #FAF9F5;
  --bg-2: #F0EEE6;
  --surface: #FFFFFF;
  --surface-2: #F6F5F0;
  --line: #E8E5DA;
  --line-2: #D8D4C6;
  --text: #141413;
  --text-2: #5E5D59;
  --text-3: #8F8C82;
  --accent: #D97757;
  --accent-2: #C15F3C;
  --accent-soft: #F7E7DF;
  --accent-ink: #A24A2A;
  --ok: #5B8A57;
  --ok-soft: #E5EEDD;
  --warn: #A97A22;
  --warn-soft: #F5ECD6;
  --danger: #B4483A;
  --danger-soft: #F6E0DB;
  --info: #557591;
  --info-soft: #E2EAF0;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, .04);
  --shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 6px 20px rgba(20, 20, 19, .05);
  --shadow-lg: 0 12px 40px rgba(20, 20, 19, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --num: "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1E1C;
    --bg-2: #262523;
    --surface: #2A2927;
    --surface-2: #31302D;
    --line: #393834;
    --line-2: #4A4843;
    --text: #F2F0E8;
    --text-2: #BEBBB1;
    --text-3: #8E8B81;
    --accent: #D97757;
    --accent-2: #E38B6C;
    --accent-soft: #46302A;
    --accent-ink: #F0A385;
    --ok: #8DB486;
    --ok-soft: #2D3729;
    --warn: #D7AE5E;
    --warn-soft: #3D3425;
    --danger: #E3806F;
    --danger-soft: #45292A;
    --info: #92B2CD;
    --info-soft: #28323B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F1E1C; --bg-2: #262523; --surface: #2A2927; --surface-2: #31302D;
  --line: #393834; --line-2: #4A4843; --text: #F2F0E8; --text-2: #BEBBB1; --text-3: #8E8B81;
  --accent: #D97757; --accent-2: #E38B6C; --accent-soft: #46302A; --accent-ink: #F0A385;
  --ok: #8DB486; --ok-soft: #2D3729; --warn: #D7AE5E; --warn-soft: #3D3425;
  --danger: #E3806F; --danger-soft: #45292A; --info: #92B2CD; --info-soft: #28323B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2); --shadow: 0 1px 2px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.18);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-2); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.ic { flex: none; display: block; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.brand-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }
.store-chip {
  display: flex; align-items: center; gap: 10px;
  margin: 0 4px 18px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.store-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.store-chip b { font-weight: 600; font-size: 13.5px; display: block; line-height: 1.3; }
.store-chip span { font-size: 12px; color: var(--text-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14.5px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-item:hover { background: rgba(20,20,19,.04); color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.nav-item.active .ic { color: var(--accent); }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-foot .who b { display: block; font-size: 13.5px; font-weight: 600; }
.side-foot .who span { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; padding: 36px 44px 80px; }
.main-inner { max-width: 1120px; margin: 0 auto; }

.topbar, .tabbar { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 8px 16px 108px; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 20;
    padding: 12px 16px 10px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
  }
  .topbar.scrolled { border-bottom-color: var(--line); }
  .topbar .brand-mark { width: 26px; height: 26px; }
  .topbar .t-store { flex: 1; min-width: 0; line-height: 1.25; }
  .topbar .t-store b { display: block; font-size: 14.5px; font-weight: 600; }
  .topbar .t-store span { font-size: 11.5px; color: var(--text-3); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0 4px; border-radius: 12px; font-size: 11.5px; color: var(--text-3);
    position: relative; transition: color .2s;
  }
  .tab-item .ic { transition: transform .3s var(--spring); }
  .tab-item.active { color: var(--accent-2); font-weight: 600; }
  .tab-item.active .ic { transform: translateY(-1px) scale(1.06); }
  .tab-item .badge { position: absolute; top: 2px; left: calc(50% + 8px); }
}

/* ---------- 页面头 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
.page-head .sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .page-head { margin: 8px 0 18px; align-items: flex-start; }
  .page-head h1 { font-size: 25px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-title h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title h2 .ic { color: var(--accent); }
.section-title .link { font-size: 13.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; }
.section-title .link:hover { color: var(--accent-2); }

/* ---------- 动效 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); height: 0; margin: 0; padding-top: 0; padding-bottom: 0; } }
@keyframes ring { from { stroke-dashoffset: var(--len); } }

.page { animation: rise .34s var(--ease) backwards; }
.stagger > * { animation: rise3d .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 50ms); transform-origin: 50% 0%; }
.fade-in { animation: fade .3s var(--ease) both; }
.swap { animation: rise .28s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
