/* ============================================================
   生日福利领取系统 · 全局样式
   设计语言：企业尊贵 · 深宝石蓝 + 香槟金（方案 A）
   主色 #1E3A5F / 点缀 #C9A96E / 白底 / 辅助 #F0F4F8
   说明：小程序 rpx 以 750rpx 设计稿换算，1rpx ≈ 0.5px(375px屏)
   所有颜色/字体/间距/圆角/阴影均由 CSS 变量统一管理，可一键换肤。
   ============================================================ */

:root {
  /* ===== 品牌色 ===== */
  --primary: #1E3A5F;            /* 主色 深宝石蓝 */
  --primary-light: #2D4B73;      /* 主色 亮阶 */
  --primary-dark: #172A45;       /* 主色 暗阶 */
  --gold: #C9A96E;               /* 点缀 香槟金 */
  --gold-light: #DCC49A;         /* 点缀 亮金 */
  --gold-dark: #A8844F;          /* 点缀 深金 */
  --gold-deep: #8B6F44;          /* 点缀 文字用深金 */
  --gold-tint: #F6F0E4;          /* 金色淡底色 */

  /* ===== 背景 ===== */
  --bg: #FFFFFF;                 /* 主背景 白 */
  --bg-soft: #F0F4F8;            /* 辅助背景 浅灰蓝 */
  --bg-input: #F7F7F7;           /* 输入框底色 */
  --card: #FFFFFF;

  /* ===== 文字 ===== */
  --ink: #333333;                /* 主文字 深灰 */
  --ink-2: #666666;              /* 次要文字 */
  --ink-3: #999999;              /* 弱文字 */

  /* ===== 分割线 / 边框 ===== */
  --line: #E5E7EB;
  --line-soft: #F0F0F0;

  /* ===== 语义色（低饱和，避免廉价感） ===== */
  --success: #7FA37A;            /* 已收货 鼠尾草绿 */
  --info: #5E8FB4;               /* 已发货 雾蓝 */
  --warning: #C79A4B;            /* 待发货 香槟金橙 */
  --danger: #C26B5E;             /* 赤陶 危险 */
  --error-text: #C0564F;         /* 表单错误提示 温和红 */

  /* ===== 阴影 ===== */
  --shadow-xs: 0 2px 8px rgba(30, 58, 95, 0.05);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);   /* 0 4rpx 20rpx */
  --shadow-md: 0 8px 30px rgba(30, 58, 95, 0.10);

  /* ===== 圆角 ===== */
  --radius: 12px;                /* 卡片 16~24rpx */
  --radius-card: 12px;
  --radius-btn: 8px;             /* 按钮 12~16rpx */
  --radius-input: 6px;
  --radius-sm: 6px;

  /* ===== 字体 ===== */
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Hiragino Sans GB', 'Source Han Sans SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --serif: Georgia, 'Times New Roman', 'Songti SC', 'STSong', serif;

  /* ===== 动效 ===== */
  --dur-fast: .2s;               /* 快速反馈 */
  --dur: .3s;                    /* 常规过渡 */
  --dur-slow: .5s;               /* 慢速氛围动画 */
  --ease: cubic-bezier(.25, .1, .25, 1);   /* 标准缓动 */
  --ease-out: cubic-bezier(0, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);  /* 弹簧 */
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

h1, h2, h3 { font-weight: 600; letter-spacing: 0.04em; }

/* ============ 员工端 顶部横幅 ============ */
.header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  color: var(--ink);
  padding: 24px 16px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line-soft);
}
.header h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.16em; color: var(--primary); }
.header .sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; font-weight: 300; letter-spacing: 0.1em; }

/* 页面容器：四周留白 >= 32rpx(16px) */
.container { max-width: 560px; margin: 0 auto; padding: 16px 16px 32px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  transition: all .3s ease;
}
.card:hover { box-shadow: var(--shadow-sm); }

/* 区块标题（金色竖线） */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 18px; letter-spacing: 0.08em;
}
.section-title::before {
  content: ''; width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  flex-shrink: 0;
}
.section-title .icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--gold-tint); border: 1px solid rgba(201, 169, 110, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--gold-deep); font-style: normal;
}
.section-title .icon::before { display: none; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 8px; letter-spacing: 0.06em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  font-size: 15px; font-weight: 400; color: var(--ink);
  outline: none; background: var(--bg-input);
  transition: all .25s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08), inset 0 -2px 0 var(--gold);
}
.form-group input[readonly] { background: var(--bg-soft); color: var(--ink-2); }
.form-group textarea { resize: vertical; min-height: 72px; line-height: 1.6; }

/* 表单错误提示 */
.field-error {
  font-size: 12px; color: var(--error-text); margin-top: 6px;
  min-height: 0; opacity: 0; transition: all .25s ease; letter-spacing: 0.02em;
}
.field-error.show { opacity: 1; }

/* ============ 按钮 ============ */
.btn-primary {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; border: none;
  padding: 0 20px; height: 44px; border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 600; cursor: pointer; width: 100%;
  letter-spacing: 0.14em; text-indent: 0.14em;
  transition: transform .15s ease, box-shadow .25s ease, opacity .25s ease;
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.22);
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 3px 8px rgba(30, 58, 95, 0.18); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

/* 金色主按钮（用于强调性 CTA） */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  box-shadow: 0 6px 16px rgba(168, 132, 79, 0.28);
}
.btn-gold:active { box-shadow: 0 3px 8px rgba(168, 132, 79, 0.22); }

.btn-secondary {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); padding: 0 20px; height: 44px;
  border-radius: var(--radius-btn); font-size: 14px; font-weight: 400; cursor: pointer;
  letter-spacing: 0.08em; transition: all .25s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-soft); }
.btn-sm { padding: 0 14px; font-size: 12px; height: 32px; border-radius: var(--radius-sm); }

/* ============ 按钮加载动画（三点跳动） ============ */
.btn-loading { position: relative; pointer-events: none; }
.btn-loading .btn-dots { display: inline-flex; align-items: center; gap: 5px; }
.btn-loading .btn-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dotJump 1s ease-in-out infinite; }
.btn-loading .btn-dots i:nth-child(2) { animation-delay: .15s; }
.btn-loading .btn-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotJump { 0%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ============ Toast ============ */
.toast {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%) translateY(-8px);
  padding: 11px 24px; border-radius: 8px; font-size: 13px; font-weight: 400;
  z-index: 9999; opacity: 0; transition: all .3s ease;
  pointer-events: none; background: rgba(30, 58, 95, 0.94); color: #fff;
  letter-spacing: 0.04em; box-shadow: var(--shadow-md); max-width: 82vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(63, 128, 106, 0.95); }
.toast.error { background: rgba(194, 107, 94, 0.95); }

/* ============ 短信验证码 ============ */
.sms-row { display: flex; gap: 10px; align-items: stretch; }
.sms-row .field-with-icon { flex: 1; }
.sms-btn {
  background: transparent; color: var(--primary); border: 1px solid var(--primary);
  border-radius: var(--radius-input); padding: 0 16px; height: 44px;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  letter-spacing: 0.04em; transition: all .25s ease; flex-shrink: 0;
}
.sms-btn:active { transform: scale(0.97); }
.sms-btn:disabled { color: var(--ink-3); border-color: var(--line); background: var(--bg-input); cursor: not-allowed; }

/* 带图标输入框 */
.field-with-icon { position: relative; }
.field-with-icon .f-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .5; pointer-events: none; font-style: normal;
}
.field-with-icon input { padding-left: 38px; }

/* ============ 商品卡片（员工端） ============ */
.product-list { display: flex; flex-direction: column; gap: 12px; }
.product-card {
  background: #fff; border-radius: 16px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  box-shadow: 0 6px 24px rgba(30, 58, 95, 0.08); border: 1px solid var(--line-soft);
  transition: transform .3s ease, box-shadow .3s ease;
}
.product-card:active { transform: scale(0.985); box-shadow: 0 3px 12px rgba(30,58,95,.1); }
.product-card .img {
  width: 100%; aspect-ratio: 16 / 9.4; display: flex; align-items: center; justify-content: center;
  font-size: 60px; background: linear-gradient(160deg, #fbf7ee, #f3edd9); overflow: hidden;
  flex-shrink: 0; position: relative;
}
.product-card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card .info { flex: 1; padding: 14px 15px 16px; display: flex; flex-direction: column; min-width: 0; position: relative; }
.product-card .name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.02em;
}
.product-card .desc {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .stock { font-size: 12px; color: var(--gold-deep); margin-top: 8px; font-weight: 500; }
.product-card .stock.zero { color: var(--ink-3); font-weight: 400; }
.product-card .btn-get {
  margin-top: 12px; width: 100%; height: 44px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; border: none; padding: 0 22px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  letter-spacing: 0.12em; text-indent: 0.12em;
  transition: transform .15s ease, opacity .25s ease;
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.2);
}
.product-card .btn-get:active { transform: scale(0.98); }
.product-card .btn-get:disabled {
  background: var(--bg-input); color: var(--ink-3); box-shadow: none; cursor: not-allowed;
}

/* ============ 订单卡片（员工端） ============ */
.order-card {
  background: #fff; border-radius: var(--radius-card); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft);
  transition: all .3s ease;
}
.order-card:active { transform: scale(0.99); }
.order-card .order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-card .order-no { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; }
.order-card .order-body { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.order-card .order-thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.order-card .order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-card .order-main { flex: 1; min-width: 0; }
.order-card .p-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .p-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.order-card .order-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3);
}

/* 状态徽章（低饱和，细线条） */
.status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 12px; border-radius: 20px; font-weight: 500;
  letter-spacing: 0.06em; border: 1px solid transparent;
}
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pending { background: rgba(199, 154, 75, 0.12); color: var(--warning); border-color: rgba(199, 154, 75, 0.30); }
.status-shipped { background: rgba(94, 143, 180, 0.12); color: var(--info); border-color: rgba(94, 143, 180, 0.30); }
.status-received { background: rgba(127, 163, 122, 0.12); color: var(--success); border-color: rgba(127, 163, 122, 0.30); }
.status-cancelled { background: rgba(180, 180, 180, 0.14); color: #8a8a8a; border-color: rgba(180, 180, 180, 0.30); }

/* 取消订单按钮 */
.cancel-btn {
  background: transparent; color: var(--danger); border: 1px solid var(--danger);
  border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 400; cursor: pointer;
  transition: all .25s ease;
}
.cancel-btn:active { background: var(--danger); color: #fff; transform: scale(0.97); }

/* ============ 空状态 ============ */
.empty-box { text-align: center; padding: 60px 20px; }
.empty-box .e-mark {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--gold-deep);
}
.empty-box .e-text { color: var(--ink-3); font-size: 14px; margin: 18px 0 26px; font-weight: 300; }

/* ============ 弹窗（进出场动画） ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(23, 42, 69, 0.45);
  -webkit-backdrop-filter: blur(10rpx); backdrop-filter: blur(8px);
  z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.show { display: flex; animation: overlayIn .3s var(--ease); }
.modal-overlay.closing { animation: overlayOut .22s var(--ease) forwards; }
.modal-dialog {
  background: #fff; width: 100%; max-width: 440px; max-height: 82vh;
  border-radius: 14px; overflow-y: auto; padding: 26px 22px;
  box-shadow: var(--shadow-md); border: 1px solid var(--line-soft);
  transform-origin: center;
  animation: dialogIn .38s var(--ease-spring);
}
.modal-overlay.closing .modal-dialog { animation: dialogOut .2s ease forwards; }
.modal-dialog h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 12px; letter-spacing: 0.06em; }
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.modal-actions button { flex: 1; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; } }
@keyframes dialogIn { from { opacity: 0; transform: scale(.92) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dialogOut { to { opacity: 0; transform: scale(.95); } }

/* 底部弹窗（地址选择等）：自下而上滑入，带弹簧缓动 */
.modal-sheet { align-items: flex-end; padding: 0; }
.modal-sheet .modal-dialog {
  width: 100%; max-width: 100%; max-height: 84vh; border-radius: 20px 20px 0 0;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
  animation: sheetIn .4s var(--ease-spring);
}
.modal-sheet.closing .modal-dialog { animation: sheetOut .26s ease forwards; }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* 优雅结果弹窗（金色线条蛋糕简笔 + 粒子上升） */
.result-modal .cake-mark {
  width: 84px; height: 84px; margin: 6px auto 14px; position: relative;
}
.result-modal .cake-mark svg { width: 100%; height: 100%; display: block; }
.result-modal .modal-title { text-align: center; font-size: 19px; font-weight: 600; color: var(--primary); letter-spacing: 0.1em; }
.result-modal .modal-sub { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.7; font-weight: 300; }
.result-modal .modal-actions { margin-top: 26px; }
.rise-dot {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: 0;
  animation: rise 1.8s ease-in infinite;
}
@keyframes rise {
  0% { transform: translateY(6px); opacity: 0; }
  25% { opacity: .8; }
  100% { transform: translateY(-38px); opacity: 0; }
}

/* ============ 订单详情 步骤条 ============ */
.step-bar { display: flex; align-items: flex-start; margin: 8px 0 4px; }
.step-item { flex: 1; position: relative; text-align: center; }
.step-item .dot {
  width: 12px; height: 12px; border-radius: 50%; margin: 0 auto 6px;
  background: #fff; border: 2px solid var(--line);
  position: relative; z-index: 2;
}
.step-item .step-label { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.step-item.done .dot { border-color: var(--success); background: var(--success); }
.step-item.done .step-label { color: var(--success); }
.step-item.active .dot { border-color: var(--warning); background: var(--warning); box-shadow: 0 0 0 3px rgba(199,154,75,.18); }
.step-item.active .step-label { color: var(--warning); font-weight: 600; }
.step-item.cancelled .dot { border-color: #c0c0c0; background: #c0c0c0; }
.step-item.cancelled .step-label { color: #8a8a8a; }
.step-item::before {
  content: ''; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px;
  background: var(--line); z-index: 1;
}
.step-item:first-child::before { display: none; }
.step-item.done::before { background: var(--success); }
.step-item.active::before { background: linear-gradient(90deg, var(--success), var(--warning)); }

/* 订单详情信息行 */
.detail-row { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--ink-3); width: 76px; flex-shrink: 0; letter-spacing: 0.02em; }
.detail-row .v { color: var(--ink); flex: 1; line-height: 1.6; word-break: break-all; }

/* 快递单号复制 */
.copy-link {
  display: inline-flex; align-items: center; gap: 4px; color: var(--info);
  border-bottom: 1px dashed currentColor; cursor: pointer; font-size: 13px;
}
.copy-link:active { opacity: .6; }

/* ============ 底部固定操作栏 ============ */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 20px rgba(30, 58, 95, 0.06);
}
.bottom-bar .bar-product { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bottom-bar .bar-thumb {
  width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.bottom-bar .bar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bottom-bar .bar-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-bar .bar-qty { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.bottom-bar .btn-primary { width: 180px; flex-shrink: 0; }

/* 底部占位（避免被固定栏遮挡） */
.bottom-safe { height: 76px; }

/* 页面切换淡入上滑 */
.page-enter { animation: pageIn .3s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   管理后台
   ============================================================ */
.admin-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  color: var(--ink); padding: 18px 28px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 100;
}
.admin-header h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.1em; color: var(--primary); }
.admin-header .btn {
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 8px; font-size: 13px; cursor: pointer; letter-spacing: 0.08em;
  transition: all .25s ease;
}
.admin-header .btn:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-soft); }

.admin-layout { display: flex; min-height: calc(100vh - 62px); }
.admin-sidebar {
  width: 210px; background: var(--bg-soft); color: var(--ink);
  padding: 24px 0; flex-shrink: 0; border-right: 1px solid var(--line-soft);
}
.admin-sidebar .menu-item {
  padding: 13px 24px; cursor: pointer; font-size: 13px;
  color: var(--ink-2); font-weight: 400; letter-spacing: 0.06em;
  border-left: 2px solid transparent;
  transition: all .25s ease;
}
.admin-sidebar .menu-item:hover { background: rgba(30, 58, 95, 0.06); color: var(--ink); }
.admin-sidebar .menu-item.active {
  background: rgba(30, 58, 95, 0.08); color: var(--primary);
  border-left-color: var(--primary); font-weight: 600;
}
.admin-main { flex: 1; padding: 32px 36px; overflow-x: auto; background: var(--bg); }

/* 表格 */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: var(--radius-card); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft);
}
.admin-table th {
  background: var(--bg-soft); padding: 14px 16px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft); letter-spacing: 0.08em;
}
.admin-table td { padding: 15px 16px; font-size: 13px; font-weight: 400; border-bottom: 1px solid var(--line); color: var(--ink); }
.admin-table tbody tr { transition: all .25s ease; }
.admin-table tbody tr:hover td { background: rgba(30, 58, 95, 0.03); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* 数据密集型表格（.resp）：窄屏下保持列宽可读，避免列被压塌导致中文逐字竖排。
   外层容器已带 overflow-x:auto，通过 min-width 触发横向滚动而非压缩列宽。 */
.admin-table.resp { min-width: 960px; }
.admin-table.resp th, .admin-table.resp td { white-space: nowrap; }
.admin-table.resp td .card-info { white-space: normal; }
.admin-table.resp td .product-img { white-space: normal; }

/* 工具栏 */
.toolbar, .admin-search { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select, .admin-search input, .admin-search select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-weight: 400; outline: none; background: #fff; color: var(--ink);
  transition: all .25s ease;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.10); }
.toolbar .date-range-label { font-size: 13px; color: var(--ink-2); font-weight: 400; white-space: nowrap; }
.toolbar .date-range-sep { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.toolbar input[type="date"] { width: 150px; }

/* ---------- 日期区间下拉选择器（统一控件） ---------- */
.date-range-picker { position: relative; display: inline-block; min-width: 168px; }
.dr-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--ink); background: #fff; cursor: pointer;
  user-select: none; white-space: nowrap; transition: all .25s ease;
}
.dr-trigger:hover { border-color: var(--primary); }
.dr-trigger .dr-icon { font-size: 14px; }
.dr-trigger .dr-text { font-weight: 400; }
.dr-trigger .dr-caret { font-size: 10px; color: var(--ink-3); transition: transform .2s ease; }
.dr-panel.open + .dr-trigger .dr-caret,
.date-range-picker:focus-within .dr-caret { transform: rotate(180deg); }
.dr-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 12px; min-width: 256px;
  display: none;
}
.dr-panel.open { display: block; animation: valuePop .18s var(--ease); }
.dr-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dr-presets button {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: all .2s ease; white-space: nowrap;
}
.dr-presets button:hover { border-color: var(--primary); color: var(--ink); }
.dr-presets button.active { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-deep); font-weight: 500; }
.dr-custom {
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.dr-custom input {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; background: var(--bg-input); color: var(--ink); outline: none;
}
.dr-custom input:focus { border-color: var(--primary); }

/* 中文日期选择器（flatpickr）配色 */
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.selected:focus { background: var(--primary); border-color: var(--primary); }
.flatpickr-day.today { border-color: var(--gold); }
.flatpickr-day.today:hover { background: var(--gold-tint); color: var(--ink); }
.dr-custom .dr-sep { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.dr-custom .dr-apply {
  border: none; background: var(--primary); color: #fff; padding: 6px 14px;
  border-radius: 6px; font-size: 12px; cursor: pointer; letter-spacing: .04em; white-space: nowrap;
}
.dr-custom .dr-apply:active { transform: scale(.97); }

/* 深色主题覆盖 */
:root[data-theme="dark"] .dr-trigger { background: var(--bg-input); }
:root[data-theme="dark"] .dr-panel { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .dr-presets button { background: var(--bg-soft); border-color: var(--line); color: var(--ink-2); }
:root[data-theme="dark"] .dr-presets button.active { background: var(--gold-tint); border-color: var(--gold); color: var(--gold); }

/* 后台通用按钮（低饱和） */
.btn { display: inline-block; }
.toolbar .btn, .admin-search .btn {
  padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; letter-spacing: 0.08em;
  transition: all .25s ease;
}
.toolbar .btn:active, .admin-search .btn:active { transform: scale(0.98); }
.btn-success { background: linear-gradient(135deg, #8FB38B, var(--success)); color: #fff; }
.btn-info { background: linear-gradient(135deg, #7AA0BF, var(--info)); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #D4AC62, var(--warning)); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #D08477, var(--danger)); color: #fff; }


.admin-tabs { display: flex; gap: 0; margin-bottom: 20px; }
.admin-tab { padding: 10px 20px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--ink-2); transition: all .25s; }
.admin-tab:first-child { border-radius: 8px 0 0 8px; }
.admin-tab:last-child { border-radius: 0 8px 8px 0; }
.admin-tab:hover { background: var(--bg-soft); }
.admin-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(201, 169, 110, 0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(30, 58, 95, 0.07), transparent 45%),
    var(--bg);
  padding: 20px; position: relative; overflow: hidden;
}
.login-card {
  background: rgba(255, 255, 255, 0.90); border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px); border: 1px solid var(--line-soft);
  position: relative; z-index: 2;
}
.login-card .logo { text-align: center; margin-bottom: 32px; }
.login-card .logo .icon { font-size: 38px; }
.login-card .logo h2 { font-size: 20px; margin-top: 14px; color: var(--primary); letter-spacing: 0.14em; }
.login-card .logo p { font-size: 12px; color: var(--ink-3); margin-top: 6px; letter-spacing: 0.06em; }

/* ============ 数据看板 ============ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius-card); padding: 26px 16px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); position: relative; overflow: hidden;
  transition: all .3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.stat-card .stat-num { font-size: 30px; font-weight: 600; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--ink-3); margin-top: 8px; font-weight: 400; letter-spacing: 0.1em; }

/* 看板柱状图 */
.chart-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.chart-bar .label { width: 130px; font-size: 13px; font-weight: 400; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.chart-bar .bar-wrap { flex: 1; background: var(--bg-soft); border-radius: 4px; height: 24px; overflow: hidden; }
.chart-bar .bar-fill {
  background: linear-gradient(90deg, var(--gold-tint), var(--gold));
  height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 10px;
  font-size: 11px; color: var(--ink-2); font-weight: 500; min-width: 36px; transition: all .6s ease;
}
.chart-bar .count { width: 46px; font-size: 13px; font-weight: 500; color: var(--ink); }

/* 快速入口 */
.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.quick-link {
  background: #fff; border-radius: var(--radius-card); padding: 26px 12px; text-align: center;
  cursor: pointer; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft);
  transition: all .3s ease;
}
.quick-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); border-color: rgba(201, 169, 110, 0.5); }
.quick-link .icon { font-size: 28px; margin-bottom: 10px; }
.quick-link .label { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-3); font-weight: 400; }
.empty-state .icon { font-size: 46px; }

/* ============ 响应式 ============ */
@media (max-width: 700px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid var(--line-soft); }
  .admin-sidebar .menu-item { flex-shrink: 0; padding: 12px 18px; font-size: 13px; border-left: none; border-bottom: 2px solid transparent; }
  .admin-sidebar .menu-item.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .bottom-bar .btn-primary { width: 140px; padding: 0 12px; font-size: 14px; letter-spacing: 0.06em; text-indent: 0.06em; }
}

/* 细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dde6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b9c6d2; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   交互层 · 全局动效系统（升级版）
   原则：优先 CSS transition/animation，JS 仅负责切换类名；
   时长统一 0.2s~0.5s，缓动统一 var(--ease)/var(--ease-spring)。
   ============================================================ */

/* ---------- 1. 页面进入：分批渐显 ---------- */
/* 用法：.reveal + 由 JS 按批次加 .in（可自定义 transitionDelay 制造层次）；
   .reveal-observe 由 IntersectionObserver 在进入可视区时加 .in */
/* 关键：隐藏态仅在 HTML 带 .has-js（JS 证明自己活着）时生效，
   脚本失败/禁用时页面内容保持可见，避免整页白屏（fail-open）。 */
.has-js .reveal, .has-js .reveal-observe {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
.has-js .reveal.from-left, .has-js .reveal-observe.from-left { transform: translateX(-18px); }
.has-js .reveal.from-right, .has-js .reveal-observe.from-right { transform: translateX(18px); }
.has-js .reveal.zoom, .has-js .reveal-observe.zoom { transform: scale(.95); }
.reveal.in, .reveal-observe.in { opacity: 1; transform: none; }

/* 2. 页面退场（跳转前淡出，支持返回方向反向位移） */
body.page-leaving { animation: pageOut .22s var(--ease) forwards; }
body.page-leaving.back { animation: pageOutBack .26s var(--ease) forwards; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-14px); } }
@keyframes pageOutBack { to { opacity: 0; transform: translateY(16px); } }

/* ---------- 3. 按钮水波纹 ---------- */
.btn-primary, .btn-secondary, .btn-gold, .btn-get, .sms-btn, .cancel-btn,
.text-btn, .back-btn, .btn, .btn-success, .btn-info, .btn-warning, .btn-danger,
.quick-link, .address-card {
  position: relative; overflow: hidden;
}
.ripple-ink {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .45); transform: scale(0);
  animation: ripple .6s var(--ease-out) forwards;
}
.ripple-ink.dark { background: rgba(30, 58, 95, .12); }
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

/* 卡片点击弹跳（先放大再恢复） */
.tap-pop { transition: transform .18s var(--ease); }
.tap-pop.pop { transform: scale(1.02); }

/* ---------- 4. 骨架屏（首屏加载占位） ---------- */
.skeleton {
  position: relative; overflow: hidden;
  background: #eef1f5; border-radius: 10px; color: transparent !important;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* 刷新提示（品牌金环旋转） */
.spin-ring {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(201, 169, 110, .3); border-top-color: var(--gold);
  animation: rotate .8s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* ---------- 5. 数字/文字跳动（验证码倒计时等） ---------- */
.tick { animation: countTick .3s var(--ease); }
@keyframes countTick { from { opacity: 0; transform: translateY(-4px) scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- 6. 呼吸动效（立即领取按钮，微弱不廉价） ---------- */
@keyframes breathe {
  0%, 100% { box-shadow: 0 4px 12px rgba(30, 58, 95, .16); }
  50% { box-shadow: 0 4px 20px rgba(30, 58, 95, .32); }
}
.breathe { animation: breathe 2.4s ease-in-out infinite; }
.breathe.gold { animation-name: breatheGold; }
@keyframes breatheGold {
  0%, 100% { box-shadow: 0 4px 12px rgba(168, 132, 79, .18); }
  50% { box-shadow: 0 4px 20px rgba(168, 132, 79, .36); }
}

/* ---------- 7. SVG 描边成功动画 ---------- */
/* 给 path 加 pathLength="1"，则描边长度归一化为 1，动画始终正确 */
.draw-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) forwards; }
.draw-stroke.d2 { animation-duration: .7s; animation-delay: .35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-pop { transform: scale(0); animation: successPop .5s var(--ease-spring) 1.25s forwards; }
@keyframes successPop { 60% { transform: scale(1.15); } to { transform: scale(1); } }

/* ---------- 8. 地址选中 / 值出现淡入 ---------- */
.value-pop { animation: valuePop .35s var(--ease); }
@keyframes valuePop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 9. 下拉刷新中的品牌色小球 ---------- */
.refresh-dots { display: inline-flex; gap: 6px; align-items: center; }
.refresh-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: refreshJump 1s ease-in-out infinite; }
.refresh-dots i:nth-child(2) { animation-delay: .16s; }
.refresh-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes refreshJump { 0%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ---------- 10. 页面横幅顶部金色线条入场 ---------- */
.hero-in { animation: heroIn .5s var(--ease) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* 尊重系统减弱动效偏好：移除位移，仅保留必要信息（加载环/进度）与焦点反馈 */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-observe, .has-js .reveal, .has-js .reveal-observe,
  .tap-pop, .breathe, .tick, .value-pop, .hero-in {
    animation: none !important; transition: none !important;
    opacity: 1 !important; transform: none !important;
  }
  body.page-leaving, body.page-leaving.back { animation: none; }
  .admin-sidebar, .admin-sidebar.collapsed,
  .admin-sidebar-head, .modal-dialog, .admin-toast {
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   管理后台 · 交互与界面升级（深色主题 + 侧边栏 + 微交互）
   仅作用于设了 data-theme="dark|light" 及 .admin 的管理页面；
   员工端页面不设属性，保持浅色不变。
   ============================================================ */

/* ---------- 深色主题变量（默认深色，低饱和、干净） ---------- */
:root[data-theme="dark"] {
  --primary: #6E92BC;           /* 深色下提亮主蓝，保住品牌又可读 */
  --primary-light: #8AA8CC;
  --primary-dark: #44607F;
  --gold: #D8BC87;
  --gold-light: #E6D2A7;
  --gold-dark: #C09E64;
  --gold-deep: #D8BC87;
  --gold-tint: rgba(216, 188, 135, .10);

  --bg: #0E141B;
  --bg-soft: #161E28;
  --bg-input: #1B2531;
  --card: #161E28;

  --ink: #E6EAF0;
  --ink-2: #A6B1C0;
  --ink-3: #67758A;

  --line: #263140;
  --line-soft: #1D2733;

  --success: #8FB391; --info: #78A0C2; --warning: #C9A65E; --danger: #C97B6D;

  --shadow-xs: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .40);
  --shadow-md: 0 10px 34px rgba(0, 0, 0, .50);
}

/* 管理端通用深色组件覆盖 */
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] body.admin::before { transition: opacity .4s ease; }

/* ---------- 管理端布局基础 ---------- */
.admin-header {
  transition: background .3s ease, border-color .3s ease;
}
.admin-header .btn,
.toolbar .btn, .admin-search .btn {
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.admin-header .btn:hover,
.toolbar .btn:hover, .admin-search .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.toolbar .btn, .admin-search .btn { box-shadow: 0 1px 2px rgba(0,0,0,.04); }

/* 深色下的工具栏输入框/下拉 */
:root[data-theme="dark"] .toolbar input,
:root[data-theme="dark"] .toolbar select,
:root[data-theme="dark"] .admin-search input,
:root[data-theme="dark"] .admin-search select {
  background: var(--bg-input); color: var(--ink); border-color: var(--line);
}
:root[data-theme="dark"] .toolbar input:focus,
:root[data-theme="dark"] .toolbar select:focus,
:root[data-theme="dark"] .admin-search input:focus,
:root[data-theme="dark"] .admin-search select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110,146,188,.15); }

:root[data-theme="dark"] .admin-table { background: var(--card); }
:root[data-theme="dark"] .admin-table th { background: var(--bg-soft); border-color: var(--line-soft); }
:root[data-theme="dark"] .admin-table td { border-color: var(--line-soft); color: var(--ink); }
:root[data-theme="dark"] .admin-table tbody tr:hover td { background: rgba(110,146,188,.06); }
:root[data-theme="dark"] .admin-table select, :root[data-theme="dark"] .admin-table input { background: var(--bg-input); color: var(--ink); border-color: var(--line); }

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal-dialog,
:root[data-theme="dark"] .welcome-bar,
:root[data-theme="dark"] .quick-link,
:root[data-theme="dark"] .stat-card { background: var(--card); }

:root[data-theme="dark"] .welcome-bar {
  background: linear-gradient(135deg, rgba(216,188,135,.08), rgba(18,26,36,.4));
  border-color: rgba(216,188,135,.22);
}
:root[data-theme="dark"] .chart-bar .bar-wrap { background: var(--bg-soft); }
:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group select,
:root[data-theme="dark"] .form-group textarea { background: var(--bg-input); color: var(--ink); border-color: var(--line); }

:root[data-theme="dark"] .login-card { background: rgba(22,30,40,.92); }
:root[data-theme="dark"] .login-page {
  background:
    radial-gradient(circle at 15% 20%, rgba(216,188,135,.06), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(110,146,188,.06), transparent 45%),
    var(--bg);
}
:root[data-theme="dark"] .stat-card { background: var(--card); border-color: var(--line-soft); }
:root[data-theme="dark"] .stat-card::after { background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- 侧边栏：头 + 折叠 + 拖拽调宽 ---------- */
.admin-sidebar {
  position: relative; width: 220px;
  padding: 0;
  transition: width .3s var(--ease);
  display: flex; flex-direction: column;
}
.admin-sidebar.collapsed { width: 64px; }
.admin-sidebar.collapsed .sidebar-brand span { display: none; }

.admin-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft);
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: .04em; white-space: nowrap; overflow: hidden; }
.sidebar-brand i { font-style: normal; }
.sidebar-collapse {
  border: none; background: transparent; color: var(--ink-3); cursor: pointer;
  width: 24px; height: 24px; border-radius: 6px; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease), background .2s var(--ease), color .2s var(--ease);
  flex-shrink: 0;
}
.sidebar-collapse:hover { background: rgba(110,146,188,.12); color: var(--primary); }
.admin-sidebar.collapsed .sidebar-collapse { transform: rotate(180deg); }
.admin-sidebar.collapsed .admin-sidebar-head { justify-content: center; padding: 18px 8px 14px; }

.menu-list { flex: 1; overflow-y: auto; padding: 10px 0; }
.admin-sidebar .menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; cursor: pointer; font-size: 13px;
  color: var(--ink-2); font-weight: 400; letter-spacing: .02em;
  border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden;
  transition: all .25s var(--ease);
}
.admin-sidebar .menu-item i { font-style: normal; font-size: 16px; flex-shrink: 0; }
.admin-sidebar .menu-item .ml { transition: opacity .2s var(--ease); }
.admin-sidebar .menu-item:hover { background: rgba(110,146,188,.08); color: var(--ink); transform: translateX(3px); }
.admin-sidebar .menu-item.active {
  background: linear-gradient(90deg, rgba(110,146,188,.14), transparent);
  color: var(--primary); border-left-color: var(--gold); font-weight: 600;
}
.admin-sidebar.collapsed .menu-item { justify-content: center; gap: 0; padding: 14px 0; }
.admin-sidebar.collapsed .menu-item .ml, .admin-sidebar.collapsed .sidebar-collapse-text { display: none; }

/* 深色下侧边栏文字颜色 */
:root[data-theme="dark"] .admin-sidebar { background: var(--bg-soft); border-color: var(--line); }
:root[data-theme="dark"] .sidebar-brand { color: var(--ink); }

/* 拖拽调宽手柄 */
.sidebar-resizer {
  position: absolute; right: -3px; top: 0; bottom: 0; width: 8px;
  cursor: col-resize; z-index: 10;
}
.sidebar-resizer::after {
  content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; border-radius: 2px;
  background: transparent; transition: background .2s ease;
}
.sidebar-resizer:hover::after, .sidebar-resizer.dragging::after { background: var(--gold); }
body.sb-resizing { user-select: none; cursor: col-resize; }
body.sb-resizing .admin-sidebar { transition: none; }

/* ---------- 头部：汉堡 + 主题切换 ---------- */
.hamburger, .icon-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  transition: all .25s var(--ease); flex-shrink: 0;
}
.hamburger:hover, .icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-soft); }
.hamburger { display: none; }
.admin-head-left { display: flex; align-items: center; gap: 14px; }
.admin-head-right { display: flex; align-items: center; gap: 12px; }

/* ---------- 窄屏：侧边栏变为抽屉式 ---------- */
.sidebar-mask {
  position: fixed; inset: 0; background: rgba(6,10,16,.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  z-index: 250; opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.sidebar-mask.show { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .hamburger { display: inline-flex; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 250px;
    transform: translateX(-100%); z-index: 260;
    transition: transform .32s var(--ease-spring); box-shadow: var(--shadow-md);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar.collapsed { width: 250px; }
  .admin-sidebar.collapsed .sidebar-brand span,
  .admin-sidebar.collapsed .menu-item .ml,
  .admin-sidebar.collapsed .menu-item { justify-content: flex-start; }
  .admin-sidebar.collapsed .menu-item .ml { display: inline; }
  .sidebar-resizer { display: none; }
  .admin-header { padding: 14px 18px; }
  .admin-main { padding: 20px 16px; }
  .admin-header h1 { font-size: 16px; }
  /* 覆盖旧版窄屏横向菜单，保证抽屉内保持纵向导航 */
  .admin-sidebar { display: flex; flex-direction: column; overflow: visible; border-right: 1px solid var(--line-soft); border-bottom: none; }
  .admin-sidebar .menu-item { flex-shrink: 0; padding: 12px 18px; border-left: 3px solid transparent; border-bottom: none; }
  .admin-sidebar .menu-item.active { border-left-color: var(--gold); border-bottom-color: transparent; }
  .admin-sidebar .menu-item .ml { display: inline; }
}

/* ---------- 弹窗：标题拖拽区 + 微交互 ---------- */
.modal-dialog h3 { cursor: move; user-select: none; }
.modal-dialog.dragging { transition: none; box-shadow: var(--shadow-md); }
.modal-dialog h3 .drag-hint { font-size: 10px; color: var(--ink-3); font-weight: 400; margin-left: 6px; letter-spacing: .02em; }

/* 表单控件在弹窗内的聚焦下划线微动效 */
.modal-dialog .form-group input:focus,
.modal-dialog .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110,146,188,.14); }

/* ---------- 右上角 Toast（图标 + 文字，3s 自动消失） ---------- */
.admin-toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 10000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.admin-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 9px;
  min-width: 180px; max-width: 320px; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 400; letter-spacing: .02em; color: #fff;
  box-shadow: var(--shadow-md) ; opacity: 0;
  transform: translateX(24px); transition: all .32s var(--ease-spring);
}
.admin-toast.show { opacity: 1; transform: translateX(0); }
.admin-toast.hide { opacity: 0; transform: translateX(24px); }
.admin-toast .t-icon { font-size: 15px; line-height: 1; flex-shrink: 0; }
.admin-toast.success { background: linear-gradient(135deg, #4E7A5E, #3E6B50); }
.admin-toast.error { background: linear-gradient(135deg, #B05A4E, #9C4A40); }
.admin-toast.info { background: linear-gradient(135deg, #44607F, #39536F); }

/* 主题全局切换时的过渡 */
:root[data-theme="dark"] body, :root[data-theme="dark"] .admin-main,
:root[data-theme="dark"] .admin-header { transition: background .35s ease, color .35s ease; }

/* ============================================================
   无障碍与压感反馈 · 全局（交互设计的收尾层）
   ============================================================ */

/* 焦点可见性：鼠标/触屏不显示外圈，键盘聚焦显示品牌色外圈 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 控件按压缩放（0.2s，立即响应）——键盘/指针通用 */
.btn, .btn-primary, .btn-secondary, .btn-gold, .btn-get,
.sms-btn, .cancel-btn, .text-btn, .back-btn,
.btn-success, .btn-info, .btn-warning, .btn-danger,
.icon-btn, .hamburger, .sidebar-collapse,
.menu-card, .step-done, .cancel-btn, .product-card {
  transition: transform .2s var(--ease), opacity .2s var(--ease),
              box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-gold:active,
.btn-get:active, .btn-success:active, .btn-info:active,
.btn-warning:active, .btn-danger:active,
.icon-btn:active, .hamburger:active, .sidebar-collapse:active {
  transform: scale(.97);
}

/* 可点击行/卡片的指针语义与压感 */
[onclick], .menu-item, .product-card, .order-body, .address-card, .quick-link { cursor: pointer; }

/* 禁用态：不透明、不可点 */
[disabled], .btn[disabled], button[disabled] { cursor: not-allowed; opacity: .55 !important; }
