/* ============================================================
   诺拉电竞 · 极简订单列表
   ============================================================ */

:root {
  --purple-700: #7C3AED;
  --purple-600: #8B5CF6;
  --pink-500: #EC4899;
  --pink-400: #F472B6;

  --grad: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --grad-soft: linear-gradient(135deg, #EDE9FE 0%, #FCE7F3 100%);

  --bg: #FAF7FF;
  --card: #FFFFFF;
  --ink: #2A1B4D;
  --ink-2: #6E5B93;
  --ink-3: #A89BBE;
  --line: rgba(124, 58, 237, 0.12);

  --r-lg: 16px;
  --r-md: 12px;
  --shadow: 0 6px 22px rgba(124, 58, 237, 0.10);

  --container: 880px;
  --header-h: 56px;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  /* 滚动条始终占位：避免 tab 切换导致内容高度变化 → 滚动条出现/消失 → 内容变宽 → banner 按比例变大 */
  scrollbar-gutter: stable;
}
[hidden] { display: none !important; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; background: none; border: none; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ============================================================
   Header（仅品牌）
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
}

/* ============================================================
   订单列表（核心）
   ============================================================ */
/* ============================================================
   Banner 轮播
   ============================================================ */
.banner-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}
.banner-track {
  display: flex;
  transition: transform 0.4s ease;
}
.banner-slide {
  flex: 0 0 100%;
  aspect-ratio: 16 / 7;
  background: var(--grad-soft);
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.banner-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.banner-dots span.active {
  background: #fff;
  transform: scale(1.25);
}
.banner-slide { cursor: pointer; }
.banner-slide.no-click { cursor: default; }

/* ============================================================
   Banner 大图预览（Lightbox）
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 35, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-mask { position: absolute; inset: 0; }
.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ============================================================
   通用 Section
   ============================================================ */
.orders { padding: 24px 0 48px; }

.orders-head {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

/* 切换器 */
.order-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  min-height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-2);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.tab:active { transform: scale(0.97); }
.tab.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

/* 网格：移动 2 列 → 平板/桌面 2 列 → 大屏 3 列 */
.order-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  align-items: start; /* 卡片按各自内容高度，不被同行高卡片撑出空白 */
}

.order-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.18);
  border-color: var(--purple-600);
}
.order-card:active { transform: scale(0.98); }

/* 视觉区（压扁，避免大面积空白） */
.order-cover {
  position: relative;
  aspect-ratio: 16 / 8;
  background: var(--grad-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.order-cover::before,
.order-cover::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
}
.order-cover::before {
  width: 80px; height: 80px;
  top: -20px; right: -20px;
  background: var(--pink-400);
}
.order-cover::after {
  width: 90px; height: 90px;
  bottom: -30px; left: -20px;
  background: var(--purple-600);
}
.order-emoji {
  position: relative;
  font-size: 46px;
  filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.25));
}
.order-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

/* 卡片内容 */
.order-body { padding: 4px 8px 4px; }

.order-name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.order-name {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.order-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-opt-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple-200);
  background: var(--purple-50);
  border-radius: 20px;
  padding: 2px 9px;
}
.order-price-suffix { font-size: 11px; font-weight: 700; margin-left: 2px; opacity: 0.75; }
.modal-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.modal-opt {
  border: 0.5px solid var(--line);
  background: var(--bg);
  border-radius: 18px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-opt.on {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: #fff;
}
.order-desc {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.order-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 0;
}
.order-price {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.order-price em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-600);
}
.order-price strong {
  font-size: 20px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.order-price .order-original {
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: line-through;
  margin-left: 6px;
  background: none;
  -webkit-text-fill-color: var(--ink-3);
}

.order-more {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-600);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.order-more::after {
  content: "›";
  font-size: 15px;
  line-height: 1;
}

/* ============================================================
   全部订单：类别卡片 → 该类订单 二级视图
   ============================================================ */

/* 返回头 */
.cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cat-back {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--purple-700);
  font-size: 13.5px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cat-back:active { background: var(--grad-soft); }
.cat-title { font-size: 17px; font-weight: 900; }

/* 类别卡片 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 16px 18px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.18);
  border-color: var(--purple-600);
}
.cat-card:active { transform: scale(0.98); }
.cat-emoji { font-size: 34px; margin-bottom: 6px; }
/* 分类图标（图片版，替代 emoji；由后台 categories.json 的 icon 字段驱动） */
.cat-icon { width: 40px; height: 40px; display: block; margin-bottom: 6px; object-fit: contain; }
.cat-name { font-size: 17px; font-weight: 900; line-height: 1.3; }
.cat-count { font-size: 12px; color: var(--ink-2); }
.cat-more {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple-600);
}
.cat-more::after { content: " ›"; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: #2A1B4D;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 22px 16px;
  line-height: 1.9;
  font-size: 13px;
}
.site-footer small {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}
.site-footer .site-icp a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
}
.site-footer .site-icp a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ============================================================
   订单详情弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(46, 16, 101, 0.5);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto; /* 内容超出弹窗时内部滚动 */
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 36px rgba(46, 16, 101, 0.22);
  transform: translateY(40px);
  transition: transform 0.3s ease;
}
.modal.open .modal-card { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal-close:hover { background: var(--grad-soft); color: var(--purple-700); }

.modal-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-700);
  background: var(--grad-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.modal-name {
  font-size: 22px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.25;
  padding-right: 32px;
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.modal-price { margin-bottom: 14px; }
.modal-price em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--purple-600); }
.modal-price strong {
  font-size: 28px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-price .order-original {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: line-through;
  margin-left: 8px;
  background: none;
  -webkit-text-fill-color: var(--ink-3);
}
.modal-desc {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.9;
  white-space: pre-wrap; /* 保留管理后台输入的换行 */
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
}
.modal-desc-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: desc-item;
}
.modal-desc-list li {
  position: relative;
  padding: 0 0 14px 0;
  counter-increment: desc-item;
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
}
.modal-desc-list li::before {
  content: counter(desc-item);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  border-radius: 6px;
  position: relative;
  top: 2px;
}
.modal-desc-list li:last-child {
  padding-bottom: 0;
}
.modal-desc-list.ul {
  counter-reset: none;
}
.modal-desc-list.ul li {
  position: relative;
  padding: 0 0 12px 20px;
  line-height: 1.7;
}
.modal-desc-list.ul li.nested {
  padding-left: 38px;
  font-size: 0.95em;
  opacity: 0.92;
}
.modal-desc-list.ul li.nested::before {
  left: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  border: 1px solid #7c3aed;
}
.modal-desc-list.ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-400, #7F77DD);
  -webkit-background-clip: initial;
  background-clip: initial;
  color: transparent;
}
.modal-desc-list.ul li:last-child {
  padding-bottom: 0;
}
.modal-desc p {
  margin: 0 0 10px 0;
  line-height: 1.7;
}
.modal-desc p:last-child {
  margin-bottom: 0;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.modal-meta strong { color: var(--ink); margin-right: 4px; }

/* ============================================================
   桌面
   ============================================================ */
@media (min-width: 640px) {
  .order-grid { gap: 18px; }
  .order-cover { aspect-ratio: 16 / 7; }
  .order-emoji { font-size: 56px; }
  .order-body { padding: 6px 8px 6px; }
  .order-name { font-size: 20px; }
  .order-desc { font-size: 12.5px; }
  .order-price strong { font-size: 22px; }
  .order-more { font-size: 13px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .cat-emoji { font-size: 42px; }
  .cat-name { font-size: 19px; }
}

@media (min-width: 1024px) {
  .orders { padding: 36px 0 56px; }
  .order-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .tab { min-height: 44px; padding: 0 28px; font-size: 15px; }
  .modal { align-items: center; }
  .modal-card { border-radius: 22px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}