* { box-sizing: border-box; }
:root { color-scheme: light; --paper: #f4f1e8; --ink: #263d42; --muted: #627679; --line: #d8e1da; --green: #23695d; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 1px solid #bdcec5; background: #fffef8; color: var(--ink); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 650; touch-action: manipulation; }
button:hover:not(:disabled) { background: #edf4e9; border-color: #5e9486; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #d59b33; outline-offset: 3px; }
[hidden] { display: none !important; }
.page { max-width: 1180px; margin: auto; padding: 24px 32px 0; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.back-home { display: inline-flex; align-items: center; min-height: 44px; color: #47645e; font-size: 14px; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lab-mark { font-size: 12px; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.lab-mark span { color: #b78336; font-size: 22px; vertical-align: middle; }
.hero { padding: 36px 0 28px; }
.eyebrow { margin: 0 0 7px; color: #64817a; font-size: 10px; font-weight: 750; letter-spacing: 2px; }
h1 { margin: 0 0 13px; font-size: clamp(34px, 5vw, 52px); line-height: 1.25; letter-spacing: 1px; font-weight: 800; }
h1 span { color: #cb9252; }
.lead { color: #5d7275; margin: 0; font-size: 16px; line-height: 1.9; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-tags span { padding: 4px 10px; border-radius: 6px; font-size: 11px; color: #547069; background: #e7eadd; }
.puzzle-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.puzzle-actions button { min-height: 46px; font-size: 13px; font-weight: 600; }
.notice { margin: 0 0 12px; padding: 12px 15px; border: 1px solid #dfc68c; border-radius: 12px; background: #fff7df; color: #715b2b; font-size: 12px; }
.notice p { margin: 3px 0; }
.lab-layout, .bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 22px; align-items: start; }
.panel { min-width: 0; background: #fffef9; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 5px 0 #e8e9dd; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
h2 { font-size: 20px; line-height: 1.4; margin: 0; letter-spacing: .3px; }
.paperclip { align-self: start; font-size: 36px; line-height: 1; color: #bac5b5; transform: rotate(-20deg); }
.note-mark { color: #b6bfae; font-size: 20px; white-space: nowrap; font-family: ui-monospace, monospace; }
.puzzle-meta, .meter { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.puzzle-meta { color: #75847d; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.puzzle-meta code { letter-spacing: 1.3px; color: #526c63; font-family: ui-monospace, monospace; }
.meter { padding: 13px 0 7px; color: #688079; }
.meter strong { color: var(--green); font-size: 18px; }
.input-guide { font-size: 12px; color: #5b746c; margin: 12px 0; }
.input-guide strong { font-weight: 650; white-space: nowrap; }
.draft { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; height: 104px; padding: 7px 2px; background: #f7f8ee; border: 1px dashed #bdcdbb; border-radius: 13px; }
.slot[aria-pressed="true"] { background: #edf5e7; border: 2px solid #427b66; box-shadow: 0 0 0 3px #e3edda; }
.slot-number { position: absolute; left: 7px; top: 4px; font-size: 9px; color: #a1ae9d; font-weight: 500; }
.slot-empty { color: #b6c0ab; font-weight: 400; font-size: 26px; line-height: 40px; }
.slot-caption { font-size: 10px; line-height: 1.4; color: #5f7467; }
.symbol-svg { width: 30px; height: 30px; overflow: visible; flex-shrink: 0; color: var(--symbol-ink, #547069); }
.symbol-svg .shape { fill: var(--symbol-fill); stroke: var(--symbol-ink); stroke-width: 1.5; stroke-linejoin: round; }
.symbol-a { --symbol-fill: #aad8c1; --symbol-ink: #24694e; }
.symbol-b { --symbol-fill: #efcc86; --symbol-ink: #937025; }
.symbol-c { --symbol-fill: #a9c8e2; --symbol-ink: #426d91; }
.symbol-d { --symbol-fill: #d7bbe7; --symbol-ink: #7d5195; }
.symbol-e { --symbol-fill: #edb3a4; --symbol-ink: #a35643; }
.symbol-f { --symbol-fill: #cbd394; --symbol-ink: #737e32; }
.draft-status { min-height: 38px; padding-top: 9px; margin: 0 0 7px; font-size: 11px; color: #5c786c; }
.palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.symbol-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; min-height: 78px; padding: 9px 1px; background: #fafbf4; border-color: #dde5d8; border-radius: 10px; }
.symbol-choice .symbol-svg { width: 26px; height: 26px; }
.symbol-label { font-size: 10px; line-height: 1.3; white-space: nowrap; }
.edit-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.edit-actions button { padding: 9px 3px; font-size: 11px; border-color: #dce4d7; font-weight: 550; }
.primary { background: var(--green); color: #fffdf3; border-color: var(--green); }
.primary:hover:not(:disabled) { background: #1d574d; border-color: #1d574d; }
#submit { width: 100%; margin-top: 10px; min-height: 48px; letter-spacing: 1.2px; font-size: 14px; }
.live-status { margin: 12px 0 0; min-height: 44px; font-size: 12px; color: #537468; }
.result { padding: 14px; margin-top: 10px; border: 1px solid #e1e8d9; background: #f5f7ec; border-radius: 12px; }
.result h3 { font-size: 14px; margin: 0 0 5px; }
.result p { margin: 0; font-size: 11px; color: #60786b; }
.result[data-phase="won"] { border-color: #97c4a5; background: #eaf5e9; }
.result[data-phase="lost"] { border-color: #dac29b; background: #fcf3e4; }
.answer { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 13px; }
.answer-symbol { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 5px; flex: 1; background: #fffdf5; border: 1px solid #d9e0cf; border-radius: 9px; font-size: 10px; }
.save-note { font-size: 10px; color: #899383; margin: 14px 0 0; }
.history-guide { color: #728275; font-size: 11px; margin: -4px 0 14px; }
.history-guide strong { font-weight: 650; }
.history { display: grid; gap: 8px; }
.guess-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(108px, .95fr); align-items: center; gap: 7px; min-height: 69px; padding: 8px 10px; border: 1px solid #e5e9dd; border-radius: 11px; background: #fbfcf5; }
.guess-row[data-used="false"] { background: transparent; border-style: dashed; opacity: .68; }
.row-number { color: #a4af9c; font-size: 10px; font-family: ui-monospace, monospace; }
.guess-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; align-items: center; }
.guess-symbol { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.guess-symbol .symbol-svg { width: 22px; height: 22px; }
.guess-letter { font-size: 9px; line-height: 1.1; color: #63786b; }
.empty-symbol { width: 22px; height: 22px; display: block; border-radius: 6px; background: #edf0e5; border: 1px dashed #dce3d1; }
.feedback { padding-left: 9px; border-left: 1px solid #e0e8d7; font-size: 10px; line-height: 1.6; white-space: nowrap; }
.feedback .counts { display: flex; gap: 8px; }
.feedback strong { font-size: 14px; color: #3e6b57; margin-left: 3px; }
.feedback .misplaced { color: #a27d35; }
.absent-label, .waiting-label { color: #93a086; font-size: 9px; }
.bottom-grid { margin-top: 24px; }
.rulebook > p:not(.eyebrow), .rulebook dd { font-size: 12px; color: #697e71; }
.rules { margin: 17px 0; }
.rules > div { margin-bottom: 11px; }
.rules dt { font-size: 12px; color: #476851; font-weight: 700; }
.rules dd { margin: 3px 0 0 18px; }
.exact-dot, .misplaced-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #47806a; }
.misplaced-dot { background: #cfac56; }
.rule-example { padding: 12px; margin: 14px 0; background: #f2f4e9; border-left: 3px solid #c2d1b7; border-radius: 0 8px 8px 0; font-size: 11px; color: #677960; }
.rule-example > strong { color: #4d705c; }
.rule-example p { margin: 8px 0 0; line-height: 1.9; }
.rule-example b { font-weight: 550; }
.small-note { font-size: 10px !important; color: #85917d !important; line-height: 1.8; }
.count { color: #7a8e72; font-size: 11px; white-space: nowrap; }
.records { max-height: 322px; overflow-y: auto; padding: 1px 3px 3px 0; }
.empty-record { padding: 30px 5px; text-align: center; color: #a3b293; font-size: 12px; }
.record-item { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed #e1e7d7; }
.record-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.record-seed { font-size: 12px; font-family: ui-monospace, monospace; color: #617c60; }
.record-score, .record-date { font-size: 10px; color: #8b997e; }
.record-item button { min-width: 70px; font-size: 11px; padding: 8px; border-color: #d5dfc9; }
.share-panel { margin-top: 25px; padding: 15px 18px; border-radius: 12px; background: #e9eddf; color: #76866a; font-size: 11px; }
.share-panel p { margin: 0; }
.share-panel label { display: block; margin-top: 12px; margin-bottom: 5px; }
#share-fallback { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #bbcbb0; border-radius: 8px; color: #426647; background: #fbfdf3; font-size: 12px; }
footer { padding: 28px 0; text-align: center; color: #a2ad94; font-size: 10px; letter-spacing: 1px; }
footer span { padding: 0 5px; }
dialog { width: min(440px, calc(100% - 32px)); padding: 28px; border: 1px solid #c6d3be; border-radius: 20px; color: var(--ink); background: #fffef8; box-shadow: 0 20px 70px #1f3b3738; }
dialog::backdrop { background: #243e3d66; backdrop-filter: blur(3px); }
dialog h2 { font-size: 23px; }
dialog > p:not(.eyebrow) { font-size: 13px; color: #6d8072; margin: 14px 0 22px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.dialog-actions button { font-size: 12px; padding: 10px 5px; }
@media (max-width: 900px) {
  .page { padding-inline: 22px; }
  .lab-layout, .bottom-grid { gap: 16px; }
  .panel { padding: 18px; }
  .palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .symbol-choice { flex-direction: row; justify-content: center; gap: 6px; min-height: 48px; }
  .guess-row { grid-template-columns: 14px minmax(0, 1fr); padding: 8px; gap: 6px; min-height: 89px; }
  .feedback { grid-column: 2; border-left: none; padding-left: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .guess-values { gap: 7px; }
  .guess-symbol .symbol-svg { width: 26px; height: 26px; }
  .feedback .counts { gap: 12px; }
  h2 { font-size: 18px; }
}
@media (max-width: 650px) {
  .page { padding: 14px 16px 0; }
  .site-header { gap: 8px; }
  .lab-mark { letter-spacing: 0; font-size: 10px; }
  .back-home { font-size: 12px; }
  .hero { padding: 27px 0 23px; }
  .lead { font-size: 14px; }
  .puzzle-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .puzzle-actions button { font-size: 12px; }
  .lab-layout, .bottom-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .panel { padding: 18px 16px; border-radius: 17px; }
  .draft { gap: 8px; }
  .slot { height: 94px; }
  .palette { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .symbol-choice { min-height: 51px; }
  .symbol-label { font-size: 11px; }
  .guess-row { grid-template-columns: 16px minmax(0, 1fr) 123px; min-height: 69px; gap: 5px; padding: 8px; }
  .guess-symbol .symbol-svg { width: 21px; height: 21px; }
  .guess-values { gap: 1px; }
  .feedback { display: block; grid-column: auto; border-left: 1px solid #e0e8d7; padding-left: 8px; font-size: 9px; }
  .feedback .counts { gap: 7px; }
  .feedback strong { font-size: 13px; margin-left: 2px; }
  .history-guide { font-size: 10px; }
  .bottom-grid { margin-top: 20px; }
  .collection .section-heading { margin-bottom: 10px; }
  .share-panel { margin-top: 21px; }
  dialog { padding: 23px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  button:active:not(:disabled) { transform: none; }
}
