/* ================================================================
   AI作文小老师 · 移动端 H5
   设计令牌与微信小程序 / preview 保持一致（750rpx → 375px 基准）
   ================================================================ */
:root {
  --cream-0: #fffdf7;
  --cream-1: #fdf7ea;
  --cream-2: #fbf1df;
  --ink: #23211d;
  --ink-2: #4f483e;
  --muted: #978c7a;
  --line: #ece3d3;
  --green-1: #3cbb6b;
  --green-2: #8fd354;
  --mint: #ddf7e2;
  --orange: #f5a63c;
  --orange-2: #f8b95c;
  --blue: #5b9df0;
  --card-shadow: 0 10px 26px rgba(186, 154, 96, 0.13);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cream-1);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

body { background: #f4ecdd; }

button, input, textarea { font-family: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; }

/* 应用容器：移动端全屏；桌面端居中成手机框 */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream-1);
  isolation: isolate;
}

@media (min-width: 640px) {
  body {
    background:
      radial-gradient(900px 500px at 15% 0%, #3a352b 0%, rgba(58, 53, 43, 0) 60%),
      radial-gradient(760px 460px at 90% 10%, #33402d 0%, rgba(51, 64, 45, 0) 58%),
      #1f1d19;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
  }
  .app {
    height: min(900px, calc(100dvh - 48px));
    border-radius: 38px;
    box-shadow:
      0 0 0 8px #151412,
      0 0 0 9.5px #3a3834,
      0 34px 70px rgba(0, 0, 0, 0.5);
  }
}

/* ------------------------------ 视图 / 导航栏 ------------------------------ */
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--cream-0) 0%, var(--cream-1) 56%, var(--cream-2) 100%);
}

.view.active { display: flex; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: none;
  display: flex;
  align-items: center;
  padding: calc(9px + var(--safe-top)) 16px 9px;
  min-height: calc(56px + var(--safe-top));
  background: linear-gradient(180deg, rgba(253, 248, 238, 0.96), rgba(253, 248, 238, 0.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-back {
  flex: none;
  width: 74px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #2c2924;
  letter-spacing: 0.3px;
  padding: 6px 0;
}

.chev-left {
  width: 9px;
  height: 9px;
  border-left: 1.8px solid #2c2924;
  border-bottom: 1.8px solid #2c2924;
  transform: rotate(45deg);
  border-radius: 1px;
  flex: none;
}

.topbar-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #211f1c;
  white-space: nowrap;
}

.topbar-dots {
  flex: none;
  width: 74px;
  text-align: right;
  font-size: 19px;
  letter-spacing: 2px;
  color: #33302b;
  line-height: 1;
  transform: translateY(-2px);
  padding: 6px 0;
}

/* ------------------------------ 首页 ------------------------------ */
.home { overflow-y: auto; }
.home-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: calc(28px + var(--safe-top)) 20px calc(26px + var(--safe-bottom));
}

.home-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.home-glow.g1 {
  width: 190px; height: 190px; left: -58px; top: 168px;
  background: radial-gradient(closest-side, rgba(197, 233, 178, 0.65), rgba(197, 233, 178, 0));
}
.home-glow.g2 {
  width: 200px; height: 200px; right: -66px; top: 150px;
  background: radial-gradient(closest-side, rgba(252, 214, 160, 0.6), rgba(252, 214, 160, 0));
}

.home-title {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  font-size: 31px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #191713;
}

.home-sub {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 12.5px;
  letter-spacing: 1.2px;
  color: #433c33;
}

.home-hero {
  position: relative;
  z-index: 1;
  width: min(306px, 82vw);
  height: auto;
  margin: 8px 0 0;
  display: block;
  filter: drop-shadow(0 16px 18px rgba(154, 121, 62, 0.14));
}

.primary-cta {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border-radius: 23px;
  background: linear-gradient(96deg, #3cbb6b 0%, #57c95f 46%, #93d655 100%);
  box-shadow: 0 10px 20px rgba(74, 186, 98, 0.34);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.primary-cta:active { transform: scale(0.985); opacity: 0.94; }
.cta-plane {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
}

.quick-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.quick-card {
  border-radius: 15px;
  padding: 13px 12px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 118px;
  box-shadow: var(--card-shadow);
  transition: transform 0.12s ease;
}
.quick-card:active { transform: scale(0.98); }
.quick-card.green { background: linear-gradient(165deg, #f2fcf1 0%, #e6f8e7 100%); }
.quick-card.warm { background: linear-gradient(165deg, #fffaf0 0%, #fdf2e0 100%); }
.quick-icon {
  align-self: flex-start;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(170, 140, 84, 0.18);
  object-fit: cover;
}
.quick-title { margin-top: 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.3px; color: #221f1a; }
.quick-sub { margin-top: 4px; font-size: 9.5px; line-height: 1.5; color: #7f7565; }

.privacy-pill {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 0;
  width: 100%;
  max-width: 292px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: #4d463b;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(186, 154, 96, 0.1);
}

.chev {
  width: 7px;
  height: 7px;
  border-top: 1.6px solid #b3a894;
  border-right: 1.6px solid #b3a894;
  transform: rotate(45deg);
  flex: none;
}

.design-link {
  margin-top: 14px;
  font-size: 10.5px;
  color: #a3967f;
  text-decoration: none;
  padding: 4px;
}

/* ------------------------------ 选择题目 ------------------------------ */
.topic { overflow-y: auto; }
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 20px 0;
}
.topic-card {
  position: relative;
  height: 136px;
  border-radius: 16px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.42;
  color: #2a261f;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  transition: transform 0.12s ease;
}
.topic-card:active { transform: scale(0.985); }
.topic-card .dot {
  position: absolute;
  left: 13px; top: 13px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}
.topic-card.mint { background: linear-gradient(160deg, #e7fbec 0%, #d9f5df 100%); }
.topic-card.mint-2 { background: linear-gradient(160deg, #e6fbea 0%, #d8f4de 100%); }
.topic-card.orange { background: linear-gradient(160deg, #f9c181 0%, #f3ae62 100%); color: #fff; }
.topic-card.blue {
  background: linear-gradient(160deg, #cbe4fb 0%, #b7d8f8 100%);
  color: #fff;
  box-shadow: 0 0 0 2.5px #4c92f5, 0 12px 24px rgba(58, 122, 214, 0.28);
}
.topic-card.orange .dot { background: rgba(255, 255, 255, 0.55); }
.topic-card.blue .dot { background: rgba(255, 255, 255, 0.55); }

.topic-chat {
  display: flex;
  justify-content: flex-end;
  padding: 34px 42px 0 20px;
}
.bubble {
  position: relative;
  max-width: 240px;
  background: #fff;
  border-radius: 15px;
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.85;
  color: #3a352d;
  box-shadow: 0 6px 16px rgba(186, 154, 96, 0.1);
}
.bubble-tail {
  position: absolute;
  left: 18px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 0 0 3px 0;
  transform: skewX(-28deg);
}

.topic-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 20px 0 34px;
  font-size: 11.5px;
  color: #7f7565;
}
.topic-step-text { letter-spacing: 0.3px; }
.topic-step-arrow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #9a8f7d;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(186, 154, 96, 0.16);
  animation: step-bounce 1.6s ease-in-out infinite;
}
@keyframes step-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.topic-chips {
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: flex-start;
  padding: 14px 20px 0 34px;
}
.chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid #e9dfcd;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  color: #3c362d;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.chip:active { background: #fff; }
.chip.recommended {
  position: relative;
  border-color: #b9e3b3;
  background: #eaf9e9;
  color: #2b7a37;
  font-weight: 600;
}
.chip.selected {
  border-color: #8bbcf0;
  background: #edf6ff;
  color: #23649c;
  font-weight: 600;
}
.chip.selected.recommended {
  border-color: #8bbcf0;
  background: linear-gradient(100deg, #eaf9e9 0%, #edf6ff 100%);
  color: #246b48;
}
.chip.recommended::after {
  content: '推荐';
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 7px;
  background: #3cbb6b;
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
}

.topic-more {
  padding: 16px 20px 0 34px;
}
.topic-more-label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  color: #9a8f7d;
  letter-spacing: 0.5px;
}
.topic-more .chip-row { flex-wrap: wrap; }

.topic-cta-wrap {
  padding: 18px 20px calc(22px + var(--safe-bottom));
}
.topic-cta {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  padding: 7px 16px;
  background: linear-gradient(96deg, #3cbb6b 0%, #57c95f 46%, #93d655 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  box-shadow: 0 10px 22px rgba(74, 186, 98, 0.32);
}
.topic-cta-main { font-size: 15.5px; font-weight: 700; letter-spacing: 1.5px; }
.topic-cta-sub { margin-top: 2px; font-size: 10px; font-weight: 500; opacity: 0.88; letter-spacing: 0.3px; }

/* ------------------------------ 回忆细节 ------------------------------ */
.chat { background: linear-gradient(180deg, #fdf8ee 0%, #fdf6e8 55%, #fcf2e0 100%); }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px 0;
}
.chat-inner { display: flex; flex-direction: column; min-height: 100%; }
.chat-divider {
  text-align: center;
  font-size: 10px;
  color: #a89d8a;
  letter-spacing: 1.5px;
  margin: 4px 0 10px;
}
.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 17px;
}
.msg.user { flex-direction: row-reverse; }
.avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 4px 9px rgba(168, 138, 86, 0.2);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar.ai {
  background: linear-gradient(150deg, #ffcf6e 0%, #f6a93b 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.msg-bubble {
  position: relative;
  max-width: calc(100% - 90px);
  border-radius: 15px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.8;
  color: #38342c;
  background: #fff;
  box-shadow: 0 6px 16px rgba(186, 154, 96, 0.1);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-bubble.user {
  background: linear-gradient(155deg, #fbdc9c 0%, #f8cd83 100%);
  color: #5b492c;
}
.msg-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 7px;
  width: 13px;
  height: 13px;
  background: inherit;
  border-radius: 0 0 2px 0;
  transform: skewX(-28deg);
}
.msg.user .msg-bubble::after {
  display: none;
}
.typing { color: #9a8f7d; font-size: 12.5px; }
.chat-bottom-space { height: 18px; }

.chat-quick {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 10px;
}
.chat-quick-hint {
  flex: 0 0 100%;
  font-size: 10px;
  color: #a3957f;
  line-height: 1.4;
  margin-bottom: 1px;
}
.quick-pill {
  flex: 1;
  min-height: 34px;
  border-radius: 17px;
  border: 1px solid #ecdfc8;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  color: #4a4237;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  white-space: nowrap;
}
.quick-pill.selected {
  border-color: #f0a63a;
  background: #fff2d9;
  color: #a55a12;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(240, 160, 48, 0.22);
}
.quick-pill .emoji { font-size: 12px; line-height: 1; }

.chat-inputbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid rgba(235, 224, 205, 0.75);
  background: rgba(253, 247, 236, 0.94);
}
.chat-input {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #f0e6d6;
  padding: 0 16px;
  font-size: 13px;
  color: #4a4237;
  outline: none;
  min-width: 0;
}
.chat-input::placeholder { color: #8e8371; }
.chat-input:focus { border-color: #d9c9ad; }
.send-btn {
  flex: none;
  min-width: 58px;
  height: 38px;
  border-radius: 19px;
  background: linear-gradient(150deg, #fbc46a 0%, #f19d2c 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(240, 160, 48, 0.3);
}
.send-btn:disabled { opacity: 0.55; }
.chat-outline-bar {
  flex: none;
  padding: 10px 16px calc(16px + var(--safe-bottom));
  border-top: 1px solid rgba(235, 224, 205, 0.75);
  background: rgba(253, 247, 236, 0.94);
}
.outline-btn {
  width: 100%;
  height: 42px;
  border-radius: 21px;
  background: linear-gradient(96deg, #3cbb6b 0%, #7ed05f 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 22px rgba(74, 186, 98, 0.3);
}

/* ------------------------------ 写作页 ------------------------------ */
.write-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 10px 18px 0;
}
.outline-wrap { flex: none; }
.outline-card {
  position: relative;
  border-radius: 17px;
  background: linear-gradient(165deg, #d9ecfb 0%, #cbe5fb 100%);
  padding: 26px 10px 10px;
  box-shadow: 0 8px 20px rgba(118, 158, 199, 0.18);
}
.outline-tag {
  position: absolute;
  left: 22px;
  top: 8px;
  height: 20px;
  padding: 0 12px;
  border-radius: 10px;
  background: linear-gradient(150deg, #fbc45f 0%, #f3a832 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(226, 158, 52, 0.28);
}
.outline-inner {
  background: #fff;
  border-radius: 12px;
  padding: 14px 13px 12px;
  font-size: 12px;
  line-height: 2.05;
  color: #3b362e;
}
.outline-inner p { margin: 0; }

.good-words {
  margin: 10px 0 0 12px;
  align-self: flex-start;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: calc(100% - 12px);
  min-height: 31px;
  padding: 6px 15px;
  border-radius: 16px;
  background: linear-gradient(100deg, #7cc96b 0%, #93d464 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 14px rgba(116, 186, 98, 0.26);
}
.good-words b {
  flex: none;
  white-space: nowrap;
  font-weight: 400;
  opacity: 0.9;
  line-height: 1.6;
}
.good-words span {
  flex: 1;
  line-height: 1.6;
  word-break: break-word;
}

.write-reminder {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(120deg, #fffaf0 0%, #fdf3df 100%);
  border: 1px solid #f2e6d2;
  font-size: 11.5px;
  line-height: 1.7;
  color: #7a6c56;
  box-shadow: 0 6px 16px rgba(186, 154, 96, 0.08);
}
.memory-card {
  flex: none;
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f4f9ee;
  border: 1px solid #dcebd0;
}
.memory-head {
  font-size: 10.5px;
  color: #5f7a4d;
  font-weight: 600;
}
.memory-head span { font-weight: 400; color: #8fa07c; }
.memory-list {
  margin: 5px 0 0;
  padding-left: 15px;
  font-size: 10.5px;
  line-height: 1.7;
  color: #627558;
  max-height: 76px;
  overflow-y: auto;
}
.reminder-icon { flex: none; font-size: 13px; line-height: 1.5; }
.reminder-text { flex: 1; }
.write-stats {
  padding: 6px 12px 0;
  font-size: 10.5px;
  color: #9a8f7d;
  letter-spacing: 0.2px;
}
.write-stats.below { color: #d07a32; font-weight: 600; }
.write-stats.done { color: #3f8c52; font-weight: 600; }

.paper {
  position: relative;
  flex: 1;
  min-height: 230px;
  margin: 11px 0 0;
  border-radius: 14px;
  background-color: #fff;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 27px,
    #efe8da 27px, #efe8da 28px
  );
  background-position: 0 46px;
  box-shadow: 0 8px 20px rgba(186, 154, 96, 0.1);
  overflow: hidden;
}
.paper-placeholder {
  position: absolute;
  top: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  line-height: 28px;
  color: #8c8270;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.paper-input {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 230px;
  border: 0;
  outline: none;
  resize: none;
  padding: 18px 8px;
  font-size: 14px;
  text-align: justify;
  line-height: 28px;
  color: #3a352d;
  background: transparent;
}
.write-actions {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 18px calc(16px + var(--safe-bottom));
}
.pill-btn {
  height: 43px;
  border-radius: 21.5px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: opacity 0.12s ease;
}
.pill-btn:active { opacity: 0.9; }
.pill-btn.blue { background: linear-gradient(100deg, #7db9f3 0%, #4e96ee 100%); box-shadow: 0 8px 18px rgba(74, 140, 225, 0.3); }
.pill-btn.orange { background: linear-gradient(100deg, #f9bf67 0%, #f39628 100%); box-shadow: 0 8px 18px rgba(238, 155, 45, 0.32); }
.pill-btn.ghost {
  background: #fff;
  color: #3b352c;
  border: 1px solid #f0e6d4;
  box-shadow: 0 8px 18px rgba(120, 150, 80, 0.14);
}
.pill-btn:disabled { opacity: 0.6; }

/* ------------------------------ 批改结果 ------------------------------ */
.result {
  background: linear-gradient(180deg, #b7e2fb 0%, #d9f0fd 34%, #eef9fb 56%, #d5f1b8 78%, #b9e58c 100%);
}
.result-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.cloud { position: absolute; background: rgba(255, 255, 255, 0.92); border-radius: 100px; }
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud.c1 { width: 76px; height: 24px; left: -20px; top: calc(96px + var(--safe-top)); }
.cloud.c1::before { width: 34px; height: 30px; left: 12px; top: -14px; }
.cloud.c1::after { width: 24px; height: 22px; left: 42px; top: -9px; }
.cloud.c2 { width: 62px; height: 20px; right: -14px; top: calc(132px + var(--safe-top)); opacity: 0.85; }
.cloud.c2::before { width: 28px; height: 25px; left: 10px; top: -12px; }
.cloud.c2::after { width: 20px; height: 18px; left: 34px; top: -8px; }
.cloud.c3 { width: 48px; height: 15px; right: 42px; top: calc(84px + var(--safe-top)); opacity: 0.7; }
.cloud.c3::before { width: 22px; height: 20px; left: 8px; top: -10px; }
.hill { position: absolute; border-radius: 50% 50% 0 0; bottom: -40px; }
.hill.h1 { width: 330px; height: 170px; left: -110px; background: #b6e08c; }
.hill.h2 { width: 300px; height: 150px; right: -120px; background: #a6d97b; bottom: -34px; }
.tree { position: absolute; z-index: 1; bottom: 4px; }
.tree .crown {
  display: block;
  width: 44px; height: 52px;
  background: #7fbf58;
  border-radius: 48% 48% 44% 44%;
  box-shadow: inset -6px -6px 0 rgba(95, 160, 62, 0.35);
}
.tree .trunk {
  display: block;
  width: 8px; height: 15px;
  margin: -12px auto 0;
  background: #a9713b;
  border-radius: 3px;
}
.tree.t1 { left: 8px; }
.tree.t2 { right: 4px; opacity: 0.95; }
.result .topbar { background: linear-gradient(180deg, rgba(183, 226, 251, 0.92), rgba(183, 226, 251, 0)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.result-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 4px;
}
.score-block { text-align: center; padding: 8px 24px 0; }
.score-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #1c1a16;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
}
.score-star { font-size: 27px; color: #f7a71f; text-shadow: 0 3px 6px rgba(214, 145, 12, 0.3); }
.score-comment { display: block; margin-top: 6px; font-size: 12px; color: #2c2a25; }
.result-cards {
  padding: 16px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.result-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 15px 15px 14px;
  box-shadow: 0 10px 24px rgba(80, 110, 60, 0.12);
}
.result-card.highlight {
  background: linear-gradient(120deg, #ffe694 0%, #ffd359 100%);
  box-shadow: 0 10px 24px rgba(206, 158, 26, 0.24);
}
.result-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  color: #27241f;
  cursor: pointer;
}
.result-card-head .chev { transition: transform 0.2s; }
.result-card.open .result-card-head .chev { transform: rotate(135deg); }
.result-card-preview { margin-top: 6px; font-size: 12px; line-height: 1.85; color: #4b453b; }
.result-card-preview .row { display: flex; gap: 4px; }
.result-card-preview .row-label { color: #6c6354; flex: none; }
.result-card-more { margin-top: 6px; font-size: 10px; color: #b09a74; }
.result-card.highlight .result-card-preview { color: #5f4d1b; }
.result-card.highlight .result-card-more { color: #8a6d1f; }
.result-card-head .star { font-size: 14px; color: #f2a63a; }
.result-card-head .star.hollow { color: #fff; }
.result-card-head .chev { margin-left: auto; border-color: #b5a992; }
.result-card.highlight .chev { border-color: #b99a4d; }
.result-card-body { margin-top: 8px; font-size: 12px; line-height: 1.9; color: #34302a; }
.result-card-body .row { display: flex; gap: 4px; }
.result-card-body .row-label { color: #6c6354; flex: none; }
.result-card-body .fix { color: #e0782a; font-weight: 600; }
.result-actions {
  position: relative;
  z-index: 3;
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 18px calc(16px + var(--safe-bottom));
}
.result-empty {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px 80px;
}
.empty-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(80, 110, 60, 0.16);
  max-width: 320px;
}
.empty-card h2 { margin: 0; font-size: 17px; }
.empty-card p { margin: 10px 0 0; font-size: 12px; line-height: 1.8; color: #6f6555; }
.empty-card .pill-btn { margin-top: 18px; width: 100%; }

/* ------------------------------ 我的作文本 ------------------------------ */
.book { background: linear-gradient(180deg, #fdf8ee 0%, #fdf6e8 55%, #fcf2e0 100%); }
.book-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px calc(26px + var(--safe-bottom));
}
.summary-card {
  height: 108px;
  border-radius: 18px;
  background: linear-gradient(105deg, #79c9f2 0%, #8edbe4 52%, #a7e5c5 100%);
  box-shadow: 0 12px 28px rgba(90, 160, 190, 0.26);
  display: flex;
  align-items: center;
  color: #fff;
}
.summary-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.summary-label { font-size: 10.5px; letter-spacing: 0.6px; opacity: 0.92; }
.summary-value { display: flex; align-items: baseline; gap: 2px; }
.summary-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.summary-unit { font-size: 11.5px; font-weight: 600; }
.summary-divider { width: 1px; height: 54px; background: rgba(255, 255, 255, 0.45); }
.essay-list { display: flex; flex-direction: column; gap: 11px; padding-top: 16px; }
.essay-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 15px;
  padding: 13px;
  box-shadow: 0 8px 20px rgba(186, 154, 96, 0.12);
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease;
}
.essay-item:active { transform: scale(0.99); }
.essay-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.essay-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.essay-del {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fbefec;
  color: #b45b4a;
  font-size: 15px;
  line-height: 24px;
  text-align: center;
  font-weight: 600;
}
.essay-del:active { background: #f6ddd7; }
.essay-title { font-size: 14px; font-weight: 700; color: #26231e; }
.essay-score { margin-top: 2px; font-size: 13px; font-weight: 700; color: #ea8a2c; }
.essay-score .unit { font-size: 9px; font-weight: 500; color: #9a8f7d; }
.essay-date { margin-top: 1px; font-size: 9.5px; color: #94897a; }
.book-new { margin-top: 20px; display: flex; justify-content: center; }
.new-btn {
  min-height: 38px;
  padding: 0 24px;
  border-radius: 19px;
  background: #fff;
  color: #3b352c;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(186, 154, 96, 0.14);
}
.empty-book {
  margin-top: 60px;
  padding: 30px 22px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(186, 154, 96, 0.1);
}
.empty-book h2 { margin: 0; font-size: 16px; }
.empty-book p { margin: 8px 0 0; font-size: 12px; line-height: 1.8; color: #7f7565; }
.empty-book .pill-btn { margin-top: 16px; padding: 0 28px; width: auto; }

/* ------------------------------ 弹层 / Toast ------------------------------ */
.sheet-mask {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(28, 24, 18, 0.45);
  backdrop-filter: blur(1px);
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 78%;
  display: flex;
  flex-direction: column;
  background: #fffdf7;
  border-radius: 22px 22px 0 0;
  padding: 18px 20px calc(18px + var(--safe-bottom));
  box-shadow: 0 -18px 44px rgba(40, 30, 10, 0.2);
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(20px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; }
.sheet-title { margin: 0; font-size: 17px; font-weight: 700; color: #221f1a; }
.sheet-close { font-size: 24px; line-height: 1; color: #a89d8a; padding: 2px 6px; }
.sheet-body { margin-top: 10px; overflow-y: auto; padding-bottom: 4px; }
.sheet-note { margin: 8px 0 0; font-size: 12px; line-height: 1.85; color: #6f6555; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-list button {
  min-height: 44px;
  border-radius: 12px;
  background: #f7f3e9;
  font-size: 14px;
  color: #3b352c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.sheet-list button.current { background: #e8f7e9; color: #2b7a37; font-weight: 600; }
.sheet-list button .check { color: #3cbb6b; font-weight: 700; }
.sheet-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.word-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: #eaf9e9;
  border: 1px solid #cfecc9;
  color: #2b7a37;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.sheet-ideas { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 2; color: #4f483e; }
.sheet-ideas li { margin: 0; }
.sheet-reply { margin: 4px 0 0; font-size: 13px; line-height: 1.8; color: #4f483e; }
.sheet-actions { margin-top: 16px; }
.sheet-actions .pill-btn { width: 100%; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: 80%;
  padding: 9px 16px;
  border-radius: 18px;
  background: rgba(35, 33, 29, 0.82);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  animation: toast-in 0.18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.noscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdf7ea;
  color: #4f483e;
  font-size: 14px;
  z-index: 999;
}

/* 小屏 / 大屏微调 */
@media (max-width: 350px) {
  .home-title { font-size: 28px; }
  .topic-card { height: 124px; font-size: 17px; }
  .quick-title { font-size: 13px; }
}
@media (min-width: 431px) {
  .home-scroll { padding-left: 24px; padding-right: 24px; }
}
