@font-face {
  font-family: "UwayReportCustom";
  src: url("/static/fonts/report_font.ttf") format("truetype");
  font-display: swap;
}

:root {
  --page-max-width: 520px;
  --page-ratio: 1463 / 2048;
  --bg-start: #0f172a;
  --bg-end: #1e293b;
  --card-bg: rgba(255, 255, 255, 0.12);
  --card-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-subtle: rgba(248, 250, 252, 0.78);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.35);
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-report: "UwayReportCustom", "FangSong", "SimSun", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(236, 72, 153, 0.22), transparent 28%),
    radial-gradient(circle at bottom, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.site-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 24px 16px 96px;
}

.hero,
.lookup-card,
.report-meta,
.empty-state {
  backdrop-filter: blur(16px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}

.hero {
  border-radius: 28px;
  padding: 24px 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.1;
}

.hero p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 15px;
  line-height: 1.7;
}

.hero-tip {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: rgba(248, 250, 252, 0.62) !important;
  word-break: break-all;
}

.lookup-card {
  border-radius: 24px;
  padding: 18px;
  margin-top: 18px;
}

.lookup-form {
  display: grid;
  gap: 14px;
}

.input-wrap {
  display: grid;
  gap: 8px;
}

.input-wrap span {
  font-size: 14px;
  color: var(--text-subtle);
}

.input-wrap input {
  height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.34);
  color: var(--text-main);
  outline: none;
}

.input-wrap input:focus {
  border-color: rgba(248, 113, 113, 0.65);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.lookup-form button {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #fb7185, #ef4444);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(239, 68, 68, 0.22);
}

.lookup-form button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.status-bar {
  min-height: 24px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-subtle);
}

.status-bar.is-error {
  color: #fecaca;
}

.status-bar.is-success {
  color: #bbf7d0;
}

.report-meta {
  display: grid;
  gap: 6px;
  margin: 20px auto 0;
  padding: 16px 18px;
  width: min(100%, var(--page-max-width));
  border-radius: 22px;
}

.report-meta h2 {
  margin: 0;
  font-size: 22px;
}

.report-meta p {
  margin: 0;
  font-size: 14px;
  color: var(--text-subtle);
  line-height: 1.6;
}

.report-pages {
  display: grid;
  gap: 22px;
  margin-top: 20px;
  justify-items: center;
}

.empty-state {
  width: min(100%, var(--page-max-width));
  border-radius: 24px;
  padding: 22px 20px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--text-subtle);
  line-height: 1.7;
}

.report-page {
  position: relative;
  width: min(100%, var(--page-max-width));
  aspect-ratio: var(--page-ratio);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  scroll-snap-align: start;
  background: rgba(15, 23, 42, 0.45);
  container-type: inline-size;
}

.page-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page-field,
.page-copy {
  position: absolute;
  z-index: 2;
  font-family: var(--font-report);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.page-field {
  font-size: 3cqw;
  line-height: 1.2;
  font-weight: 600;
}

.page-copy {
  color: #2b2323;
}

.page-copy h3,
.page-copy p,
.page-copy ul,
.page-copy li {
  font-family: inherit;
}

.page-copy ul {
  margin: 0;
  padding-left: 1.2em;
}

.page-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 72%, rgba(15, 23, 42, 0.08));
  z-index: 1;
}

.page-static::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bgm-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  min-width: 108px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.bgm-toggle.is-playing {
  background: linear-gradient(135deg, #fb7185, #ef4444);
}

@media (min-width: 768px) {
  .site-shell {
    padding-top: 34px;
  }

  .lookup-form {
    grid-template-columns: 1fr 220px;
    align-items: end;
  }
}

@media (max-width: 420px) {
  .site-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero,
  .lookup-card,
  .report-meta,
  .empty-state {
    border-radius: 20px;
  }

  .report-page {
    border-radius: 18px;
  }
}
