/* ==========================================================================
 * 上上签重庆火锅馆官网 — 统一设计系统 v2
 * Tailwind CDN 负责工具类；本文件负责结构性组件类、动效与响应式。
 * 设计基调：暖色调（红 / 橙 / 金 / 奶油）+ 强食欲感 + WCAG AA 可访问性
 * ========================================================================== */

/* ==========================================================================
 * 1. CSS 自定义属性（Design Tokens）
 * ========================================================================== */
:root {
  /* ── 品牌色（暖色调火锅主题）── */
  --c-chili:        #e8391a;
  --c-chili-hover:  #c62a12;
  --c-chili-dark:   #9d2213;
  --c-chili-light:  #ffe4dc;
  --c-chili-soft:   #fff5f2;

  --c-ember:        #f28c0f;
  --c-ember-hover:  #d16f05;
  --c-ember-dark:   #a35507;
  --c-ember-light:  #fff1d6;
  --c-ember-soft:   #fff8ec;

  --c-gold:         #f7c948;
  --c-gold-dark:    #b98600;
  --c-gold-light:   #ffe08a;
  --c-gold-soft:    #fdf6e3;

  --c-cream:        #fffaf5;
  --c-cream-dark:   #fdf1e7;

  /* ── 中性色 ── */
  --c-ink:          #1c1310;
  --c-ink-soft:     #2b1e1a;
  --c-ink-muted:    #3b2b25;
  --c-body:         #4b3f3a;
  --c-muted:        #6b5d56;
  --c-subtle:       #8b7d76;
  --c-placeholder:  #a89b94;
  --c-line:         #ddd0c9;
  --c-line-light:   #f0e9e5;
  --c-surface:      #fff;
  --c-bg:           var(--c-cream);

  /* ── 语义色 ── */
  --c-success:      #16a34a;
  --c-success-bg:   #f0fdf4;
  --c-success-line: #bbf7d0;
  --c-warning:      #d97706;
  --c-warning-bg:   #fffbeb;
  --c-warning-line: #fde68a;
  --c-error:        #dc2626;
  --c-error-bg:     #fef2f2;
  --c-error-line:   #fecaca;
  --c-info:         #2563eb;
  --c-info-bg:      #eff6ff;
  --c-info-line:    #bfdbfe;

  /* ── 排版 ── */
  --font-sans:      "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-mono:      "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  --fs-xs:          0.75rem;   /* 12px */
  --fs-sm:          0.8125rem; /* 13px */
  --fs-base:        0.875rem;  /* 14px */
  --fs-md:          0.9375rem; /* 15px */
  --fs-lg:          1rem;      /* 16px */
  --fs-xl:          1.125rem;  /* 18px */
  --fs-2xl:         1.25rem;   /* 20px */
  --fs-3xl:         1.5rem;    /* 24px */
  --fs-4xl:         1.875rem;  /* 30px */
  --lh-tight:       1.25;
  --lh-normal:      1.6;
  --lh-relaxed:     1.75;

  /* ── 间距 ── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* ── 圆角 ── */
  --radius-sm:   0.5rem;   /* 8px — 小型按钮/标签 */
  --radius-md:   0.625rem; /* 10px — 输入框/工具栏 */
  --radius-lg:   0.75rem;  /* 12px — 按钮/标签导航 */
  --radius-xl:   0.875rem; /* 14px — 卡片/面板 */
  --radius-2xl:  1rem;     /* 16px — 大卡片 */
  --radius-full: 9999px;

  /* ── 阴影 ── */
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --shadow-md:  0 4px 12px -2px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg:  0 12px 28px -8px rgb(0 0 0 / 0.12), 0 4px 8px -4px rgb(0 0 0 / 0.06);
  --shadow-xl:  0 20px 48px -12px rgb(0 0 0 / 0.16), 0 8px 12px -6px rgb(0 0 0 / 0.08);
  --shadow-warm:      0 18px 40px -18px rgba(198, 42, 18, 0.55);
  --shadow-warm-lg:   0 28px 60px -20px rgba(198, 42, 18, 0.65);
  --shadow-card-hover: 0 30px 60px -22px rgba(198, 42, 18, 0.55);

  /* ── 过渡 ── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    150ms;
  --dur-normal:  250ms;
  --dur-slow:    400ms;

  /* ── 聚焦环 ── */
  --focus-ring:  0 0 0 3px rgba(232, 57, 26, 0.25);
  --focus-ring-offset: 2px;

  /* ── Z-index 层级 ── */
  --z-sticky:  50;
  --z-tabbar:  55;
  --z-toast:   60;
  --z-modal:   70;
  --z-tooltip: 80;
}

/* ==========================================================================
 * 2. 重置 & 基础样式
 * ========================================================================== */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--c-bg);
  font-family: var(--font-sans);
  color: var(--c-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 文本选中 ── */
::selection {
  background: rgba(232, 57, 26, 0.18);
  color: var(--c-ink);
}

/* ── 全局聚焦样式（WCAG AA：可见聚焦指示器）── */
:focus-visible {
  outline: 2px solid var(--c-chili);
  outline-offset: 2px;
}
/* 按钮/输入框使用 ring，避免和自身边框重叠 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── 无障碍：跳转到内容（不可见但可聚焦）── */
.skip-to-content {
  position: absolute; top: -100%; left: 0; z-index: 999;
  padding: 12px 20px; background: var(--c-chili); color: #fff;
  font-weight: 600; font-size: var(--fs-base); border-radius: 0 0 var(--radius-lg) 0;
  text-decoration: none; transition: top var(--dur-normal);
}
.skip-to-content:focus { top: 0; }

/* ── 仅屏幕阅读器可见 ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-chili-light); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-chili), var(--c-ember));
  border-radius: var(--radius-full); border: 2px solid var(--c-chili-light);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--c-chili-dark), var(--c-chili)); }

/* ==========================================================================
 * 3. 排版工具类
 * ========================================================================== */
.text-gradient-warm {
  background-image: linear-gradient(92deg, #ffe08a 0%, #ffab33 42%, #ff6b3d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 英雄区渐变背景 */
.hero-warm { position: relative; overflow: hidden; }
.bg-flow-warm {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(120deg, #7a1e14 0%, #c62a12 26%, #e8391a 48%, #f28c0f 72%, #f7c948 100%);
  background-size: 260% 260%;
  animation: flowWarm 16s ease-in-out infinite;
}
@keyframes flowWarm {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
 * 4. 布局系统
 * ========================================================================== */

/* ── 控制台双栏布局 ── */
.console-layout {
  max-width: 72rem; margin: 0 auto; padding: 28px var(--sp-6);
  display: flex; align-items: flex-start; gap: 24px;
}
.console-sidebar {
  width: 236px; flex-shrink: 0; background: var(--c-surface);
  border: 1px solid var(--c-line-light); border-radius: var(--radius-2xl);
  padding: 18px; position: sticky; top: 84px;
  box-shadow: var(--shadow-lg);
}
.console-main { flex: 1; min-width: 0; }

.console-user {
  display: flex; align-items: center; gap: 12px; padding-bottom: 16px;
  margin-bottom: 12px; border-bottom: 1px solid var(--c-line-light);
}
.console-nav { display: flex; flex-direction: column; gap: 2px; }

.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: var(--radius-lg); font-size: var(--fs-base); color: var(--c-muted);
  text-decoration: none; transition: background var(--dur-fast), color var(--dur-fast);
}
.side-link:hover { background: var(--c-chili-soft); color: var(--c-chili-hover); }
/* 当前激活（.side-link-active 由 JS 添加） */
.side-link-active { background: var(--c-chili-light); color: var(--c-chili-hover); font-weight: 600; }

/* ── 页面标题区 ── */
.page-head { margin-bottom: 20px; }
.page-head h2 {
  font-size: var(--fs-3xl); font-weight: 800; color: var(--c-ink);
  line-height: var(--lh-tight); letter-spacing: -0.02em;
}
.page-head p { font-size: var(--fs-base); color: var(--c-subtle); margin-top: 4px; }

/* ── 统计卡片网格 ── */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat-grid-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ── 快捷入口 ── */
.quick-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 18px; border-radius: var(--radius-xl);
  background: var(--c-chili-soft); color: var(--c-chili-hover);
  text-decoration: none; font-size: var(--fs-sm); font-weight: 600;
  transition: transform var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.quick-tile:hover {
  transform: translateY(-3px); background: var(--c-chili-light);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
 * 5. 组件库 - 按钮
 * ========================================================================== */
.btn-primary, .btn-ghost, .btn-primary-lg, .btn-ghost-lg,
.btn-disabled, .btn-danger, .btn-success {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  line-height: 1.4; white-space: nowrap;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast),
              background-color var(--dur-fast), opacity var(--dur-fast),
              border-color var(--dur-fast);
}

/* ── 主按钮 ── */
.btn-primary {
  padding: 10px 18px; font-size: var(--fs-base); color: #fff;
  background: linear-gradient(120deg, var(--c-chili), var(--c-ember));
  border-radius: var(--radius-lg); box-shadow: 0 2px 8px rgba(232, 57, 26, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(198, 42, 18, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-primary-lg {
  padding: 14px 30px; font-size: var(--fs-lg); color: #fff;
  background: linear-gradient(120deg, var(--c-chili), var(--c-ember));
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(198, 42, 18, 0.35);
}
.btn-primary-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(198, 42, 18, 0.45);
}
.btn-primary-lg:active { transform: translateY(0); }

/* ── 次按钮 / 幽灵 ── */
.btn-ghost {
  padding: 10px 18px; font-size: var(--fs-base); color: var(--c-chili-hover);
  background: var(--c-surface); border: 1px solid var(--c-chili-light);
  border-radius: var(--radius-lg);
}
.btn-ghost:hover {
  background: var(--c-chili-soft); border-color: var(--c-chili);
}

.btn-ghost-lg {
  padding: 14px 30px; font-size: var(--fs-lg); color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg); backdrop-filter: blur(6px);
}
.btn-ghost-lg:hover { background: rgba(255, 255, 255, 0.24); }

/* ── 禁用 ── */
.btn-disabled {
  padding: 10px 18px; font-size: var(--fs-base); color: var(--c-placeholder);
  background: var(--c-line-light); border-radius: var(--radius-lg);
  cursor: not-allowed; opacity: 0.7;
}

/* ── 危险 / 成功（管理端操作按钮）── */
.btn-danger {
  padding: 8px 14px; font-size: var(--fs-sm); color: #fff;
  background: var(--c-error); border-radius: var(--radius-sm);
}
.btn-danger:hover { background: #b91c1c; }

.btn-success {
  padding: 8px 14px; font-size: var(--fs-sm); color: #fff;
  background: var(--c-success); border-radius: var(--radius-sm);
}
.btn-success:hover { background: #15803d; }

/* ── 全宽按钮 ── */
.btn-block { width: 100%; justify-content: center; }

/* ── 加载中 ── */
.btn-busy { opacity: 0.65; cursor: progress; pointer-events: none; }

/* ── 按压反馈（active）── */
.btn-primary:active, .btn-primary-lg:active,
.btn-success:active, .btn-danger:active { transform: translateY(1px) scale(0.98); }
.btn-ghost:active, .btn-ghost-lg:active { transform: translateY(1px); }
.nav-cta:active { transform: translateY(1px); }

/* ── 加载态（内嵌 spinner，配合 ui.submitGuard 的 .btn-loading）── */
.btn-loading { position: relative; pointer-events: none; opacity: 0.85; }
.btn-loading::before {
  content: ''; width: 14px; height: 14px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn-ghost.btn-loading::before,
.btn-disabled.btn-loading::before {
  border-color: rgba(198, 42, 18, 0.2); border-top-color: var(--c-chili-hover);
}

/* ── 通用禁用兜底 ── */
.btn-primary:disabled, .btn-ghost:disabled,
.btn-success:disabled, .btn-danger:disabled {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
  transform: none; box-shadow: none;
}

/* ==========================================================================
 * 6. 组件库 - 表单
 * ========================================================================== */
.form-label {
  display: block; font-size: var(--fs-sm); font-weight: 500;
  color: var(--c-muted); margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; font-size: var(--fs-base);
  font-family: var(--font-sans); color: var(--c-ink-soft);
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-md); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--c-placeholder); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--c-chili); box-shadow: var(--focus-ring);
}
.form-input[aria-invalid="true"], .form-input.is-invalid {
  border-color: var(--c-error); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7d76' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-textarea { resize: vertical; min-height: 80px; line-height: var(--lh-normal); }

/* 表单错误文案 */
.form-error {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: var(--fs-xs); color: var(--c-error); line-height: 1.4;
}

/* 表单帮助说明 */
.form-help {
  margin-top: 5px; font-size: var(--fs-xs); color: var(--c-subtle); line-height: 1.5;
}

/* ── 单选 / 复选（原生控件自定义外观）── */
.form-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-base); color: var(--c-body); cursor: pointer;
  user-select: none; line-height: 1.4;
}
.form-check + .form-check { margin-left: 16px; }
.form-check__input {
  appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0;
  width: 18px; height: 18px; border: 2px solid var(--c-line);
  background: var(--c-surface); border-radius: 5px;
  display: inline-grid; place-content: center; cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.form-check__input[type="radio"] { border-radius: 50%; }
.form-check__input:hover { border-color: var(--c-subtle); }
.form-check__input:checked {
  border-color: var(--c-chili); background: var(--c-chili);
}
.form-check__input:checked::before {
  content: ''; width: 10px; height: 10px; background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.form-check__input[type="radio"]:checked::before {
  width: 8px; height: 8px; clip-path: none; border-radius: 50%;
}
.form-check__input:focus-visible { outline: 2px solid var(--c-chili); outline-offset: 2px; }
.form-check__input:disabled { opacity: 0.5; cursor: not-allowed; }
.form-check--disabled { opacity: 0.55; cursor: not-allowed; }

/* ── 开关 ── */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; width: 44px; height: 24px; border-radius: var(--radius-full);
  background: var(--c-line); flex-shrink: 0;
  transition: background var(--dur-fast);
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast);
}
.switch__label { font-size: var(--fs-base); color: var(--c-body); line-height: 1.4; }
.switch input:checked + .switch__track { background: var(--c-chili); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }
.switch input:disabled + .switch__track { opacity: 0.5; cursor: not-allowed; }
.switch--disabled { opacity: 0.55; cursor: not-allowed; }

/* ── 日期 / 时间选择（对齐表单控件高度）── */
.form-input[type="date"], .form-input[type="time"],
.form-input[type="datetime-local"], .form-input[type="month"] {
  min-height: 42px; appearance: none; -webkit-appearance: none;
  cursor: pointer;
}
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; }

/* ── 字段校验错误（bindFormValidation / validateFields 输出）── */
.field-error {
  display: none; margin-top: 5px;
  font-size: var(--fs-xs); color: var(--c-error); line-height: 1.4;
}
.input-invalid, .form-input.input-invalid {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ==========================================================================
 * 7. 组件库 - 徽章
 * ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 500; line-height: 1.6;
}
.badge--default  { background: var(--c-line-light); color: var(--c-muted); }
.badge--success  { background: var(--c-success-bg); color: var(--c-success); }
.badge--warning  { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--error    { background: var(--c-error-bg); color: var(--c-error); }
.badge--info     { background: var(--c-info-bg); color: var(--c-info); }
.badge--chili    { background: var(--c-chili-soft); color: var(--c-chili); }
.badge--ember    { background: var(--c-ember-soft); color: var(--c-ember); }

/* 等级徽章（背景色动态，只设通用样式） */
.level-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 600; color: #fff; white-space: nowrap;
}

/* ==========================================================================
 * 8. 组件库 - 卡片
 * ========================================================================== */
.card {
  background: var(--c-surface); border-radius: var(--radius-2xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-xs); overflow: hidden;
}
.card--bordered { border-color: var(--c-line-light); }
.card--hover {
  transition: transform var(--dur-normal), box-shadow var(--dur-normal),
              border-color var(--dur-normal);
}
.card--hover:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: rgba(242, 140, 15, 0.35);
}
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--c-line-light);
}
.card__header h3 { font-weight: 700; color: var(--c-ink); font-size: var(--fs-base); }
.card__body { padding: var(--sp-5); }

/* ── 图片卡片 ── */
.card--media .card__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--c-line-light);
}
.card--media .card__media--tall { aspect-ratio: 4 / 3; }
.card--media .card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.card--media:hover .card__media img { transform: scale(1.05); }
.card--media .card__media-badge {
  position: absolute; top: 10px; left: 10px;
}
.card--media .card__body { padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.card--media .card__title {
  font-size: var(--fs-lg); font-weight: 700; color: var(--c-ink);
  line-height: var(--lh-tight); margin-bottom: 6px;
}
.card--media .card__desc {
  font-size: var(--fs-sm); color: var(--c-subtle);
  line-height: var(--lh-normal);
}

/* ── 卡片操作区（底部按钮组）── */
.card__footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--c-line-light);
}
.card__footer--spread { justify-content: space-between; }

/* ==========================================================================
 * 9. 组件库 - 列表
 * ========================================================================== */
.list { margin: 0; padding: 0; list-style: none; }

/* 有序 / 无序（保留原生列表语义，仅统一间距） */
.list--ordered { list-style: decimal; padding-left: 22px; }
.list--unordered { list-style: disc; padding-left: 22px; }
.list--ordered .list-item, .list--unordered .list-item {
  display: list-item; padding: 6px 0; font-size: var(--fs-base);
  color: var(--c-body); line-height: var(--lh-normal);
}
.list--ordered .list-item + .list-item,
.list--unordered .list-item + .list-item { margin-top: 2px; }

/* ── 通用列表项（行容器）── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-lg);
  font-size: var(--fs-base); color: var(--c-body);
  transition: background var(--dur-fast);
}
.list-item + .list-item { margin-top: 2px; }
.list-item--divider + .list-item--divider {
  border-top: 1px solid var(--c-line-light); border-radius: 0;
}
.list-item--hover:hover { background: var(--c-chili-soft); }
.list-item--clickable { cursor: pointer; }

/* 列表项图标容器 */
.list-item__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: var(--c-chili-soft); color: var(--c-chili-hover);
  flex-shrink: 0;
}
.list-item__icon--emoji { background: transparent; font-size: 20px; }

/* 可点击列表项（href）内部的链接 */
.list-item__link {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0; color: inherit; text-decoration: none;
}

/* 列表项文本区 */
.list-item__content { flex: 1; min-width: 0; }
.list-item__title {
  font-weight: 600; color: var(--c-ink-soft);
  line-height: 1.4; word-break: break-word;
}
.list-item__desc {
  margin-top: 2px; font-size: var(--fs-sm); color: var(--c-subtle);
  line-height: var(--lh-normal); word-break: break-word;
}

/* 右侧元信息 / 操作区 */
.list-item__meta {
  flex-shrink: 0; font-size: var(--fs-sm); color: var(--c-subtle);
  white-space: nowrap;
}
.list-item__actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
/* 行内操作按钮（编辑 / 删除等） */
.list-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-xs); font-weight: 500; color: var(--c-muted);
  background: var(--c-line-light); transition: all var(--dur-fast);
}
.list-action:hover { background: var(--c-chili-light); color: var(--c-chili-hover); }
.list-action--edit { color: var(--c-info); background: var(--c-info-bg); }
.list-action--edit:hover { background: var(--c-info-line); color: var(--c-info); }
.list-action--delete { color: var(--c-error); background: var(--c-error-bg); }
.list-action--delete:hover { background: var(--c-error-line); color: var(--c-error); }

/* 空列表状态（复用 Hotpot.C.empty 语义，加分隔） */
.list__empty {
  padding: 32px 0; border-top: 1px solid var(--c-line-light);
  border-bottom: 1px solid var(--c-line-light);
}

/* ==========================================================================
 * 10. 组件库 - 表格
 * ========================================================================== */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-base);
  min-width: 520px;
}
.data-table th {
  text-align: left; padding: 10px 12px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-subtle); text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--c-bg); border-bottom: 1px solid var(--c-line-light);
  white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid var(--c-line-light);
  color: var(--c-ink-muted); vertical-align: middle;
}
.data-table tbody tr:last-child td,
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--dur-fast);
}
.data-table tbody tr:hover td { background: var(--c-bg); }

/* 文本对齐类 */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* 我的订单：整行可点击 */
.orders-table .data-table tbody tr { cursor: pointer; }
.orders-table .data-table tbody tr:hover td { background: var(--c-chili-soft); }

/* ==========================================================================
 * 10. 组件库 - 分页
 * ========================================================================== */
.pagination-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding-top: 16px;
}
.page-btn {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-line);
  background: var(--c-surface); font-size: var(--fs-sm); color: var(--c-muted);
  cursor: pointer; transition: all var(--dur-fast); min-width: 36px; text-align: center;
}
.page-btn:hover:not(.page-btn-disabled):not(.page-btn-active) {
  background: var(--c-chili-soft); border-color: var(--c-chili-light);
}
.page-btn-active { background: var(--c-chili-hover); color: #fff; border-color: var(--c-chili-hover); }
.page-btn-disabled { opacity: 0.4; cursor: not-allowed; }

/* ==========================================================================
 * 11. 组件库 - 标签导航
 * ========================================================================== */
.tab-nav {
  display: flex; gap: 2px; border-bottom: 1px solid var(--c-line-light);
  margin-bottom: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  font-size: var(--fs-base); color: var(--c-subtle); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab-link:hover { color: var(--c-chili-hover); }
.tab-link-active { color: var(--c-chili-hover); font-weight: 600; border-bottom-color: var(--c-chili-hover); }

/* 内嵌小标签 */
.inner-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--c-line-light);
  margin-bottom: 14px;
}
.inner-tab {
  padding: 8px 14px; font-size: var(--fs-sm); color: var(--c-subtle);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; transition: color var(--dur-fast);
}
.inner-tab:hover { color: var(--c-chili-hover); }
.inner-tab-active { color: var(--c-chili-hover); font-weight: 600; border-bottom-color: var(--c-chili-hover); }

/* ── 面包屑 ── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: var(--fs-sm); color: var(--c-subtle);
}
.breadcrumb__item {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--c-muted); text-decoration: none;
  transition: color var(--dur-fast);
}
.breadcrumb__item:hover { color: var(--c-chili-hover); }
.breadcrumb__item--current {
  color: var(--c-ink); font-weight: 600;
  pointer-events: none; overflow-wrap: anywhere;
}
.breadcrumb__sep {
  color: var(--c-placeholder); font-size: 12px;
  user-select: none; line-height: 1;
}

/* ==========================================================================
 * 12. 组件库 - 弹窗
 * ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(28, 19, 16, 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn var(--dur-normal);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  position: relative; width: 100%; max-width: 28rem; max-height: 90vh;
  overflow-y: auto; background: var(--c-surface); border-radius: var(--radius-2xl);
  padding: 28px; box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--ease-out);
}
.modal-wide { max-width: 40rem; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: var(--radius-sm); display: inline-flex; align-items: center;
  justify-content: center; color: var(--c-subtle); background: var(--c-line-light);
  border: none; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.modal-close:hover { background: var(--c-chili-light); color: var(--c-chili-hover); }

/* ==========================================================================
 * 13. 组件库 - Toast 轻提示
 * ========================================================================== */
.toast-item {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-lg);
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.4;
  color: #fff; box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--ease-spring);
  max-width: 360px;
}
.toast-item.toast-out { animation: toastOut 0.3s var(--ease-out) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-14px) scale(0.94); }
}

/* Toast 类型由 JS 动态添加的 Tailwind 类控制 */

/* ==========================================================================
 * 14. 组件库 - 加载 / 空 / 错误状态
 * ========================================================================== */
.loading-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--c-chili-light);
  border-top-color: var(--c-chili);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 & 错误状态（由 C.empty / C.errorState / C.loading 输出） */

/* ── 骨架屏（列表 / 卡片 / 详情加载占位）── */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--c-line-light); border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255, 255, 255, 0.65) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: skeletonShimmer 1.4s var(--ease-out) infinite;
}
@keyframes skeletonShimmer { 100% { transform: translateX(100%); } }
.skeleton--text { height: 12px; }
.skeleton--title { height: 18px; width: 60%; }
.skeleton--avatar { width: 44px; height: 44px; border-radius: 50%; }
.skeleton--image { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.skeleton--button { width: 88px; height: 36px; border-radius: var(--radius-md); }
.skeleton--badge { width: 52px; height: 22px; border-radius: var(--radius-full); }
.skeleton-block { display: flex; flex-direction: column; gap: 10px; }
.skeleton-card {
  background: var(--c-surface); border: 1px solid var(--c-line-light);
  border-radius: var(--radius-2xl); padding: var(--sp-5);
  box-shadow: var(--shadow-xs);
}
.skeleton-list .skeleton-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
}
.skeleton-list .skeleton-row + .skeleton-row { border-top: 1px solid var(--c-line-light); }

/* ==========================================================================
 * 15. 顶部导航
 * ========================================================================== */
#app-header {
  background: rgba(255, 250, 245, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line-light);
}
.header-inner {
  max-width: 72rem; margin: 0 auto; height: 64px;
  padding: 0 var(--sp-6); display: flex; align-items: center;
  justify-content: space-between; gap: var(--sp-4);
}
.brand-logo {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; transition: opacity var(--dur-fast);
}
.brand-logo:hover { opacity: 0.85; }
.brand-mark { font-size: 22px; }
.brand-name {
  font-weight: 800; font-size: 18px; color: var(--c-chili-hover);
  letter-spacing: 0.02em;
}
.main-nav { display: flex; align-items: center; gap: var(--sp-6); }
.nav-link {
  font-size: var(--fs-base); color: var(--c-muted); text-decoration: none;
  padding: 4px 0; position: relative; transition: color var(--dur-fast);
}
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  border-radius: 1px; background: var(--c-chili-hover);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-normal);
}
.nav-link:hover { color: var(--c-chili-hover); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link-active { color: var(--c-chili-hover); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 12px; }
.nav-cta {
  display: inline-flex; align-items: center; padding: 8px 16px;
  border-radius: var(--radius-md); font-size: var(--fs-base); font-weight: 600;
  color: #fff; text-decoration: none;
  background: linear-gradient(120deg, var(--c-chili), var(--c-ember));
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(198, 42, 18, 0.3); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-md);
  color: var(--c-muted); background: var(--c-line-light);
  border: none; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-logout:hover { background: var(--c-chili-light); color: var(--c-chili-hover); }

/* ── 语言切换下拉 ── */
.lang-dropdown { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px;
  border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  color: var(--c-subtle); background: transparent; cursor: pointer;
  transition: color var(--dur-fast);
}
.lang-current:hover { color: var(--c-chili-hover); }
.lang-caret { font-size: 9px; opacity: 0.55; transition: transform var(--dur-fast); }
.lang-dropdown.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  z-index: var(--z-sticky); min-width: 132px; padding: 4px;
  border-radius: var(--radius-md); background: var(--c-surface);
  box-shadow: var(--shadow-lg); border: 1px solid var(--c-line-light);
}
.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu,
.lang-dropdown.open .lang-menu { display: block; }

.lang-option {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); color: var(--c-body);
  background: transparent; cursor: pointer; text-align: left;
  transition: background var(--dur-fast);
}
.lang-option:hover { background: var(--c-chili-soft); color: var(--c-chili-hover); }

/* ── 旧版 inline lang-switcher 保留兼容 ── */
.lang-switcher {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: var(--radius-md); background: var(--c-line-light); flex-shrink: 0;
}
.lang-switcher button {
  padding: 5px 9px; border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  color: var(--c-subtle); background: transparent; cursor: pointer; transition: all var(--dur-fast);
}
.lang-switcher button:hover { color: var(--c-chili-hover); }
.lang-switcher button.lang-active { background: var(--c-chili-hover); color: #fff; }
.footer-lang { justify-content: center; }

/* ==========================================================================
 * 16. 页脚
 * ========================================================================== */
.footer-inner {
  max-width: 72rem; margin: 0 auto; padding: 48px var(--sp-6) 24px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px;
}
.footer-col h4 {
  font-size: var(--fs-base); font-weight: 700; margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.8);
}
.footer-col a, .footer-col span {
  display: block; font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.55);
  text-decoration: none; margin-bottom: 8px; transition: color var(--dur-fast);
}
.footer-col a:hover { color: var(--c-ember); }
.footer-bottom {
  max-width: 72rem; margin: 0 auto; padding: 18px var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
 * 17. 首页 — Hero & CTA
 * ========================================================================== */
.hero-section { position: relative; overflow: hidden; }

.hero-content {
  max-width: 72rem; margin: 0 auto; padding: 64px var(--sp-5);
  position: relative; z-index: 10; text-align: center;
}

.hero-badge {
  display: inline-block; padding: 6px 18px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(8px);
  color: #fff; font-size: var(--fs-sm); margin-bottom: var(--sp-6);
}

.hero-title {
  font-size: clamp(1.75rem, 5.5vw, 3.75rem); font-weight: 800;
  color: #fff; line-height: 1.15; margin-bottom: var(--sp-5);
  letter-spacing: -0.01em; overflow-wrap: break-word;
}

.hero-slogan {
  font-size: clamp(1.125rem, 2.6vw, 1.5rem); color: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--sp-3);
}

.hero-tagline {
  color: rgba(255, 255, 255, 0.7); max-width: 42rem;
  margin: 0 auto var(--sp-10); font-size: var(--fs-base); line-height: var(--lh-relaxed);
}

.hero-cta {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: var(--sp-4);
}

/* 指标区 */
.hero-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6); max-width: 32rem; margin: 3.5rem auto 0;
}
.hero-metric { text-align: center; }
.hero-metric__num {
  font-size: clamp(1.5rem, 4vw, 1.875rem); font-weight: 700; color: #fff;
}
.hero-metric__label { font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.7); margin-top: 4px; }

/* CTA Banner（复用 hero-warm 渐变背景） */
.cta-banner {
  position: relative; overflow: hidden; padding: 64px var(--sp-5);
}
.cta-banner__inner {
  max-width: 56rem; margin: 0 auto; text-align: center; position: relative; z-index: 10;
}
.cta-banner__title {
  font-size: clamp(1.5rem, 4vw, 1.875rem); font-weight: 800; color: #fff; margin-bottom: var(--sp-3);
}
.cta-banner__sub { color: rgba(255, 255, 255, 0.8); margin-bottom: var(--sp-7); }

/* ── 桌面端 hero 增宽 ── */
@media (min-width: 768px) { .hero-content { padding-top: 112px; padding-bottom: 112px; } }

/* ── 超小屏指标区缩窄间距 ── */
@media (max-width: 400px) {
  .hero-metrics { gap: var(--sp-3); }
}

/* ==========================================================================
 * 18. 首页 — 轮播
 * ========================================================================== */
.carousel { background: var(--c-ember-light); }
.carousel-track { will-change: transform; }
.carousel-slide img { display: block; }
.carousel-slide a { text-decoration: none; }

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--radius-full); border: none;
  cursor: pointer; background: rgba(28, 19, 16, 0.35); color: #fff;
  font-size: 26px; line-height: 1; display: flex; align-items: center;
  justify-content: center; z-index: 5;
  transition: background var(--dur-fast), transform var(--dur-fast);
  backdrop-filter: blur(4px);
}
.carousel-btn:hover { background: rgba(198, 42, 18, 0.8); transform: translateY(-50%) scale(1.1); }
.carousel-btn.left-3  { left: 12px; }
.carousel-btn.right-3 { right: 12px; }

.carousel-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: var(--radius-full);
  border: none; cursor: pointer; padding: 0;
  background: rgba(255, 255, 255, 0.5); transition: all var(--dur-normal);
}
.carousel-dot.is-active { background: var(--c-chili); width: 24px; }

/* 图片加载失败 */
.carousel-img-fallback {
  min-height: 200px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, var(--c-chili-light), var(--c-ember-light));
}
.carousel-img-fallback img { display: none; }
.carousel-img-fallback::after {
  content: '图片加载失败'; color: var(--c-placeholder); font-size: var(--fs-sm);
}

/* ==========================================================================
 * 19. 首页 — 通知
 * ========================================================================== */
.notice-item {
  transition: transform var(--dur-normal), box-shadow var(--dur-normal),
              border-color var(--dur-normal);
}
.notice-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-warm);
  border-color: rgba(242, 140, 15, 0.4);
}
.notice-priority { flex-shrink: 0; }

/* ==========================================================================
 * 20. 首页 — 活动专区
 * ========================================================================== */
.activity-block {
  background: var(--c-bg); border: 1px solid var(--c-line-light);
  border-radius: var(--radius-xl); padding: 16px;
  transition: border-color var(--dur-normal);
}
.activity-block:hover { border-color: rgba(242, 140, 15, 0.35); }

.activity-block-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--c-chili-dark);
  font-size: var(--fs-base); margin-bottom: 10px;
}
.activity-block-title::before {
  content: ''; width: 4px; height: 14px; border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--c-chili), var(--c-ember));
}
.activity-block ul, .activity-block ol { margin: 0; padding-left: 18px; }
.activity-block li {
  font-size: var(--fs-base); color: var(--c-muted);
  line-height: var(--lh-relaxed); margin-bottom: 6px;
}
.activity-block li b { color: var(--c-ink-muted); }
.activity-block p { line-height: var(--lh-relaxed); }

/* ==========================================================================
 * 21. 首页 — 菜品卡片
 * ========================================================================== */
.dish-card {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
  will-change: transform;
}
.dish-card:hover, .dish-card:focus-within {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(242, 140, 15, 0.5);
}
.dish-card img { transition: transform 0.5s var(--ease-out); }
.dish-card:hover img { transform: scale(1.08); }

/* ==========================================================================
 * 22. 滚动进场
 * ========================================================================== */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
 * 23. 订单详情
 * ========================================================================== */
.order-detail-kv {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
}
.order-detail-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.order-detail-label { font-size: var(--fs-sm); color: var(--c-subtle); white-space: nowrap; }
.order-detail-value {
  font-size: var(--fs-base); font-weight: 600; color: var(--c-ink);
  text-align: right; word-break: break-all;
}
.items-foot {
  padding-top: 14px; margin-top: 12px;
  border-top: 1px dashed var(--c-line-light);
  font-size: var(--fs-sm); color: var(--c-subtle); text-align: right;
}
.items-raw {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--c-bg); border: 1px solid var(--c-line-light);
  font-size: var(--fs-sm); color: var(--c-ink-muted);
  white-space: pre-wrap; word-break: break-all;
}

/* ==========================================================================
 * 24. 积分商城
 * ========================================================================== */
.points-balance {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 12px 24px; border-radius: var(--radius-lg); color: #fff; font-size: var(--fs-md);
  background: linear-gradient(120deg, var(--c-chili), var(--c-ember));
}
.points-balance b { font-size: var(--fs-2xl); margin: 0 2px; }

.point-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.point-card {
  display: flex; flex-direction: column; background: var(--c-surface);
  border: 1px solid var(--c-line-light); border-radius: var(--radius-2xl);
  padding: 16px; transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.point-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.point-emoji { font-size: 40px; text-align: center; margin-bottom: 8px; }
.exchange-btn {
  width: 100%; margin-top: 12px; padding: 9px 0; border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border: none;
}

/* ==========================================================================
 * 25. 图表容器
 * ========================================================================== */
.chart-box { width: 100%; height: 320px; min-height: 260px; }

/* ── 时间范围切换 ── */
.range-group { display: flex; gap: 4px; }
.range-btn {
  padding: 5px 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-line);
  background: var(--c-surface); font-size: 12px; color: var(--c-muted);
  cursor: pointer; transition: all var(--dur-fast);
}
.range-btn:hover { background: var(--c-chili-soft); }
.range-btn-active { background: var(--c-chili-hover); color: #fff; border-color: var(--c-chili-hover); }

/* ==========================================================================
 * 26. 工具栏 / 过滤 / 操作按钮
 * ========================================================================== */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.toolbar-input {
  flex: 0 1 260px; padding: 9px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--c-line); font-size: var(--fs-base); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.toolbar-input:focus { border-color: var(--c-chili); box-shadow: var(--focus-ring); }

.toolbar-select {
  padding: 9px 12px; border-radius: var(--radius-md); border: 1px solid var(--c-line);
  background: var(--c-surface); font-size: var(--fs-base); color: var(--c-body);
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7d76' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
.toolbar-select:focus { border-color: var(--c-chili); box-shadow: var(--focus-ring); }

.filter-btn {
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--c-line);
  background: var(--c-surface); font-size: var(--fs-sm); color: var(--c-muted);
  cursor: pointer; transition: all var(--dur-fast);
}
.filter-btn:hover { background: var(--c-chili-soft); }
.filter-btn-active { background: var(--c-chili-hover); color: #fff; border-color: var(--c-chili-hover); }

.op-btn {
  padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 600;
  border: none; cursor: pointer; margin: 0 3px; transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.op-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.op-approve { background: var(--c-success); color: #fff; }
.op-reject  { background: var(--c-line-light); color: var(--c-muted); }
.op-pay     { background: var(--c-info); color: #fff; }

.toolbar-spacer { flex: 1 1 auto; }

/* ==========================================================================
 * 27. Excel 导入 / 导出
 * ========================================================================== */
.import-modal { font-size: var(--fs-base); }

.import-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.import-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 30px 20px; border: 2px dashed var(--c-chili-light);
  border-radius: var(--radius-xl); background: #fffaf8; color: var(--c-subtle);
  cursor: pointer; transition: all var(--dur-normal);
}
.import-drop:hover { border-color: var(--c-chili); background: var(--c-chili-soft); color: var(--c-chili-hover); }
.import-drop-title { font-size: var(--fs-md); font-weight: 700; color: var(--c-body); }
.import-drop-sub { font-size: 12px; color: var(--c-subtle); text-align: center; line-height: 1.6; }
.import-filename {
  margin-top: 12px; padding: 9px 14px; border-radius: var(--radius-md);
  background: var(--c-line-light); font-size: var(--fs-sm); color: var(--c-body); word-break: break-all;
}

/* ── 进度条 ── */
.import-phase { font-size: var(--fs-md); font-weight: 700; color: var(--c-body); margin: 22px 0 12px; text-align: center; }
.import-phase-sub { font-size: 12px; color: var(--c-subtle); margin-top: 8px; text-align: center; }
.progress-bar { width: 100%; height: 10px; border-radius: var(--radius-full); background: var(--c-line-light); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; border-radius: var(--radius-full);
  background: linear-gradient(120deg, var(--c-chili), var(--c-ember));
  transition: width var(--dur-normal);
}
.progress-indeterminate {
  background-image: linear-gradient(115deg,
    rgba(255,255,255,.42) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,.42) 50%, rgba(255,255,255,.42) 75%, transparent 75%, transparent),
    linear-gradient(120deg, var(--c-chili), var(--c-ember));
  background-size: 28px 28px, 100% 100%;
  animation: progressStripes 0.9s linear infinite;
}
@keyframes progressStripes { from { background-position: 0 0, 0 0; } to { background-position: 28px 0, 0 0; } }

/* ── 结果统计 ── */
.import-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.import-stat {
  padding: 14px 10px; border-radius: var(--radius-lg); background: #f7f2ef;
  border: 1px solid var(--c-line-light); text-align: center;
}
.import-stat-num { font-size: 22px; font-weight: 800; color: var(--c-body); line-height: 1.2; }
.import-stat-label { font-size: 12px; color: var(--c-subtle); margin-top: 2px; }
.import-stat-ok { background: var(--c-success-bg); border-color: var(--c-success-line); }
.import-stat-ok .import-stat-num { color: var(--c-success); }
.import-stat-fail { background: var(--c-chili-soft); border-color: var(--c-chili-light); }
.import-stat-fail .import-stat-num { color: var(--c-chili-hover); }

/* ── 失败明细表 ── */
.failure-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-body); margin: 14px 0 8px; }
.failure-table-wrap {
  max-height: 260px; overflow: auto; border: 1px solid var(--c-line-light);
  border-radius: var(--radius-md);
}
.failure-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.failure-table th {
  position: sticky; top: 0; z-index: 1; background: #f7f2ef; color: var(--c-muted);
  font-weight: 700; text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--c-line-light); white-space: nowrap;
}
.failure-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--c-line-light);
  color: var(--c-body); vertical-align: top;
}
.failure-table tbody tr:last-child td { border-bottom: none; }
.failure-table tbody tr:hover { background: #fffaf8; }
.failure-reason { color: var(--c-chili-hover); }
.failure-raw {
  color: var(--c-subtle); max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ── 首页管理行 ── */
.home-sec-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--c-line-light);
}
.home-sec-row:last-child { border-bottom: none; }

/* ==========================================================================
 * 28. 行编辑器（活动 task/guide/howTo 管理）
 * ========================================================================== */
.arow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.arow input { flex: 1; min-width: 0; }

/* 轮播缩略图 */
.feature-thumb {
  width: 64px; height: 40px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--c-line-light); background: var(--c-bg);
  display: inline-block; vertical-align: middle;
}

/* ==========================================================================
 * 29. 回到顶部
 * ========================================================================== */
#back-to-top {
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-normal), visibility var(--dur-normal), transform var(--dur-fast);
}
#back-to-top.show,
#back-to-top[style*="display: block"] { opacity: 1; visibility: visible; }

/* ==========================================================================
 * 30. 移动端固定底栏 Tab
 * ========================================================================== */
.mobile-tabbar { display: none; }

/* ==========================================================================
 * 31. 响应式设计
 * ========================================================================== */

/* ── 大屏（1280px+）── */
@media (min-width: 1280px) {
  .container-wide { max-width: 80rem; }
}

/* ── 桌面（≤1024px）── */
@media (max-width: 1024px) {
  .console-layout { flex-direction: column; padding: 20px var(--sp-4); }
  .console-sidebar {
    width: 100%; position: static; display: flex; align-items: center;
    gap: 12px; padding: 14px 16px; flex-wrap: wrap;
  }
  .console-user { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
  .console-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-link { flex: 0 1 auto; justify-content: center; padding: 9px 12px; font-size: var(--fs-sm); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .header-inner { padding: 0 var(--sp-4); }
}

/* ── 平板（≤768px）── */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .header-inner { padding: 0 var(--sp-4); height: 56px; }
  .brand-name { font-size: 16px; }
  .console-layout { padding: 16px var(--sp-4); }
  .console-sidebar { padding: 12px; border-radius: var(--radius-xl); }
  .console-nav { gap: 2px; }
  .side-link { padding: 8px 10px; font-size: var(--fs-xs); }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding-top: 36px; }
  .page-head h2 { font-size: var(--fs-2xl); }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .stat-grid-3, .stat-grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .modal-panel { padding: 20px; max-height: 85vh; }
  .modal-wide { max-width: 100%; }
  .data-table { font-size: var(--fs-sm); }
  .data-table th, .data-table td { padding: 8px 10px; }

  /* ── 触控目标统一（≥44px，WCAG 2.5.5 / 移动端可用性）── */
  .side-link { min-height: 44px; }
  .tab-link { min-height: 44px; }
  .inner-tab { min-height: 44px; }
  .page-btn { min-width: 44px; min-height: 44px; padding: 8px 14px; }
  .filter-btn, .range-btn { min-height: 40px; padding: 8px 14px; }
  .op-btn { min-height: 36px; padding: 6px 12px; }
  .lang-current { min-height: 40px; padding: 6px 10px; }
  .lang-option { min-height: 44px; }
  .modal-close { width: 40px; height: 40px; }

  /* 表格滚动提示：边缘渐隐暗示可横向滑动 */
  .table-wrap { scrollbar-width: thin; }

  /* 移动端底栏 */
  .mobile-tabbar {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
    background: rgba(255, 250, 245, 0.97);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--c-line-light);
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar-nav {
    display: flex; align-items: stretch; justify-content: space-around;
    max-width: 30rem; margin: 0 auto;
  }
  .tabbar-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 6px 2px; border-radius: var(--radius-lg);
    font-size: 11px; color: var(--c-subtle); text-decoration: none;
    transition: color var(--dur-fast), background var(--dur-fast);
  }
  .tabbar-item:active { background: var(--c-ember-light); }
  .tabbar-item-active { color: var(--c-chili-hover); font-weight: 600; }

  /* 底栏安全区 */
  body { padding-bottom: 64px; }
  #back-to-top { bottom: 74px; }

  /* 语言切换下拉右对齐防溢出 */
  .lang-menu { right: auto; left: 50%; transform: translateX(-50%); }

  /* 轮播按钮移动端隐藏 */
  .carousel-btn { display: none; }

  /* 行编辑器移动端换行 */
  .arow { flex-wrap: wrap; }
  .arow input { flex: 1 1 100%; }
}

/* ── 手机（≤640px）── */
@media (max-width: 640px) {
  .header-inner { gap: var(--sp-2); }
  .header-right { gap: 6px; }
  .nav-cta { padding: 6px 12px; font-size: var(--fs-sm); }
  .hero-content { padding: 48px var(--sp-4); }
  .hero-tagline { font-size: var(--fs-sm); }
  .btn-primary-lg { padding: 12px 24px; font-size: var(--fs-base); width: 100%; max-width: 280px; }
  .btn-ghost-lg { padding: 12px 24px; font-size: var(--fs-base); width: 100%; max-width: 280px; }
  .hero-cta { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto; }

  .import-result-grid { grid-template-columns: 1fr; }
  .order-detail-kv { grid-template-columns: minmax(0, 1fr); }
  .pagination-bar { justify-content: center; }
  .pagination-bar .mr-auto { margin-right: 0; width: 100%; text-align: center; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-input { flex: 1 1 auto; }
  .toolbar-spacer { display: none; }
  .tab-nav { gap: 0; }
  .tab-link { padding: 8px 12px; font-size: var(--fs-sm); }

  /* ── 控制台侧边栏：横向滚动单行，避免 wrap 挤压内容高度 ── */
  .console-sidebar {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 10px 12px;
  }
  .console-sidebar::-webkit-scrollbar { display: none; }
  .console-user { flex-shrink: 0; }
  .console-nav { flex-wrap: nowrap; flex-shrink: 0; }
  .side-link { flex: 0 0 auto; white-space: nowrap; }

  /* ── 弹窗：移动端贴底弹出，提升单手握持体验 ── */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-panel {
    max-width: 100%; width: 100%; max-height: 92vh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: 24px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: modalInBottom 0.32s var(--ease-out);
  }
  @keyframes modalInBottom {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .modal-close { top: 16px; right: 16px; }

  /* ── 表格更紧凑 ── */
  .data-table th, .data-table td { padding: 8px; }

  /* ── 统计卡片固定 2 列，避免 150px 三列挤压 ── */
  .stat-grid, .stat-grid-3, .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 超小屏（≤400px）── */
@media (max-width: 400px) {
  .brand-name { display: none; }
  .header-right { gap: 4px; }
  .point-grid { grid-template-columns: 1fr 1fr; }

  /* 统计卡片在超小屏单列，保证数值不被挤压换行 */
  .stat-grid, .stat-grid-3, .stat-grid-5 { grid-template-columns: 1fr; }

  /* 会员/分销卡片中的 kv 行允许换行 */
  .order-detail-item { flex-direction: column; align-items: flex-start; gap: 2px; }
  .order-detail-value { text-align: left; }
}

/* ==========================================================================
 * 32. 无障碍 — 减少动效
 * ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
 * 33. 打印样式
 * ========================================================================== */
@media print {
  #app-header, #app-footer, #mobile-tabbar, #back-to-top, #toast-root { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0; }
  .console-sidebar { display: none; }
  .console-main { flex: none; width: 100%; }
}

/* ==========================================================================
 * 34. 分销层级开关（checkbox 变身开关）
 * ========================================================================== */
.dist-switch {
  width: 42px;
  height: 22px;
  accent-color: var(--c-chili, #e8391a);
  cursor: pointer;
  flex-shrink: 0;
}
