:root {
  /* 绿光童趣手账绘本风配色系统 */
  --paper: #faf6ea;
  --paper-grid: rgba(186, 178, 152, 0.24);
  --paper-deep: #efe9d8;
  --card: #fffdf7;
  --ink: #24332a;
  --muted: #5b6d60;

  --green: #257a55;
  --green-bright: #48a97c;
  --green-hover: #1e6747;
  --green-soft: #e6f5ec;

  --honey: #eab338;
  --honey-soft: #fff6dc;
  --coral: #e67e5e;
  --coral-soft: #fff0e8;
  --sky: #6ea8e5;
  --sky-soft: #edf5fe;
  --lilac: #9f86e6;
  --lilac-soft: #f4f0ff;

  --line: #dfd9c7;
  --focus: #d96b38;
  --radius: 24px;
  --base-size: 20px;
}

body.font-large { --base-size: 23px; }
body.font-xlarge { --base-size: 26px; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  /* 绿光同款淡雅手账方格底纹 + 柔和暖光晕 */
  background-image:
    radial-gradient(circle at 12% 8%, rgba(167, 224, 191, 0.32), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(255, 222, 156, 0.32), transparent 36%),
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px, 28px 28px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: var(--base-size);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #e6e0ce;
}

.topbar-inner,
.container,
.footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px 5px 6px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  min-height: 52px;
}
.brand-btn:hover { background: var(--green-soft); border-color: #bfe0cd; transform: none; }

.brand-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--green-bright);
  background: #fdf9ee;
  box-shadow: 0 3px 8px rgba(37, 122, 85, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.brand-text strong {
  font-family: "Kaiti SC", "STKaiti", "Songti SC", Georgia, serif;
  font-size: 1.25em;
  color: var(--green);
}
.brand-text small {
  font-size: 0.68em;
  color: var(--muted);
  font-weight: 500;
}

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

/* Icons */
.icon {
  width: 1.08em;
  height: 1.08em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}

/* Cute Bouncy Buttons */
button, select, input, textarea {
  font: inherit;
  color: inherit;
}

button, select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid #c9d8cc;
  background: #ffffff;
  box-shadow: 0 3px 0 #d9e2d8;
  cursor: pointer;
  font-weight: 650;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

button:hover:not(:disabled) {
  background: var(--green-soft);
  border-color: var(--green-bright);
  transform: translateY(-1px);
}
button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #d9e2d8;
}

button.primary, button.selected {
  background: linear-gradient(180deg, #329469 0%, #257a55 100%);
  color: #fff;
  border-color: #1f6a49;
  box-shadow: 0 4px 0 #19563b;
}
button.primary:hover:not(:disabled), button.selected:hover:not(:disabled) {
  background: linear-gradient(180deg, #39a576 0%, #2a875e 100%);
  border-color: #1f6a49;
}

button.warm {
  background: linear-gradient(180deg, #fff3d6 0%, #fde6b4 100%);
  border-color: #e6ba63;
  color: #6b4308;
  box-shadow: 0 4px 0 #e2c07a;
}
button.warm:hover:not(:disabled) { background: #fce2a6; }

button.coral {
  background: linear-gradient(180deg, #ffefe9 0%, #fcdcd0 100%);
  border-color: #e9a38b;
  color: #7c3520;
  box-shadow: 0 4px 0 #e5b3a1;
}

button.subtle {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: 0 2px 0 #e6e0ce;
  font-weight: 600;
}

button.speaking {
  background: linear-gradient(180deg, #ef8b6d 0%, #d96949 100%);
  color: #fff;
  border-color: #c25738;
  box-shadow: 0 4px 0 #a3452a, 0 0 0 5px rgba(239, 139, 109, 0.28);
}

button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

select { border-radius: 16px; }

input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid #cdd8ce;
  background: #fff;
  line-height: 1.6;
}
textarea { resize: vertical; }

/* Notice bar */
.notice {
  position: sticky;
  top: 76px;
  z-index: 18;
  background: var(--honey-soft);
  color: #6a4408;
  border-bottom: 2px solid #efd08c;
  padding: 10px clamp(16px, 4vw, 40px);
  font-weight: 650;
  font-size: 0.92em;
}
.notice:empty { display: none; }

/* Main container */
.container {
  padding-top: 26px;
  padding-bottom: 48px;
  min-height: calc(100vh - 150px);
}

h1, h2, h3, p { margin: 0 0 0.65em; }
h1 {
  font-family: "Kaiti SC", "STKaiti", "Songti SC", Georgia, serif;
  font-size: clamp(1.75em, 3.6vw, 2.45em);
  line-height: 1.24;
  color: #1e3528;
}
h2 {
  font-family: "Kaiti SC", "STKaiti", "Songti SC", Georgia, serif;
  font-size: 1.4em;
  line-height: 1.3;
}
h3 { font-size: 1.08em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--honey-soft);
  color: #7c510a;
  border: 1px solid #efd291;
  font-weight: 700;
  font-size: 0.8em;
  margin-bottom: 10px;
}
.tag.green { background: var(--green-soft); color: var(--green); border-color: #bce0ca; }
.tag.sky { background: var(--sky-soft); color: #2b5f9e; border-color: #bdd8f6; }
.tag.coral { background: var(--coral-soft); color: #8c3d25; border-color: #f3c4b3; }

.meta, small { color: var(--muted); font-size: 0.86em; }
.em-sub { font-family: Georgia, serif; font-style: italic; color: var(--muted); font-weight: 400; font-size: 0.72em; margin-left: 6px; }

/* Panels & Cards */
.panel, details.card-details {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.6vw, 28px);
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(45, 74, 56, 0.06);
}
details.card-details summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.card-details summary::after {
  content: "点开 ▾";
  font-size: 0.85em;
  color: var(--green);
  background: var(--green-soft);
  padding: 4px 12px;
  border-radius: 999px;
}
details.card-details[open] summary::after { content: "收起 ▴"; }

/* Cute Welcome Hero (绿光吉祥物童趣风格) */
.welcome-banner {
  position: relative;
  background: linear-gradient(135deg, #eef9f1 0%, #fffaf0 58%, #eef6ff 100%);
  border: 2px solid #cce3d2;
  border-top: 6px solid var(--green-bright);
  border-radius: 28px;
  padding: clamp(22px, 3.4vw, 36px);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  box-shadow: 0 10px 28px rgba(37, 122, 85, 0.08);
}

.mascot-hero-wrap {
  position: relative;
  width: clamp(130px, 16vw, 185px);
  height: clamp(130px, 16vw, 185px);
  border-radius: 30px;
  background: #fdf9ee;
  border: 3px solid #fff;
  box-shadow: 0 8px 22px rgba(37, 122, 85, 0.16), 0 0 0 3px #cde6d6;
  overflow: hidden;
  flex-shrink: 0;
  animation: gentle-bob 4.5s ease-in-out infinite;
}
.mascot-hero-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes gentle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.welcome-copy p { color: var(--muted); max-width: 38em; }

.mascot-mini {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(37, 122, 85, 0.16);
  background: #fdf9ee;
  flex-shrink: 0;
}

.mascot-celebrate {
  width: 150px;
  height: 150px;
  border-radius: 28px;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(234, 179, 56, 0.25), 0 0 0 3px #f2d488;
  background: #fdf9ee;
  flex-shrink: 0;
}

.review-banner {
  background: linear-gradient(135deg, #fff6e4 0%, #fff0e7 100%);
  border: 2px solid #f0cca0;
  border-left: 7px solid var(--coral);
  border-radius: 22px;
  padding: 18px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Bookshelf Grid — 绿光色彩顶边手账卡片 */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.book-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-top: 6px solid var(--green-bright);
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(38, 66, 48, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-card:nth-child(2n) { border-top-color: var(--honey); }
.book-card:nth-child(3n) { border-top-color: var(--sky); }
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(38, 66, 48, 0.12);
}

.book-cover-wrap {
  background: radial-gradient(circle at 50% 30%, #ffffff, #e8f3ea 85%);
  padding: 24px;
  display: grid;
  place-items: center;
  min-height: 255px;
  border-bottom: 1.5px dashed #d6e2d6;
}
.book-card:nth-child(2n) .book-cover-wrap {
  background: radial-gradient(circle at 50% 30%, #ffffff, #fcf1d9 85%);
  border-bottom-color: #ebdcb8;
}

.book-cover-wrap img {
  width: min(100%, 255px);
  max-height: 235px;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #fff;
  box-shadow: 6px 8px 0 rgba(37, 122, 85, 0.14), 0 12px 24px rgba(38, 56, 40, 0.18);
}

.book-card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-card-body h2 { margin-bottom: 4px; }
.book-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
}
.pill.warm { background: var(--coral-soft); color: #9a4024; }
.pill.sky { background: var(--sky-soft); color: #2b5f9e; }

.book-card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
}

/* Reader layout */
.read-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.read-header h1 { font-size: clamp(1.4em, 2.5vw, 1.9em); margin-bottom: 0; }
.page-counter {
  background: var(--green-soft);
  color: var(--green);
  border: 1.5px solid #bfe0cc;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95em;
}

.progress-track {
  height: 10px;
  background: #e8e2cf;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--honey));
  border-radius: 99px;
  transition: width 0.25s ease;
}

.spread {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(330px, 1fr);
  gap: 22px;
  align-items: start;
}

.sheet {
  background: #fffdf7;
  border: 2px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(38, 66, 48, 0.08);
}

.picture-stage {
  background: #eef3ea;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  touch-action: pan-y;
  padding: 8px;
}

.picture-stage img {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 14px;
}

.sheet-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
  border-top: 2px dashed #e5e0cf;
  background: var(--card);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.speed-select {
  min-height: 46px;
  padding: 6px 14px;
  font-size: 0.85em;
}

.companion-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.translation-card {
  background: var(--card);
  border: 2px solid #cbe2d3;
  border-top: 6px solid var(--green-bright);
  border-radius: 24px;
  padding: clamp(18px, 2.2vw, 26px);
  box-shadow: 0 6px 18px rgba(37, 122, 85, 0.07);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.88em;
  margin-bottom: 10px;
}

.cn-text {
  font-size: clamp(1.12em, 1.6vw, 1.32em);
  line-height: 1.78;
  margin-bottom: 16px;
}

.en-box {
  background: var(--sky-soft);
  border: 1px solid #cce0f7;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-family: Georgia, serif;
  font-size: 0.92em;
  line-height: 1.6;
  color: #304966;
}

.clue-card {
  background: var(--honey-soft);
  border: 2px dashed #e8c26d;
  border-radius: 24px;
  padding: 16px 20px;
}
.clue-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.clue-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
}
.clue-list li { margin-bottom: 8px; }

.think-card {
  background: var(--coral-soft);
  border: 2px solid #f2c6b4;
  border-radius: 24px;
  padding: 18px 22px;
}
.think-card h3 { color: #8c3c22; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.think-card p { margin: 8px 0 12px; }

.ai-reply-bubble {
  background: var(--green-soft);
  border: 1.5px solid #bfe0cb;
  border-left: 6px solid var(--green-bright);
  border-radius: 18px;
  padding: 16px 20px;
  margin-top: 12px;
}

/* Sticky reader navigation */
.reader-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: 22px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: blur(10px);
  border: 2px solid #e5dfcc;
  border-radius: 24px 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Quiz / Reflection */
.quiz-wrap { max-width: 920px; margin: 0 auto; }
.opts-list { display: grid; gap: 12px; }
.opts-list button {
  justify-content: flex-start;
  text-align: left;
  padding: 16px 22px;
  border-radius: 18px;
  line-height: 1.5;
}

.pic-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.pic-choice-btn {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  border-radius: 20px;
  text-align: left;
  gap: 10px;
  height: auto;
}
.pic-choice-btn img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-radius: 12px;
  background: #e4e9de;
}

.order-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 1.08em;
  font-weight: 800;
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.order-summary {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--honey-soft);
  border: 1.5px solid #edd28f;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mic-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}
.mic-status { color: #9a4024; font-weight: 650; font-size: 0.9em; }

/* Celebration Hero */
.celebrate-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Records & Family notes */
.family-note {
  background: var(--honey-soft);
  border: 1.5px solid #eed08a;
  border-left: 6px solid var(--honey);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 12px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

label.field { display: block; margin-bottom: 14px; font-weight: 650; }
label.field small { display: block; font-weight: 400; margin-top: 4px; }

/* Footer */
.site-footer {
  border-top: 2px dashed #dfd9c7;
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.86em;
  background: rgba(255, 253, 247, 0.65);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.link-btn {
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  font-weight: 500;
}
.link-btn:hover { background: var(--green-soft); color: var(--green); }

/* Zoom Dialog */
.zoom-dialog {
  border: 3px solid #cce3d2;
  border-radius: 24px;
  padding: 0;
  width: min(96vw, 1180px);
  max-height: 94vh;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.zoom-dialog::backdrop { background: rgba(20, 32, 24, 0.68); backdrop-filter: blur(4px); }
.zoom-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 2px solid #e6e0ce;
}
.zoom-audio { display: flex; gap: 8px; flex-wrap: wrap; }
.zoom-body { padding: 16px; text-align: center; }
.zoom-body img { max-width: 100%; max-height: 70vh; width: auto; border-radius: 12px; margin: 0 auto; display: block; }
.zoom-caption { max-width: 38em; margin: 14px auto 4px; font-size: 1.15em; line-height: 1.7; text-align: left; }

@media (max-width: 900px) {
  .spread { grid-template-columns: 1fr; }
  .picture-stage img { max-height: 52vh; }
}

@media (max-width: 680px) {
  .welcome-banner { grid-template-columns: 1fr; text-align: left; }
  .mascot-hero-wrap { width: 124px; height: 124px; }
  .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
  button, select { min-height: 48px; padding: 8px 16px; font-size: 0.94em; }
  .shelf-grid { grid-template-columns: 1fr; }
}
