:root {
  color-scheme: light;
  --ink: #20201d;
  --muted: #68675f;
  --paper: #f8f5ee;
  --card: #fffdf8;
  --line: #ded9cc;
  --accent: #d9552f;
  --accent-dark: #a9381d;
  --accent-soft: #fff0e8;
  --green: #1d7758;
  --shadow: 0 16px 45px rgba(67, 49, 30, 0.09);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(240, 166, 102, .16), transparent 28rem),
    var(--paper);
  line-height: 1.65;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-dark); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(18px, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid rgba(222, 217, 204, .8);
  background: rgba(248, 245, 238, .92);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: white; background: var(--accent); }
.guide-link { font-weight: 700; text-decoration: none; }

main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.hero { max-width: 780px; padding: 64px 0 34px; }
.hero h1 { max-width: 720px; margin: 6px 0 16px; font-size: clamp(2rem, 6vw, 4.15rem); line-height: 1.08; letter-spacing: -.05em; }
.hero p:last-child { max-width: 680px; margin: 0; color: var(--muted); font-size: 1.06rem; }
.eyebrow, .step-label { margin: 0; color: var(--accent-dark); font-size: .82rem; font-weight: 800; letter-spacing: .08em; }

.panel, .result-panel, .guide-card {
  margin-bottom: 28px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

h2 { margin: 3px 0 10px; font-size: clamp(1.45rem, 4vw, 2.1rem); line-height: 1.25; }
.muted { margin: 0; color: var(--muted); }
.panel-heading, .result-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.activated-badge { flex: none; padding: 5px 11px; border-radius: 999px; color: var(--green); background: #e7f6ef; font-size: .82rem; font-weight: 800; }

.activation-panel { display: grid; gap: 24px; }
.activation-form label { display: block; margin-bottom: 7px; font-weight: 800; }
.input-action { display: flex; gap: 10px; }
.input-action input { min-width: 0; flex: 1; text-transform: uppercase; letter-spacing: .08em; }

input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cfc9bb;
  border-radius: 12px;
  color: var(--ink);
  background: white;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(217, 85, 47, .25); outline-offset: 2px; border-color: var(--accent); }

button { min-height: 44px; padding: 9px 16px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 800; }
button:disabled { cursor: wait; opacity: .65; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: var(--ink); border: 1px solid var(--line); background: white; }
.secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.large { min-height: 52px; padding-inline: 26px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { display: block; margin-bottom: 7px; font-weight: 800; }
.field b { color: var(--accent); }
.field small { display: block; margin-top: 5px; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.selling-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.selling-points legend, .selling-points small { grid-column: 1 / -1; }
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-group legend { width: 100%; }
.choice-group label { position: relative; flex: 1; min-width: 100px; }
.choice-group input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-group span { display: grid; min-height: 46px; place-items: center; border: 1px solid #cfc9bb; border-radius: 12px; background: white; font-weight: 700; cursor: pointer; }
.choice-group input:checked + span { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-group input:focus-visible + span { outline: 3px solid rgba(217, 85, 47, .25); outline-offset: 2px; }
.submit-row { display: flex; align-items: center; gap: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.submit-row p { margin: 0; color: var(--muted); font-size: .9rem; }

.status { margin: 16px 0; padding: 13px 16px; border: 1px solid #efb9a7; border-radius: 12px; color: #832d18; background: var(--accent-soft); }
.status.success { border-color: #9bcdbb; color: #125e44; background: #eaf7f2; }
.warning-box { margin-bottom: 16px; padding: 16px 18px; border: 1px solid #e6bd68; border-radius: 14px; background: #fff8df; }
.warning-box strong { display: block; }
.warning-box ul { margin: 8px 0 0; padding-left: 20px; }

.result-panel { margin-top: 30px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#result-content { display: grid; gap: 16px; margin-top: 24px; }
.result-block { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: white; }
.result-block-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); background: #fbf8f1; }
.result-block-header h3 { margin: 0; font-size: 1.06rem; }
.copy-button { min-height: 36px; padding: 6px 11px; color: var(--accent-dark); background: var(--accent-soft); font-size: .82rem; }
.result-body { padding: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-body p { margin: 0 0 9px; }
.result-body p:last-child { margin-bottom: 0; }
.shot-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.shot-table th, .shot-table td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.shot-table th { background: #fbf8f1; white-space: nowrap; }

footer { width: min(1080px, calc(100% - 32px)); margin: 42px auto 0; padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer p { margin: 0 0 6px; }
.hidden { display: none !important; }

.guide-main { max-width: 820px; }
.guide-card h2 { margin-top: 0; }
.guide-card h3 { margin: 24px 0 8px; }
.guide-card ol, .guide-card ul { padding-left: 1.35rem; }
.guide-card li { margin-bottom: 10px; }
.tip { padding: 14px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); }

.seller-main { max-width: 760px; }
.seller-hero { padding-bottom: 24px; }
.seller-card { padding: clamp(20px, 5vw, 32px); }
.seller-form { display: grid; gap: 16px; }
.seller-form-spaced { margin-top: 20px; }
.seller-primary { width: 100%; min-height: 58px; font-size: 1.05rem; }
.seller-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.seller-stats div { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.seller-stats span { display: block; color: var(--muted); font-size: .9rem; }
.seller-stats strong { display: block; margin-top: 2px; font-size: 2rem; line-height: 1.2; }
.code-display { margin: 8px 0 18px; color: var(--accent-dark); font-size: clamp(1.45rem, 7vw, 2.3rem); font-weight: 900; letter-spacing: .08em; overflow-wrap: anywhere; }
.delivery-text { width: 100%; margin-bottom: 14px; padding: 14px; border: 1px solid #cfc9bb; border-radius: 12px; color: var(--ink); background: white; font: inherit; resize: vertical; }

@media (max-width: 720px) {
  .topbar { min-height: 58px; }
  .brand { font-size: .94rem; }
  .brand-mark { width: 32px; height: 32px; }
  main { width: min(100% - 22px, 1080px); }
  .hero { padding: 42px 4px 24px; }
  .hero h1 { font-size: 2.35rem; }
  .panel, .result-panel, .guide-card { padding: 19px 15px; border-radius: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-wide { grid-column: auto; }
  .selling-points { grid-template-columns: 1fr; }
  .selling-points legend, .selling-points small { grid-column: auto; }
  .input-action, .submit-row, .result-toolbar, .panel-heading { align-items: stretch; flex-direction: column; }
  .input-action button, .submit-row button { width: 100%; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-actions .primary { grid-column: 1 / -1; }
  .activated-badge { align-self: flex-start; }
  .shot-table, .shot-table tbody, .shot-table tr, .shot-table th, .shot-table td { display: block; }
  .shot-table thead { display: none; }
  .shot-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .shot-table tr:last-child { border-bottom: 0; }
  .shot-table td { padding: 5px 12px; border: 0; }
  .shot-table td::before { content: attr(data-label) "："; color: var(--muted); font-weight: 800; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
