:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --paper-deep: #ece6d9;
  --card: #fffefa;
  --ink: #29342f;
  --muted: #80857f;
  --green: #2e6653;
  --green-deep: #23483d;
  --gold: #b38a54;
  --line: rgba(53, 70, 61, .11);
  --shadow: 0 12px 36px rgba(48, 62, 54, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #dedbd3; }
body { min-height: 100%; margin: 0; color: var(--ink); background: #dedbd3; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, textarea, input { font: inherit; }
button { color: inherit; }
.is-hidden { visibility: hidden; pointer-events: none; }

.app-shell { position: relative; width: 100%; min-height: 100vh; margin: 0 auto; overflow: hidden; background: var(--paper); }
.site-header { position: sticky; top: 0; z-index: 20; height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; border-bottom: 1px solid rgba(70,76,70,.05); background: rgba(247,243,234,.94); backdrop-filter: blur(16px); }
.site-header__title { text-align: center; font-size: 17px; font-weight: 700; }
.site-header__seal { width: 31px; height: 31px; display: grid; place-items: center; justify-self: end; border-radius: 10px; color: #f8efdc; background: var(--green); font-family: STKaiti, KaiTi, serif; }
.icon-button { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; font-size: 34px; line-height: 1; }

.page { min-height: calc(100vh - 54px); padding: 18px 18px calc(86px + env(safe-area-inset-bottom)); }
.card { border: 1px solid rgba(255,255,255,.75); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.eyebrow { color: #9b805c; font-size: 11px; letter-spacing: 2px; }
.section-head { margin: 26px 2px 14px; display: flex; align-items: center; justify-content: space-between; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head button, .text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 13px; }

.home-top { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 18px; }
.home-top__hello { margin-top: 5px; font-family: STKaiti, KaiTi, serif; font-size: 25px; font-weight: 700; }
.avatar { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(179,138,84,.25); border-radius: 50%; color: var(--green); background: #eee7d7; font-family: STKaiti, KaiTi, serif; font-size: 21px; }
.hero { position: relative; overflow: hidden; padding: 27px 24px 23px; border-radius: 25px; color: #f8efdc; background: linear-gradient(145deg,#376755,#24493d); box-shadow: 0 18px 42px rgba(35,72,61,.2); }
.hero::before,.hero::after { content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.055); }
.hero::before { width:170px; height:170px; right:-68px; top:-75px; }
.hero::after { width:90px; height:90px; right:30px; bottom:-55px; }
.hero__mark { width: 52px; height: 28px; display:grid; place-items:center; border:1px solid rgba(245,219,168,.32); border-radius:999px; color:#edd29f; font-family:STKaiti,KaiTi,serif; font-size:14px; }
.hero h1 { margin: 15px 0 7px; font-family: STKaiti, KaiTi, serif; font-size: 28px; }
.hero p { margin: 0; color: rgba(255,255,255,.68); font-size: 14px; }
.hero__ask { position:relative; z-index:1; width:100%; margin-top:22px; padding:13px 14px 13px 17px; display:flex; align-items:center; justify-content:space-between; border:0; border-radius:15px; color:#777d77; background:#fffefa; text-align:left; }
.hero__ask strong { padding:7px 13px; border-radius:11px; color:#fff; background:var(--green); font-size:13px; }
.hero__note { margin-top:13px; color:rgba(255,255,255,.46); font-size:11px; }

.shortcut-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.shortcut { padding:19px 17px; border:0; text-align:left; }
.shortcut__icon { width:40px; height:40px; display:grid; place-items:center; border-radius:13px; font-family:STKaiti,KaiTi,serif; font-size:19px; }
.shortcut:nth-child(1) .shortcut__icon { color:#315e4d; background:#deebe3; }
.shortcut:nth-child(2) .shortcut__icon { color:#8b6538; background:#f0e3cf; }
.shortcut:nth-child(3) .shortcut__icon { color:#486976; background:#dfe9ee; }
.shortcut:nth-child(4) .shortcut__icon { color:#915d54; background:#eee0dc; }
.shortcut h3 { margin:13px 0 5px; font-size:16px; }
.shortcut p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.today-card { padding:17px; display:flex; gap:16px; border:0; text-align:left; }
.today-card__cover { width:86px; height:112px; flex:0 0 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:15px; color:#f4e4c8; background:#744c38; font-family:STKaiti,KaiTi,serif; }
.today-card__cover small { margin-top:7px; opacity:.65; }
.today-card__body { min-width:0; flex:1; padding:5px 0; }
.today-card__body small { color:#9a784d; }
.today-card__body h3 { margin:10px 0 16px; font-size:17px; line-height:1.45; }
.today-card__foot { display:flex; justify-content:space-between; color:#91958f; font-size:12px; }
.today-card__foot b { color:var(--green); }

.site-footer { padding:0 18px calc(82px + env(safe-area-inset-bottom)); color:#9a9d97; text-align:center; font-size:11px; line-height:1.7; }
.site-footer a { color:inherit; text-decoration:none; }

.tab-bar { position:fixed; left:0; right:0; bottom:0; z-index:30; height:calc(64px + env(safe-area-inset-bottom)); padding:6px 14px env(safe-area-inset-bottom); display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); background:rgba(255,254,250,.96); backdrop-filter:blur(18px); }
.tab-bar button { display:grid; place-items:center; border:0; color:#92958f; background:transparent; }
.tab-bar b { display:block; padding:8px 12px; border-radius:999px; font-size:13px; font-weight:500; }
.tab-bar button.is-active { color:var(--green); }
.tab-bar button.is-active b { background:#e7f0eb; font-weight:700; }

.chat-page { margin:-18px; display:flex; flex-direction:column; min-height:calc(100vh - 54px - 70px); }
.chat-intro { padding:18px 20px; display:flex; align-items:center; gap:13px; border-bottom:1px solid var(--line); }
.chat-intro__mark { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; color:#f5e8ce; background:var(--green); font-family:STKaiti,KaiTi,serif; font-size:20px; }
.chat-intro h2 { margin:0 0 4px; font-size:17px; }
.chat-intro p { margin:0; color:#7d857f; font-size:12px; }
.dot { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; background:#55a677; }
.messages { min-height:340px; flex:1; padding:20px 17px 185px; }
.message { margin-bottom:16px; display:flex; align-items:flex-start; gap:9px; }
.message--user { justify-content:flex-end; }
.message__avatar { width:29px; height:29px; flex:0 0 auto; display:grid; place-items:center; border-radius:10px; color:#fff; background:var(--green); font-family:STKaiti,KaiTi,serif; font-size:14px; }
.bubble { max-width:82%; padding:13px 15px; border-radius:6px 17px 17px 17px; background:#fffefa; box-shadow:0 7px 22px rgba(56,65,59,.06); font-size:14px; line-height:1.75; white-space:pre-wrap; }
.message--user .bubble { border-radius:17px 6px 17px 17px; color:#fff; background:var(--green); }
.bubble img { width:100%; max-height:210px; margin-bottom:9px; border-radius:12px; object-fit:cover; }
.sources { margin-top:13px; padding-top:11px; border-top:1px solid var(--line); color:#717a74; font-size:12px; }
.sources b { display:block; margin-bottom:7px; color:var(--green); }
.suggestions { display:flex; flex-direction:column; gap:9px; margin:5px 38px 0; }
.suggestion { padding:12px 14px; border:1px solid var(--line); border-radius:14px; color:#55635c; background:#fbfaf5; text-align:left; font-size:13px; }
.composer-wrap { position:fixed; left:0; right:0; bottom:64px; z-index:25; padding:10px 15px 13px; background:linear-gradient(180deg,rgba(247,243,234,0),#f7f3ea 18%); }
.selected-image { margin-bottom:8px; padding:8px; display:flex; align-items:center; gap:10px; border-radius:13px; background:#fff; box-shadow:var(--shadow); }
.selected-image img { width:48px; height:48px; border-radius:9px; object-fit:cover; }
.selected-image button { margin-left:auto; border:0; background:transparent; font-size:22px; }
.composer { padding:7px; display:flex; align-items:flex-end; gap:7px; border:1px solid var(--line); border-radius:18px; background:#fffefa; box-shadow:0 10px 28px rgba(51,64,56,.1); }
.composer textarea { min-height:38px; max-height:120px; flex:1; resize:none; padding:9px 5px; border:0; outline:0; color:var(--ink); background:transparent; line-height:1.5; }
.composer__image,.composer__send { width:38px; height:38px; flex:0 0 auto; border:0; border-radius:12px; }
.composer__image { color:var(--green); background:#edf2ee; font-size:22px; }
.composer__send { color:#fff; background:var(--green); font-size:18px; }
.safety { margin-bottom:6px; color:#9b9e98; text-align:center; font-size:10px; }

.page-hero { padding:28px 25px; border-radius:24px; color:#f8efdc; background:linear-gradient(145deg,#376755,#25463b); box-shadow:0 16px 38px rgba(35,72,61,.16); }
.page-hero h1 { margin:8px 0; font-family:STKaiti,KaiTi,serif; font-size:28px; }
.page-hero p { margin:0; color:rgba(255,255,255,.67); font-size:13px; line-height:1.65; }
.list { display:flex; flex-direction:column; gap:13px; margin-top:19px; }
.list-card { width:100%; padding:15px; display:flex; align-items:center; gap:14px; border:0; text-align:left; }
.book-cover { width:74px; height:94px; flex:0 0 auto; display:grid; place-items:center; border-radius:14px; color:#f4e5cc; background:#76503e; font-family:STKaiti,KaiTi,serif; writing-mode:vertical-lr; letter-spacing:3px; }
.list-card:nth-child(2) .book-cover { background:#536c57; }
.list-card:nth-child(3) .book-cover { background:#536d76; }
.list-card__body { min-width:0; flex:1; }
.list-card__tag { color:#9b7547; font-size:11px; }
.list-card h3 { margin:7px 0; font-size:16px; }
.list-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.list-card__foot { margin-top:10px; display:flex; justify-content:space-between; color:#9a9d97; font-size:11px; }
.list-card__foot b { color:var(--green); }

.tool-card { margin-top:17px; padding:21px; }
.tool-card label { display:block; margin-bottom:11px; font-weight:700; }
.tool-card textarea { width:100%; min-height:130px; padding:15px; resize:vertical; border:0; border-radius:15px; outline:0; color:var(--ink); background:#f5f1e8; line-height:1.65; }
.primary-button { width:100%; margin-top:13px; padding:13px; border:0; border-radius:14px; color:#fff; background:var(--green); font-weight:700; }
.result-card { margin-top:15px; padding:20px; font-size:14px; line-height:1.8; white-space:pre-wrap; }
.result-card h3 { margin:0 0 10px; }

.resource-icon { width:54px; height:61px; flex:0 0 auto; display:grid; place-items:center; border-radius:11px; color:#fff; background:#a45f4c; font-size:12px; font-weight:700; }
.list-card:nth-child(3) .resource-icon { background:#557480; }
.resource-action { padding:7px 11px; border-radius:999px; color:var(--green); background:#e7f0eb; font-size:11px; }
.notice { margin:20px 12px; color:#989d97; text-align:center; font-size:11px; line-height:1.65; }

.member-card { padding:27px 24px 22px; border-radius:24px; color:#f8efd9; background:linear-gradient(135deg,#2f6352,#23483d); box-shadow:0 18px 38px rgba(35,72,61,.18); }
.member-card__top { display:flex; align-items:flex-start; justify-content:space-between; }
.member-card h1 { margin:8px 0 0; font-family:STKaiti,KaiTi,serif; font-size:25px; }
.member-level { padding:6px 10px; border:1px solid rgba(245,219,168,.42); border-radius:999px; color:#f1d6a4; font-size:11px; }
.member-card__bottom { margin-top:25px; padding-top:17px; display:flex; justify-content:space-between; border-top:1px solid rgba(255,255,255,.12); color:rgba(255,255,255,.66); font-size:12px; }
.circle-button { width:100%; margin:15px 0 22px; padding:17px 19px; display:flex; justify-content:space-between; align-items:center; border:0; text-align:left; }
.circle-button h3 { margin:0 0 5px; font-size:17px; }
.circle-button p { margin:0; color:var(--muted); font-size:12px; }
.circle-button span { color:var(--gold); font-size:29px; }

.profile-head { display:flex; align-items:center; gap:13px; padding:10px 4px 19px; }
.profile-head__avatar { width:58px; height:58px; display:grid; place-items:center; border-radius:50%; color:#f8efdc; background:var(--green); font-family:STKaiti,KaiTi,serif; font-size:25px; }
.profile-head h2 { margin:0 0 5px; font-size:20px; }
.profile-head p { margin:0; color:var(--muted); font-size:12px; }
.stats { padding:18px 10px; display:grid; grid-template-columns:repeat(3,1fr); text-align:center; }
.stat + .stat { border-left:1px solid var(--line); }
.stat b { display:block; font-size:21px; }
.stat span { color:var(--muted); font-size:11px; }
.quote { margin-top:15px; padding:24px; color:#715642; background:#eee2cf; }
.quote strong { font-family:STKaiti,KaiTi,serif; font-size:21px; }
.quote p { margin:8px 0 0; color:#93775f; font-size:12px; }
.menu { margin-top:15px; overflow:hidden; }
.menu-row { padding:16px 18px; display:flex; align-items:center; gap:13px; }
.menu-row + .menu-row { border-top:1px solid var(--line); }
.menu-row__icon { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:var(--green); background:#e8f0eb; font-family:STKaiti,KaiTi,serif; }
.menu-row h3 { flex:1; margin:0; font-size:14px; }
.menu-row p { margin:0 5px 0 0; color:var(--muted); font-size:11px; }

.toast { position:fixed; left:50%; bottom:94px; z-index:100; max-width:80%; padding:10px 15px; border-radius:12px; color:#fff; background:rgba(36,48,42,.92); font-size:13px; opacity:0; transform:translate(-50%,10px); pointer-events:none; transition:.2s ease; }
.toast.is-visible { opacity:1; transform:translate(-50%,0); }
.loading { opacity:.68; pointer-events:none; }

@media (min-width: 700px) {
  .app-shell { width: 430px; min-height: 100vh; box-shadow: 0 0 55px rgba(40,46,42,.2); }
  .tab-bar,.composer-wrap { left:50%; right:auto; width:430px; transform:translateX(-50%); }
}
