:root {
  --bg: #fff7ed;
  --paper: #fffdf9;
  --ink: #233a52;
  --subtle: #657f95;
  --orange: #ff8d5f;
  --orange-deep: #ff6c55;
  --yellow: #ffe18d;
  --blue: #84d4ff;
  --mint: #9be7ca;
  --pink: #ffc4d0;
  --line: #efe2cf;
  --shadow: 0 4px 16px rgba(56, 74, 93, 0.1);
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #ffffff;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: var(--space-lg);
  padding-bottom: 80px;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: #f5f0e8;
  border-bottom: 1px solid #e8dcc8;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-bar button.back {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f0e8;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-bar span {
  font-size: 18px;
  font-weight: 700;
}

.hero-panel {
  margin-top: var(--space-md);
  padding: var(--space-xl);
  border-radius: 24px;
  background: linear-gradient(145deg, #ffe48d 0%, #ffd9aa 54%, #c4ebff 100%);
  color: #20425d;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -14px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.mascot {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: rgba(255, 255, 255, 0.82);
}

.hero-panel h3 {
  margin: var(--space-md) 0 var(--space-sm);
  font-size: 24px;
  line-height: 1.2;
}

.hero-panel p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.card,
.row-card,
.goal-card,
.metric,
.story-card {
  background: var(--paper);
  border: 1px solid #f3e8d8;
  border-radius: var(--radius);
}

.card,
.goal-card,
.story-card {
  padding: var(--space-lg);
  margin-top: 10px;
}

.metric {
  padding: 12px 14px;
  margin-top: 0;
}

.card > strong {
  margin-bottom: var(--space-md);
}

.row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  margin-top: 10px;
}

.icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.icon.yellow { background: #fff3c8; }
.icon.blue { background: #e5f6ff; }
.icon.mint { background: #e8fbf2; }
.icon.pink { background: #ffe8ef; }

strong {
  display: block;
  font-size: 17px;
}

span,
p.small {
  color: var(--subtle);
  font-size: 14px;
  line-height: 1.6;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.pill {
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  background: #f8f2e8;
  color: #7b6d5d;
  cursor: pointer;
}

.pill.active {
  background: #ffe4a6;
  color: #8f6318;
}

.progress-bar {
  height: 12px;
  margin-top: var(--space-md);
  border-radius: 999px;
  background: #f3eadb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fd4ff, #9ae8c9);
  transition: width 0.3s;
}

.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: 0;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  box-shadow: 0 8px 16px rgba(255, 125, 95, 0.24);
}

.secondary {
  color: #24658d;
  background: #eaf6ff;
}

.ghost {
  color: #8b693a;
  background: #fff1d2;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.banner {
  margin-top: 10px;
  padding: var(--space-lg);
  border-radius: 24px;
  background: linear-gradient(135deg, #dff4ff, #fff1c2);
}

.banner strong {
  font-size: 18px;
}

.banner .small {
  font-size: 14px;
  margin-top: var(--space-sm);
}

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

.metric span {
  font-size: 14px;
}

.metric b {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  color: var(--ink);
}

.illustration {
  margin-top: var(--space-md);
  padding: var(--space-xl);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.1)),
    linear-gradient(135deg, #ffefb1, #d5efff);
}

.art-box {
  height: 160px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 30%, #fff7da 0, transparent 22%),
    radial-gradient(circle at 72% 40%, #ffd7bb 0, transparent 24%),
    linear-gradient(135deg, #d9f1ff 0%, #fff4ca 100%);
  display: grid;
  place-items: center;
  font-size: 54px;
}

.story-card {
  line-height: 1.8;
  font-size: 15px;
}

.book-page {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  border-radius: 24px;
  background: linear-gradient(180deg, #fffefb 0%, #fff8ef 100%);
  border: 1px solid #f0e2cc;
}

.book-page p {
  margin: var(--space-md) 0 0;
  font-size: 16px;
  line-height: 1.9;
  color: #365069;
}

.book-page b {
  display: inline;
  background: #fff0b2;
  padding: 0 4px;
  border-radius: 6px;
}

.bottom-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.input-mock {
  height: 50px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #f0e5d4;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #93a5b2;
  font-size: 15px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl) var(--space-lg);
  border-top: 1px solid #e8dcc8;
  background: #f5f0e8;
  z-index: 1000;
}

.tabbar div {
  text-align: center;
  font-size: 14px;
  color: #95a5b3;
  font-weight: 700;
  padding: var(--space-sm) 0;
  cursor: pointer;
}

.tabbar div.active { color: #ff7a5b; }

.arrow {
  color: #ccc;
  font-size: 18px;
}

.book-list {
  margin-top: var(--space-md);
}

.book-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius);
  background: #faf8f3;
  margin-bottom: var(--space-md);
  border: 2px solid transparent;
  cursor: pointer;
}

.book-item.active {
  border-color: #ff8d5f;
  background: #fff5ed;
}

.book-cover {
  width: 60px;
  height: 80px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff4ca, #ffe4a6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.book-info {
  flex: 1;
}

.book-info strong {
  font-size: 16px;
}

.book-info span {
  font-size: 14px;
}

.vocab-list {
  margin-top: var(--space-md);
}

.vocab-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-bottom: 1px solid #f0e8dc;
  font-size: 15px;
}

.vocab-item:last-child {
  border-bottom: none;
}

.sentence-list {
  margin-top: var(--space-md);
}

.sentence-item {
  padding: var(--space-md);
  background: #faf8f3;
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
  font-size: 15px;
  line-height: 1.7;
}

.reading-content {
  margin-top: var(--space-sm);
  line-height: 1.9;
  font-size: 17px;
  color: #365069;
}

.reading-content p {
  margin: var(--space-md) 0;
}

.option-list {
  margin-top: var(--space-md);
}

.option-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  background: #faf8f3;
  margin-bottom: var(--space-md);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 16px;
}

.option-item.active {
  border-color: #ff8d5f;
  background: #fff5ed;
}

.option-label {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0e8dc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex: 0 0 auto;
}

.option-item.active .option-label {
  background: #ff8d5f;
  color: white;
}

.score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe48d, #ffd9aa);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: var(--space-xl) auto;
}

.score-circle span:first-child {
  font-size: 40px;
  font-weight: 800;
  color: #20425d;
}

.score-circle span:last-child {
  font-size: 15px;
  color: #8b693a;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  margin-top: var(--space-lg);
}

.stats-row div {
  text-align: center;
}

.stats-row div strong {
  font-size: 22px;
  color: var(--ink);
}

.stats-row div span {
  font-size: 13px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid #f0e8dc;
  cursor: pointer;
  font-size: 16px;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item .arrow {
  color: #ccc;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff4ca, #ffe4a6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.time-picker input {
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius);
  border: 1px solid #f0e8dc;
  font-size: 16px;
  margin-top: var(--space-sm);
}

.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  font-size: 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #ff8d5f;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.log-list {
  margin-top: var(--space-md);
}

.log-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid #f0e8dc;
  font-size: 15px;
}

.log-item:last-child {
  border-bottom: none;
}

.log-item .status {
  font-size: 14px;
}

.log-item .status.success {
  color: #9be7ca;
}

.ai-image {
  width: 100%;
  height: 180px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff4ca, #d5efff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  margin: var(--space-md) 0;
}

.chapter-item {
  padding: var(--space-lg);
  background: #faf8f3;
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
}

.chapter-item:last-child {
  margin-bottom: 0;
}

.chapter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.book-name {
  font-size: 14px;
  color: #ff8d5f;
  background: #fff5ed;
  padding: 3px 10px;
  border-radius: 10px;
}

.chapter-num {
  font-size: 14px;
  color: #999;
}

.chapter-title {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: var(--space-md);
}

.chapter-stats {
  display: flex;
  gap: var(--space-md);
  font-size: 14px;
  color: #666;
  margin-bottom: var(--space-sm);
}

.chapter-footer {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #999;
}

.stats-row div:first-child {
  cursor: pointer;
}

@media (max-width: 480px) {
  .page-content {
    padding: var(--space-md);
    padding-bottom: 70px;
  }

  .hero-panel h3 {
    font-size: 22px;
  }

  .hero-panel p {
    font-size: 14px;
  }

  .tabbar {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .reading-content {
    font-size: 16px;
  }

  .option-item {
    font-size: 15px;
  }

  .metric b {
    font-size: 22px;
  }

  .score-circle span:first-child {
    font-size: 36px;
  }
}
