:root {
  --paper: #f7f3ea;
  --paper-strong: #efe8da;
  --card: #fffdf8;
  --ink: #23281f;
  --muted: #6f756e;
  --line: #e4ddcf;
  --accent: #e8590c;
  --accent-dark: #c2410c;
  --accent-soft: #fdeee2;
  --success: #2f9e6e;
  --success-dark: #207a52;
  --success-soft: #e5f5ec;
  --warn: #8a5b12;
  --warn-soft: #fff5dc;
  --danger: #9b3b32;
  --shadow: 0 16px 42px rgba(44, 39, 29, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% -6%, rgba(232, 89, 12, 0.09), transparent 34rem),
    radial-gradient(circle at 98% 12%, rgba(190, 150, 76, 0.13), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-dark);
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 16px calc(128px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- hero */
.hero {
  padding: 15px 4px 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 8px 0 7px;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

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

/* --------------------------------------------------------------- panels */
.panel {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(221, 214, 200, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.boot-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 118px;
  color: var(--muted);
}

.state-panel {
  padding: 44px 24px;
  text-align: center;
}

.state-panel h2 {
  margin: 12px 0 8px;
  font-size: 22px;
}

.state-panel p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--muted);
}

.state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.state-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.state-actions .button {
  min-width: 132px;
}

/* --------------------------------------------------------- order chip */
.order-chip {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.65);
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

/* ------------------------------------------------------ browse banner */
.browse-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #f3cfae;
  border-radius: 14px;
  background: var(--accent-soft);
}

.browse-banner-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  color: #7c3a08;
}

.browse-banner-text strong {
  font-size: 14px;
}

.browse-banner .text-button {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--accent-dark);
}

/* -------------------------------------------------------- order entry */
.order-entry {
  margin: 0 0 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 26px rgba(44, 39, 29, 0.07);
}

.order-entry h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

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

.order-entry-row {
  display: flex;
  gap: 10px;
}

.order-entry-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.order-entry-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 89, 12, 0.1);
}

.order-entry-row .button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 20px;
}

.order-entry-hint {
  margin: 9px 0 0;
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

/* 没有卡密时的两条出口：买套餐 / 找回 */
.order-entry-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.order-entry-actions .button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

/* 这台设备买过的卡：便利入口，不承诺长期存在 */
.entry-recall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--success-soft);
  font-size: 12px;
  color: var(--success-dark);
}

.entry-recall-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------- notice */
.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e8d5a8;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

/* ------------------------------------------------------ selection bar */
.selection-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -4px;
  padding: 12px 4px;
  background: linear-gradient(
    180deg,
    rgba(247, 243, 234, 0.98) 0%,
    rgba(247, 243, 234, 0.92) 76%,
    rgba(247, 243, 234, 0) 100%
  );
  backdrop-filter: blur(7px);
}

.selection-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 13px;
  border: 1px solid #f0d3b8;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #7c3a08;
  font-size: 13px;
  font-weight: 600;
}

.selection-pill strong {
  color: var(--accent-dark);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.selection-pill span {
  color: #b07248;
  font-size: 12px;
  font-weight: 500;
}

.selection-tip {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 600;
}

/* ------------------------------------------------------- search panel */
.search-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 26px rgba(44, 39, 29, 0.07);
}

.search-panel label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #a3a89f;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 89, 12, 0.1);
}

.search-wrap input::placeholder {
  color: #9b9f98;
}

.search-wrap .spinner {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

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

/* ------------------------------------------------------------- results */
.results {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  /* 结果列表必须待在自己的容器里：任何负边距/绝对定位都会让它比上面的
     搜索卡片更宽，手机上看着像误排版。这里锁死宽度做兜底。 */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.result-item.is-selected {
  border-color: rgba(232, 89, 12, 0.45);
  background: var(--accent-soft);
}

.result-item.is-disabled {
  opacity: 0.55;
}

.result-item label {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  cursor: pointer;
}

.result-item.is-disabled label {
  cursor: not-allowed;
}

.result-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin: 0;
  accent-color: var(--accent);
}

.result-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.result-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.row-status {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
}

.row-status.is-selected {
  color: var(--accent-dark);
}

.row-status.is-idle {
  color: #a3a89f;
}

.row-status.is-full {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper-strong);
  color: #8b8f87;
}

.result-empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.search-error {
  color: var(--danger);
}

/* ------------------------------------------------------ selected list */
.selected-panel {
  margin-top: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.section-heading h2 {
  margin: 0;
  font-size: 15px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.selected-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selected-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.selected-index {
  flex: 0 0 24px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.selected-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.remove-selected {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.legal-note {
  padding: 23px 8px 8px;
  color: #858a83;
  text-align: center;
  font-size: 11px;
}

/* ----------------------------------------------------------- submit bar */
.submit-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  padding: 12px max(16px, calc((100vw - 728px) / 2))
    calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(221, 214, 200, 0.8);
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(14px);
}

.submit-caption {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* -------------------------------------------------------------- button */
.button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.button:active {
  transform: scale(0.985);
}

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

.button.primary:hover {
  background: var(--accent-dark);
}

.button.primary:disabled {
  background: #cfc9bd;
  color: #8b8f87;
  cursor: not-allowed;
  transform: none;
}

.button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button.full {
  width: 100%;
}

/* --------------------------------------------------------- result view */
.result-wrap {
  display: grid;
  gap: 14px;
}

.result-hero {
  padding: 30px 20px 22px;
  text-align: center;
}

.result-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 13px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  box-shadow: 0 8px 24px rgba(47, 158, 110, 0.26);
}

.result-check svg {
  width: 30px;
  height: 30px;
}

.small-check {
  width: 46px;
  height: 46px;
}

.small-check svg {
  width: 24px;
  height: 24px;
}

.result-hero h2,
.result-dialog h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 27px;
}

.result-order-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.result-hero .notice {
  margin: 14px 0 0;
  text-align: left;
}

.result-card {
  padding: 17px 18px;
}

.result-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.result-sheets,
.confirm-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.result-sheets li,
.confirm-list li {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.result-sheets li::before,
.confirm-list li::before {
  counter-increment: item;
  content: counter(item) "、";
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}

.share-card {
  padding: 17px 18px;
}

.share-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.share-link {
  display: block;
  margin: 5px 0 12px;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.code-row span {
  color: #7c3a08;
  font-size: 13px;
}

.code-row strong {
  color: var(--accent-dark);
  font-size: 26px;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

.code-row .text-button {
  margin-left: auto;
  color: var(--accent-dark);
}

.share-actions {
  display: flex;
  gap: 10px;
  margin-top: 13px;
}

.share-actions .button {
  flex: 1;
  min-height: 42px;
  padding: 8px 13px;
  font-size: 13px;
}

.warning {
  margin: 15px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
}

.result-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

/* -------------------------------------------------------------- spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(232, 89, 12, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.spinner.small {
  width: 16px;
  height: 16px;
}

.spinner.large {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------- modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 28, 25, 0.48);
  backdrop-filter: blur(3px);
}

.dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(221, 214, 200, 0.9);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(25, 24, 19, 0.28);
  animation: rise 180ms ease-out;
}

.sheet-dialog {
  border-radius: 22px 22px 0 0;
  animation: slide-up 220ms cubic-bezier(0.32, 0.72, 0.35, 1);
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: -6px auto 14px;
  border-radius: 999px;
  background: var(--paper-strong);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(40px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dialog h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.dialog-sub,
.dialog-hint {
  color: var(--muted);
  font-size: 13px;
}

.dialog-hint {
  margin: 12px 0 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.dialog-actions .button {
  flex: 1;
  min-height: 46px;
}

.processing-dialog {
  max-width: 390px;
  padding: 34px 26px;
  text-align: center;
}

.processing-dialog h2 {
  margin-top: 15px;
}

.processing-dialog p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-dialog {
  max-width: 480px;
}

.modal-share {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
}

.modal-share a {
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.modal-code strong {
  color: var(--accent-dark);
  font-size: 20px;
  letter-spacing: 0.12em;
}

/* ---------------------------------------------------------- guide steps */
.guide-steps {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.guide-steps li {
  display: flex;
  gap: 12px;
}

.guide-index {
  flex: 0 0 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.guide-steps strong {
  display: block;
  font-size: 15px;
}

.guide-steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* -------------------------------------------------------------- toast */
.clipboard-fallback {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toast {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(88vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(32, 38, 33, 0.94);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 26px rgba(20, 22, 20, 0.22);
}

@media (min-width: 560px) {
  .shell {
    padding-top: 34px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .modal {
    align-items: center;
  }

  .sheet-dialog {
    border-radius: 20px;
  }
}

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

/* ==========================================================================
   曲谱检索增强：缩略图 / 元信息小字 / 一页预览
   ========================================================================== */

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.result-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f6f7f9;
}

.result-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 下拉框里的小字：艺人 / 制谱人 / 调性 / 难度 */
.result-meta {
  font-size: 12px;
  line-height: 1.35;
  color: #8a93a3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-preview {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #2f6feb;
  background: rgba(47, 111, 235, 0.08);
  border: 1px solid rgba(47, 111, 235, 0.25);
  border-radius: 999px;
  cursor: pointer;
}

.result-preview:hover {
  background: rgba(47, 111, 235, 0.16);
}

.result-item.is-out-of-stock {
  opacity: 0.55;
}

.result-item.is-out-of-stock .result-name {
  text-decoration: none;
}

.row-status.is-missing {
  color: #b26a00;
  background: rgba(255, 176, 32, 0.14);
}

/* ---------------- 预览浮层 ---------------- */
.score-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 20, 30, 0.62);
  backdrop-filter: blur(2px);
}

.score-preview-overlay[hidden] {
  display: none;
}

.score-preview-panel {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
}

.score-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.score-preview-title {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-preview-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.score-preview-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.score-preview-body {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  background: #f6f7f9;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.score-preview-body img {
  display: block;
  width: 100%;
  height: auto;
}

.score-preview-loading {
  margin: 48px auto;
  color: #8a93a3;
  font-size: 13px;
}

.score-preview-tip {
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  color: #8a93a3;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

body.has-overlay {
  overflow: hidden;
}

/* ================================================================== 全站增强 */
/* 统一焦点反馈：键盘用户能看清当前落点，鼠标点击不打扰。 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes enter-scale {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: enter-up 480ms var(--ease-out, cubic-bezier(.16, 1, .3, 1)) both; }
  .hero > :nth-child(1) { animation-delay: 40ms; }
  .hero > :nth-child(2) { animation-delay: 110ms; }
  .hero > :nth-child(3) { animation-delay: 180ms; }
  .panel:not([hidden]) { animation: enter-scale 420ms cubic-bezier(.16, 1, .3, 1) both; }
}

/* ------------------------------------------------------------- 售后入口 */
.support-strip {
  margin: 18px 0 4px;
}

.support-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(255, 253, 248, .96), rgba(253, 238, 226, .7));
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.support-trigger:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(44, 39, 29, .09);
}

.support-trigger:active {
  transform: scale(.995);
}

.support-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.support-mark svg {
  width: 21px;
  height: 21px;
}

.support-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.support-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.support-copy small {
  color: var(--muted);
  font-size: 12px;
}

.support-go {
  margin-left: auto;
  flex: none;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.support-go::after {
  content: " →";
}

body.support-open {
  overflow: hidden;
}

.support-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 40, 31, .5);
  backdrop-filter: blur(3px);
}

.support-card {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(24, 20, 12, .3);
  animation: enter-up 320ms cubic-bezier(.16, 1, .3, 1) both;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.support-head h2 {
  margin: 3px 0 14px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.support-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.support-close:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.support-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--paper-strong);
}

.support-tab {
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.support-tab.is-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(44, 39, 29, .09);
}

.support-pane {
  text-align: center;
}

.support-pane img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: zoom-in;
}

.support-pane img.is-zoomed {
  position: fixed;
  z-index: 70;
  inset: 50% auto auto 50%;
  width: min(92vw, 560px);
  max-height: 86dvh;
  object-fit: contain;
  transform: translate(-50%, -50%);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
  cursor: zoom-out;
}

.support-id {
  margin: 0 0 3px;
  font-size: 14px;
  color: var(--ink);
}

.support-id strong {
  color: var(--accent-dark);
  letter-spacing: .04em;
}

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

@media (prefers-reduced-motion: reduce) {
  .hero > *, .panel:not([hidden]), .support-card {
    animation: none !important;
  }
  .support-trigger { transition: none; }
}
