/* ============================================================
   base.css —— 重置 / 排版 / 全站通用原子件
   两端共用：只放"与布局无关"的东西
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* 兜底：未显式设尺寸的图标统一 1em，避免被 flex 拉伸成巨图
   用 :where() 把特异性归零，任何类选择器都能覆盖它 */
svg:where(:not([width]):not([height])) { width: 1em; height: 1em; }

::selection { background: var(--brand-100); color: var(--brand-900); }

:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }

/* 细滚动条 */
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--ink-200) transparent; }
.scroll-y::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 99px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }

.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------------- 排版原子 ---------------- */

.t-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-sb); letter-spacing: -0.02em; }
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-sb); letter-spacing: -0.015em; }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-sb); letter-spacing: -0.01em; }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-sm { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-500); }
.t-xs { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--ink-400); }
.t-mono-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* 眉标：小字 + 字距，全站统一的分区头部样式（辨识度元素） */
.eyebrow {
  font-size: 10.5px; line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-400);
  font-weight: var(--fw-sb);
}
.eyebrow--brand { color: var(--brand-500); }

.muted { color: var(--ink-500); }
.muted-2 { color: var(--ink-400); }
.strong { font-weight: var(--fw-sb); }
.ink-900 { color: var(--ink-900); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- 头像 ---------------- */
.avatar {
  position: relative;
  flex: none;
  border-radius: var(--r-pill);
  overflow: visible;              /* 允许在线点完整露在头像外 */
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(21, 24, 27, 0.06);
}
/* 图片自己裁成圆形，替代父级 overflow:hidden */
.avatar img, .avatar svg {
  width: 100%; height: 100%; object-fit: cover; stroke: none;
  border-radius: inherit;
}
.avatar--xs { width: 26px; height: 26px; }
.avatar--sm { width: 34px; height: 34px; }
.avatar--md { width: 44px; height: 44px; }
.avatar--lg { width: 56px; height: 56px; }
.avatar--xl { width: 76px; height: 76px; }

/* 在线点：圆心正好骑在头像 45° 边缘上，整颗可见（不再被裁掉一半） */
.dot-online {
  position: absolute; right: 3px; bottom: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 2px var(--pb, var(--surface));
}
.avatar--xs .dot-online,
.avatar--sm .dot-online { right: 1.5px; bottom: 1.5px; width: 7.5px; height: 7.5px; box-shadow: 0 0 0 1.5px var(--pb, var(--surface)); }
.avatar--lg .dot-online,
.avatar--xl .dot-online { right: 4px; bottom: 4px; width: 11px; height: 11px; }
.dot-online::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #4ade80;
  animation: pulse 2.6s var(--ease) infinite;
}
.dot-online--idle { background: var(--ink-300); }
.dot-online--idle::after { display: none; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ---------------- 标签 / 徽章（小圆角，与卡片区分） ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs); line-height: 1;
  font-weight: var(--fw-m);
  color: var(--ink-600);
  background: var(--surface-3);
  white-space: nowrap;
}
.tag--brand { color: var(--brand-700); background: var(--brand-50); }
.tag--sand  { color: var(--sand-700); background: var(--sand-50); }
.tag--line  { background: transparent; color: var(--ink-500); box-shadow: inset 0 0 0 1px var(--line); }

/* 段位徽章：金属质感，小尺寸，专属辨识点 */
.rank {
  display: inline-flex; align-items: center; gap: 3px;
  height: 20px; padding: 0 7px 0 5px;
  border-radius: var(--r-xs);
  font-size: 10.5px; font-weight: var(--fw-sb); letter-spacing: 0.02em;
  color: var(--sand-700);
  background: linear-gradient(180deg, #fbf3e7, #f3e7d6);
  box-shadow: inset 0 0 0 1px rgba(168, 121, 69, 0.16);
}
.rank::before { content: ""; width: 4px; height: 4px; border-radius: 1px; transform: rotate(45deg); background: var(--sand-500); flex: none; }

/* 状态胶囊（订单状态） */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: var(--fw-m); line-height: 1;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--live    { color: var(--brand-700); background: var(--brand-50); }
.status--wait    { color: var(--warn-600);  background: var(--warn-100); }
.status--done    { color: var(--ink-600);   background: var(--ink-50); }
.status--warn    { color: var(--err-600);   background: var(--err-100); }
.status--ok      { color: var(--ok-600);    background: var(--ok-100); }

/* ---------------- 价格 / 评分 ---------------- */
.price { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: var(--fw-sb); letter-spacing: -0.02em; }
.price .cur { font-size: 0.62em; font-weight: var(--fw-m); margin-right: 1px; }
.price .unit { font-size: 0.5em; font-weight: var(--fw-r); color: var(--ink-400); margin-left: 2px; letter-spacing: 0; }

.rate { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-sm); color: var(--ink-700); font-variant-numeric: tabular-nums; }
.rate svg { width: 12px; height: 12px; stroke: none; fill: var(--sand-500); }

/* ---------------- 分隔 / 容器 ---------------- */
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }
.hairline--soft { background: var(--line-soft); }

/* 玻璃：仅用于导航/弹窗/悬浮面板 */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-inset), var(--sh-2);
}
.glass--dark {
  background: var(--glass-bg-dark);
  border-color: var(--glass-line-dark);
  color: #fff;
}

/* ---------------- 通用小结构 ---------------- */
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { flex-wrap: wrap; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); }
.section-head__more { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); color: var(--ink-400); }
.section-head__more svg { width: 14px; height: 14px; }

/* 时长条：可约时段（本产品专属信息图形） */
.slots { display: flex; align-items: center; gap: 2px; height: 18px; }
.slots__bar { position: relative; flex: 1; height: 4px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.slots__bar span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: var(--brand-300); }

/* ---------------- 动效 ---------------- */
.fade-in { animation: fadeIn var(--dur-2) var(--ease-out) both; }
.rise-in { animation: riseIn var(--dur-3) var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 骨架屏 */
.sk { position: relative; overflow: hidden; background: var(--ink-100); border-radius: var(--r-xs); }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* 旋转 loading */
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
