/* 基础排版与通用组件：无外部字体、无外部资源 */

:root {
  --ink-deep: #070b1a;
  --night-1: #0b1026;
  --night-2: #16203f;
  --night-3: #1e2a52;
  --moon: #ffeec2;
  --gold: #ffd98a;
  --amber: #ffb347;
  --ember: #ff7a45;
  --jade: #7fd1b9;
  --danger: #ff9a9a;
  --text: #f7f1e6;
  --text-dim: rgba(247, 241, 230, 0.74);
  --text-faint: rgba(247, 241, 230, 0.52);
  --panel: rgba(18, 26, 52, 0.74);
  --panel-strong: rgba(12, 18, 38, 0.9);
  --line: rgba(255, 217, 138, 0.22);
  --line-soft: rgba(247, 241, 230, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-panel: 0 20px 50px rgba(3, 7, 18, 0.5);
  --glow-warm: 0 0 32px rgba(255, 179, 71, 0.32);
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--ink-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
dl,
dd,
dt,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 4.5vw, 28px) 40px;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 4vw, 28px);
  min-height: 100vh;
  min-height: 100dvh;
}

.masthead {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 10px;
}

.masthead__title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 7.2vw, 40px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--moon);
  text-shadow: 0 0 22px rgba(255, 205, 120, 0.45), 0 4px 18px rgba(3, 7, 18, 0.6);
}

.masthead__subtitle {
  font-family: var(--font-kai);
  font-size: clamp(13px, 3.6vw, 16px);
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-shadow: 0 2px 14px rgba(4, 8, 20, 0.92);
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: clamp(18px, 5vw, 30px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel__title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--moon);
}

.panel__hint {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
}

.notice {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ffe6c2;
  background: rgba(255, 179, 71, 0.12);
  border: 1px solid rgba(255, 179, 71, 0.28);
  border-radius: var(--radius-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: transparent;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn--primary {
  color: #3a1a05;
  background: linear-gradient(140deg, var(--gold), var(--amber) 65%, var(--ember));
  box-shadow: 0 10px 26px rgba(255, 158, 66, 0.32);
}

.btn--primary:hover {
  box-shadow: 0 14px 32px rgba(255, 158, 66, 0.42);
}

.btn--ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.btn--ghost:hover {
  border-color: rgba(255, 217, 138, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.btn--small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.footer {
  position: relative;
  z-index: 2;
  padding: 0 20px 32px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.noscript {
  position: relative;
  z-index: 3;
  margin: 40px auto;
  padding: 16px 20px;
  max-width: 480px;
  text-align: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 20, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog {
  width: min(100%, 400px);
  padding: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.dialog__title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--moon);
}

.dialog__body {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
}

.dialog__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}

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