:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: #f7f0e6;
  color: #241c17;
  --bg: #f7f0e6;
  --bg-soft: #fffaf3;
  --card: rgba(255, 252, 247, 0.88);
  --border: rgba(74, 57, 44, 0.16);
  --text-soft: #6f5c4d;
  --accent: #8d5a2b;
  --accent-strong: #6f431a;
  --danger: #a0342b;
  --shadow: 0 16px 40px rgba(91, 63, 33, 0.09);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(236, 193, 135, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(194, 145, 89, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
  color: var(--color, #241c17);
}

.page-shell {
  box-sizing: border-box;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 44px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.72;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

img {
  max-width: 100%;
  display: block;
}

.page-shell > * + * {
  margin-top: 18px;
}

.hero,
.subpage-head,
.auth-card,
.card,
.empty-state,
.stat-card,
.notice,
.form {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero,
.subpage-head,
.auth-card,
.empty-state {
  border-radius: 24px;
  padding: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  color: var(--text-soft);
  font-size: 1.02rem;
}

.form-hint {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.meta-line {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.stack {
  display: grid;
  gap: 18px;
}

.card {
  border-radius: 18px;
  padding: 18px;
}

.comic-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comic-feature {
  margin: 0;
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.comic-feature img,
.comic-placeholder {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f5efe7;
}

.comic-placeholder {
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--text-soft);
  font-size: 0.96rem;
  text-align: center;
  line-height: 1.7;
}

.comic-feature figcaption {
  padding: 0 14px 14px;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.comic-tile {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.comic-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f5efe7;
}

.comic-tile figcaption {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.comic-tile figcaption span {
  color: var(--accent-strong);
  font-weight: 700;
}

.card h2 {
  margin-top: 6px;
}

.card p + p,
.card h2 + p,
.subpage-head > * + *,
.hero > * + * {
  margin-top: 10px;
}

.empty-state {
  text-align: center;
}

.empty-state h2 + p {
  margin-top: 8px;
}

.notice {
  border-radius: 16px;
  padding: 14px 16px;
}

.notice.error {
  color: #7e2119;
  background: rgba(168, 52, 43, 0.08);
}

.notice.success {
  color: #1e5b39;
  background: rgba(51, 132, 89, 0.11);
}

.form {
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.form-wide {
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

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

input,
textarea,
select {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  color: inherit;
  box-sizing: border-box;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.card-code-block {
  display: grid;
  gap: 12px;
}

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

.json-block {
  min-height: 320px;
  resize: vertical;
  overflow: auto;
  white-space: pre;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button-secondary {
  background: #eadcc9;
  color: #3f2e22;
}

.button-secondary:hover {
  background: #dcc7ad;
}

.button-ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--border);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #882a22;
}

.button-small {
  padding: 9px 14px;
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-wrap {
  margin-top: 12px;
}

.subtle-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.subtle-actions .meta-line {
  flex: 1;
}

.grid-two {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.section-heading p {
  color: var(--text-soft);
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.stat-card strong {
  font-size: 1.8rem;
}

.text-link,
.back-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-card {
  width: min(100%, 520px);
}

.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 20px;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 30px;
  }

  .grid-two,
  .grid-three,
  .stats,
  .comic-grid {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
  }

  .auth-page {
    min-height: auto;
    padding: 0;
  }
}
