/* 一起玩游戏工作室 · 单页落地页样式
 *
 * 响应式策略：不写 media query 断点，用 grid 的 auto-fit/minmax 自动决定列数，
 * 用 clamp() 让字号与间距随视口流动。所以手机与 PC 是同一套规则，
 * 不存在「两套布局」需要同步维护。
 */

:root {
  --bg: #f6f7f8;
  --surface: #fff;
  --text: #16181d;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #07c160;
  --accent-dark: #06a552;
  --danger: #b03030;
  --radius: 14px;

  /* 流式尺寸：手机取小值，PC 取大值，中间自动插值 */
  --gutter: clamp(18px, 5vw, 40px);
  --gap: clamp(12px, 1.6vw, 20px);
  --section-y: clamp(40px, 7vw, 88px);
  --maxw: 1120px;

  --fs-hero: clamp(30px, 6.4vw, 56px);
  --fs-h2: clamp(20px, 3vw, 28px);
  --fs-body: clamp(14px, 1.05vw, 16px);
}

* { box-sizing: border-box; }

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

/* 锚点跳转时留出粘性顶栏的高度 */
:target { scroll-margin-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.muted { color: var(--muted); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  word-break: break-all;
}

/* 布局容器 */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* 阅读型内容（结果页等）用更窄的容器，PC 上不至于拉得很散 */
.wrap-narrow { max-width: 560px; }

.section { padding-block: var(--section-y); }

.section-head { margin-bottom: clamp(20px, 3vw, 36px); }

.section-head h2 {
  margin: 0 0 8px;
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }

/* 行内提示（如「在微信中打开」），用于区块末尾的补充说明 */
.notice-inline { margin: var(--gap) 0 0; font-size: 13px; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  flex: none;
}

/* 导航：手机上只展示短标签，靠 margin-left:auto 推到右侧 */
.nav {
  display: flex;
  gap: clamp(12px, 2.4vw, 26px);
  margin-left: auto;
  font-size: clamp(13px, 1vw, 14px);
  color: var(--muted);
}

.nav a:hover { color: var(--text); }

/* 已登录的用户信息；空间不足时让导航优先 */
.who {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 8em;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.badge {
  padding: 2px 9px;
  font-size: 11px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  white-space: nowrap;
}

/* 手机上隐藏昵称文字（顶栏宽度有限），并隐藏锚点导航：
 * 单页内容一滚就能看到，hero 里已有主 CTA，而 4 个链接挤在 120px 里
 * 触控目标太小反而难用。 */
@media (max-width: 480px) {
  .who span { display: none; }
  .nav { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(48px, 9vw, 120px);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: var(--fs-hero);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

.hero-lead {
  margin: 0 0 30px;
  font-size: clamp(15px, 1.5vw, 19px);
  color: var(--muted);
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- 自适应网格 ----------
 * auto-fit + minmax 是关键：宽度够就并排，不够就自动换行成单列。
 * 手机与 PC 共用这一条规则。 */

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* 会员只有两项，限制最小宽度让它们在 PC 上不至于拉得过宽 */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* ---------- 卡片 ---------- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 26px);
}

.card h3 {
  margin: 0 0 6px;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 600;
}

.card .desc { margin: 0; color: var(--muted); }

/* 价格与按钮钉在卡片底部，同一行卡片高低不齐时也能对齐 */
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.price {
  font-size: clamp(19px, 1.8vw, 22px);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.price small { font-size: 0.6em; font-weight: 400; color: var(--muted); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { border-color: #d1d5db; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-lg { padding: 13px 28px; font-size: 15px; }

.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- 关于 ---------- */

.prose { max-width: 62ch; }

.prose p { margin: 0 0 14px; }

.prose p:last-child { margin-bottom: 0; }

/* 两栏说明区：PC 上左右分栏，手机自动堆叠 */
.split {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* ---------- 订单结果 ---------- */

/* ---------- 下单确认模态框 ----------
 * 用原生 <dialog>：::backdrop 与焦点陷阱由浏览器提供。
 * 手机上从底部滑出（拇指好够），PC 上居中。 */

.modal {
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  max-width: min(92vw, 420px);
  width: 100%;
  /* dialog 默认在块流里定位，必须显式居中 */
  margin: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.modal::backdrop { background: rgba(0, 0, 0, 0.45); }

/* 出场与退场动画。
 * 手机上是底部抽屉（从下滑入），PC 上居中（淡入 + 微缩放）。 */
@keyframes modal-in-center {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes modal-out-center {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.modal[open] { animation: modal-in-center 180ms ease-out; }
.modal.modal-closing {
  animation: modal-out-center 140ms ease-in forwards;
  pointer-events: none;   /* 退场期间不接收点击，避免连点 */
}

/* 减少动态效果：直接切换，不做动画（可访问性要求） */
@media (prefers-reduced-motion: reduce) {
  .modal[open], .modal.modal-closing { animation: none; }
}

.modal-form { padding: clamp(18px, 4vw, 26px); }

.modal-title {
  margin: 0 0 16px;
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 600;
}

.modal-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 0 0 22px;
  font-size: 14px;
}

.modal-kv dt { color: var(--muted); }

.modal-kv dd { margin: 0; }

/* 金额是确认框里最重要的信息，单独突出 */
.modal-price {
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-price small { font-size: 0.6em; font-weight: 400; color: var(--muted); }

/* 跨天预约：确认框里逐段列出 */
.seg-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

/* 手机上按钮堆叠，拇指区更大 */
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions .btn { flex: 1 1 auto; }

@media (max-width: 480px) {
  .timegrid { --tg-row: 26px; }
  .modal {
    max-width: 100%;
    margin: auto 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 88vh;
  }
}

.modal-sub { margin: -10px 0 14px; color: var(--muted); font-size: 13px; }

/* 「只选了起点」的确认层。
 *
 * 为什么单写一个 class 而不是复用 .modal：现有 JS 靠 `body > dialog.modal`
 * 定位下单框（openModal 的复用分支 / popstate / 请求参数补全）。
 * 复用会让它命中错的元素 —— 所以视觉共用，选择器分开。
 * 视觉规则与 .modal 保持一致（含手机底部抽屉）。
 * 没有退场动画：确认层的关闭是即时的（closeConfirm 直接 close()）。 */
.bk-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  max-width: min(92vw, 420px);
  width: 100%;
  margin: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.bk-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

.bk-dialog[open] { animation: modal-in-center 180ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .bk-dialog[open] { animation: none; }
}

@media (max-width: 480px) {
  .bk-dialog {
    max-width: 100%;
    margin: auto 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 88vh;
  }
}

/* 错误提示：时长/时段不合法时打回 */
.modal-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  background: #fdf0f0;
  border: 1px solid #f0c0c0;
  border-radius: 8px;
  color: #b03030;
  font-size: 13px;
}

/* ---------- 预约：两栏布局（照 Cal.com / Calendly）----------
 * PC  >=720px：左栏选日期，右栏时间轴
 * 手机 <720px：横向日期条 + 下方时间轴（月历在窄屏太挤） */

/* 预约框更宽：两栏布局需要更多横向空间 */
.modal-wide { max-width: min(96vw, 760px); }

/* 手机上必须贴边。96vw 在窄屏会只在右侧留 4vw 的缝（左侧贴边、右侧漏空，
 * 看起来像被挤扁了）。底部抽屉的标准形态就是满宽。
 * 这条必须在上面 .modal-wide 之后，同权重下靠源序覆盖。 */
@media (max-width: 480px) {
  .modal-wide { max-width: 100%; }

  /* 手机是底部抽屉：从下滑入 / 向下滑出（与视觉位置一致） */
  @keyframes modal-in-drawer {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes modal-out-drawer {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(24px); }
  }
  .modal[open] { animation: modal-in-drawer 200ms ease-out; }
  .modal.modal-closing { animation: modal-out-drawer 150ms ease-in forwards; }
  @media (prefers-reduced-motion: reduce) {
    .modal[open], .modal.modal-closing { animation: none; }
  }
}

.bk-head { margin-bottom: 16px; }

.modal-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Esc 提示只在有实体键盘的设备显示：触屏上没有 Esc 键，
 * 写了只会占地方、让人困惑。
 * 用 (hover: hover) and (pointer: fine) 判定鼠标/触控板设备。 */
.hint-esc { display: none; }

@media (hover: hover) and (pointer: fine) {
  .hint-esc { display: inline; }
}

/* 副标题两套文案：窄屏用短的，避免换行把弹窗撑高 */
.sub-short { display: none; }

@media (max-width: 480px) {
  .sub-full { display: none; }
  .sub-short { display: inline; }
}

.modal-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  background: #fdf0f0;
  border: 1px solid #f0c0c0;
  border-radius: 8px;
  color: #b03030;
  font-size: 13px;
}

.bk-body {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr; /* 手机：单列堆叠 */
}

/* grid 子项默认 min-width:auto，内部有 overflow-x 的元素会把列撑开
 * （实测：手机横向日期条把 374px 的弹窗撑到 748px）。 */
.bk-dates, .bk-times { min-width: 0; }

@media (min-width: 720px) {
  .bk-body { grid-template-columns: 300px 1fr; gap: 28px; }
  .bk-times { min-height: 384px; }
}

@media (max-width: 719px) {
  .cal { display: none; }        /* 手机用横条，不用月历 */
}

/* ---------- 横向日期条（手机）----------
 * 一屏约 7 天，横向滚动看更远。比 7×5 月历好点得多。 */

/* 日期条：横向滚动，一屏约 7 天。
 *
 * 「可滚动」必须看得出来（Google Chrome 官方规范 Scrollability Affordance Hints）：
 *   1. 边缘渐隐遮罩 —— 只在那侧还能滚时才显示
 *   2. 最后一个可见项被裁切（peek）—— 移动端横滑的经典提示
 *   3. 滚动条常驻细条，滚动时加深
 * 渐隐用 container scroll-state 查询（Chrome/Edge 133+），
 * 不支持的浏览器退化为「只显示静态的内侧留白」，功能不受影响。 */

.daystrip-wrap {
  position: relative;
  margin-bottom: 14px;
}

/* ---------- 日期条左右箭头 ----------
 * W3C APG：用 <button> + 描述性 aria-label（不写「‹」）；
 * 点击后焦点留在按钮上。只在那侧还能滚时显示（JS 控制 hidden）。 */
.strip-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.strip-nav:hover { border-color: var(--accent); color: var(--accent-dark); }
.strip-nav:active { transform: translateY(-50%) scale(0.94); }
.strip-nav[hidden] { display: none; }

.strip-nav-prev { left: -6px; }
.strip-nav-next { right: -6px; }

/* 有箭头时把渐隐压到箭头下面，避免两层提示叠在一起 */
.strip-nav + .daystrip ~ .strip-fade { z-index: 2; }

.daystrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-block: 2px 10px;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  /* 滚动状态查询容器：让遮罩能根据「还能不能滚」显示 */
  container-type: scroll-state;
  scrollbar-color: #c8ccd2 transparent;
}

.daystrip > * { scroll-snap-align: center; }

/* 兜底用的哨兵：零尺寸，不影响布局 */
.strip-sentinel { flex: none; width: 0; height: 0; }

/* 常驻细滚动条：一眼能看出可横向滚动 */
.daystrip::-webkit-scrollbar { height: 6px; }
.daystrip::-webkit-scrollbar-track { background: transparent; }
.daystrip::-webkit-scrollbar-thumb {
  background: #d4d8dd;
  border-radius: 3px;
}
.daystrip:hover::-webkit-scrollbar-thumb { background: #b9bfc6; }

/* 两侧渐隐：默认隐藏（不可滚时不该显示），pointer-events:none 不挡点击。
 * 覆盖在日期条上（absolute），不参与滚动内容——
 * 放进滚动容器会被当成 flex item，sticky 在横轴不成立。 */
.strip-fade {
  position: absolute;
  top: 0;
  bottom: 12px;          /* 让出滚动条的位置 */
  width: 34px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  z-index: 2;
}

/* 从边缘实色渐变到透明：起点不用偏移（用 --surface 打底），
 * 这样被裁切的日期会明显「淡出」，而不是硬切断。 */
.strip-fade-left {
  left: 0;
  background: linear-gradient(to right,
    var(--surface) 0%,
    color-mix(in srgb, var(--surface) 70%, transparent) 45%,
    transparent 100%);
}

.strip-fade-right {
  right: 0;
  background: linear-gradient(to left,
    var(--surface) 0%,
    color-mix(in srgb, var(--surface) 70%, transparent) 45%,
    transparent 100%);
}

/* 还能向左/右滚时才显示对应遮罩。
 * 由 JS 加类控制——@container scroll-state 虽然 CSS.supports 报 true，
 * 但实测规则不生效（Chrome 133+ 的实现细节），所以统一走 JS，
 * 不维护两套机制。 */
.daystrip-wrap.can-scroll-left .strip-fade-left { opacity: 1; }
.daystrip-wrap.can-scroll-right .strip-fade-right { opacity: 1; }

.ds-day {
  flex: none;
  scroll-snap-align: start;
  width: 46px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.ds-dow { font-size: 10px; color: var(--muted); white-space: nowrap; }
.ds-num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ds-day:hover { border-color: var(--accent); }

.ds-today .ds-dow { color: var(--accent-dark); font-weight: 600; }

.ds-on { background: var(--accent); border-color: var(--accent); color: #fff; }

.ds-on .ds-dow { color: rgba(255, 255, 255, 0.85); }

/* ---------- 月历（PC） ---------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month { font-weight: 600; font-size: 14px; }

.cal-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover { border-color: #d1d5db; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 6px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-cell:hover:not(.cal-disabled):not(.cal-empty) { background: var(--bg); }
.cal-empty { cursor: default; }
.cal-disabled { color: #c8ccd2; cursor: default; }
.cal-today { border-color: var(--accent); }
.cal-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 时段 chip + 时长步进（手机的紧凑做法）----------
 * 来源：UX Movement 专文「不要用原生滚轮，用 chip」；Mobbin 的 select option。
 * 手机上 24 行时间轴占掉大半屏，chip 一行高度就能给出所有可选时段。 */

.bk-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.stepper-key { font-size: 12px; color: var(--muted); }

.stepper-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.stepper-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.stepper-val {
  min-width: 2.6em;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stepper-unit { font-size: 12px; color: var(--muted); }

/* chip 行：横向滚动，边缘裁切暗示可滑（UX Movement 的做法） */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  /* 负 margin + padding：让首尾 chip 贴边时仍有一点余量 */
  margin-inline: -2px;
  padding-inline: 2px;
}

.chip {
  flex: none;
  scroll-snap-align: start;
  min-width: 64px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.chip:hover { border-color: var(--accent); }

/* 选中态：高对比描边（UX Movement 建议的 2px 高对比边框） */
.chip-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.chips-empty {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

/* 时间轴折叠：PC 上默认收起（用 chip 更快），需要拖长区间时展开 */
.timeline-wrap { margin-top: 10px; }

.timeline-wrap > summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}

.timeline-wrap > summary::marker, .timeline-wrap > summary::-webkit-details-marker { display: none; }

.timeline-wrap > summary::before { content: "▸ "; }

.timeline-wrap[open] > summary::before { content: "▾ "; }

.timeline-wrap[open] > summary { margin-bottom: 8px; }

/* PC 上时间轴默认展开：鼠标拖拽比点 chip 更适合选长区间 */
@media (min-width: 720px) {
  .timeline-wrap[open] > summary { display: none; }
}

/* ---------- 折行时间格（单天、不滚动、可跨行拖拽）----------
 * 一天的时段折成多行，一屏可见。折行只是显示形式：
 * 选区语义是线性连续区间，第 N 行末与第 N+1 行首在时间上连续。 */

.bk-head { margin-bottom: 16px; }

.modal-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

  .sub-short { display: inline; }
}

.modal-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  background: #fdf0f0;
  border: 1px solid #f0c0c0;
  border-radius: 8px;
  color: #b03030;
  font-size: 13px;
}

/* 日期条：单天选择，一屏 7 天可滑 */
.daystrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  overscroll-behavior-x: contain;
  border-bottom: 1px solid var(--border);
}

.ds-day {
  flex: none;
  min-width: 52px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.ds-dow { font-size: 10px; color: var(--muted); white-space: nowrap; }
.ds-num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ds-day:hover { background: var(--bg); }
.ds-today .ds-dow { color: var(--accent-dark); font-weight: 600; }
.ds-on { background: var(--accent); color: #fff; }
.ds-on .ds-dow { color: rgba(255, 255, 255, 0.9); }

/* 折行网格标题 */
.fold-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fold-day { font-size: 14px; font-weight: 600; }
.fold-hint { font-size: 11px; color: var(--muted); }

/* 网格本体：不设 max-height，靠折行保证一屏可见 */
.fold-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  touch-action: none;   /* 拖拽时不滚动页面 */
  user-select: none;
  outline: none;
  padding: 2px;
}

.fold-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
}

/* 行首时间范围：让用户知道这行覆盖几点到几点 */
.fold-row-label {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fold-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

/* 单格：光标提示可抓取（NN/g：hover 要给信号） */
.fold-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 100ms ease-out, border-color 100ms ease-out;
}

/* hover：只有可选格子才抬升（NN/g 的「可拖拽信号」） */
.fold-cell:hover:not(.fold-off):not(.fold-on) {
  border-color: var(--accent);
  background: #f0f7f3;
  box-shadow: 0 1px 3px rgba(7, 193, 96, 0.18);
}

.fold-cell.fold-off {
  background: repeating-linear-gradient(
    45deg, transparent, transparent 4px, #f2f3f5 4px, #f2f3f5 8px);
  color: #c8ccd2;
  cursor: not-allowed;
}

/* 拖拽被斜纹格挡住时，把「那面墙」标出来：
 * 只改描边与文字色，不换背景——保持斜纹外观，不让人误以为它被选中了。
 * 必须排在 .fold-off 之后：同权重，源序决定覆盖。 */
.fold-cell.fold-blocked {
  color: var(--danger);
  box-shadow: inset 0 0 0 2px var(--danger);
}

/* 区间视觉分三段（uxpatterns 的建议）：
 * 中段浅色连续、端点实心，一眼看出起点与终点在哪 */
.fold-cell.fold-mid {
  background: #d6f5e3;
  border-color: #b6e6cd;
  color: #0b5c38;
  font-weight: 500;
  border-radius: 4px;   /* 中段收窄圆角，与端点区分 */
}

.fold-cell.fold-on.fold-edge-start,
.fold-cell.fold-on.fold-edge-end {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(7, 193, 96, 0.3);
}

/* 单格区间（起止同一格）*/
.fold-cell.fold-on.fold-edge-start.fold-edge-end {
  transform: scale(1.06);
}

/* 正在拖拽：整格加圈，明确「抓着」的状态 */
.fold-grid.fold-dragging .fold-cell.fold-on {
  transform: scale(1.04);
}

.fold-grid.fold-dragging { cursor: grabbing; }

/* 跨行拖拽的提示浮层 */
.fold-ghost {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  pointer-events: none;
}

.fold-ghost-blocked { color: var(--danger); }

.fold-grid.fold-dragging { cursor: row-resize; }

/* 手机上格子稍微小一点，保证 4 行都能放下 */
@media (max-width: 480px) {
  .fold-row { grid-template-columns: 62px 1fr; gap: 6px; }
  .fold-cell { height: 38px; font-size: 11px; }
  .fold-cells { gap: 3px; }
}

/* ---------- 区间摘要（始终显示，未选时为占位）---------- */

.bk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
}

.bk-sum-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.bk-sum-key { font-size: 11px; color: var(--muted); }

.bk-sum-val {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bk-sum-price { margin-left: auto; text-align: right; }

.bk-sum-price .bk-sum-val {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ---------- 页脚 ---------- */

.foot {
  border-top: 1px solid var(--border);
  padding-block: clamp(28px, 4vw, 48px);
  color: var(--muted);
  font-size: 13px;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: baseline;
  justify-content: space-between;
}

.foot p { margin: 0; }

/* ---------- 轻提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  max-width: min(78vw, 400px);
  padding: 11px 18px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  z-index: 100;
}

/* ---- 账号页（/me）---- */
a.who { text-decoration: none; }

#profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-width: 22em;
}

#profile-form input {
  padding: 9px 12px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
}

#profile-form .form-msg-error { color: #c0392b; font-size: 13px; }
#profile-form .form-msg-ok { color: var(--accent); font-size: 13px; }

/* ---------- PC 扫码登录（/login 全页与登录弹窗共用） ---------- */

/* nav 的「登录」按钮：轻量 pill（边框 + 圆角），与纯文字导航链接形成
   主次区分——它是动作不是导航项，不能裸文字挤在最后（用户反馈：丑）。
   ⚠️ font-family/line-height 必须显式继承：button 的 UA 默认是 Arial +
   line-height:normal，不继承页面字体（实测中文字形完全不同、盒高矮
   4px、垂直错位）。不能写 font:inherit ——那会连字号一起盖掉 .who
   的 13px（实测登录字变大）。 */
.who-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 14px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit; line-height: inherit;
  /* 与导航拉开：topbar gap 10px + 这里的 12px ≈ nav 内部 26px 的节奏 */
  margin-left: clamp(4px, 1vw, 12px);
}
.who-btn:hover {
  color: var(--text);
  border-color: #d1d5db;   /* 与 .btn:hover 同色，一个体系 */
}

/* 退出：次要动作，低调但可发现；与「我的」保持一档间距（不再 2px 挤着） */
.who-logout { margin-left: var(--gap); }
.who-logout:hover { color: var(--text); }

/* /login 全页与弹窗共用的核心块：居中排版（全页 #pc-login 与弹窗都靠它，
   不各写一份） */
.pc-login-core { text-align: center; }
#pc-login h2 { margin-bottom: 8px; }

/* 二维码容器：遮罩层的定位基准 */
.qr-box { position: relative; display: inline-block; border-radius: var(--radius); overflow: hidden; }

/* 三态遮罩：盖在二维码上（pending 隐藏）。比换一行小字显眼得多。
   ⚠️ [hidden] 必须显式写：上面的 display:flex 是作者样式，会盖过 UA
   的 [hidden]{display:none}——不写这条，pending 态遮罩永远显示，
   二维码看着发灰（实测用户反馈）。 */
.qr-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  font-weight: 600; text-align: center; padding: 12px;
}
.qr-overlay[hidden] { display: none; }
.qr-overlay-icon { font-size: 30px; line-height: 1; }
.qr-overlay--scanned .qr-overlay-icon,
.qr-overlay--ok .qr-overlay-icon { color: var(--accent); }
.qr-overlay--expired .qr-overlay-icon { color: #e64340; }

/* 状态行：pending 低调，其余三态带颜色 */
.login-status { min-height: 1.5em; margin: 10px 0 0; }
.login-status--pending { opacity: 0.75; }
.login-status--scanned,
.login-status--ok { color: var(--accent); font-weight: 600; }
.login-status--expired { color: #e64340; font-weight: 600; }
