/* ==========================================================================
   抽派生 · 样式表
   视觉稿：Ardot file/727928496100182
   断点：>=1200 两栏 ｜ 900-1199 控件上移 ｜ <900 单列（等同手机稿）
   ========================================================================== */

:root {
  color-scheme: light;

  /* 底 / 面 */
  --paper: #f7f1e9;
  --paper-deep: #efe6da;
  --card: #fffdf9;
  --card-deep: #faf5ee;

  /* 字 */
  --ink: #292826;
  --muted: #716e68;
  --dim: #8a7e70;
  --faint: #a89684;
  --fainter: #b39b85;

  /* 线 */
  --line: #ddd2c4;
  --line-soft: #e3d8c9;
  --line-row: #dec9c4;

  /* 角色 */
  --akito: #ff7722;
  --akito-soft: #ff772229;
  --akito-ink: var(--akito);
  --toya: #0077dd;
  --toya-soft: #0077dd29;

  /* 做饭 */
  --cook-bg: #fff0bf;
  --cook-ink: #855d00;
  --cook-line: #dfa93a;
  --cook-chip: #855d00;
  --cook-chip-ink: #fff6dc;
  --cook-star: #ffd46b;

  /* 特殊结果 */
  --sp-bg: #f9f7fc;
  --sp-line: #ddd4e7;
  --sp-ink: #5c4c8c;
  --sp-muted: #7a6e96;
  --sp-chip: #efe9f7;

  --danger: #ae382f;
  --danger-line: #d8aaa5;

  --radius-card: 22px;
  --shadow-card: 0 14px 36px -6px rgba(66, 48, 32, .1);
  --shadow-float: 0 14px 30px -8px rgba(66, 48, 32, .16);

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Han Serif CN", "Noto Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, serif;
  --font-num: "Inter", "Segoe UI", system-ui, sans-serif;

  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
main img, header img, footer img, dialog img, .profile-export img { display: block; }
h1, h2, h3, p { text-wrap: pretty; }
.hidden { display: none !important; }

.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;
}

.skip-link {
  position: fixed; z-index: 200; top: 8px; left: 8px;
  transform: translateY(-160%);
  padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff;
}
.skip-link:focus { transform: none; }

:focus-visible { outline: 3px solid rgba(255, 119, 34, .38); outline-offset: 2px; }

/* ---------- 通用容器 / 排版 ---------- */

.container { width: min(100% - 48px, 1280px); margin-inline: auto; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--faint);
  font: 700 11px/1.4 var(--font-sans);
  letter-spacing: .25em;
  text-transform: uppercase;
}

.hero { padding: 44px 0 0; }
.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 52px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.01em;
}
.hero__title .k { color: var(--akito); }
.hero__title .t { color: var(--toya); }
.hero__sub { margin: 16px 0 0; max-width: 720px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
}

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

.site-header {
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 88px;
}
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 17px; letter-spacing: .08em; }
.brand small {
  display: block; margin-top: 2px;
  color: var(--faint); font: 700 9px/1 var(--font-sans); letter-spacing: .24em;
}

.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav__item {
  padding: 9px 18px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 14px; text-decoration: none;
}
.top-nav__item.is-active {
  border-color: var(--line); background: var(--card); color: var(--ink); font-weight: 700;
}
.top-nav__item--updates { display: inline-flex; align-items: center; gap: 7px; }
.nav-new {
  padding: 2px 5px; border-radius: 999px;
  background: var(--akito); color: #fff; font: 700 8px/1 var(--font-num); letter-spacing: .03em;
}

.count-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: 999px;
  background: var(--card); color: var(--muted); font-size: 12.5px;
}
.count-chip__dot { width: 7px; height: 7px; border-radius: 999px; background: var(--akito); }

/* ---------- 抽派生 · 主布局 ---------- */

.draw-main {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 36px 0 96px;
}
.draw-side { display: flex; flex-direction: column; gap: 16px; }

.home-update {
  margin-top: 28px;
  border: 1px solid var(--akito);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: 0 12px 30px -10px rgba(255, 119, 34, .18);
}
.home-update__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  color: inherit;
  text-decoration: none;
}
.home-update__line { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.home-update__label { flex: none; color: var(--akito-ink); font-size: 12px; font-weight: 700; }
.home-update__line time { flex: none; color: var(--faint); font: 700 12px/1 var(--font-num); }
.home-update h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-update__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--akito-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.home-update__cta span { font-size: 18px; line-height: 1; }
.home-update__link:hover { background: rgba(255, 255, 255, .42); }

/* ---------- 控制卡 ---------- */

.control-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.control-card__group { display: flex; flex-direction: column; gap: 10px; }
.control-card__group + .control-card__group { margin-top: 20px; }
.control-card__legend {
  margin: 0;
  color: var(--muted); font-size: 12.5px; font-weight: 700;
}

/* 分段控件 */
.segmented {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; padding: 5px; border-radius: 14px; background: var(--paper-deep);
}
.segmented label { display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented__opt {
  display: block; padding: 10px 6px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; text-align: center;
  transition: background .15s ease, box-shadow .15s ease, color .15s ease;
}
.segmented input:checked + .segmented__opt {
  background: var(--card); color: var(--ink); font-weight: 700;
  box-shadow: 0 2px 8px rgba(66, 48, 32, .1);
}
.segmented input:focus-visible + .segmented__opt { outline: 2px solid var(--akito); outline-offset: 1px; }
.segmented input:disabled + .segmented__opt { cursor: not-allowed; }

.primary-button {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 54px; margin-top: 20px;
  border: 0; border-radius: 14px; background: var(--ink); color: var(--card);
  font-size: 15px; font-weight: 700; letter-spacing: .16em;
  transition: opacity .15s ease;
}
.primary-button:hover { opacity: .9; }
.primary-button:disabled { opacity: .5; cursor: wait; }
.primary-button.is-cooling {
  opacity: .55; cursor: not-allowed;
  letter-spacing: .1em; font-variant-numeric: tabular-nums;
}
.primary-button svg { flex: none; }

.save-hint { margin: 20px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.form-status { min-height: 18px; margin: 10px 0 -6px; color: var(--danger); font-size: 13px; text-align: center; }

/* ---------- 固定派生选择器 ---------- */

.picker-field { position: relative; }
.picker { position: relative; }

.picker__trigger {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  text-align: left;
}
.picker__trigger[aria-expanded="true"] { border-color: var(--akito); }
.picker__avatar {
  flex: none; width: 26px; height: 26px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--paper-deep); color: var(--faint); font-size: 12px; font-weight: 700;
}
.picker__avatar img { width: 100%; height: 100%; object-fit: cover; }
.picker__name {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker__caret { flex: none; width: 13px; height: 13px; color: var(--dim); }
.picker__caret svg { width: 100%; height: 100%; }

.picker.is-disabled .picker__trigger {
  background: var(--paper-deep); border-color: var(--line-soft); cursor: not-allowed;
}
.picker.is-disabled .picker__name { color: var(--fainter); font-weight: 400; }
.picker.is-disabled .picker__caret { color: var(--fainter); }

.picker__panel {
  position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; right: 0;
  display: flex; flex-direction: column; gap: 9px;
  padding: 11px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-float);
}

.picker__search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line-soft); border-radius: 9px; background: var(--card-deep);
}
.picker__search:focus-within { border-color: var(--akito); }
.picker__search svg { flex: none; width: 14px; height: 14px; color: var(--dim); }
.picker__search:focus-within svg { color: var(--akito); }
.picker__search input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  border: 0; background: transparent; font-size: 12.5px;
}
.picker__search input:focus { outline: none; }
.picker__clear {
  flex: none; width: 16px; height: 16px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 999px; background: #ebdfd3; color: var(--dim);
}
.picker__clear svg { width: 8px; height: 8px; color: currentColor; }

.picker__list {
  height: 166px; margin: 0; padding: 0; overflow-y: auto;
  list-style: none;
}
.picker__option {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 6px 8px; border: 1px solid transparent; border-radius: 9px;
  cursor: pointer;
}
.picker__option + .picker__option { margin-top: 2px; }
.picker__option img,
.picker__option .picker__option-fallback {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--paper-deep); color: var(--faint); font-size: 12px; font-weight: 700;
}
.picker__option img { object-fit: cover; }
.picker__option span.picker__option-name {
  flex: 1 1 auto; min-width: 0; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker__option[aria-selected="true"] { background: var(--akito-soft); }
.picker__option[aria-selected="true"] .picker__option-name { color: var(--akito); font-weight: 700; }
.picker__option.is-active { background: #ff772214; border-color: var(--akito); }
.picker__option .picker__option-bar {
  flex: none; width: 3px; height: 16px; border-radius: 999px; background: transparent;
}
.picker__option.is-active .picker__option-bar { background: var(--akito); }
.picker__option__check { flex: none; width: 14px; height: 14px; color: var(--akito); }
.picker__option__check svg { width: 100%; height: 100%; }

.picker__empty {
  height: 166px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  color: var(--faint); text-align: center;
}
.picker__empty-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 999px; background: #efe9e1; color: var(--fainter);
}
.picker__empty strong { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.picker__empty small { font-size: 11px; }
.picker__hint { margin: 0; color: var(--dim); font-size: 11px; }

/* 原生 select：无 JS 时兜底显示，有 JS 时隐藏 */
.picker__native { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
html:not(.no-js) .picker__native {
  position: absolute; width: 1px; height: 1px; min-height: 0;
  padding: 0; margin: -1px; border: 0; opacity: 0; pointer-events: none;
}
html.no-js .picker__trigger,
html.no-js .picker__panel { display: none; }

/* ---------- 累计卡 ---------- */

.session-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft); border-radius: 16px; background: var(--card-deep);
}
.session-card__title { margin: 0 0 2px; color: var(--faint); font-size: 12px; }
.session-card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-card__label { color: var(--muted); font-size: 12.5px; }
.session-card__value { font-family: var(--font-num); font-size: 20px; font-weight: 700; }
.session-card__value.is-draw { color: var(--ink); }
.session-card__value.is-cook { color: var(--akito); }
.session-card__value.is-special { color: var(--toya); }

/* ---------- 结果区 ---------- */

.result-area { min-width: 0; }
.result-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 18px;
}
.result-head__actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.time-chip {
  padding: 7px 13px; border: 1px solid var(--line-soft); border-radius: 999px;
  background: var(--card); color: var(--muted); font-size: 12px;
}
.export-button {
  min-height: 36px; padding: 0 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 700;
}
.export-button:hover { border-color: var(--akito); color: var(--akito-ink); }
.export-button:disabled { opacity: .45; cursor: not-allowed; }
.export-button svg { flex: none; width: 15px; height: 15px; }
.export-button.is-primary { border-color: var(--ink); background: var(--ink); color: var(--card); }
.export-button.is-primary:hover { border-color: var(--ink); color: var(--card); opacity: .9; }
.result-list { display: flex; flex-direction: column; gap: 20px; }

.empty-state {
  min-height: 240px; display: grid; place-items: center; align-content: center; gap: 12px;
  border: 1px dashed #c9bdaf; border-radius: var(--radius-card);
  color: var(--muted); background: rgba(255, 255, 255, .3); text-align: center;
}
.empty-state svg { color: var(--fainter); }
.empty-state__icon { color: var(--fainter); line-height: 0; }
.empty-state p { margin: 0; }

/* 结果行卡 */
.row {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line-row); border-radius: 20px; background: var(--card);
  box-shadow: 0 6px 20px -12px rgba(66, 48, 32, .14);
}
.row__main { display: flex; align-items: center; gap: 20px; }
.row--cook { border-color: var(--cook-line); }
.row--special { background: var(--sp-bg); border-color: var(--sp-line); }

.row__index { flex: none; width: 80px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.row__num { color: var(--fainter); font: 700 11px/1 var(--font-num); letter-spacing: .06em; }
.row__mode {
  padding: 4px 8px; border-radius: 999px;
  background: var(--paper-deep); color: var(--muted); font-size: 10.5px; white-space: nowrap;
}

.row__pair { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0; }
.side { flex: none; width: 190px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.side__avatar {
  width: 88px; height: 88px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--paper-deep); color: var(--faint); font-size: 30px; font-weight: 700;
}
.side__avatar img { width: 100%; height: 100%; object-fit: cover; }
.side__name { font-size: 15px; font-weight: 700; }
.side--akito .side__name { color: var(--akito); }
.side--toya .side__name { color: var(--toya); }
.side__role { color: var(--faint); font-size: 11.5px; }

.row__cross {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 999px; background: var(--card); color: var(--fainter);
  box-shadow: 0 2px 10px rgba(66, 48, 32, .12);
}
.row__cross svg { width: 12px; height: 12px; }

.row__slot { flex: none; width: 112px; display: flex; align-items: center; justify-content: flex-end; }

.badge-cook {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--cook-chip); color: var(--cook-chip-ink);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-cook svg { flex: none; width: 12px; height: 12px; color: var(--cook-star); }

.cook-strip {
  padding: 10px 12px; border-radius: 10px;
  background: var(--cook-bg); color: var(--cook-ink);
  font-size: 13px; line-height: 1.5; text-align: center;
}
.cook-strip .a { color: var(--akito); font-weight: 700; }
.cook-strip .t { color: var(--toya); font-weight: 700; }
.cook-strip .x { margin: 0 6px; color: var(--cook-ink); }

.special-body {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.special-icons { flex: none; display: flex; align-items: center; gap: 8px; }
.special-icons img {
  width: 84px; height: 84px; border-radius: 12px; object-fit: cover;
  background: var(--paper-deep);
}
.special-icons.is-wide { min-width: min(280px, 34vw); justify-content: center; }
.special-icons.is-wide img {
  width: auto; height: auto; max-width: min(280px, 34vw); max-height: 150px; object-fit: contain;
}
.special-icons .fallback {
  width: 84px; height: 84px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sp-chip); color: var(--sp-ink); font-size: 30px;
}
.special-text { display: flex; flex-direction: column; gap: 4px; }
.special-text strong { color: var(--sp-ink); font-size: 18px; font-weight: 700; }
.special-text p { margin: 0; color: var(--sp-muted); font-size: 12.5px; line-height: 1.6; white-space: pre-line; }

/* ---------- 派生池 ---------- */

.pool-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; margin: 30px 0;
}
.search-field {
  display: flex; align-items: center; gap: 9px;
  width: 340px; max-width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.search-field:focus-within { border-color: var(--akito); }
.search-field svg { flex: none; width: 15px; height: 15px; color: var(--faint); }
.search-field input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; font-size: 13.5px; }
.search-field input:focus { outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }

.filter-chips { display: flex; gap: 6px; padding: 5px; border-radius: 12px; background: var(--card-deep); }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13px;
}
.filter-chip.is-active { background: var(--ink); color: var(--card); font-weight: 700; }
.filter-chip__count { color: inherit; opacity: .62; font-family: var(--font-num); font-size: 11.5px; }

.pool-sections { display: flex; flex-direction: column; gap: 34px; }
.pool-section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.pool-section__title { display: flex; align-items: center; gap: 10px; }
.pool-section__dot { width: 9px; height: 9px; border-radius: 999px; }
.pool-section__dot.dot-akito { background: var(--akito); }
.pool-section__dot.dot-toya { background: var(--toya); }
.pool-section__dot.dot-special { background: var(--cook-line); }
.pool-section__title h2 { margin: 0; font-size: 18px; font-weight: 700; }
.pool-section__count { color: var(--muted); font-size: 12.5px; }
.pool-section__link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 2px; border: 0; background: transparent;
  font-size: 12.5px; font-weight: 700;
}
.pool-section__link svg { width: 12px; height: 12px; }
.pool-section__link.link-akito { color: var(--akito); }
.pool-section__link.link-toya { color: var(--toya); }

.pool-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.pool-card {
  padding: 10px; border: 1px solid var(--line-soft); border-radius: 16px;
  background: var(--card); text-align: center;
}
.pool-card__avatar {
  width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--paper-deep); color: var(--faint); font-size: 26px; font-weight: 700;
}
.pool-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pool-card__name {
  margin: 9px 2px 0; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pool-grid--special { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.special-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border: 1px solid var(--sp-line); border-radius: 18px; background: var(--sp-bg);
}
.special-card.is-cook { border-color: var(--cook-line); }
.special-card__icons { display: flex; gap: 8px; min-height: 88px; align-items: center; }
/* 图标宽度跟着卡片走：卡片够宽就 84，变窄就等比缩，永远不出框体 */
.special-card__slot {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 84px; aspect-ratio: 1;
}
.special-card__stack { position: relative; width: 100%; height: 100%; }
.special-card__icons img,
.special-card__icons .fallback {
  width: auto; flex: 1 1 0; min-width: 0; max-width: 84px;
  height: auto; aspect-ratio: 1;
  border-radius: 12px; object-fit: cover; background: var(--paper-deep);
}
.special-card__stack img,
.special-card__stack .fallback {
  width: 100%; height: 100%; aspect-ratio: 1;
  border-radius: 12px; object-fit: cover; background: var(--paper-deep);
}
.special-card__icons .fallback,
.special-card__stack .fallback {
  display: grid; place-items: center;
  background: var(--sp-chip); color: var(--sp-ink); font-size: 30px;
}

/* 相册堆叠：主图压在最上，后面几张往右下错开露出一角（像一叠照片）。
   素材本身是白底，光靠错位看不出来，所以每张都描一圈浅紫边 + 主图带一点点投影。 */
.special-card__stack.is-stack { cursor: pointer; }
.special-card__stack.is-stack > img,
.special-card__stack.is-stack > .fallback {
  position: absolute; inset: 0;
  border: 1px solid var(--sp-line);
}
.special-card__stack.is-stack > :nth-child(1) { z-index: 3; box-shadow: 0 1px 4px rgba(41, 40, 38, 0.16); }
.special-card__stack.is-stack > :nth-child(2) { z-index: 2; transform: translate(8px, 8px) rotate(3deg); }
.special-card__stack.is-stack > :nth-child(3) { z-index: 1; transform: translate(16px, 16px) rotate(-3deg); }
.special-card__stack.is-stack > img:nth-child(n+4) { display: none; }

/* 收起时给个「还有几张」的角标：手机没有 hover，不给提示就没人知道能点 */
.special-card__count {
  position: absolute; right: -7px; bottom: -7px; z-index: 4;
  min-width: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--sp-ink); color: var(--sp-bg);
  font-size: 10.5px; font-weight: 700; line-height: 19px; text-align: center;
}

/* 展开 = 原地弹出浮层，把整叠摊开。
   桌面 3 张横排 72px（248×88）正好铺满图标区、不压到下面的文字；
   手机放不下一行三张，退成 2×2 的 56px（136×136）。 */
.special-card__stack.is-stack.is-open {
  /* 往外各扩 9px（内边距 8 + 边框 1），浮层左边和收起时的图左边对齐 */
  position: absolute; top: 0; left: -9px;
  display: flex; gap: 8px;
  padding: 8px;
  background: var(--sp-bg);
  border: 1px solid var(--sp-line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(41, 40, 38, 0.2);
  z-index: 40;
}
.special-card__stack.is-stack.is-open > img,
.special-card__stack.is-stack.is-open > .fallback {
  position: static; transform: none; box-shadow: none;
  flex: none; max-width: none;
  width: 72px; height: 72px;
}
.special-card__stack.is-stack.is-open > .special-card__count { display: none; }
.special-card__body { display: flex; flex-direction: column; gap: 5px; }
.special-card__name { color: var(--sp-ink); font-size: 16px; font-weight: 700; }
.special-card__msg { margin: 0; color: var(--sp-muted); font-size: 12px; line-height: 1.6; white-space: pre-line; }
.special-card__tag {
  align-self: flex-start; padding: 4px 9px; border-radius: 999px;
  background: var(--cook-chip); color: var(--cook-chip-ink); font-size: 10.5px; font-weight: 700;
}

.pool-pager {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 22px;
}
.pool-note { margin: 18px 0 0; color: var(--faint); font-size: 11.5px; text-align: center; }

/* ---------- 更新公告 ---------- */

.updates-hero { padding-bottom: 8px; }
.updates-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  padding: 28px 0 96px;
}
.update-card {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--card); box-shadow: var(--shadow-card);
}
.update-card.is-highlight { border-color: var(--akito); box-shadow: 0 14px 36px -6px rgba(255, 119, 34, .14); }
.update-card__button {
  display: block; width: 100%; padding: 24px; border: 0; border-radius: inherit;
  background: transparent; text-align: left;
}
.update-card__button:hover { background: rgba(255, 255, 255, .42); }
.update-card__head { display: flex; align-items: center; gap: 8px; }
.update-card__latest {
  padding: 4px 8px; border-radius: 999px; background: var(--akito-soft); color: var(--akito-ink);
  font-size: 11px; font-weight: 700;
}
.update-card__date { color: var(--faint); font: 700 12px/1 var(--font-num); letter-spacing: .04em; }
.update-card h2 { margin: 18px 0 9px; font-family: var(--font-serif); font-size: 23px; line-height: 1.35; }
.update-card p { min-height: 48px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.update-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.update-card__tags, .update-dialog__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.update-tag { padding: 5px 9px; border-radius: 999px; background: var(--paper-deep); color: var(--muted); font-size: 11px; }
.update-card__arrow { flex: none; color: var(--faint); }
.update-card__arrow svg { width: 15px; height: 15px; }

.update-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.update-dialog__card { padding: 26px; }
.update-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.update-dialog__head h2 { margin: 0; font-family: var(--font-serif); font-size: 27px; line-height: 1.35; }
.update-dialog__date { margin: 8px 0 0; color: var(--faint); font: 700 12px/1 var(--font-num); }
.update-dialog__summary { margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.update-dialog__details { display: flex; flex-direction: column; gap: 13px; margin: 20px 0 0; padding-left: 21px; color: var(--ink); font-size: 13.5px; line-height: 1.8; }
.update-dialog__details li::marker { color: var(--akito); }
.update-dialog__tags { margin-top: 22px; }

/* ---------- 趣味派生数据 ---------- */

.stats-hero { padding-bottom: 8px; }
.community-total {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin-top: 28px; padding: 22px 24px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--card); box-shadow: var(--shadow-card);
}
.community-total__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.community-total__item + .community-total__item { margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--line); }
.community-total__label { color: var(--muted); font-size: 14px; font-weight: 700; }
.community-total strong { color: var(--ink); font: 700 38px/1 var(--font-num); }
.community-stats-note { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; font-style: italic; line-height: 1.5; }
.community-stats-note + .community-stats-note { margin-top: 8px; }
.community-updated { margin: 0; color: var(--faint); font-size: 11.5px; }

/* 单人纪录：框体、字号、跨端逻辑全部沿用上方的 .community-total，这里只补差额 */
.community-total--record { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.community-total__value { display: inline-flex; align-items: baseline; gap: 4px; }
.community-total__lead { color: var(--muted); font-size: 13px; font-weight: 700; }
.community-total__value small { color: var(--muted); font-size: 14px; font-weight: 700; }
/* 没数据时「还没有」按正文大小显示，别用 38px 撑一整行 */
.community-total__value.is-empty strong { color: var(--faint); font: 700 15px/1 var(--font-sans); }
.community-total__value.is-empty small,
.community-total__value.is-empty .community-total__lead { display: none; }
.stats-switch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.stats-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: 13px; background: var(--paper-deep);
}
.stats-switch__button {
  padding: 8px 16px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 12.5px;
}
.stats-switch__button.is-active {
  background: var(--card); color: var(--ink); font-weight: 700;
  box-shadow: 0 2px 8px rgba(66, 48, 32, .1);
}
.community-rank-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  padding: 22px 0 96px;
}
.community-rank-card {
  min-width: 0; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--card); box-shadow: var(--shadow-card);
}
.community-rank-card--akito { border-top: 3px solid var(--akito); }
.community-rank-card--toya { border-top: 3px solid var(--toya); }
/* 两张组合榜并排各占半宽（原先只有一张，靠 grid-column 占满整行） */
.community-rank-card--pair { border-top: 3px solid var(--ink); }
.community-rank-card--cook-pair { border-top: 3px solid var(--cook-line); }
.community-rank-card__head .eyebrow { margin-bottom: 6px; }
.community-rank-card__head h2 { margin: 0; font-family: var(--font-serif); font-size: 22px; }
.community-rank-card__head h2 .k { color: var(--akito); }
.community-rank-card__head h2 .t { color: var(--toya); }
.community-rank-list {
  display: flex; flex-direction: column; gap: 8px;
  margin: 18px 0 0; padding: 0; list-style: none;
}
.community-rank-list > .records-empty { padding: 28px 12px; }
.community-rank-row { display: flex; align-items: center; gap: 11px; min-width: 0; }
.community-rank-row__position {
  flex: none; width: 23px; color: var(--faint); font: 700 11px/1 var(--font-num); text-align: right;
}
.community-rank-row__body {
  display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%;
  padding: 8px 10px; border-radius: 12px; background: var(--card-deep);
}
.community-rank-row__avatar {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  overflow: hidden; border-radius: 10px; background: var(--paper-deep); color: var(--faint); font-size: 13px; font-weight: 700;
}
.community-rank-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-rank-row__avatar--akito { background: var(--akito-soft); color: var(--akito-ink); }
.community-rank-row__avatar--toya { background: var(--toya-soft); color: var(--toya); }
.community-rank-row__name { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.community-rank-row__count { margin-left: auto; flex: none; color: var(--muted); font: 700 12px/1 var(--font-num); }
.community-rank-row__avatars { display: flex; flex: none; }
.community-rank-row__avatars .community-rank-row__avatar + .community-rank-row__avatar { margin-left: -7px; border: 2px solid var(--card-deep); }
.community-rank-row__names { display: flex; align-items: center; min-width: 0; gap: 5px; }
.community-rank-row__name--akito { color: var(--akito-ink); }
.community-rank-row__name--toya { color: var(--toya); }
.community-rank-row__cross { color: var(--faint); font-size: 12px; }

/* 分页控件（桌面/移动共用） */
.pager__btn {
  min-width: 34px; height: 34px; padding: 0 9px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--card); color: var(--muted); font-size: 13px;
}
.pager__btn svg { width: 12px; height: 12px; }
.pager__btn.is-current { border-color: var(--ink); background: var(--ink); color: var(--card); font-weight: 700; }
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }
.pager__gap { padding: 0 2px; color: var(--faint); }

/* ---------- 我的记录 ---------- */

.records-main { padding: 36px 0 96px; }
.records-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 16px; align-items: center; }
.records-heading .eyebrow { grid-column: 1; margin: 0; }
.records-heading .hero__title { grid-column: 1; grid-row: 2; }
.records-heading .export-button { grid-column: 2; grid-row: 1 / 3; justify-self: end; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 30px 0; }
.stat-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--card);
}
.stat-card__label { color: var(--faint); font-size: 12px; }
.stat-card__value { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card__value.is-draw { color: var(--ink); }
.stat-card__value.is-cook { color: var(--akito); }
.stat-card__value.is-special { color: var(--toya); }
.stat-card__value.is-plain { color: var(--muted); }

.records-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.records-toolbar__actions { display: flex; align-items: center; gap: 9px; }
.danger-button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border: 1px solid var(--danger-line); border-radius: 10px;
  background: transparent; color: var(--danger); font-size: 13px;
}
.danger-button svg { width: 14px; height: 14px; }

.records-list { display: flex; flex-direction: column; gap: 24px; }
.records-pager { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; }
.records-pager p { margin: 0; color: var(--faint); font: 12px/1.5 var(--font-num); }
.records-pager .secondary-button { min-width: 150px; min-height: 40px; padding-inline: 16px; }
.records-pager .secondary-button:disabled { opacity: .55; cursor: wait; }
.record-report-status { margin: 10px 0; color: var(--muted); font-size: 12px; }
.record-report-status:empty { display: none; }
.day-group { display: flex; flex-direction: column; gap: 10px; }
.day-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 0 4px; color: var(--muted); font-size: 12.5px;
}
.day-head strong { color: var(--ink); font-size: 13.5px; }
.day-head small { color: var(--faint); }
.record-batch { display: flex; flex-direction: column; gap: 10px; }
.record-batch__head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px; color: var(--faint); }
.record-batch__line { flex: 1 1 0; height: 1px; background: var(--line-soft); }
.record-batch__title { flex: none; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.record-batch__meta { min-width: 0; max-width: 42%; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-select {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card); cursor: pointer;
}
.record-select input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.record-select__mark { width: 11px; height: 11px; border-radius: 3px; background: transparent; }
.record-select input:checked + .record-select__mark, .record-select input:indeterminate + .record-select__mark { background: var(--ink); }
.record-select input:indeterminate + .record-select__mark { height: 3px; border-radius: 999px; }
.record-select:focus-within { outline: 3px solid rgba(255, 119, 34, .3); outline-offset: 2px; }

.record-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card);
}
.record-row.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.record-row--cook { border-color: var(--cook-line); }
.record-row--special { background: var(--sp-bg); border-color: var(--sp-line); }
.record-row__time { flex: none; width: 46px; color: var(--faint); font-family: var(--font-num); font-size: 12px; }
.record-row__body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.record-row__body img {
  flex: none; width: 40px; height: 40px; border-radius: 11px; object-fit: cover; background: var(--paper-deep);
}
.record-row__body .fallback {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--paper-deep); color: var(--faint); font-weight: 700;
}
.record-row__name { font-size: 13.5px; font-weight: 700; }
.record-row__name.a { color: var(--akito); }
.record-row__name.t { color: var(--toya); }
.record-row__cross { color: #c0b4a6; }
.record-row__cross svg { width: 11px; height: 11px; }
.record-row__msg { color: var(--sp-muted); font-size: 13px; white-space: pre-line; }
.record-row__msg strong { color: var(--sp-ink); margin-right: 8px; }

.outcome-chip {
  flex: none; padding: 6px 11px; border-radius: 999px;
  background: var(--paper-deep); color: var(--muted); font-size: 11px; white-space: nowrap;
}
.outcome-chip.is-cook { background: var(--cook-bg); color: var(--cook-ink); font-weight: 700; }
.outcome-chip.is-special { background: var(--sp-chip); color: var(--sp-ink); font-weight: 700; }

.records-empty {
  padding: 56px 20px; border: 1px dashed #c9bdaf; border-radius: 18px;
  color: var(--muted); text-align: center;
}

.record-export-bar {
  position: sticky; z-index: 20; bottom: 18px;
  margin: -8px 0 22px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255, 253, 249, .96); box-shadow: var(--shadow-float); backdrop-filter: blur(12px);
}
.record-export-bar strong { font-size: 13.5px; }
.record-export-bar p { margin: 4px 0 0; color: var(--faint); font-size: 11.5px; }
.record-export-bar__actions { display: flex; align-items: center; gap: 8px; }
.record-export-bar .secondary-button { min-height: 36px; padding: 0 13px; }

/* ---------- 页脚 / 移动底栏 ---------- */

.site-footer {
  margin-top: 40px; padding: 22px 0 34px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--faint); font-size: 12px;
}
.site-footer p { margin: 0; }

.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-mark { flex: none; display: block; width: 22px; height: 22px; }
.footer-mark svg { display: block; width: 22px; height: 22px; }
.footer-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-meta a { color: inherit; text-underline-offset: 3px; }
.footer-meta a:hover { color: var(--ink); }
.footer-registrations { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.footer-registrations > a { display: inline-flex; align-items: center; min-height: 20px; white-space: nowrap; }
.footer-registrations > a:first-child { padding-left: 26px; }
.footer-beian { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.footer-beian img { display: block; flex: none; width: 20px; height: 20px; object-fit: contain; }

.bottom-nav {
  display: none;
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 253, 249, .96);
  backdrop-filter: blur(14px);
}
.bottom-nav__inner { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px; border: 0; border-radius: 12px;
  background: transparent; color: var(--faint); font-size: 11px;
}
.bottom-nav__item svg { width: 18px; height: 18px; }
.bottom-nav__item.is-active { color: var(--ink); font-weight: 700; }

/* ---------- 弹窗 ---------- */

dialog {
  width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow-card);
}
dialog::backdrop { background: rgba(30, 28, 25, .48); backdrop-filter: blur(3px); }
.dialog-card { padding: 28px; }
.dialog-card h2 { margin: 0 0 9px; font-family: var(--font-serif); font-size: 26px; }
.dialog-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.secondary-button, .dialog-danger {
  min-height: 46px; border-radius: 12px; font-size: 14px;
}
.secondary-button { border: 1px solid var(--line); background: transparent; }
.dialog-danger { border: 0; background: var(--danger); color: #fff; font-weight: 700; }

.export-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.export-dialog__card { padding: 22px; }
.export-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.export-dialog__head h2 { margin: 0; font-family: var(--font-serif); font-size: 25px; }
.dialog-close {
  flex: none; width: 36px; height: 36px; border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--card-deep); color: var(--muted); font-size: 22px; line-height: 1;
}
.export-preview {
  margin-top: 18px; max-height: 58dvh; overflow: auto;
  border: 1px solid var(--line-soft); border-radius: 14px; background: var(--paper);
}
.export-preview img { display: block; width: 100%; height: auto; }
.export-dialog__status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.export-dialog__actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.export-dialog__actions .secondary-button, .export-dialog__actions .export-button { min-width: 120px; min-height: 42px; }

/* ==========================================================================
   断点
   ========================================================================== */

@media (max-width: 1199px) {
  .draw-main { grid-template-columns: minmax(0, 1fr); }
  .draw-side { display: grid; grid-template-columns: minmax(0, 1fr); }
  .control-card { max-width: 560px; }
  .session-card { max-width: 560px; }
}

@media (max-width: 1023px) {
  .pool-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* 这一档 .pool-grid 是 6 列，特殊卡必须显式压回 4 列（否则 4 张卡被挤成 128px） */
  .pool-grid--special { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .container { width: min(100% - 40px, 720px); }
  .site-header__inner { min-height: 68px; }
  .top-nav { display: none; }
  .bottom-nav { display: block; }
  .hero { padding-top: 26px; }
  .hero__title { font-size: 27px; line-height: 1.33; }
  .hero__sub { margin-top: 12px; font-size: 12.5px; }
  .section-title { font-size: 22px; }
  .result-head { align-items: center; }

  .home-update { margin-top: 20px; }
  .home-update__link { gap: 10px; padding: 12px 14px; }
  .home-update__line { gap: 7px; }
  .home-update__label { display: none; }
  .home-update__line time { font-size: 10px; }
  .home-update h2 { font-size: 14px; }
  .home-update__cta { font-size: 0; }
  .home-update__cta span { font-size: 16px; }

  .draw-main { padding: 24px 0 110px; gap: 22px; }
  .control-card { max-width: none; padding: 20px; border-radius: 18px; }
  .save-hint { margin-top: 18px; }

  .row { padding: 14px; gap: 11px; border-radius: 18px; }
  .row__main { gap: 12px; }
  .row__index { width: auto; }
  .row__pair { flex-direction: row; gap: 0; }
  .side { width: auto; flex: 1 1 0; gap: 7px; }
  .side__avatar { width: 64px; height: 64px; border-radius: 12px; font-size: 22px; }
  .side__name { font-size: 13px; }
  .side__role { font-size: 10.5px; }
  .row__cross { width: 24px; height: 24px; }
  .row__slot { width: auto; }

  .special-body { gap: 11px; }
  .special-icons img, .special-icons .fallback { width: 64px; height: 64px; }
  .special-icons.is-wide { min-width: min(160px, 36vw); }
  .special-icons.is-wide img { width: auto; height: auto; max-width: min(160px, 36vw); max-height: 110px; }
  .special-text strong { font-size: 14px; }
  .special-text p { font-size: 11px; }

  .pool-toolbar { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 20px; }
  .search-field { width: 100%; height: 40px; }
  .filter-chips { overflow-x: auto; }
  .filter-chip { flex: 1 0 auto; }
  .pool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
  /* 这一档 .pool-grid 是 3 列，特殊卡必须显式写回 4 列；真正降成 2×2 的是 ≤759（见下方） */
  .pool-grid--special { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
  .pool-card { padding: 8px; border-radius: 14px; }
  .pool-card__name { margin-top: 6px; font-size: 11px; }
  .pool-sections { gap: 22px; }

  /* 手机档特殊卡转 2×2；图标宽度已在全局规则里自适应，这里只收紧留白 */
  .special-card { padding: 13px; gap: 10px; border-radius: 16px; }
  .special-card__name { font-size: 14px; }
  .special-card__msg { font-size: 11.5px; line-height: 1.5; }
  /* 一行三张放不下，摊开的浮层退成 2×2 */
  .special-card__stack.is-stack.is-open { display: grid; grid-template-columns: repeat(2, 56px); }
  .special-card__stack.is-stack.is-open > img,
  .special-card__stack.is-stack.is-open > .fallback { width: 56px; height: 56px; }

  .updates-list { grid-template-columns: minmax(0, 1fr); padding-top: 22px; }

  .community-total { margin-top: 20px; padding: 17px 16px; }
  .community-total__item { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
  .community-total__item + .community-total__item { margin-left: 14px; padding-left: 14px; }
  .community-total__label { font-size: 12px; }
  .community-total strong { font-size: 30px; }
  .community-total__lead,
  .community-total__value small { font-size: 12px; }
  .stats-switch-row { margin-top: 14px; }
  .stats-switch__button { padding: 8px 13px; }
  .community-rank-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; padding-top: 16px; }
  .community-rank-card { padding: 17px 14px; border-radius: 18px; }
  .community-rank-card__head h2 { font-size: 19px; }
  .community-rank-row__body { padding: 7px 8px; }
  .community-rank-row__name { font-size: 12px; }

  .records-main { padding: 24px 0 110px; }
  .records-heading .hero__title { grid-column: 1 / -1; }
  .records-heading .export-button { grid-row: 1; }
  .stats-row { gap: 10px; margin: 20px 0; }
  .stat-card { padding: 14px; border-radius: 14px; }
  .stat-card__value { font-size: 22px; }

  .records-toolbar { gap: 10px; }
  .records-toolbar__actions { width: 100%; flex-wrap: wrap; }
  .records-toolbar__actions > button { flex: 1 1 auto; justify-content: center; }
  .record-batch__head { gap: 7px; padding-top: 6px; }
  .record-batch__title { font-size: 11px; }
  .record-batch__meta { max-width: 38%; font-size: 10px; }
  .record-row { padding: 10px 12px; gap: 10px; border-radius: 13px; }
  .record-row__time { width: 38px; font-size: 11px; }
  .record-row__body img, .record-row__body .fallback { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
  .record-row__name { font-size: 11.5px; }
  .record-row__msg { font-size: 11.5px; }
  .outcome-chip { padding: 5px 9px; font-size: 10px; }
  .record-export-bar { bottom: 78px; }

  .site-footer { padding-bottom: 88px; }
}

/* 特殊卡什么时候从"一行四张"降成"2×2"：只看放得下放不下。
   容器上限 720 时四列每张 171.75（≈手机两列的卡宽，狐兔两个图标 68），再窄就缩得没法看。
   → 视口 760 以上（平板竖屏 768/834）仍是一行四张，手机才换行。 */
@media (max-width: 759px) {
  .pool-grid--special { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-total--record { grid-template-columns: minmax(0, 1fr); }
  .community-total--record .community-total__item + .community-total__item {
    margin: 14px 0 0; padding: 14px 0 0;
    border-top: 1px solid var(--line); border-left: 0;
  }
}

@media (max-width: 560px) {
  /* 手机档下拉框允许折行：提示语「先选「固定彰人」或「固定冬弥」」在 320 宽会被省略号吃掉两个字，
     宁可让触发条高一行，也不要把字裁掉 */
  .picker__name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented__opt { font-size: 12.5px; padding: 10px 4px; }
  .result-head { align-items: flex-start; }
  .result-head__actions { flex-direction: column; align-items: flex-end; }
  .result-head__actions .export-button { min-height: 32px; }
  .row--cook { position: relative; overflow: hidden; }
  .row--cook .row__slot { position: absolute; z-index: 1; top: 0; right: 0; width: auto; }
  .row--cook .badge-cook {
    height: 28px; padding: 0 10px; border-radius: 0 17px 0 12px;
    font-size: 10px; box-shadow: 0 3px 10px rgba(66, 48, 32, .12);
  }
  .row--cook .badge-cook svg { width: 11px; height: 11px; }
  .row--cook .badge-cook > span:last-child { font-size: 0; }
  .row--cook .badge-cook > span:last-child::after { content: "做饭"; font-size: 10px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
  .record-export-bar { align-items: stretch; flex-direction: column; gap: 10px; padding: 13px; }
  .record-export-bar__actions > button { flex: 1 1 0; }
  .export-dialog__card { padding: 16px; }
  .export-dialog__actions > button { flex: 1 1 0; min-width: 0; }
  .update-card__button { padding: 20px; }
  .update-card h2 { font-size: 21px; }
  .update-dialog__card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
