/* ============ 精致外卖后台 · 设计令牌 ============ */
:root {
  --primary: #2b5aa7;
  --primary-600: #244c8c;
  --primary-700: #1d3f75;
  --primary-50: #eef3fb;
  --primary-100: #dde8f7;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e8eaee;
  --border-light: #f0f2f5;
  --text: #1f2733;
  --text-2: #5a6572;
  --text-3: #8a93a0;
  --success: #2e9e5b;
  --warning: #e08a1e;
  --danger: #d64545;
  --info: #2b5aa7;
  --purple: #6b5bd2;
  --teal: #16a6a0;
  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-tag: 4px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, 0.16);
  --sidebar-w: 224px;
  --header-h: 56px;
  --tabs-h: 40px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --primary: #5f8fd8;
  --primary-600: #7aa5e6;
  --primary-700: #9cbdf0;
  --primary-50: #1c2635;
  --primary-100: #223148;
  --bg: #111419;
  --card: #191d24;
  --border: #272d37;
  --border-light: #22272f;
  --text: #e4e9f0;
  --text-2: #a3adbb;
  --text-3: #78828f;
  --success: #4cba7c;
  --warning: #e8a340;
  --danger: #e26a6a;
  --info: #6f9de4;
  --purple: #9488e6;
  --teal: #3ec0ba;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p, dl, dd, dt, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d0da; border-radius: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a424e; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 启动遮罩 ============ */
.boot {
  height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px; background: var(--bg);
}
.boot-mark { display: flex; align-items: center; gap: 12px; }
.boot-mark b { display: block; font-size: 18px; letter-spacing: 0.5px; }
.boot-mark span { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.boot-bar { width: 220px; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--primary); border-radius: 4px; animation: bootmove 1.1s ease-in-out infinite; }
.boot p { font-size: 12px; color: var(--text-3); }
@keyframes bootmove { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ============ 主框架 ============ */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--card);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  z-index: 20; transition: width 0.18s ease;
}
.brand {
  height: var(--header-h); flex: 0 0 var(--header-h); display: flex; align-items: center;
  gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border-light);
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 30px;
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: 0.3px; line-height: 1.2; }
.brand-sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.4px; margin-top: 2px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.menu-group { margin-top: 12px; }
.menu-group:first-child { margin-top: 2px; }
.menu-label {
  font-size: 11px; color: var(--text-3); letter-spacing: 1px; padding: 6px 10px 6px;
  font-weight: 500;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: 6px; color: var(--text-2); cursor: pointer; position: relative;
  font-size: 13.5px; user-select: none; margin-bottom: 2px; transition: background 0.14s, color 0.14s;
}
.menu-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.85; }
.menu-item:hover { background: var(--border-light); color: var(--text); }
.menu-item.active { background: var(--primary-50); color: var(--primary); font-weight: 500; }
.menu-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.menu-item.active svg { opacity: 1; }
.menu-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; display: flex;
  align-items: center; justify-content: center; font-weight: 500;
}
.side-foot { padding: 12px 16px; border-top: 1px solid var(--border-light); }
.env-badge {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3);
}
.env-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(46, 158, 91, 0.12); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: var(--header-h); flex: 0 0 var(--header-h); background: var(--card);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 20px; gap: 16px; z-index: 15;
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; flex: none; }
.crumb span { white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb svg { width: 14px; height: 14px; }
.header-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: 220px;
  height: 32px; padding: 0 10px; border-radius: 6px; background: var(--bg);
  border: 1px solid transparent; transition: border 0.15s, background 0.15s;
}
.header-search:focus-within { border-color: var(--primary); background: var(--card); }
.header-search svg { width: 14px; height: 14px; color: var(--text-3); }
.header-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13px; }
.header-search input::placeholder { color: var(--text-3); }
.header-actions { display: flex; align-items: center; gap: 4px; }
.hbtn {
  width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: background 0.14s;
}
.hbtn:hover { background: var(--border-light); }
.hbtn svg { width: 17px; height: 17px; }
.hbtn .dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--card); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 20px;
  cursor: pointer; margin-left: 4px; transition: background 0.14s; user-select: none;
}
.user-chip:hover { background: var(--border-light); }
.user-chip .u-name { font-size: 13px; line-height: 1.2; white-space: nowrap; }
.user-chip .u-role { font-size: 11px; color: var(--text-3); line-height: 1.2; margin-top: 1px; white-space: nowrap; }
.user-chip svg { width: 14px; height: 14px; color: var(--text-3); }
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600; flex: none; overflow: hidden;
  letter-spacing: 0.5px;
}
.avatar.sq { border-radius: 7px; }

.tabbar {
  height: var(--tabs-h); flex: 0 0 var(--tabs-h); background: var(--card);
  border-bottom: 1px solid var(--border); display: flex; align-items: stretch;
  padding: 0 12px; gap: 2px; overflow-x: auto; overflow-y: hidden;
}
.tabbar::-webkit-scrollbar { height: 0; }
.ptab {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; position: relative; white-space: nowrap;
  border-right: 1px solid var(--border-light); user-select: none;
}
.ptab:hover { background: var(--bg); color: var(--text); }
.ptab.active { color: var(--primary); background: var(--primary-50); font-weight: 500; }
.ptab.active::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--primary); }
.ptab .x { width: 15px; height: 15px; border-radius: 3px; display: flex; align-items: center; justify-content: center; opacity: 0.5; }
.ptab .x:hover { background: rgba(0, 0, 0, 0.08); opacity: 1; }
.ptab .x svg { width: 10px; height: 10px; }
.tabbar-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-left: 8px; background: var(--card); position: sticky; right: 0; }
.page { flex: 1; overflow-y: auto; padding: 20px 24px 40px; position: relative; }

/* ============ 通用排版 ============ */
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title h2 { font-size: 20px; font-weight: 600; letter-spacing: 0.2px; }
.page-title p { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.flex { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.spacer { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.hr { height: 1px; background: var(--border-light); margin: 16px 0; border: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.warn-text { color: var(--warning); }
.strong { font-weight: 600; }
.tag-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* ============ 栅格 ============ */
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cols-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cols-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.main-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.main-side.wide { grid-template-columns: minmax(0, 1fr) 360px; }
.span-2 { grid-column: span 2; }

/* ============ 登录页 ============ */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card);
}
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 56px 60px;
  background: linear-gradient(145deg, #1d3f75 0%, #2b5aa7 46%, #3f78c9 100%);
  display: flex; flex-direction: column;
}
.login-art::before {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  right: -240px; top: -220px; background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 62%);
}
.login-art::after {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  left: -180px; bottom: -240px; background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 65%);
}
.login-art .la-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.login-art h1 { font-size: 38px; line-height: 1.3; margin-top: 64px; letter-spacing: 1px; position: relative; z-index: 2; font-weight: 600; }
.login-art h1 em { font-style: normal; color: #cfe1ff; }
.login-art .la-desc { margin-top: 16px; font-size: 14px; color: rgba(255, 255, 255, 0.72); line-height: 1.9; max-width: 440px; position: relative; z-index: 2; }
.la-points { margin-top: 40px; display: grid; gap: 14px; position: relative; z-index: 2; }
.la-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, 0.88); }
.la-points .lp-ico { width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, 0.14); display: flex; align-items: center; justify-content: center; }
.la-points svg { width: 14px; height: 14px; }
.la-stats { margin-top: auto; display: flex; gap: 42px; padding-top: 48px; position: relative; z-index: 2; }
.la-stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: 0.5px; }
.la-stats span { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); }
.la-foot { position: relative; z-index: 2; margin-top: 34px; font-size: 11.5px; color: rgba(255, 255, 255, 0.42); }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card); }
.login-form { width: 360px; }
.lf-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.lf-brand b { display: block; font-size: 15px; letter-spacing: 0.5px; }
.lf-brand span { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.login-form h2 { font-size: 24px; font-weight: 600; }
.login-form .lf-sub { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.lf-field { margin-top: 22px; }
.lf-field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.lf-input { position: relative; }
.lf-input > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); }
.lf-input input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); outline: none; font-size: 13.5px;
  transition: border 0.15s, box-shadow 0.15s;
}
.lf-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.lf-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 6px; display: flex; }
.lf-eye svg { width: 15px; height: 15px; }
.lf-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.lf-error { margin-top: 12px; font-size: 12.5px; color: var(--danger); background: #fdeeee; border-radius: 6px; padding: 8px 10px; display: none; }
[data-theme="dark"] .lf-error { background: rgba(214, 69, 69, 0.14); }
.lf-error.show { display: block; }
.login-submit { width: 100%; height: 40px; margin-top: 22px; }
.demo-accounts { margin-top: 26px; border-top: 1px dashed var(--border); padding-top: 18px; }
.demo-accounts .da-title { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.da-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.da-chip {
  border: 1px solid var(--border); background: var(--card); border-radius: 4px;
  padding: 4px 9px; font-size: 11.5px; color: var(--text-2); cursor: pointer;
  transition: all 0.14s;
}
.da-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.lf-hint { margin-top: 14px; font-size: 11.5px; color: var(--text-3); line-height: 1.8; }

/* ============ 响应式 ============ */
@media (max-width: 1500px) {
  .la-stats { gap: 28px; }
  .login-art { padding: 44px; }
  .login-art h1 { font-size: 32px; }
}
@media (max-width: 1366px) {
  :root { --sidebar-w: 208px; }
  .page { padding: 16px 18px 32px; }
  .header-search { width: 180px; }
  .login-art { padding: 36px; }
  .login-art h1 { font-size: 29px; margin-top: 44px; }
  .login-art .la-desc { font-size: 13px; }
}
@media (max-width: 1180px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .lf-brand { display: flex; }
  .login-form-wrap { background: var(--bg); }
  .login-form { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 28px; box-shadow: var(--shadow-sm); }
}
