@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --primary-bg: #e0e7ff;
  --card-bg: #fffdf5;
  --text-main: #5c4033;
  --accent-yellow: #ffd93d;
  --accent-pink: #ff8aae;
  --accent-green: #6bcb77;
  --btn-shadow: rgba(0, 0, 0, 0.1);
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #2b2b2b;
  --muted: #a1a1a1;
  --line: #e9e9e9;
  --bubble: #eeeeee;
  --blue: #3369ff;
  --pink: #ff5c8d;
  --purple: #6b5cff;
  --green: #1ea672;
  --entity: #d62b2b;
  --shadow: 5px 4px 20px rgba(0, 0, 0, 0.13);
  --screen-count: 2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: 'Nunito', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding: 14px;
  display: grid;
  place-items: center;
}

.phone {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 28px));
  margin: 0 auto;
  border-radius: 40px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone--wide {
  width: min(960px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 28px));
}

.carousel {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.carousel-track {
  height: 100%;
  display: flex;
  width: calc(var(--screen-count) * 100%);
  transform: translateX(-25%);
}

.screen {
  width: calc(100% / var(--screen-count));
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.screen-header {
  padding: 30px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screen-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.screen-title--blue h1 {
  color: var(--blue);
}

.screen-title--pink h1 {
  color: var(--pink);
}

.screen-title--purple h1 {
  color: var(--purple);
}

.screen-title--green h1 {
  color: var(--green);
}

.screen-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-block;
  position: relative;
}

.screen-icon--robot {
  background: rgba(51, 105, 255, 0.12);
}

.screen-icon--flower {
  background: rgba(255, 92, 141, 0.12);
}

.screen-icon--grapes {
  background: rgba(107, 92, 255, 0.12);
}

.screen-icon--leaf {
  background: rgba(30, 166, 114, 0.12);
}

.screen-icon::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 7px;
  background: currentColor;
  opacity: 0.18;
}

.screen-title--blue .screen-icon {
  color: var(--blue);
}
.screen-title--pink .screen-icon {
  color: var(--pink);
}
.screen-title--purple .screen-icon {
  color: var(--purple);
}
.screen-title--green .screen-icon {
  color: var(--green);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 32px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.screen-divider {
  height: 1px;
  background: var(--line);
}

.screen-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.screen-body--center {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px 26px 8px;
  overflow: auto;
}

.screen--idioms .screen-body--center {
  display: block;
  text-align: center;
  padding: 34px 26px 12px;
  overflow-y: auto;
}

.screen--brain {
  background: linear-gradient(180deg, #9fcbff 0%, var(--primary-bg) 100%);
  color: var(--text-main);
  overflow: hidden;
}

.brain-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  position: relative;
}

.brain-app::before,
.brain-app::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  opacity: 0.8;
}

.brain-app::before {
  top: 70px;
  right: 50px;
  background: var(--accent-yellow);
  box-shadow: -200px 14px 0 0 rgba(255, 138, 174, 0.85), -120px 44px 0 0 rgba(107, 203, 119, 0.85),
    26px 86px 0 0 rgba(255, 138, 174, 0.85), 12px 170px 0 0 rgba(107, 203, 119, 0.85);
  transform: rotate(18deg);
}

.brain-app::after {
  top: 28px;
  left: 42px;
  width: 12px;
  height: 12px;
  background: #fff8cc;
  box-shadow: 220px 10px 0 0 rgba(255, 255, 255, 0.8), 258px 190px 0 0 rgba(255, 255, 255, 0.8),
    -12px 204px 0 0 rgba(255, 255, 255, 0.78);
  border-radius: 999px;
}

.brain-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  position: relative;
}

.brain-mascot {
  position: absolute;
  left: 0;
  top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brain-mascot-star {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-size: 38px;
  color: #ffb545;
  background: radial-gradient(circle at 30% 30%, #fff8bd 0%, #ffd66e 52%, #ffb347 100%);
  clip-path: polygon(50% 0%, 62% 35%, 98% 35%, 69% 56%, 79% 92%, 50% 71%, 21% 92%, 31% 56%, 2% 35%, 38% 35%);
  filter: drop-shadow(0 6px 10px rgba(255, 173, 64, 0.3));
}

.brain-mascot-badge {
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  color: #4a57b7;
  box-shadow: 0 6px 12px rgba(72, 84, 179, 0.12);
  text-align: center;
}

.header-title {
  margin: 20px 0 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ff7b54;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(0, 0, 0, 0.05);
}

.brain-card {
  background: var(--card-bg);
  border: 4px solid #8d8be6;
  border-radius: 30px;
  margin-top: 26px;
  min-height: 0;
  flex: 1 1 auto;
  box-shadow: 0 10px 0 #7b75d5, 0 18px 30px rgba(88, 102, 196, 0.14);
  display: flex;
  overflow: hidden;
}

.brain-card-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 24px 20px 22px;
  overflow-y: auto;
}

.brain-intro {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #8b6c56;
}

.question-text {
  margin: 0;
  font-size: 20px;
  line-height: 1.58;
  color: var(--text-main);
  font-weight: 700;
}

.answer-mask {
  border: none;
  border-radius: 22px;
  padding: 14px 18px;
  background: linear-gradient(45deg, var(--accent-yellow), #ffb100);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: center;
  min-width: 210px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 5px 0 #d49100, 0 14px 24px rgba(255, 177, 0, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.answer-mask:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #d49100, 0 10px 18px rgba(255, 177, 0, 0.18);
}

.answer-mask.is-hidden {
  display: none;
}

.answer-mask-text {
  white-space: nowrap;
}

.answer-mask-icon {
  font-size: 24px;
  line-height: 1;
}

.brain-answer-panel {
  background: rgba(255, 247, 229, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(223, 194, 152, 0.5);
  padding: 16px 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.brain-answer-panel.is-hidden {
  display: none;
}

.brain-answer-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #9d7e63;
}

.brain-answer-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-main);
  font-weight: 700;
}

.brain-answer-tip {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #8f7a6f;
}

.brain-reaction-row {
  display: flex;
  gap: 14px;
  margin-top: auto;
}

.brain-reaction {
  flex: 1 1 0;
  border: none;
  border-radius: 24px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--text-main);
}

.brain-reaction-emoji {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffe7a6 0%, #ffc86a 100%);
  box-shadow: 0 8px 18px rgba(255, 180, 77, 0.24);
  font-size: 30px;
}

.brain-reaction-text {
  font-size: 15px;
  font-weight: 800;
  color: #6f4d42;
}

.brain-reaction.is-active .brain-reaction-emoji {
  outline: 4px solid rgba(255, 138, 174, 0.32);
  transform: translateY(-1px);
}

.brain-reaction.is-negative .brain-reaction-emoji {
  outline: 4px solid rgba(107, 203, 119, 0.32);
}

.brain-footer {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.button-group {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.btn-action {
  flex: 1 1 0;
  height: 54px;
  border-radius: 27px;
  border: none;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.1);
}

.btn-action:disabled {
  opacity: 0.55;
}

.btn-prev {
  background-color: var(--accent-green);
  box-shadow: 0 5px 0 #4da658;
}

.btn-next {
  background-color: var(--accent-pink);
  box-shadow: 0 5px 0 #d66384;
}

.brain-nav-arrow {
  font-size: 16px;
}

.brain-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brain-progress-steps {
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: #a97d54;
}

.progress-bar {
  height: 12px;
  background: #d1d8e0;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(94, 114, 180, 0.16);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), #ffb100);
  border-radius: inherit;
  transition: width 180ms ease;
}

.brain-feedback-note {
  margin: 0;
  text-align: center;
  color: #6c5d62;
  font-size: 12px;
  line-height: 1.45;
}

.chat-window {
  overflow-y: auto;
  padding: 18px 22px 8px;
  height: 100%;
}

.message {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.message.user {
  justify-content: flex-end;
}

.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1.962px 1.962px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--blue);
}

.bubble {
  max-width: 84%;
  padding: 18px 18px;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.message.bot .bubble {
  background: var(--bubble);
  color: #505050;
  border-radius: 25px 25px 25px 0;
}

.message.user .bubble {
  background: var(--blue);
  color: #fff;
  border-radius: 25px 0 25px 25px;
}

.screen--cards {
  background: linear-gradient(180deg, #fad0c4 0%, #ffd1ff 100%);
  overflow: hidden;
}

.cards-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  position: relative;
}

.cards-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 76px;
}

.cards-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  color: #d53f8c;
  text-align: center;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 4px 10px rgba(0, 0, 0, 0.08);
}

.cards-manual-btn {
  position: absolute;
  right: 4px;
  top: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #fff7c2 0%, #ffd977 100%);
  box-shadow: 0 6px 14px rgba(255, 198, 90, 0.24);
  font-size: 20px;
}

.card-container {
  flex: 1;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid #bee3f8;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(255, 255, 255, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 18px 24px;
  position: relative;
  overflow: hidden;
}

.card-meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: rgba(112, 93, 117, 0.78);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.cards-bead-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.cards-bead {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(129, 108, 188, 0.16);
}

.cards-bead--pink {
  background: radial-gradient(circle at 30% 30%, #ffd6e8 0%, #ff8aae 70%);
}

.cards-bead--blue {
  background: radial-gradient(circle at 30% 30%, #d8f1ff 0%, #8bd3ff 70%);
}

.cards-bead--purple {
  background: radial-gradient(circle at 30% 30%, #efe3ff 0%, #c29cff 70%);
}

.card-question-scroll {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 12px 6px 18px;
}

.card-question-zh {
  margin: 0;
  font-size: 28px;
  color: #d53f8c;
  font-weight: 900;
  line-height: 1.6;
  text-align: center;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cards-ornament {
  position: absolute;
  font-size: 30px;
  filter: drop-shadow(0 6px 8px rgba(183, 116, 196, 0.18));
  opacity: 0.92;
}

.cards-ornament--tl {
  top: 82px;
  left: 18px;
}

.cards-ornament--tr {
  top: 74px;
  right: 18px;
}

.cards-ornament--bl {
  left: 24px;
  bottom: 92px;
  font-size: 56px;
}

.cards-ornament--br {
  right: 22px;
  bottom: 82px;
  font-size: 56px;
}

.cards-cloud {
  position: absolute;
  width: 138px;
  height: 80px;
  background: radial-gradient(circle at 40% 35%, rgba(255, 221, 243, 0.74) 0%, rgba(255, 221, 243, 0.08) 70%);
  filter: blur(2px);
  opacity: 0.7;
}

.cards-cloud--left {
  left: 6px;
  top: 160px;
}

.cards-cloud--right {
  right: 6px;
  bottom: 146px;
  background: radial-gradient(circle at 50% 40%, rgba(221, 236, 255, 0.78) 0%, rgba(221, 236, 255, 0.08) 72%);
}

.cards-footer {
  padding: 18px 6px 2px;
}

.cards-button-group {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.cards-btn {
  flex: 1 1 0;
  height: 60px;
  border-radius: 30px;
  border: none;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
}

.cards-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b794f4;
}

.cards-btn-random {
  background: linear-gradient(180deg, #d69e2e 0%, #b7791f 100%);
  color: #fff;
  box-shadow: 0 6px 0 #8f5f17;
}

.cards-btn-next {
  background: linear-gradient(180deg, #faf5ff 0%, #e9d8fd 100%);
  color: #553c9a;
  border: 2px solid #b794f4;
  box-shadow: 0 6px 0 #b794f4;
}

.cards-btn-icon {
  font-size: 20px;
  line-height: 1;
}

.screen-footer {
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
}

.footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pill {
  height: 56px;
  width: 100%;
  border: none;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 22px;
}

.pill-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.pill-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  background: currentColor;
  mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M3.4 20.2c-.4.2-.9.1-1.2-.2-.3-.3-.4-.8-.2-1.2L4 12 1 5.2c-.2-.4-.1-.9.2-1.2.3-.3.8-.4 1.2-.2l19 8c.4.2.7.6.7 1s-.3.8-.7 1l-19 8zM5.6 12l-1 2.3L18.2 12 4.6 9.7l1 2.3z\" fill=\"black\"/></svg>') center / contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M3.4 20.2c-.4.2-.9.1-1.2-.2-.3-.3-.4-.8-.2-1.2L4 12 1 5.2c-.2-.4-.1-.9.2-1.2.3-.3.8-.4 1.2-.2l19 8c.4.2.7.6.7 1s-.3.8-.7 1l-19 8zM5.6 12l-1 2.3L18.2 12 4.6 9.7l1 2.3z\" fill=\"black\"/></svg>') center / contain no-repeat;
}

.footer-actions[data-accent='blue'] .pill-icon {
  color: var(--blue);
}
.footer-actions[data-accent='pink'] .pill-icon {
  color: var(--pink);
}
.footer-actions[data-accent='purple'] .pill-icon {
  color: var(--purple);
}
.footer-actions[data-accent='green'] .pill-icon {
  color: var(--green);
}

.feedback-panel {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 10px 8px;
}

.feedback-chip {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(93, 83, 230, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 24px rgba(63, 60, 109, 0.08);
}

.feedback-chip-icon {
  font-size: 16px;
  line-height: 1;
}

.feedback-chip.is-active {
  border-color: rgba(74, 107, 255, 0.55);
  background: rgba(74, 107, 255, 0.12);
  color: var(--blue);
}

.feedback-chip.is-negative {
  border-color: rgba(255, 109, 122, 0.55);
  background: rgba(255, 109, 122, 0.12);
  color: #e05f6b;
}

.feedback-note {
  margin: 10px 4px 0;
  text-align: center;
  color: #8a8a8a;
  font-size: 11px;
  line-height: 1.45;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 7px;
  padding: 6px 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  opacity: 0.3;
  transform: scale(1);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dot.is-active {
  opacity: 1;
  transform: scale(1.15);
}

.dot--blue {
  background: var(--blue);
}
.dot--pink {
  background: var(--pink);
}
.dot--purple {
  background: var(--purple);
}

.dot--green {
  background: var(--green);
}

.screen-body--plan {
  padding: 18px 18px 10px;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.plan-summary {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(30, 166, 114, 0.16), rgba(30, 166, 114, 0.06));
  border: 1px solid rgba(30, 166, 114, 0.14);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 26px rgba(30, 166, 114, 0.08);
}

.plan-summary-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #4e7f6c;
  letter-spacing: 0.06em;
}

.plan-summary-range {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  color: #166147;
}

.plan-summary-count {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4f7063;
}

.plan-list {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-bottom: 8px;
}

.plan-empty {
  border-radius: 20px;
  border: 1px dashed rgba(30, 166, 114, 0.22);
  background: #f7fffb;
  padding: 18px 16px;
  color: #65877a;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.plan-day {
  display: grid;
  gap: 8px;
}

.plan-day-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #5c6d66;
  letter-spacing: 0.02em;
}

.plan-item {
  border-radius: 20px;
  border: 1px solid rgba(30, 166, 114, 0.08);
  background: #fff;
  box-shadow: 0 8px 22px rgba(25, 50, 38, 0.05);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.plan-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-item-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}

.plan-item-delete {
  border: none;
  background: #f3f4f4;
  color: #70847b;
  border-radius: 999px;
  min-width: 48px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.plan-item-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #264137;
}

.plan-item-details {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #70807a;
}

.plan-status {
  margin: 0;
  font-size: 13px;
  color: #75867f;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.idiom-word {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--purple);
}

.idiom-story {
  margin: 0 auto;
  width: min(100%, 290px);
  display: grid;
  gap: 16px;
  text-align: left;
  padding-bottom: 6px;
  align-content: start;
}

.idiom-illustration-card {
  margin: 18px auto 0;
  width: min(100%, 236px);
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(71, 56, 122, 0.08);
  border: 1px solid rgba(107, 92, 255, 0.08);
  background: #f7f5ff;
  padding: 10px;
}

.idiom-illustration {
  display: block;
  width: 100%;
  height: 100%;
}

.idiom-illustration-scene {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 14px;
}

.idiom-illustration-scene--default,
.idiom-illustration-scene--study {
  background: linear-gradient(180deg, #f4edff 0%, #e2d7ff 100%);
}

.idiom-illustration-scene--mountain {
  background: linear-gradient(180deg, #eefaf4 0%, #d5f0e5 100%);
}

.idiom-illustration-scene--horse {
  background: linear-gradient(180deg, #fff1e6 0%, #ffd9bd 100%);
}

.idiom-illustration-scene--bird {
  background: linear-gradient(180deg, #eef4ff 0%, #d8e5ff 100%);
}

.idiom-illustration-scene--animal {
  background: linear-gradient(180deg, #fff0f7 0%, #ffd8e8 100%);
}

.idiom-illustration-scene--sun {
  background: linear-gradient(180deg, #fff8e8 0%, #ffe2a8 100%);
}

.idiom-illustration-scene--home {
  background: linear-gradient(180deg, #f5f0ff 0%, #e2d7ff 100%);
}

.idiom-illustration-scene--warrior {
  background: linear-gradient(180deg, #fff0ee 0%, #ffd1ca 100%);
}

.idiom-illustration-orb {
  position: absolute;
  width: 112px;
  height: 112px;
  right: 10px;
  top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.idiom-illustration-badge {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--purple);
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(88, 71, 145, 0.12);
}

.idiom-illustration-title {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: #5647ba;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.idiom-illustration-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #6b6682;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
}

.idiom-motif-row {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.idiom-motif {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 6px 8px;
  box-shadow: inset 0 0 0 1px rgba(107, 92, 255, 0.08);
}

.idiom-motif-icon {
  color: #5b4fe0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.idiom-motif-label {
  margin-top: 6px;
  color: #6d6a7b;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}

.idiom-illustration-wave {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(107, 92, 255, 0.14);
}

.idiom-illustration-wave--one {
  width: 118px;
  height: 10px;
  bottom: 28px;
}

.idiom-illustration-wave--two {
  width: 86px;
  height: 8px;
  bottom: 16px;
  background: rgba(107, 92, 255, 0.22);
}

.idiom-section {
  border-radius: 22px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(107, 92, 255, 0.08);
  box-shadow: 0 10px 24px rgba(40, 26, 90, 0.06);
  min-height: fit-content;
  height: auto;
}

.idiom-section--story {
  background: linear-gradient(180deg, rgba(107, 92, 255, 0.16), rgba(107, 92, 255, 0.07));
  border-color: rgba(107, 92, 255, 0.14);
}

.idiom-section--meaning {
  background: linear-gradient(180deg, rgba(134, 121, 255, 0.11), rgba(134, 121, 255, 0.05));
  border-color: rgba(107, 92, 255, 0.1);
}

.idiom-section--origin {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.045), rgba(0, 0, 0, 0.025));
  border-color: rgba(0, 0, 0, 0.06);
}

.idiom-section-label {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.idiom-section--story .idiom-section-label {
  color: var(--purple);
}

.idiom-section--meaning .idiom-section-label {
  color: #7d6cf8;
}

.idiom-section--origin .idiom-section-label {
  color: #8a8a8a;
}

.idiom-section-content {
  font-size: 14px;
  line-height: 1.65;
  color: #555;
  font-weight: 600;
}

.idiom-section--story .idiom-section-content {
  color: #49405f;
  font-size: 15px;
  line-height: 1.72;
}

.idiom-section--origin .idiom-section-content {
  color: #767676;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
}

.entity {
  color: var(--entity);
  font-weight: 700;
}

.screen--idioms {
  background: linear-gradient(180deg, #fad0c4 0%, #ffd1ff 100%);
  overflow: hidden;
}

.idiom-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

.idiom-header {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.idiom-banner {
  min-width: 220px;
  padding: 14px 24px;
  border-radius: 26px;
  background: linear-gradient(180deg, #9a8cff 0%, #7667db 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(118, 103, 219, 0.2);
  text-shadow: 0 2px 6px rgba(73, 61, 153, 0.18);
}

.idiom-banner-icon {
  font-size: 24px;
}

.card-main {
  flex: 1;
  margin: 18px 0 0;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid #bee3f8;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(255, 255, 255, 1);
  overflow-y: auto;
  padding: 28px 20px 24px;
  position: relative;
}

.idiom-title {
  margin: 0 0 16px;
  font-size: 36px;
  color: #d53f8c;
  font-weight: 900;
  text-align: center;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 0 4px 6px rgba(0, 0, 0, 0.1);
}

.idiom-beads {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.idiom-bead {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(129, 108, 188, 0.16);
}

.idiom-bead--pink {
  background: radial-gradient(circle at 30% 30%, #ffd6e8 0%, #ff8aae 70%);
}

.idiom-bead--blue {
  background: radial-gradient(circle at 30% 30%, #d8f1ff 0%, #8bd3ff 70%);
}

.idiom-bead--yellow {
  background: radial-gradient(circle at 30% 30%, #fff0b5 0%, #ffd93d 70%);
}

.idiom-bead--green {
  background: radial-gradient(circle at 30% 30%, #dbffdd 0%, #6bcb77 70%);
}

.idiom-bead--purple {
  background: radial-gradient(circle at 30% 30%, #efe3ff 0%, #c29cff 70%);
}

.idiom-storybook {
  display: grid;
  gap: 18px;
}

.idiom-section-card {
  border-radius: 28px;
  padding: 18px 18px 16px;
  border: 3px solid rgba(145, 194, 232, 0.58);
  box-shadow: 0 8px 18px rgba(140, 163, 207, 0.12);
}

.idiom-section-card--story {
  background: linear-gradient(180deg, #d9efff 0%, #c1e4ff 100%);
}

.idiom-section-card--meaning {
  background: linear-gradient(180deg, #ffe5ef 0%, #ffd9ea 100%);
}

.idiom-section-card--origin {
  background: linear-gradient(180deg, #ebffe5 0%, #dbf9d2 100%);
}

.idiom-section-label {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: #6a55bf;
  letter-spacing: 0;
  text-transform: none;
}

.section-content {
  font-size: 20px;
  color: #333;
  line-height: 1.8;
  margin-bottom: 0;
  text-align: justify;
  font-weight: 700;
}

.source-panel {
  background-color: rgba(247, 250, 252, 1);
  border-radius: 20px;
  padding: 15px 20px;
  border: 2px solid #e2e8f0;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.entity {
  color: #e53e3e;
  font-weight: 900;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: rgba(229, 62, 62, 0.35);
  text-underline-offset: 5px;
}

.idiom-footer {
  padding: 18px 6px 2px;
}

.idiom-button-group {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.idiom-btn {
  flex: 1 1 0;
  height: 60px;
  border-radius: 30px;
  border: none;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 0 #b794f4;
  transition: all 0.1s;
}

.idiom-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b794f4;
}

.idiom-btn-reset {
  background: linear-gradient(180deg, #d69e2e 0%, #b7791f 100%);
  color: #fff;
  box-shadow: 0 6px 0 #8f5f17;
}

.idiom-btn-next {
  background: linear-gradient(180deg, #faf5ff 0%, #e9d8fd 100%);
  color: #553c9a;
  border: 2px solid #b794f4;
}

.idiom-btn-icon {
  font-size: 24px;
  line-height: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100vw);
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.16);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 16px;
  font-family: inherit;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-ghost,
.btn-primary {
  border: none;
  border-radius: 14px;
  height: 44px;
  font-size: 14px;
  font-weight: 700;
}

.btn-ghost {
  background: #f2f2f2;
  color: #555;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 380px) {
  body {
    padding: 10px;
  }
  .screen-header {
    padding: 26px 18px 16px;
  }
  .screen-footer {
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .footer-actions {
    gap: 12px;
  }
  .pill {
    padding: 0 14px 0 18px;
  }
  .feedback-panel {
    margin-left: 4px;
  }
}
.manual-form {
  display: grid;
  gap: 8px;
  border-radius: 14px;
  border: 1px dashed rgba(234, 90, 53, 0.35);
  background: #fff8f3;
  padding: 10px;
}

.manual-form.is-hidden {
  display: none;
}

.manual-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--soft-ink);
}

.manual-form textarea {
  resize: vertical;
  min-height: 52px;
}

.panel-idioms {
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.idiom-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.idiom-toolbar p {
  margin: 0;
  font-size: 12px;
  color: var(--soft-ink);
}

.idiom-list {
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: grid;
  gap: 10px;
}

.idiom-item {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fffefb;
  padding: 10px 12px;
}

.idiom-word {
  margin: 0 0 4px;
  font-size: 24px;
  font-family: 'Ma Shan Zheng', cursive;
  color: #413247;
}

.idiom-story {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.idiom-chain-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--soft-ink);
}

.entity {
  color: var(--entity);
  font-weight: 700;
}

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

@keyframes drift {
  from {
    transform: translateY(-2px);
  }
  to {
    transform: translateY(6px);
  }
}

@media (max-width: 420px) {
  body {
    padding: 10px;
  }

  .app-shell {
    min-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .card-question-zh {
    font-size: 21px;
  }

  .idiom-word {
    font-size: 22px;
  }
}

.screen--english {
  background:
    radial-gradient(circle at top right, rgba(255, 228, 197, 0.95), transparent 28%),
    radial-gradient(circle at bottom left, rgba(213, 231, 255, 0.95), transparent 24%),
    linear-gradient(135deg, #fff8ef 0%, #fefdf8 52%, #f2f8ff 100%);
  overflow: hidden;
}

.english-app {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 22px;
  padding: 28px 28px 30px;
}

.english-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.english-eyebrow {
  margin: 0 0 10px;
  color: #df6f3c;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.english-title {
  margin: 0;
  color: #2e3442;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.16;
}

.english-intro {
  margin: 16px 0 0;
  color: #5d6370;
  font-size: 19px;
  line-height: 1.7;
  max-width: 24em;
}

.english-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.english-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #445066;
  border: 1px solid rgba(87, 110, 152, 0.12);
  box-shadow: 0 10px 24px rgba(77, 98, 135, 0.08);
  font-size: 14px;
  font-weight: 700;
}

.english-actions {
  margin-top: 28px;
}

.english-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3369ff 0%, #5b8cff 100%);
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(51, 105, 255, 0.24);
}

.english-note {
  margin: 14px 0 0;
  color: #7a8191;
  font-size: 14px;
  line-height: 1.7;
}

.english-preview {
  align-self: center;
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(88, 99, 122, 0.08);
  box-shadow: 0 18px 38px rgba(73, 82, 101, 0.14);
}

.preview-card--main {
  width: min(100%, 360px);
  padding: 24px 22px 20px;
  transform: rotate(-4deg);
}

.preview-card--side {
  position: absolute;
  right: 10px;
  bottom: 22px;
  width: min(86%, 250px);
  padding: 16px 18px;
  transform: rotate(6deg);
}

.preview-label {
  margin: 0;
  color: #df6f3c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.preview-line {
  margin: 18px 0 0;
  color: #2d3444;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.5;
}

.preview-underline {
  text-decoration: underline;
  text-decoration-thickness: 4px;
  text-decoration-color: #e0a87d;
  text-underline-offset: 7px;
}

.preview-checks {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.preview-checks span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 30px;
  font-weight: 900;
}

.preview-checks span:first-child {
  background: rgba(30, 166, 114, 0.14);
  color: #1ea672;
}

.preview-checks span:last-child {
  background: rgba(255, 92, 141, 0.12);
  color: #d54b72;
}

.preview-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #4f5668;
  line-height: 1.8;
}

@media (max-width: 900px) {
  .phone--wide {
    width: min(560px, calc(100vw - 20px));
    height: min(860px, calc(100vh - 20px));
  }

  .english-app {
    grid-template-columns: 1fr;
    padding: 24px 20px 26px;
  }

  .english-title {
    font-size: 34px;
  }

  .english-intro {
    font-size: 17px;
  }

  .english-preview {
    min-height: 280px;
  }

  .preview-card--side {
    right: 0;
    bottom: 0;
  }
}
