/* ------------------------------------------------------------------ */
/* 基础                                                                */
/* ------------------------------------------------------------------ */

:root {
  --paper: #fbf4e8;
  --paper-deep: #f4e6d3;
  --paper-light: #fffaf1;
  --card: #fffdf7;
  --ink: #3d2c25;
  --ink-soft: #5f4a3f;
  --muted: #8e7667;
  --muted-light: #b09a89;
  --coral: #e9775a;
  --coral-deep: #cf5f43;
  --coral-soft: #fbe3d8;
  --sage: #6f9578;
  --sage-soft: #e3ede2;
  --butter: #f2ce82;
  --line: rgba(83, 58, 43, 0.13);
  --line-strong: rgba(83, 58, 43, 0.22);
  --shadow-sm: 0 4px 18px rgba(80, 53, 36, 0.06);
  --shadow-md: 0 18px 50px rgba(80, 53, 36, 0.11);
  --shadow-lg: 0 34px 90px rgba(76, 48, 32, 0.18);
  --display: "KaiTi", "STKaiti", "Noto Serif SC", "Songti SC", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --latin: "Segoe UI", "Andika", "Trebuchet MS", sans-serif;
  --radius: 22px;
  --max: 1320px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.9), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(241, 206, 130, 0.16), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

body.in-studio #headerStart,
body.in-studio .nav-link[data-scroll] {
  display: none;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid rgba(233, 119, 90, 0.65);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-grain {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/* 通用组件                                                            */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 12px 23px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  background: var(--coral);
  border-color: var(--coral);
  color: #fffaf1;
  box-shadow: 0 10px 24px rgba(207, 95, 67, 0.24);
}

.btn-primary:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
  box-shadow: 0 14px 30px rgba(207, 95, 67, 0.3);
}

.btn-paper {
  background: rgba(255, 253, 247, 0.9);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-paper:hover {
  background: #fffdf8;
  border-color: rgba(83, 58, 43, 0.35);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: rgba(255, 253, 247, 0.7);
}

.btn-large {
  padding: 16px 30px;
  font-size: 15.5px;
}

.btn-small {
  padding: 8px 15px;
  font-size: 12.5px;
}

.btn-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 180ms ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.text-button,
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(142, 118, 103, 0.35);
  text-underline-offset: 4px;
}

.text-button:hover,
.link-button:hover {
  color: var(--coral-deep);
}

.link-button {
  color: var(--coral-deep);
  text-decoration-color: rgba(207, 95, 67, 0.3);
}

.icon-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.8);
  color: var(--ink-soft);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  background: #fffdf8;
  border-color: var(--line-strong);
  transform: rotate(3deg);
}

.section-kicker {
  display: block;
  color: var(--coral-deep);
  font-family: var(--latin);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 8px 15px 8px 11px;
  border: 1px solid rgba(110, 84, 62, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.68);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(233, 119, 90, 0.12);
}

/* ------------------------------------------------------------------ */
/* 顶部                                                                */
/* ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 15px clamp(20px, 4vw, 54px);
  border-bottom: 1px solid rgba(99, 70, 50, 0.08);
  background: rgba(251, 244, 232, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 43px;
  height: 43px;
  align-items: center;
  justify-content: center;
  border-radius: 13px 13px 13px 4px;
  background: var(--coral);
  color: #fffaf1;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 6px 14px rgba(207, 95, 67, 0.22);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px 10px 10px 3px;
  font-size: 19px;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.brand-text small {
  color: var(--muted-light);
  font-family: var(--latin);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  border: 0;
  background: none;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--coral-deep);
}

/* ------------------------------------------------------------------ */
/* 首页                                                                */
/* ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(380px, 0.97fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 86px) clamp(22px, 4vw, 54px) clamp(60px, 9vh, 110px);
}

.hero-copy {
  max-width: 610px;
  animation: rise-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(58px, 7vw, 92px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.hero h1 em {
  position: relative;
  z-index: 0;
  display: inline-block;
  isolation: isolate;
  color: var(--coral);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 3px;
  left: 6px;
  height: 12px;
  border-radius: 50%;
  background: rgba(242, 206, 130, 0.55);
  z-index: -1;
  transform: rotate(-1.2deg);
}

.hero-lead {
  margin: 27px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 31px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 31px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-list span {
  color: var(--sage);
  font-size: 11px;
}

.hero-visual {
  position: relative;
  min-height: 570px;
  animation: rise-in 850ms 120ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-sun {
  position: absolute;
  top: 4%;
  right: 7%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fbe6a8 0, #f2ce82 45%, rgba(242, 206, 130, 0) 72%);
  opacity: 0.72;
  filter: blur(2px);
}

.hero-scribble {
  position: absolute;
  color: rgba(111, 149, 120, 0.65);
  font-family: var(--latin);
  font-size: 30px;
  transform: rotate(-12deg);
}

.scribble-one {
  top: 9%;
  left: 5%;
}

.scribble-two {
  right: 2%;
  bottom: 21%;
  color: rgba(233, 119, 90, 0.55);
  font-size: 37px;
  transform: rotate(9deg);
}

.hero-book {
  position: absolute;
  top: 49%;
  left: 50%;
  width: min(390px, 70%);
  aspect-ratio: 4 / 5;
  transform: translate(-50%, -50%) rotate(4.5deg);
  filter: drop-shadow(0 35px 45px rgba(71, 43, 27, 0.2));
}

.hero-book-pages {
  position: absolute;
  inset: 8px -9px -9px 12px;
  border-radius: 4px 14px 14px 4px;
  background: repeating-linear-gradient(90deg, #eee0cb 0 2px, #fffaf0 2px 6px);
  box-shadow: 2px 2px 0 rgba(81, 55, 37, 0.1);
}

.hero-book-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 5px 16px 16px 5px;
  background: #f7ead5;
  box-shadow: inset 8px 0 14px -8px rgba(66, 42, 26, 0.45), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.hero-book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(102, 72, 50, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.hero-book-cover canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-tape {
  position: absolute;
  top: 17%;
  left: 40%;
  z-index: 3;
  padding: 8px 20px;
  background: rgba(244, 222, 177, 0.9);
  color: #72543d;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.08em;
  transform: rotate(-5deg);
  box-shadow: 0 5px 13px rgba(78, 50, 30, 0.08);
  clip-path: polygon(2% 0, 100% 4%, 98% 100%, 0 96%);
}

.hero-note {
  position: absolute;
  right: 0;
  bottom: 5%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 185px;
  padding: 18px 19px;
  border: 1px solid rgba(105, 77, 55, 0.12);
  border-radius: 4px;
  background: #fffdf6;
  box-shadow: 0 14px 36px rgba(71, 43, 27, 0.13);
  transform: rotate(4deg);
}

.hero-note::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 17px;
  background: rgba(223, 196, 150, 0.65);
  transform: translateX(-50%) rotate(-3deg);
}

.hero-note-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}

.hero-note-line {
  width: 26px;
  height: 2px;
  margin: 8px 0;
  background: var(--coral);
}

.hero-note-sub {
  color: var(--muted);
  font-size: 10.5px;
}

.hero-star {
  position: absolute;
  z-index: 4;
  color: var(--coral);
  font-family: var(--latin);
  animation: float 5s ease-in-out infinite;
}

.star-a {
  top: 20%;
  left: 12%;
  font-size: 24px;
}

.star-b {
  right: 7%;
  bottom: 34%;
  color: var(--sage);
  font-size: 20px;
  animation-delay: -2s;
}

/* 三个步骤 */

.how-it-works {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(22px, 4vw, 54px) 100px;
}

.section-heading {
  max-width: 600px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 9px 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 3.5vw, 43px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.step-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step-card {
  position: relative;
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.64);
  overflow: hidden;
}

.step-card:nth-child(2) {
  background: rgba(227, 237, 226, 0.48);
}

.step-card:nth-child(3) {
  background: rgba(251, 227, 216, 0.38);
}

.step-number {
  position: absolute;
  top: 17px;
  right: 19px;
  color: rgba(92, 66, 48, 0.26);
  font-family: var(--latin);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.step-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 94px;
  margin-bottom: 15px;
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.65);
  overflow: hidden;
}

.step-upload {
  gap: 12px;
}

.mini-photo {
  width: 55px;
  height: 70px;
  border: 3px solid #fffdf6;
  border-radius: 8px 8px 5px 5px;
  background:
    radial-gradient(circle at 50% 34%, #e3b28d 0 12px, transparent 13px),
    radial-gradient(circle at 50% 62%, #ecb83f 0 20px, transparent 21px),
    linear-gradient(155deg, #d8e6df, #adc8c5);
  box-shadow: 0 6px 14px rgba(71, 47, 31, 0.12);
  transform: rotate(-5deg);
}

.mini-plus {
  display: flex;
  width: 29px;
  height: 29px;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--coral);
  border-radius: 50%;
  color: var(--coral);
  font-size: 18px;
  line-height: 1;
}

.step-style {
  gap: 8px;
}

.step-style span {
  width: 34px;
  height: 58px;
  border-radius: 5px;
  background: #f3d8ac;
  border: 2px solid rgba(255, 253, 247, 0.8);
  transform: rotate(-5deg);
  box-shadow: 0 4px 11px rgba(70, 46, 30, 0.1);
}

.step-style span:nth-child(2) {
  height: 65px;
  background: linear-gradient(#c6d9d1, #9dbdb1);
  transform: rotate(3deg);
}

.step-style span:nth-child(3) {
  height: 55px;
  background: linear-gradient(#e9b9ad, #d98c80);
  transform: rotate(-2deg);
}

.step-style span:nth-child(4) {
  height: 64px;
  background: linear-gradient(#e4d9f2, #b8a9da);
  transform: rotate(6deg);
}

.step-read {
  flex-direction: column;
  gap: 8px;
}

.mini-line {
  width: 145px;
  height: 8px;
  border-radius: 99px;
  background: #d5c4b1;
}

.mini-line.short {
  width: 100px;
  align-self: flex-start;
  margin-left: 32px;
}

.mini-ruby {
  width: 145px;
  height: 15px;
  background: repeating-linear-gradient(90deg, transparent 0 6px, #eeb9aa 6px 11px, transparent 11px 19px);
  opacity: 0.8;
}

.step-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.01em;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ */
/* 创作台                                                              */
/* ------------------------------------------------------------------ */

.studio {
  max-width: 1450px;
  margin: 0 auto;
  padding: 26px clamp(18px, 3.5vw, 52px) 90px;
}

.studio-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.back-link {
  align-self: center;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--coral-deep);
}

.studio-title {
  flex: 1;
  text-align: center;
}

.studio-title h1 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.3;
}

.studio-title h1 span {
  color: var(--coral);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(420px, 500px) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 54px);
  align-items: start;
}

.controls {
  min-width: 0;
}

.panel {
  margin-bottom: 16px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  gap: 13px;
  margin-bottom: 18px;
}

.panel-index {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--latin);
  font-size: 10px;
  font-weight: 700;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* 上传 */

.drop-zone {
  position: relative;
  border: 1.5px dashed rgba(145, 111, 86, 0.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.75), transparent 46%),
    #fdf6e9;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--coral);
  background: #fff8ec;
}

.drop-zone.is-dragging {
  transform: scale(1.008);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 19px;
  text-align: center;
}

.upload-icon {
  display: flex;
  width: 57px;
  height: 57px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral-deep);
}

.upload-empty strong {
  font-size: 13.5px;
  font-weight: 700;
}

.upload-empty > span {
  margin: 4px 0 13px;
  color: var(--muted);
  font-size: 10.5px;
}

.upload-filled {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 13px;
}

.photo-thumb-wrap {
  position: relative;
  flex: 0 0 auto;
}

.photo-thumb-wrap img {
  width: 78px;
  height: 98px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 22%;
  border: 3px solid #fffdf7;
  box-shadow: 0 6px 16px rgba(78, 51, 33, 0.14);
}

.photo-status {
  position: absolute;
  right: -8px;
  bottom: -6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--sage);
  color: #fffdf7;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(63, 92, 70, 0.2);
}

.photo-status.warn {
  background: #bd8b45;
}

.upload-meta {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.upload-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.upload-meta > span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.upload-actions {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  background: rgba(255, 248, 236, 0.94);
  color: var(--coral-deep);
  font-family: var(--display);
  font-size: 21px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.drop-zone.is-dragging .drop-overlay {
  opacity: 1;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 2px 0;
  color: var(--muted);
  font-size: 11px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
}

.field-row label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.field-row input {
  width: 142px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #fffdf7;
  text-align: center;
  font-family: var(--display);
  font-size: 17px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-row input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 119, 90, 0.12);
}

.field-block {
  margin-top: 18px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.field-label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted-light);
  font-size: 10px;
}

.age-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.age-card {
  position: relative;
  padding: 11px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.age-card:hover {
  border-color: rgba(233, 119, 90, 0.45);
  transform: translateY(-1px);
}

.age-card.is-selected {
  border-color: var(--coral);
  background: var(--coral-soft);
  box-shadow: 0 0 0 1px var(--coral) inset;
}

.age-card strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.2;
}

.age-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.age-card em {
  display: inline-block;
  margin-top: 4px;
  color: var(--coral-deep);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
}

.age-card.is-selected span,
.age-card.is-selected em {
  color: #9a4b36;
}

/* 画风 */

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

.style-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffdf8;
  text-align: left;
  transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.style-card:hover {
  border-color: rgba(233, 119, 90, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(78, 51, 33, 0.09);
}

.style-card.is-selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 1.5px var(--coral) inset, 0 8px 20px rgba(207, 95, 67, 0.12);
}

.style-preview {
  position: relative;
  height: 103px;
  overflow: hidden;
  background: #f1e4d1;
}

.style-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.style-preview--crayon::before {
  inset: 6px;
  border: 2px solid rgba(255, 246, 222, 0.62);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(100, 67, 48, 0.2);
}

.style-preview--watercolor::before {
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 251, 235, 0.75), transparent 25%),
    radial-gradient(circle at 92% 88%, rgba(146, 185, 157, 0.5), transparent 40%),
    radial-gradient(circle at 84% 6%, rgba(255, 255, 255, 0.35), transparent 25%);
  mix-blend-mode: screen;
}

.style-preview--clay::before {
  inset: 5px;
  border-radius: 9px;
  box-shadow:
    inset 3px 4px 7px rgba(255, 250, 238, 0.65),
    inset -3px -4px 9px rgba(92, 58, 44, 0.22);
}

.style-preview--papercut::before {
  background:
    linear-gradient(135deg, rgba(246, 210, 148, 0.9) 0 8px, transparent 8px),
    linear-gradient(225deg, rgba(223, 119, 94, 0.85) 0 9px, transparent 9px);
  mix-blend-mode: normal;
}

.style-preview--dream::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 244, 202, 0.9) 0 1.5px, transparent 2px),
    radial-gradient(circle at 76% 16%, rgba(255, 230, 247, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 42%, rgba(255, 244, 202, 0.8) 0 1.5px, transparent 2px),
    radial-gradient(circle at 68% 78%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 72%, rgba(255, 217, 246, 0.35), transparent 45%),
    linear-gradient(180deg, rgba(194, 172, 255, 0.18), rgba(255, 193, 222, 0.1));
  mix-blend-mode: screen;
}

.style-preview--film::before {
  background:
    radial-gradient(circle at 50% 45%, transparent 35%, rgba(71, 47, 31, 0.32) 100%),
    linear-gradient(180deg, rgba(255, 225, 176, 0.12), rgba(92, 59, 39, 0.15));
  box-shadow: inset 0 0 0 4px rgba(255, 247, 229, 0.22);
}

.style-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 300ms ease;
}

.style-card:hover .style-preview img {
  transform: scale(1.04);
}

.style-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--preview-wash, transparent);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.style-preview .style-grain {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.style-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(255, 250, 241, 0.84);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.style-check {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 253, 247, 0.75);
  border-radius: 50%;
  background: rgba(64, 43, 31, 0.22);
  color: transparent;
  font-size: 10px;
  transition: background 160ms ease, color 160ms ease;
}

.style-card.is-selected .style-check {
  background: var(--coral);
  color: #fffdf8;
}

.style-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px 8px;
}

.style-meta strong {
  display: block;
  font-family: var(--display);
  font-size: 13.5px;
  line-height: 1.2;
}

.style-meta span {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}

.style-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot, var(--coral));
}

.style-caption {
  min-height: 37px;
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(244, 230, 211, 0.5);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.style-caption strong {
  color: var(--ink-soft);
}

/* 场景 */

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

.theme-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.theme-card:hover {
  border-color: rgba(111, 149, 120, 0.6);
  transform: translateY(-1px);
}

.theme-card.is-selected {
  border-color: var(--sage);
  background: var(--sage-soft);
  box-shadow: 0 0 0 1px var(--sage) inset;
}

.theme-icon {
  display: flex;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--theme-soft, #f4e8d6);
  color: var(--theme-color, var(--ink));
  font-family: var(--display);
  font-size: 18px;
}

.theme-label {
  min-width: 0;
}

.theme-label strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.theme-label > span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-card .theme-icon {
  font-size: 18px;
}

/* 生成 */

.generate-wrap {
  position: relative;
  z-index: 5;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid rgba(255, 253, 247, 0.7);
  border-radius: 20px;
  background: rgba(251, 244, 232, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(76, 48, 32, 0.11);
}

.btn-generate {
  width: 100%;
  justify-content: space-between;
  padding: 16px 22px;
  border-radius: 13px;
  font-size: 15px;
}

.generate-spark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.16);
  font-size: 13px;
}

.generate-hint {
  margin: 7px 0 0;
  color: var(--muted-light);
  font-size: 9.5px;
  text-align: center;
}

/* 预览 */

.preview-pane {
  position: sticky;
  top: 88px;
  min-width: 0;
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  padding: 0 3px;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-label strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(111, 149, 120, 0.13);
  animation: pulse 2.6s ease-in-out infinite;
}

.preview-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid rgba(110, 81, 59, 0.1);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 253, 246, 0.94) 0, rgba(255, 250, 240, 0.6) 48%, rgba(244, 230, 211, 0.45) 100%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(126, 96, 72, 0.045) 22px 23px);
  overflow: hidden;
}

.preview-stage::before,
.preview-stage::after {
  content: "✦";
  position: absolute;
  color: rgba(233, 119, 90, 0.3);
  font-family: var(--latin);
  font-size: 21px;
}

.preview-stage::before {
  top: 19px;
  left: 23px;
}

.preview-stage::after {
  right: 25px;
  bottom: 16px;
  color: rgba(111, 149, 120, 0.35);
  font-size: 17px;
}

.preview-book-wrap {
  position: relative;
  width: min(100%, 560px);
}

.preview-book {
  position: relative;
  overflow: hidden;
  border-radius: 7px 16px 16px 7px;
  background: #fffaf0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 30px 70px rgba(77, 49, 31, 0.2),
    -9px 9px 0 -3px #f4e8d8,
    -14px 14px 0 -5px #ead9c3;
}

.preview-book::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 12px;
  background: linear-gradient(90deg, rgba(75, 49, 31, 0.24), rgba(75, 49, 31, 0.03) 55%, transparent);
  pointer-events: none;
}

.preview-book canvas {
  width: 100%;
  height: auto;
}

.preview-page-shadow {
  position: absolute;
  right: 8%;
  bottom: -19px;
  left: 6%;
  height: 28px;
  border-radius: 50%;
  background: rgba(75, 49, 31, 0.16);
  filter: blur(14px);
  z-index: -1;
}

.preview-busy {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 18px;
  backdrop-filter: blur(2px);
}

.busy-spinner {
  width: 34px;
  height: 34px;
  border: 2.5px solid rgba(233, 119, 90, 0.2);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 0 4px;
}

.preview-tip {
  color: var(--muted);
  font-size: 10.5px;
}

.preview-tip span {
  margin-right: 3px;
  color: var(--coral);
}

/* ------------------------------------------------------------------ */
/* 页脚                                                                */
/* ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(244, 230, 211, 0.32);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 35px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 31px clamp(22px, 4vw, 54px);
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 18px;
}

.footer-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.footer-note {
  text-align: right;
}

.footer-note p {
  margin: 0;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.8;
}

/* ------------------------------------------------------------------ */
/* 弹窗                                                                */
/* ------------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(49, 34, 25, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 200ms ease both;
}

.modal[hidden] {
  display: none;
}

.reader-shell {
  display: flex;
  width: min(1300px, 96vw);
  height: min(940px, 94vh);
  flex-direction: column;
  padding: 21px 27px 16px;
  border: 1px solid rgba(255, 252, 244, 0.5);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.8), transparent 30%),
    #f6ead7;
  box-shadow: 0 50px 130px rgba(38, 24, 16, 0.4);
  animation: modal-rise 300ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.reader-head h2 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.3;
}

.reader-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.reader-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 3vw, 38px);
  padding: 10px 0;
}

.reader-page-wrap {
  position: relative;
  display: flex;
  height: 100%;
  max-height: 100%;
  align-items: center;
  justify-content: center;
}

.reader-page-wrap::after {
  content: "";
  position: absolute;
  right: 7%;
  bottom: 3px;
  left: 4%;
  height: 20px;
  border-radius: 50%;
  background: rgba(56, 35, 22, 0.18);
  filter: blur(13px);
  z-index: -1;
}

#readerPage {
  max-width: min(760px, 67vw);
  max-height: 100%;
  border-radius: 5px 11px 11px 5px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(52, 32, 20, 0.26), -7px 7px 0 -2px #ead8c0;
  background: #fffaf0;
}

.reader-arrow {
  display: flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(110, 81, 59, 0.16);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.7);
  color: var(--ink-soft);
  font-size: 17px;
  transition: background 160ms ease, transform 160ms ease;
}

.reader-arrow:hover:not(:disabled) {
  background: #fffdf8;
  transform: scale(1.06);
}

.reader-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 5px 0;
  border-top: 1px solid rgba(110, 81, 59, 0.12);
}

.reader-dots {
  display: flex;
  gap: 8px;
}

.reader-dot {
  width: 26px;
  height: 4px;
  border: 0;
  border-radius: 99px;
  background: rgba(121, 91, 70, 0.2);
  padding: 0;
  transition: background 160ms ease, width 160ms ease;
}

.reader-dot.is-active {
  width: 42px;
  background: var(--coral);
}

.reader-counter {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* 编辑器 */

.editor-shell {
  display: flex;
  width: min(940px, 94vw);
  max-height: 90vh;
  flex-direction: column;
  padding: 25px 27px 20px;
  border-radius: 25px;
  background: #fffaf0;
  box-shadow: 0 45px 120px rgba(38, 24, 16, 0.35);
  animation: modal-rise 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.editor-head h2,
.help-shell h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(23px, 2.6vw, 31px);
  line-height: 1.3;
}

.editor-intro {
  margin: 9px 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.editor-pages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow: auto;
  padding: 2px 4px 8px 2px;
}

.editor-page {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}

.editor-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.editor-page-head strong {
  font-family: var(--display);
  font-size: 14px;
}

.editor-page-head span {
  color: var(--muted-light);
  font-size: 9px;
}

.editor-page textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fffaf0;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.7;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.editor-page textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 119, 90, 0.1);
}

.ruby-preview {
  margin-top: 7px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 2.8;
  word-break: break-all;
}

.ruby-preview ruby {
  margin: 0 2px;
  ruby-position: over;
}

.ruby-preview rt {
  color: var(--muted);
  font-family: var(--latin);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ruby-preview .punct {
  margin: 0;
}

.ruby-preview .is-name {
  color: var(--coral-deep);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* 帮助 */

.help-shell {
  position: relative;
  width: min(830px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 31px 34px;
  border-radius: 25px;
  background: #fffaf0;
  box-shadow: 0 45px 120px rgba(38, 24, 16, 0.35);
  animation: modal-rise 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.help-shell > .icon-button {
  position: absolute;
  top: 20px;
  right: 20px;
}

.help-shell h2 {
  max-width: 560px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 22px;
}

.help-grid article {
  padding: 15px 17px;
  border-radius: 14px;
  background: #fdf5e8;
}

.help-grid article > span {
  color: var(--coral);
  font-family: var(--latin);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.help-grid h3 {
  margin: 5px 0 4px;
  font-family: var(--display);
  font-size: 18px;
}

.help-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.help-privacy {
  margin: 20px 0 0;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* 提示条 */

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  z-index: 300;
  max-width: min(420px, 90vw);
  padding: 11px 19px;
  border: 1px solid rgba(255, 253, 247, 0.4);
  border-radius: 999px;
  background: rgba(61, 44, 37, 0.93);
  color: #fffaf1;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(51, 33, 23, 0.25);
  transform: translateX(-50%);
  animation: toast-in 230ms ease both;
}

/* 打印 */

.print-area {
  display: none;
}

/* ------------------------------------------------------------------ */
/* 动效                                                                */
/* ------------------------------------------------------------------ */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ */
/* 响应式                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1160px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  }

  .hero-visual {
    min-height: 520px;
  }

  .hero-book {
    width: min(340px, 72%);
  }

  .studio-grid {
    grid-template-columns: minmax(390px, 450px) minmax(0, 1fr);
    gap: 26px;
  }

  .preview-stage {
    min-height: 470px;
  }
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 38px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-visual {
    min-height: 530px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
  }

  .hero-book {
    width: min(370px, 72%);
  }

  .how-it-works {
    padding-top: 6px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    position: relative;
    top: 0;
    order: -1;
    margin-bottom: 8px;
  }

  .preview-stage {
    min-height: 0;
    padding: 26px;
  }

  .preview-book-wrap {
    width: min(100%, 450px);
  }

  .controls {
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
  }

  .studio-top {
    flex-wrap: wrap;
  }

  .studio-title {
    order: -1;
    width: 100%;
    flex: 1 1 100%;
    text-align: left;
  }

  .generate-wrap {
    bottom: 10px;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding: 12px 18px;
  }

  .header-nav .nav-link {
    display: none;
  }

  .brand-text small {
    display: none;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    font-size: 21px;
  }

  .brand-text strong {
    font-size: 19px;
  }

  .hero {
    padding: 30px 20px 58px;
  }

  .hero h1 {
    font-size: clamp(50px, 14vw, 68px);
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-lead br {
    display: none;
  }

  .hero-visual {
    min-height: 430px;
  }

  .hero-book {
    width: min(285px, 72%);
  }

  .hero-note {
    right: 0;
    bottom: 3%;
    width: 150px;
    padding: 12px 14px;
  }

  .hero-note-title {
    font-size: 13px;
  }

  .hero-tape {
    left: 46%;
    font-size: 13px;
    padding: 6px 14px;
  }

  .step-cards {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    padding: 10px 20px 65px;
  }

  .studio {
    padding: 20px 13px 65px;
  }

  .panel {
    padding: 17px;
    border-radius: 18px;
  }

  .style-grid,
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-preview {
    height: 92px;
  }

  .age-picker {
    gap: 6px;
  }

  .age-card {
    padding: 9px 7px;
  }

  .age-card strong {
    font-size: 14px;
  }

  .age-card span {
    font-size: 8.5px;
  }

  .preview-stage {
    padding: 18px 13px 23px;
    border-radius: 19px;
  }

  .preview-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 17px;
    padding: 25px 20px;
  }

  .footer-note {
    text-align: left;
  }

  .modal {
    padding: 8px;
  }

  .reader-shell {
    width: 100%;
    height: 96vh;
    padding: 14px 12px 9px;
    border-radius: 19px;
  }

  .reader-head {
    flex-direction: column;
    gap: 8px;
  }

  .reader-head-actions {
    justify-content: flex-start;
  }

  .reader-head-actions .btn {
    padding: 7px 10px;
    font-size: 10.5px;
  }

  .reader-stage {
    gap: 6px;
  }

  .reader-arrow {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  #readerPage {
    max-width: 78vw;
  }

  .reader-counter {
    display: none;
  }

  .editor-shell {
    width: 100%;
    max-height: 94vh;
    padding: 17px 14px 14px;
    border-radius: 19px;
  }

  .help-shell {
    width: 100%;
    max-height: 94vh;
    padding: 24px 19px;
    border-radius: 19px;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-visual {
    min-height: 390px;
  }

  .hero-book {
    width: min(250px, 74%);
  }

  .hero-note {
    display: none;
  }

  .studio-title h1 {
    font-size: 23px;
  }

  .style-grid,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .style-preview {
    height: 140px;
  }
}

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

/* ------------------------------------------------------------------ */
/* 打印                                                                */
/* ------------------------------------------------------------------ */

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    background: #fff;
    margin: 0;
    padding: 0;
  }

  body > *:not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block !important;
  }

  .print-page {
    page-break-after: always;
    break-after: page;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .print-page img {
    width: 100%;
    height: auto;
    display: block;
  }
}

/* ================================================================== */
/* 多页面扩展：首页三入口 / 账号 / 书架 / 陈列室 / 管理后台             */
/* ================================================================== */

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-credit {
  padding: 5px 10px;
  border: 1px solid rgba(111, 149, 120, 0.22);
  border-radius: 999px;
  background: rgba(227, 237, 226, 0.55);
  color: var(--sage);
  font-family: var(--latin);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.user-chip:hover {
  border-color: var(--line-strong);
  background: #fffdf8;
}

.user-avatar {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--coral);
  color: #fffaf1;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1;
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.user-chip-text strong {
  max-width: 96px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-text small {
  color: var(--muted);
  font-family: var(--latin);
  font-size: 8px;
  line-height: 1.3;
}

.header-logout {
  border: 0;
  background: none;
  padding: 5px 0;
  color: var(--muted-light);
  font-size: 10px;
  cursor: pointer;
}

.header-logout:hover {
  color: var(--coral-deep);
}

/* 首页 */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(380px, 0.97fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(38px, 6vh, 76px) clamp(22px, 4vw, 54px) clamp(24px, 4vh, 46px);
}

.home-hero-copy {
  max-width: 640px;
}

.home-hero-visual {
  min-height: 540px;
}

.hero-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channels {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px clamp(22px, 4vw, 54px) 70px;
}

.channels-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.channels-head h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 43px);
  line-height: 1.2;
}

.channels-stats {
  margin: 0 0 5px;
  color: var(--muted);
  font-family: var(--latin);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: right;
}

.channel-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.93fr 0.93fr;
  gap: 14px;
}

.channel-card {
  position: relative;
  display: flex;
  min-height: 460px;
  flex-direction: column;
  padding: 23px 23px 21px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.channel-card:hover {
  transform: translateY(-5px);
  border-color: rgba(104, 75, 53, 0.28);
  box-shadow: var(--shadow-md);
}

.channel-create {
  background:
    radial-gradient(circle at 85% 100%, rgba(242, 206, 130, 0.27), transparent 36%),
    linear-gradient(145deg, rgba(251, 227, 216, 0.9), rgba(255, 250, 240, 0.92));
}

.channel-gallery {
  background:
    radial-gradient(circle at 100% 0, rgba(168, 200, 180, 0.35), transparent 35%),
    linear-gradient(150deg, rgba(232, 241, 227, 0.9), rgba(255, 250, 240, 0.9));
}

.channel-admin {
  background:
    radial-gradient(circle at 0 100%, rgba(126, 105, 86, 0.35), transparent 42%),
    #3d2e27;
  color: #f8eddb;
  border-color: transparent;
}

.channel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.channel-index {
  font-family: var(--latin);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  opacity: 0.55;
}

.channel-label {
  font-family: var(--latin);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0.5;
}

.channel-art {
  position: relative;
  height: 138px;
  margin: 15px 0 9px;
}

.channel-art-create {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-book {
  position: relative;
  width: 92px;
  height: 116px;
  border-radius: 5px 11px 11px 5px;
  background:
    radial-gradient(circle at 60% 36%, #f1c1a0 0 17px, transparent 18px),
    linear-gradient(155deg, #6e628f, #d8a0a0);
  box-shadow: 8px 12px 20px rgba(77, 51, 32, 0.2), -5px 4px 0 -1px #f4e4cc;
  transform: rotate(5deg);
}

.mini-book::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 13px;
  width: 30px;
  height: 2px;
  border-radius: 9px;
  background: rgba(255, 247, 230, 0.75);
}

.mini-book::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 19px;
  width: 40px;
  height: 2px;
  border-radius: 9px;
  background: rgba(255, 247, 230, 0.45);
}

.mini-book-face {
  position: absolute;
  right: 13px;
  top: 26px;
  color: #fff8e9;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.mini-book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  border-radius: 5px 0 0 5px;
  background: rgba(70, 45, 31, 0.24);
}

.mini-stars {
  position: absolute;
  top: 22px;
  left: 18px;
  color: rgba(233, 119, 90, 0.7);
  font-family: var(--latin);
  font-size: 14px;
  letter-spacing: 0.18em;
  transform: rotate(-8deg);
}

.channel-art-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-sheet {
  position: absolute;
  width: 94px;
  height: 120px;
  border: 4px solid #fffaf0;
  border-radius: 5px 9px 9px 5px;
  background: #eee1ca;
  box-shadow: 0 10px 18px rgba(70, 48, 32, 0.13);
}

.gallery-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-back {
  transform: translate(-34px, 4px) rotate(-11deg);
  background: #d9e4d2;
}

.sheet-mid {
  transform: translate(0, 0) rotate(-2deg);
  background: #efd9c3;
}

.sheet-front {
  transform: translate(33px, 6px) rotate(8deg);
}

.channel-art-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.admin-seal {
  display: flex;
  width: 75px;
  height: 75px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 228, 190, 0.5);
  border-radius: 6px;
  color: #f3d6ae;
  font-family: var(--display);
  font-size: 38px;
  box-shadow: inset 0 0 0 4px rgba(255, 228, 190, 0.08);
  transform: rotate(-4deg);
}

.admin-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.admin-lines span {
  display: block;
  width: 66px;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 241, 219, 0.24);
}

.admin-lines span:nth-child(2) {
  width: 46px;
}

.admin-lines span:nth-child(3) {
  width: 56px;
}

.channel-card h3 {
  margin: 6px 0 7px;
  font-family: var(--display);
  font-size: 29px;
  line-height: 1.2;
}

.channel-card p {
  margin: 0;
  max-width: 340px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.85;
}

.channel-admin p {
  color: rgba(248, 237, 219, 0.66);
}

.channel-card ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 14px 0 17px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 10px;
}

.channel-admin ul {
  color: rgba(248, 237, 219, 0.55);
}

.channel-card li::before {
  content: "·";
  margin-right: 6px;
  color: var(--coral);
}

.channel-admin li::before {
  color: #d9b487;
}

.channel-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: var(--coral-deep);
  font-family: var(--display);
  font-size: 15px;
}

.channel-admin .channel-cta {
  color: #f0c995;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(22px, 4vw, 54px) 50px;
}

.home-step {
  padding: 17px 19px;
  border-top: 1px solid var(--line);
}

.home-step > span {
  color: var(--coral);
  font-family: var(--latin);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.home-step strong {
  display: block;
  margin: 5px 0 3px;
  font-family: var(--display);
  font-size: 17px;
}

.home-step p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.home-privacy {
  display: flex;
  max-width: 1000px;
  align-items: center;
  gap: 18px;
  margin: 0 auto 80px;
  padding: 21px 25px;
  border: 1px solid rgba(111, 149, 120, 0.2);
  border-radius: 18px;
  background: rgba(227, 237, 226, 0.4);
}

.privacy-mark {
  display: flex;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sage);
  color: #fffaf1;
  font-family: var(--latin);
  font-size: 18px;
}

.home-privacy strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
}

.home-privacy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.home-privacy .text-button {
  margin-left: auto;
  white-space: nowrap;
}

/* 登录注册 */

.auth-page {
  min-height: 100vh;
}

.auth-header {
  background: rgba(251, 244, 232, 0.65);
}

.auth-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 22px;
  max-width: 1180px;
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 40px) 50px;
  align-items: stretch;
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 610px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 5vw, 55px);
  border-radius: 26px;
  background:
    radial-gradient(circle at 75% 18%, rgba(233, 119, 90, 0.4), transparent 30%),
    radial-gradient(circle at 15% 90%, rgba(111, 149, 120, 0.3), transparent 36%),
    #2f2621;
  color: #f8eddb;
}

.auth-visual-copy {
  position: relative;
  z-index: 2;
}

.auth-visual .section-kicker {
  color: #e9b783;
}

.auth-visual h1 {
  margin: 13px 0 18px;
  font-family: var(--display);
  font-size: clamp(36px, 4.3vw, 58px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.auth-visual h1 em {
  color: #f0b78d;
  font-style: normal;
}

.auth-visual p {
  max-width: 370px;
  margin: 0;
  color: rgba(248, 237, 219, 0.66);
  font-size: 12.5px;
  line-height: 1.9;
}

.auth-book {
  position: relative;
  width: 205px;
  height: 252px;
  align-self: flex-end;
  margin-top: 25px;
  transform: rotate(6deg);
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.3));
}

.auth-book::before {
  content: "";
  position: absolute;
  inset: 6px -7px -8px 10px;
  border-radius: 4px 12px 12px 4px;
  background: repeating-linear-gradient(90deg, #d9c4a8 0 2px, #fff7e8 2px 6px);
}

.auth-book img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px 12px 12px 4px;
  box-shadow: inset 9px 0 16px -10px rgba(51, 31, 18, 0.65);
}

.auth-star {
  position: absolute;
  color: #f0c68b;
  font-family: var(--latin);
}

.auth-star-a {
  top: 12%;
  right: 13%;
  font-size: 26px;
}

.auth-star-b {
  bottom: 17%;
  left: 10%;
  color: #d2a7a0;
  font-size: 17px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(23px, 3.7vw, 42px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 253, 247, 0.8);
  box-shadow: var(--shadow-md);
}

.auth-panel-head {
  margin-bottom: 23px;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(244, 230, 211, 0.66);
}

.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

.auth-tab.is-active {
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 0 3px 9px rgba(85, 58, 40, 0.08);
}

.auth-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.auth-field b {
  color: var(--coral-deep);
  font-size: 9px;
  font-weight: 500;
}

.auth-field i {
  margin-left: 5px;
  color: var(--muted-light);
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
}

.auth-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fffdf8;
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-field input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 119, 90, 0.1);
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.auth-submit {
  width: 100%;
  margin-top: 3px;
  padding: 13px 18px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.auth-error {
  min-height: 14px;
  margin: 0;
  color: var(--coral-deep);
  font-size: 10.5px;
  line-height: 1.5;
  opacity: 0;
}

.auth-error.is-visible {
  opacity: 1;
}

.auth-fineprint {
  margin: 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.7;
}

.auth-form-title {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
}

.auth-form-lead {
  margin: -5px 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.auth-back {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.auth-back:hover {
  color: var(--coral-deep);
}

.auth-code-btn {
  align-self: flex-start;
  padding: 8px 14px;
}

.auth-devcode {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(233, 119, 90, 0.35);
  border-radius: 9px;
  background: var(--coral-soft);
  color: #93513d;
  font-size: 10px;
  line-height: 1.7;
}

.auth-devcode strong {
  font-family: var(--latin);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.auth-panel-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: var(--muted-light);
  font-family: var(--latin);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

/* 创作台扩展 */

.page-gate {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.page-gate[hidden] {
  display: none !important;
}

.page-gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 35px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdf7;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.page-gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.page-gate-card .brand-mark {
  animation: float 3s ease-in-out infinite;
}

.studio-page .studio {
  padding-top: 20px;
  padding-bottom: 40px;
}

.studio-top-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.engine-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.engine-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.engine-card:hover {
  border-color: rgba(233, 119, 90, 0.5);
  transform: translateY(-1px);
}

.engine-card.is-selected {
  border-color: var(--coral);
  background: var(--coral-soft);
  box-shadow: 0 0 0 1px var(--coral) inset;
}

.engine-icon {
  display: flex;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--paper-deep);
  color: var(--coral-deep);
  font-family: var(--latin);
  font-size: 16px;
}

.engine-card.is-selected .engine-icon {
  background: rgba(255, 250, 240, 0.78);
}

.engine-card strong {
  display: block;
  font-size: 11px;
  line-height: 1.2;
}

.engine-card small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.engine-card em {
  position: absolute;
  top: 6px;
  right: 7px;
  color: var(--muted-light);
  font-size: 7.5px;
  font-style: normal;
}

.engine-card.is-selected em {
  color: var(--coral-deep);
}

.seedream-box {
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px dashed rgba(111, 149, 120, 0.32);
  border-radius: 11px;
  background: rgba(227, 237, 226, 0.36);
}

.seedream-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seedream-box-head strong {
  font-family: var(--display);
  font-size: 14px;
}

.ai-credit {
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(111, 149, 120, 0.15);
  color: var(--sage);
  font-family: var(--latin);
  font-size: 8px;
  font-weight: 700;
}

.seedream-box p {
  margin: 5px 0 4px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.seedream-actions {
  display: flex;
  gap: 12px;
}

.reader-save-state {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.reader-save-state[data-tone="saved"] {
  color: var(--sage);
}

.reader-save-state[data-tone="error"] {
  color: var(--coral-deep);
}

.reader-save-state[data-tone="saving"] {
  color: var(--muted);
}

.photo-modal .photo-shell {
  display: flex;
  width: min(860px, 94vw);
  max-height: 88vh;
  flex-direction: column;
  padding: 24px 25px 17px;
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: 0 45px 120px rgba(38, 24, 16, 0.35);
  animation: modal-rise 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.photo-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  overflow: auto;
  padding: 3px 3px 10px;
}

.photo-item {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 11px;
  background: var(--paper-deep);
}

.photo-pick {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
}

.photo-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 250ms ease;
}

.photo-item:hover img {
  transform: scale(1.04);
}

.photo-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 50%;
  background: rgba(53, 36, 27, 0.55);
  color: #fffaf1;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 160ms ease;
}

.photo-item:hover .photo-delete {
  opacity: 1;
}

.photo-empty {
  grid-column: 1 / -1;
  margin: 30px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* 陈列室 */

.gallery-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 54px) 75px;
}

.gallery-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.gallery-hero h1 {
  margin: 8px 0 7px;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.gallery-hero p {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.gallery-hero-mark {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  color: var(--coral);
  font-family: var(--latin);
  font-size: 20px;
}

.gallery-hero-mark span:nth-child(2) {
  color: var(--sage);
  font-size: 29px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 21px 0 15px;
}

.gallery-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.72);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.gallery-cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--paper-deep);
  cursor: pointer;
}

.gallery-cover img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 350ms ease;
}

.gallery-card:hover .gallery-cover img {
  transform: scale(1.025);
}

.gallery-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 250, 240, 0.86);
  color: var(--coral-deep);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.gallery-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 99px;
  background: rgba(53, 36, 27, 0.58);
  color: #fffaf1;
  font-size: 8px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.gallery-card:hover .gallery-open {
  opacity: 1;
}

.gallery-card-body {
  padding: 12px 15px 14px;
}

.gallery-card-meta {
  display: flex;
  gap: 8px;
  color: var(--muted-light);
  font-size: 8px;
}

.gallery-card-body h2 {
  margin: 5px 0 2px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.25;
}

.gallery-card-body p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9.5px;
}

.gallery-loading,
.gallery-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.gallery-empty h2 {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-size: 26px;
}

.gallery-empty p {
  margin: 0 0 15px;
  font-size: 11px;
}

/* 我的书架 */

.library-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 54px) 75px;
}

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.library-head h1 {
  margin: 7px 0 3px;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.15;
}

.library-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.library-stats {
  display: flex;
  gap: 36px;
  margin: 20px 0 4px;
}

.library-stats div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.library-stats strong {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
}

.library-stats span {
  color: var(--muted);
  font-size: 9.5px;
}

.library-tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 18px;
  border-bottom: 1px solid var(--line);
}

.library-tab {
  padding: 8px 17px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.library-tab.is-active {
  border-bottom-color: var(--coral);
  color: var(--ink);
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.book-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.75);
  transition: transform 190ms ease, box-shadow 190ms ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.book-card-cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--paper-deep);
  cursor: pointer;
}

.book-card-cover img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.book-status {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(51, 36, 27, 0.58);
  color: #fffaf1;
  font-size: 8px;
  font-weight: 600;
}

.status-approved {
  background: rgba(88, 127, 94, 0.8);
}

.status-pending {
  background: rgba(172, 123, 51, 0.8);
}

.status-rejected {
  background: rgba(161, 86, 72, 0.8);
}

.book-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 14px 13px;
}

.book-card-meta {
  color: var(--muted-light);
  font-size: 8px;
}

.book-card-body h2 {
  margin: 4px 0 2px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.25;
}

.book-card-body > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 9px;
}

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

.text-button.danger {
  color: #b15d4c;
}

.text-button:disabled {
  color: var(--muted-light);
  cursor: default;
  text-decoration: none;
}

.shelf-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.shelf-photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.75);
}

.shelf-photo-link {
  display: block;
  overflow: hidden;
  background: var(--paper-deep);
}

.shelf-photo-link img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 250ms ease;
}

.shelf-photo-link:hover img {
  transform: scale(1.03);
}

.shelf-photo-card > div {
  padding: 9px 11px 4px;
}

.shelf-photo-card strong {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-photo-card span {
  color: var(--muted);
  font-size: 8px;
}

.shelf-photo-actions {
  display: flex;
  justify-content: space-between;
  padding: 3px 11px 10px;
}

.shelf-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}

.shelf-empty > span {
  color: var(--coral);
  font-family: var(--latin);
  font-size: 24px;
}

.shelf-empty h2 {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-size: 26px;
}

.shelf-empty p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 11px;
}

.shelf-loading {
  grid-column: 1 / -1;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

/* 账号页脚 / 移动端补丁 */

@media (max-width: 1100px) {
  .channel-grid {
    grid-template-columns: 1fr 1fr;
  }

  .channel-create {
    grid-column: 1 / -1;
    min-height: 350px;
  }

  .channel-art-create {
    position: absolute;
    right: 30px;
    bottom: 35px;
    width: 150px;
    margin: 0;
  }

  .channel-create p {
    max-width: 60%;
  }

  .auth-main {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 310px;
  }

  .auth-book {
    position: absolute;
    right: 40px;
    bottom: 25px;
    width: 145px;
    height: 180px;
    margin: 0;
  }

  .auth-visual p {
    max-width: 55%;
  }

  .book-shelf {
    grid-template-columns: repeat(2, 1fr);
  }

  .shelf-photos {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .header-nav {
    gap: 8px;
  }

  .header-credit,
  .nav-link[href="gallery.html"] {
    display: none;
  }

  .user-chip-text {
    display: none;
  }

  .user-chip {
    padding: 3px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .home-hero-visual {
    min-height: 430px;
  }

  .channels {
    padding-top: 5px;
  }

  .channels-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .channels-stats {
    text-align: left;
  }

  .channel-grid {
    grid-template-columns: 1fr;
  }

  .channel-create {
    grid-column: auto;
    min-height: 430px;
  }

  .channel-art-create {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 15px 0 9px;
  }

  .channel-create p {
    max-width: none;
  }

  .channel-card {
    min-height: 390px;
  }

  .home-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .home-step {
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-privacy {
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 0 18px 50px;
  }

  .home-privacy .text-button {
    margin-left: 55px;
  }

  .auth-main {
    padding: 13px;
  }

  .auth-visual {
    min-height: 250px;
    padding: 24px;
  }

  .auth-visual h1 {
    font-size: 35px;
  }

  .auth-visual p {
    max-width: 62%;
    font-size: 10.5px;
  }

  .auth-book {
    right: 25px;
    bottom: 20px;
    width: 105px;
    height: 132px;
  }

  .auth-panel {
    padding: 21px 17px;
    border-radius: 19px;
  }

  .auth-field-row {
    grid-template-columns: 1fr;
  }

  .studio-header-auth .header-credit {
    display: none;
  }

  .studio-top-actions {
    gap: 10px;
  }

  .studio-top-actions .text-button {
    font-size: 10px;
  }

  .engine-picker {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-main,
  .library-main {
    padding-top: 25px;
  }

  .gallery-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-hero-mark {
    display: none;
  }

  .gallery-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .gallery-grid,
  .book-shelf,
  .shelf-photos {
    grid-template-columns: 1fr;
  }

  .library-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-stats {
    gap: 20px;
  }

  .library-stats strong {
    font-size: 23px;
  }
}

/* ================================================================== */
/* 管理者后台                                                          */
/* ================================================================== */

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(60% 35% at 100% 0, rgba(140, 90, 60, 0.08), transparent 65%),
    #f2eadb;
  color: #2e2721;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 4vw, 48px);
  background: #2f2621;
  color: #f8eddb;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand-seal {
  display: flex;
  width: 37px;
  height: 37px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(243, 214, 174, 0.45);
  border-radius: 3px;
  color: #f3d6ae;
  font-family: var(--display);
  font-size: 21px;
}

.admin-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.admin-brand small {
  color: rgba(248, 237, 219, 0.42);
  font-family: var(--latin);
  font-size: 7px;
  letter-spacing: 0.28em;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.admin-back,
.admin-logout {
  border: 0;
  background: none;
  color: rgba(248, 237, 219, 0.65);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.admin-back:hover,
.admin-logout:hover {
  color: #f3d6ae;
}

.admin-main {
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 46px) 70px;
}

.admin-login {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 23px;
  min-height: 580px;
  align-items: stretch;
}

.admin-login-art {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 62px);
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 20%, rgba(176, 112, 78, 0.32), transparent 40%),
    linear-gradient(150deg, #342a24, #241e1a);
  color: #f3d6ae;
}

.admin-login-art > span {
  font-family: var(--display);
  font-size: 76px;
  line-height: 1;
  opacity: 0.75;
}

.admin-login-art p {
  margin: 23px 0 0;
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 47px);
  line-height: 1.38;
}

.admin-login-art em {
  margin-top: 34px;
  color: rgba(243, 214, 174, 0.36);
  font-family: var(--latin);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.22em;
}

.admin-login-card {
  align-self: center;
  padding: 35px 34px;
  border: 1px solid rgba(70, 55, 43, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.82);
  box-shadow: 0 30px 70px -45px rgba(46, 39, 33, 0.5);
}

.admin-login-card h1 {
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
}

.admin-login-lead {
  margin: 0 0 23px;
  color: #7c7063;
  font-size: 11px;
  line-height: 1.7;
}

.admin-login-note {
  margin: 18px 0 0;
  color: #a29483;
  font-size: 9px;
  line-height: 1.7;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 13px;
}

.admin-field > span {
  color: #5f5347;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.admin-field input,
.admin-field textarea,
.admin-select,
.admin-inline-form input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid rgba(70, 55, 43, 0.2);
  border-radius: 3px;
  outline: none;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-field textarea {
  resize: vertical;
  line-height: 1.6;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-select:focus,
.admin-inline-form input:focus {
  border-color: rgba(140, 90, 60, 0.55);
  box-shadow: 0 0 0 3px rgba(140, 90, 60, 0.08);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid rgba(70, 55, 43, 0.26);
  border-radius: 3px;
  background: transparent;
  color: #3d342b;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.admin-btn:hover {
  border-color: rgba(140, 90, 60, 0.55);
  color: #8c5a3c;
}

.admin-btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #a86b4c, #825037);
  color: #fbf3e4;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(130, 80, 55, 0.18);
}

.admin-btn-primary:hover {
  background: linear-gradient(180deg, #b67857, #925b3f);
  color: #fff;
}

.admin-btn-small {
  padding: 7px 11px;
  font-size: 10px;
}

.admin-btn-ghost {
  border-color: rgba(70, 55, 43, 0.2);
}

.admin-error {
  min-height: 14px;
  margin: 4px 0 7px;
  color: #a63b2a;
  font-size: 10px;
}

.admin-error:empty {
  min-height: 0;
}

.admin-panel {
  animation: fade-in 300ms ease both;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.admin-head h1 {
  margin: 7px 0 4px;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.admin-head p {
  margin: 0;
  color: #847667;
  font-size: 10.5px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
  margin: 22px 0;
}

.admin-stat {
  padding: 17px 17px 14px;
  border: 1px solid rgba(70, 55, 43, 0.14);
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.55);
}

.admin-stat span {
  display: block;
  color: #8a7b6b;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.admin-stat strong {
  display: block;
  margin: 6px 0 2px;
  font-family: var(--display);
  font-size: 31px;
  font-weight: 500;
  line-height: 1;
}

.admin-stat em {
  color: #a29483;
  font-size: 8px;
  font-style: normal;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid rgba(70, 55, 43, 0.18);
}

.admin-tab {
  position: relative;
  padding: 10px 16px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8a7b6b;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.admin-tab.is-active {
  border-bottom-color: #8c5a3c;
  color: #2e2721;
}

.admin-tab span {
  display: inline-flex;
  min-width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  margin-left: 3px;
  border-radius: 99px;
  background: #a63b2a;
  color: #fff;
  font-size: 8px;
}

.admin-section {
  padding-top: 22px;
  animation: fade-in 220ms ease both;
}

.admin-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.admin-section-head h2 {
  margin: 0 0 3px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.admin-section-head p {
  margin: 0;
  max-width: 650px;
  color: #8a7b6b;
  font-size: 10px;
  line-height: 1.65;
}

.admin-inline-form {
  width: 230px;
}

.admin-select {
  width: 125px;
  padding: 8px 9px;
  background: rgba(255, 253, 247, 0.7);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(70, 55, 43, 0.13);
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.55);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.admin-table th,
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(70, 55, 43, 0.08);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table th {
  color: #8a7b6b;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.admin-table tbody tr:hover {
  background: rgba(140, 90, 60, 0.04);
}

.admin-table td.num {
  font-variant-numeric: tabular-nums;
}

.admin-table .admin-user-link {
  border: 0;
  background: none;
  padding: 0;
  color: #6e4b35;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(110, 75, 53, 0.25);
  cursor: pointer;
}

.admin-table-actions {
  display: flex;
  gap: 4px;
}

.admin-btn-mini {
  padding: 4px 7px;
  border: 1px solid rgba(70, 55, 43, 0.18);
  border-radius: 2px;
  background: transparent;
  color: #6b5d50;
  font-size: 8.5px;
  cursor: pointer;
}

.admin-btn-mini:hover {
  border-color: #8c5a3c;
  color: #8c5a3c;
}

.admin-btn-mini.danger {
  color: #a63b2a;
}

.admin-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(78, 122, 74, 0.12);
  color: #4e7a4a;
  font-size: 8px;
  white-space: nowrap;
}

.admin-badge.warn {
  background: rgba(166, 59, 42, 0.1);
  color: #a63b2a;
}

.admin-badge.gray {
  background: rgba(70, 55, 43, 0.08);
  color: #7c7063;
}

.admin-empty {
  margin: 0;
  padding: 28px;
  color: #9a8b7a;
  font-size: 10.5px;
  text-align: center;
}

.admin-detail {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(70, 55, 43, 0.13);
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.65);
}

.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.admin-detail h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
}

.admin-detail p {
  margin: 0;
  color: #8a7b6b;
  font-size: 9.5px;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 15px;
}

.admin-detail-grid h4 {
  margin: 0 0 6px;
  color: #7c7063;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.admin-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #5d5043;
  font-size: 10px;
  line-height: 1.9;
}

.admin-detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed rgba(70, 55, 43, 0.1);
}

.admin-detail-list em {
  color: #9a8b7a;
  font-style: normal;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.admin-card {
  padding: 18px 19px;
  border: 1px solid rgba(70, 55, 43, 0.13);
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.6);
}

.admin-card h3 {
  margin: 0 0 13px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
}

.admin-card-lead {
  margin: 0 0 12px;
  color: #8a7b6b;
  font-size: 9.5px;
  line-height: 1.7;
}

.admin-card code {
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(70, 55, 43, 0.08);
  font-family: var(--latin);
  font-size: 9px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-card-head h3 {
  margin: 0;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  grid-column: 1 / -1;
}

.admin-hint {
  min-height: 12px;
  margin: 8px 0 0;
  color: #8a7b6b;
  font-size: 9px;
  line-height: 1.6;
  grid-column: 1 / -1;
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5d5043;
  font-size: 10px;
  font-weight: 400;
}

.admin-switch input,
.admin-inline-check input {
  width: auto;
  accent-color: #8c5a3c;
}

.admin-inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a7b6b;
  font-size: 9.5px;
  grid-column: 1 / -1;
}

.admin-check-list {
  max-height: 230px;
  overflow: auto;
  border-top: 1px solid rgba(70, 55, 43, 0.09);
}

.admin-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(70, 55, 43, 0.07);
  font-size: 10px;
  cursor: pointer;
}

.admin-check-item input {
  width: auto;
  accent-color: #8c5a3c;
}

.admin-check-item span {
  min-width: 80px;
}

.admin-check-item em {
  flex: 1;
  color: #9a8b7a;
  font-size: 8.5px;
  font-style: normal;
}

.admin-check-item b {
  color: #8c5a3c;
  font-size: 8.5px;
  font-weight: 500;
}

.admin-note-card {
  margin-top: 15px;
  border-color: rgba(166, 59, 42, 0.18);
  background: rgba(250, 235, 224, 0.4);
}

.admin-note-card p {
  margin: 0;
  color: #6f5b4c;
  font-size: 10px;
  line-height: 1.8;
}

.admin-code-output {
  max-height: 190px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(70, 55, 43, 0.12);
  background: rgba(255, 255, 255, 0.5);
  color: #6e4b35;
  font-family: var(--latin);
  font-size: 10px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.admin-gallery-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.admin-gallery-card {
  overflow: hidden;
  border: 1px solid rgba(70, 55, 43, 0.13);
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.62);
}

.admin-gallery-card img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center 18%;
  background: #e7dac7;
}

.admin-gallery-body {
  padding: 10px 12px 12px;
}

.admin-gallery-body h3 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.admin-gallery-body p {
  margin: 0 0 8px;
  color: #8a7b6b;
  font-size: 9px;
  line-height: 1.5;
}

.admin-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

@media (max-width: 1050px) {
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-gallery-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-header {
    padding: 12px 17px;
  }

  .admin-brand strong {
    font-size: 13px;
  }

  .admin-main {
    padding: 22px 13px 50px;
  }

  .admin-login {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .admin-login-art {
    min-height: 240px;
    padding: 25px;
  }

  .admin-login-art > span {
    font-size: 50px;
  }

  .admin-login-art p {
    margin-top: 10px;
    font-size: 29px;
  }

  .admin-login-art em {
    margin-top: 15px;
  }

  .admin-login-card {
    padding: 24px 19px;
  }

  .admin-head,
  .admin-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-stat strong {
    font-size: 25px;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .admin-tab {
    white-space: nowrap;
  }

  .admin-gallery-list {
    grid-template-columns: 1fr;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .admin-inline-form {
    width: 100%;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

.admin-hint.is-error {
  color: #a63b2a;
}

.admin-tab span[hidden] {
  display: none;
}

.auth-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 25px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
}

.auth-benefits div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-benefits span {
  color: var(--coral);
  font-family: var(--latin);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.auth-benefits strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
}

.auth-benefits em {
  color: var(--muted-light);
  font-size: 8px;
  font-style: normal;
}

@media (max-width: 760px) {
  .auth-benefits {
    margin-top: 17px;
  }
}

.global-toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  z-index: 500;
  max-width: min(460px, 90vw);
  padding: 11px 19px;
  border: 1px solid rgba(255, 253, 247, 0.35);
  border-radius: 999px;
  background: rgba(61, 44, 37, 0.94);
  color: #fffaf1;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 14px 30px rgba(51, 33, 23, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.global-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
