:root {
  --navy: #0b3553;
  --navy-deep: #06263d;
  --red: #b92722;
  --red-dark: #8f1917;
  --ivory: #fbf7ef;
  --paper: #fffdf8;
  --ink: #17222b;
  --muted: #74716c;
  --line: #e5ddd0;
  --blue-pale: #e9f0f7;
  --gold: #c89f55;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(15, 40, 55, .08);
}

* { box-sizing: border-box; }
html { background: #e8e3da; }
body { margin: 0; color: var(--ink); background: #e8e3da; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; background: var(--ivory); box-shadow: 0 0 60px rgba(0,0,0,.12); position: relative; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.brand-bar { min-height: 82px; padding: calc(18px + env(safe-area-inset-top)) 24px 18px; background: linear-gradient(135deg, var(--navy-deep), var(--navy)); color: white; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-family: "Songti SC", STSong, serif; font-size: 25px; font-weight: 700; letter-spacing: .08em; }
.spark { color: #f0d99d; font-size: 18px; }
.member-name { font-size: 14px; opacity: .78; }
.page { padding: 30px 24px 42px; }
.eyebrow { margin: 0 0 10px; color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
h1, h2 { font-family: "Songti SC", STSong, "Noto Serif SC", serif; color: var(--navy); }
h1 { margin: 0; font-size: 36px; line-height: 1.25; }
h2 { margin: 0; font-size: 25px; line-height: 1.35; }
p { line-height: 1.75; }
.flash-stack { padding: 14px 24px 0; }
.flash { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.flash.error { background: #fbe5e2; color: #84251e; }
.flash.success { background: #e3f1e8; color: #245c3a; }
.login-page { min-height: calc(100vh - 82px); padding-top: 44px; background: radial-gradient(circle at 88% 4%, rgba(200,159,85,.22), transparent 30%), var(--ivory); }
.login-hero h1 { font-size: 42px; }
.login-hero .intro { color: var(--muted); margin: 16px 0 26px; }
.orb { width: 92px; height: 92px; border-radius: 50%; float: right; margin: -8px 0 12px 16px; border: 1px solid rgba(200,159,85,.6); display: grid; place-content: center; text-align: center; color: var(--navy); background: rgba(255,255,255,.5); }
.orb span { font-family: Georgia, serif; font-size: 30px; line-height: 1; }
.orb small { margin-top: 6px; font-size: 10px; color: var(--muted); }
.card, .plain-card, .admin-card, .record-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-card { clear: both; padding: 22px; }
label { color: var(--navy); font-weight: 650; }
input, textarea { width: 100%; margin-top: 9px; border: 1px solid #d8d0c5; border-radius: 12px; color: var(--ink); background: white; outline: none; }
input { height: 52px; padding: 0 15px; }
textarea { resize: vertical; padding: 14px 15px; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,53,83,.09); }
.primary, .read-button, .small-button { border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: white; font-weight: 700; cursor: pointer; }
.primary { width: 100%; min-height: 54px; margin-top: 18px; }
.button-link, .read-button { display: flex; align-items: center; justify-content: center; min-height: 52px; }
.quiet-link { display: block; text-align: center; margin-top: 22px; color: var(--muted); font-size: 14px; }
.helper, .draft-status, .copyright-note, .privacy-note { color: var(--muted); font-size: 13px; text-align: center; }
.day-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.day-seal { width: 70px; height: 70px; border-radius: 50%; border: 1px solid #d5b979; display: grid; place-content: center; text-align: center; color: var(--navy); font: 25px Georgia, serif; background: #fffaf0; }
.day-seal small { display: block; font: 10px -apple-system, sans-serif; color: var(--muted); margin-top: 2px; }
.hero-card { position: relative; overflow: hidden; padding: 25px; border-radius: 22px; background: linear-gradient(145deg, var(--navy-deep), #164b6e); color: white; box-shadow: 0 20px 45px rgba(6,38,61,.18); }
.hero-card::after { content: "✦"; position: absolute; right: 15px; top: 4px; color: rgba(240,217,157,.22); font-size: 88px; }
.hero-card h1, .hero-card h2 { color: white; position: relative; z-index: 1; }
.hero-card p { color: rgba(255,255,255,.72); margin: 10px 0 18px; position: relative; z-index: 1; }
.chapter-label { display: block; margin-bottom: 10px; color: #f0d99d; font-size: 12px; letter-spacing: .12em; }
.read-button { position: relative; z-index: 1; background: white; color: var(--navy); }
.read-button.secondary { margin-top: 18px; border: 1px solid var(--navy); }
.checkin-form { margin-top: 26px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 17px; background: var(--blue-pale); border-radius: 14px; }
.check-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--red); }
.check-row span { display: grid; gap: 4px; }
.check-row small { color: #62809a; font-weight: 400; }
.field { display: block; margin-top: 24px; }
.field > span { display: block; }
.section-heading { margin-bottom: 26px; }
.section-heading p:last-child { color: var(--muted); margin-bottom: 0; }
.section-heading.compact { margin-bottom: 18px; }
.progress-summary { display: flex; align-items: baseline; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--navy); }
.progress-summary b { font: 42px Georgia, serif; }
.member-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.member-chip { padding: 15px 12px; border-radius: 13px; background: #f0ece5; display: grid; gap: 5px; }
.member-chip.done { background: var(--blue-pale); }
.member-chip span { font-weight: 700; color: var(--navy); }
.member-chip small { color: #948f87; }
.member-chip.done small { color: #507795; }
.archive-list { display: grid; gap: 12px; }
.archive-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.archive-day { width: 44px; font: 24px Georgia, serif; color: var(--red); }
.archive-copy { min-width: 0; flex: 1; display: grid; gap: 5px; }
.archive-copy b { color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-copy small { color: var(--muted); }
.archive-state { font-size: 11px; color: #9a948a; }
.archive-state.done { color: var(--red); }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--navy); font-weight: 650; }
.reading-heading { margin-bottom: 20px; }
.reader-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.reader-tools { position: sticky; z-index: 5; top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -6px 22px; padding: 10px 12px; border: 1px solid rgba(229,221,208,.9); border-radius: 13px; background: rgba(255,253,248,.94); backdrop-filter: blur(10px); }
.reader-tools > span { color: var(--muted); font-size: 13px; }
.reader-size-controls { display: flex; gap: 5px; }
.reader-size-controls button { min-width: 42px; height: 34px; padding: 0 9px; border: 1px solid #d8d0c5; border-radius: 9px; color: var(--navy); background: white; cursor: pointer; }
.reader-size-controls button[aria-pressed="true"] { border-color: var(--navy); color: white; background: var(--navy); }
.chapter-text { color: #24201c; font-family: "Songti SC", STSong, "Noto Serif SC", serif; font-size: 18px; line-height: 2; letter-spacing: .015em; }
.chapter-text[data-size="small"] { font-size: 16px; }
.chapter-text[data-size="large"] { font-size: 21px; }
.chapter-text p { margin: 0 0 1.25em; text-align: justify; }
.chapter-text h2 { margin: 2.1em 0 .85em; padding-top: .8em; border-top: 1px solid var(--line); font-size: 25px; }
.chapter-text blockquote { margin: 0 0 .55em; padding: 17px 18px; border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; color: var(--navy); background: #f7f1e5; font-weight: 650; }
.chapter-text .reader-cite { margin: 0 4px 2em; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: .78em; text-align: right; }
.chapter-text .reader-list-item { position: relative; margin-bottom: .75em; padding: 13px 15px; border-radius: 12px; background: var(--blue-pale); text-align: left; }
.book-pages { display: grid; gap: 12px; }
.book-pages img { display: block; width: 100%; height: auto; border-radius: 8px; background: white; box-shadow: 0 6px 22px rgba(20,32,40,.08); }
.reader-card .button-link { margin-top: 12px; }
.record-card { padding: 19px; margin-bottom: 14px; }
.record-card span { color: var(--muted); font-size: 13px; }
.record-card p { white-space: pre-wrap; margin-bottom: 0; }
.subheading { margin: 30px 0 8px; font-size: 21px; }
.profile-card { text-align: center; padding: 28px 0; }
.avatar { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--navy-deep), var(--navy)); font: 32px "Songti SC", serif; }
.profile-card p { color: var(--muted); }
.stat-card { margin: 8px 0 18px; padding: 22px; border-radius: var(--radius); background: var(--blue-pale); display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; }
.stat-card b { font: 40px Georgia, serif; color: var(--navy); }
.stat-card span { color: var(--navy); }
.stat-card small { color: var(--muted); }
.plain-card, .admin-card { padding: 20px; margin-bottom: 16px; }
.plain-card h2, .admin-card h2 { font-size: 20px; }
.plain-card p { color: var(--muted); margin-bottom: 0; }
.secondary-button { width: 100%; height: 50px; border: 1px solid #c9c1b6; border-radius: 12px; color: var(--muted); background: transparent; }
.admin-card form { display: flex; align-items: flex-end; gap: 10px; }
.admin-card form input { margin: 10px 0 0; }
.small-button { min-width: 90px; height: 50px; padding: 0 15px; }
.admin-members { margin-top: 12px; }
.admin-members > div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.admin-members form { display: block; }
.text-button { border: 0; background: none; color: var(--red); }
.empty-card { padding: 28px 20px; border: 1px dashed #cfc5b8; border-radius: var(--radius); text-align: center; color: var(--muted); }
.bottom-nav { position: fixed; z-index: 20; bottom: 0; width: min(100%, 520px); min-height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 10px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.bottom-nav a { display: grid; place-items: center; align-content: center; gap: 2px; color: #827e77; font-size: 12px; }
.bottom-nav b { font-size: 21px; line-height: 1; font-weight: 400; }
.bottom-nav a.active { color: var(--red); }

@media (max-width: 380px) {
  .page { padding-left: 18px; padding-right: 18px; }
  h1 { font-size: 32px; }
  .login-hero h1 { font-size: 37px; }
  .archive-state { display: none; }
}
