/* Interaction layer: theme and layout refinements for the existing night sky. */
:root { --soft: #b1a3c5; --error: #ffc3ca; --motion: 160ms; }
body { isolation: isolate; }
body.modal-open { overflow: hidden; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn.primary { color: #1a0b32; }
.btn:hover { transform: none; border-color: var(--lilac); }
.btn:active:not(:disabled), .chip:active { background-color: rgba(196,168,255,.16); }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-180%); padding: 12px; background: var(--gold); color: var(--bg); border-radius: 8px; }
.skip-link:focus { transform: none; }
.topbar nav { flex-wrap: wrap; gap: 8px 20px; }
.topbar nav a, .topbar nav button { display: inline-flex; align-items: center; min-height: 40px; }
.brand-mark { display: inline-block; }
.wrap { padding-top: 40px; }
.hero { padding-top: 48px; padding-bottom: 72px; }
.hero p { line-height: 1.9; }
.section-heading p, .feature > p, .deep-cta p { font-size: 14px; line-height: 1.85; }
.mini-note, .fine, .sandbox, .trust { font-size: 12px !important; line-height: 1.8; }
.kicker { line-height: 1.8; letter-spacing: 1.4px; }
.dream-panel label span { font-variant-numeric: tabular-nums; font-family: "DM Mono", monospace; font-size: 12px; }
textarea, input { font: inherit; font-size: 16px; line-height: 1.8; }
textarea::placeholder, input::placeholder { color: #a293b5; opacity: 1; }
textarea[aria-invalid="true"] { border-color: var(--error); }
.input-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 4px 0 10px; font-size: 12px; color: var(--soft); }
.input-meta button { min-height: 40px; }
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.suggestions > span { color: var(--soft); font-size: 12px; margin-right: 4px; }
.chip { min-height: 40px; padding: 8px 14px; color: var(--muted); background: #22163b; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; transition: color var(--motion), border-color var(--motion); }
.chip:hover, .chip:focus-visible { border-color: var(--lilac); color: var(--ink); }
.field-error { color: var(--error); font-size: 13px; line-height: 1.8; background: rgba(200,60,90,.10); border: 1px solid rgba(255,160,180,.24); border-radius: 9px; padding: 10px 12px; margin: 14px 0; overflow-wrap: anywhere; }
.inline-status, .notice { background: rgba(242,203,140,.07); border: 1px solid rgba(242,203,140,.26); padding: 12px 16px; border-radius: 10px; color: #e8d2ae; font-size: 13px; line-height: 1.8; }
.notice { margin-bottom: 20px; }
.result { white-space: normal; font-size: 14px; line-height: 1.85; }
.result p { white-space: pre-line; }
.result.is-stale:before { content: "梦境已修改，下方是上次解读。点击免费速解即可更新。"; display: block; margin-bottom: 16px; color: var(--gold); font-size: 12px; }
.result li { margin: 10px 0; }
.symbol-result { padding: 16px 0; border-bottom: 1px solid var(--line); }
.symbol-result > b { color: var(--lilac); }
.symbol-result p { margin: 8px 0; }
.action-tip { font-size: 13px; color: #d2c3e6; }
.result-next { padding-top: 8px; color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.text-button { background: transparent; color: var(--muted); padding-left: 12px; padding-right: 12px; }
.quiz-field { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }
.quiz-field legend { font-weight: 600; font-size: 16px; line-height: 1.7; margin-bottom: 16px; color: var(--ink); }
.quiz-option { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer; line-height: 1.7; transition: border-color var(--motion), background-color var(--motion); }
.quiz-option input { width: 18px; height: 18px; flex: 0 0 18px; margin: 3px 0 0; accent-color: var(--violet); }
.quiz-option:has(input:checked) { background: rgba(169,135,255,.14); border-color: var(--violet); }
.quiz-option:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.quiz-controls { justify-content: space-between; }
.progress { font-size: 12px; line-height: 1.8; min-height: 35px; }
.ask-box label { margin-top: 22px; }
.ask-box .full { margin-top: 8px; }
#orderRecovery h2 { margin: 10px 0; font-size: 23px; }
#orderMessage { color: var(--muted); font-size: 14px; }
#orderNumber { overflow-wrap: anywhere; }
.modal-mask { padding: 24px; overscroll-behavior: contain; }
.modal { max-height: calc(100dvh - 48px); padding-top: 42px; scrollbar-width: thin; scrollbar-color: #694a97 #1b1031; overscroll-behavior: contain; }
.modal h2 { padding-right: 16px; line-height: 1.5; }
.modal > p { font-size: 14px; line-height: 1.85; }
.close { display: grid; place-items: center; width: 44px; height: 44px; right: 8px; top: 6px; border-radius: 8px; }
.close:hover { background: rgba(255,255,255,.07); }
.dream-preview { margin: 20px 0 8px; max-height: 150px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--gold); background: rgba(0,0,0,.18); padding: 14px 18px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.pay-modal .price { margin-top: 18px; }
.pay-modal .sandbox { text-align: left; }
.report-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.report-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.report-dream { margin-top: 18px; color: var(--muted); font-size: 13px; }
.report-dream summary { min-height: 40px; cursor: pointer; color: var(--lilac); padding: 8px 0; }
.report-dream p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.report-section { scroll-margin-top: 20px; }
.report-date { overflow-wrap: anywhere; font-size: 12px; line-height: 1.9; }
.report-item p { font-size: 14px; line-height: 1.95; }
.report-item b { font-size: 14px; }
.library-item { border: 1px solid var(--line); padding: 18px; border-radius: 12px; margin: 16px 0; }
.library-item > p { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.library-item > p:not(.mini-note) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.library-item > .btn { margin-top: 8px; }
.empty-state { border: 1px dashed var(--line); text-align: center; padding: 28px 18px; border-radius: 12px; color: var(--muted); }
.toast { position: fixed; bottom: max(22px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; background: #322044; border: 1px solid #8f75a5; box-shadow: 0 8px 32px #0006; color: var(--ink); border-radius: 12px; z-index: 50; font-size: 13px; }
.toast button { min-height: 32px; color: var(--gold); background: none; border: 0; margin-left: 8px; text-decoration: underline; }
footer .link-btn { font-size: 12px; min-height: 40px; }
@media(max-width:720px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar nav { width: 100%; gap: 4px 16px; }
  .topbar nav a:nth-child(2), .topbar nav a:nth-child(3) { display: inline-flex; }
  .topbar nav a, .topbar nav button { font-size: 12px; }
  .wrap { padding-top: 12px; }
  .hero { padding-top: 24px; padding-bottom: 48px; }
  .hero .trust { gap: 6px 10px; }
  h1 { font-size: clamp(30px,8.7vw,42px); letter-spacing: -1px; }
  .hero p { font-size: 15px; }
  .moon { top: 170px; opacity: .55; }
  .section-heading h2 { font-size: 23px; }
  .modal-mask { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); padding: 42px 20px 24px; }
  .modal h2 { font-size: 23px; }
  .button-row > .btn { flex: 1 1 auto; }
  .input-meta { font-size: 11px; }
  .dream-panel, .feature { padding: 20px; }
  .deep-cta { padding: 24px 20px; }
  .quick-row { gap: 8px; }
  .suggestions .chip { padding: 8px 12px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } .btn, .chip, .quiz-option { transition: none; } }
