:root {
  --blue: #6c8cff;
  --deep: #30405f;
  --muted: #7e8aa4;
  --bg: #f5f7fc;
  --metal: #dceaff;
  --nonmetal: #eaf4dc;
  --gas: #f8ebd7;
  --shadow: 0 10px 28px rgba(70, 96, 155, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--deep);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }
.app { max-width: 680px; min-height: 100vh; margin: auto; padding: 22px 16px 94px; }
.hero { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 13px; font-weight: 700; }
h1 { margin: 0; font-size: 27px; letter-spacing: -.5px; }
.sub, .section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.hero-icon {
  display: grid; width: 65px; height: 65px; place-items: center; border-radius: 22px;
  background: var(--blue); color: white; font-size: 25px; font-weight: 800; box-shadow: var(--shadow);
}
.soft-card { border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.intro { display: flex; flex-direction: column; gap: 5px; padding: 15px 17px; font-size: 14px; }
.intro strong { color: var(--blue); font-size: 17px; }
.intro span { color: var(--muted); }
.legend { display: flex; gap: 14px; padding: 15px 2px 10px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; }
.metal { background: var(--metal); }.nonmetal { background: var(--nonmetal); }.gas { background: var(--gas); }
.element-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.element {
  position: relative; min-height: 82px; padding: 8px 3px 5px; border: 1px solid rgba(62, 82, 119, .1);
  border-radius: 13px; color: var(--deep); text-align: center; transition: transform .12s, filter .12s;
}
.element:active { transform: scale(.94); filter: brightness(.96); }
.element .no { position: absolute; top: 5px; left: 7px; color: #65718a; font-size: 10px; }
.element .symbol { display: block; margin-top: 12px; font-size: 26px; font-weight: 800; line-height: 1; }
.element .name { display: block; margin-top: 6px; color: #59657b; font-size: 12px; }
.page { display: none; }.page.active { display: block; }
.section-head { margin: 7px 2px 14px; }
h2 { margin: 0; font-size: 22px; }
.rhyme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.rhyme-word { padding: 12px 2px; border: 0; border-radius: 12px; background: var(--nonmetal); color: var(--deep); font-size: 20px; font-weight: 800; }
.rhyme-word small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.rhyme-word.active { background: #ffd47f; transform: scale(1.07); }
.rhyme-text { color: #647088; font-size: 16px; line-height: 1.9; text-align: center; }
.flash-head { margin-top: 25px; }
.flash-card {
  width: 100%; min-height: 210px; padding: 18px; border: 0; border-radius: 22px;
  background: linear-gradient(145deg, #dceaff, #f3f7ff); color: var(--deep); box-shadow: var(--shadow);
}
.flash-card.back { background: linear-gradient(145deg, #fff0cb, #fff9e9); }
.flash-card .hint { color: var(--muted); font-size: 13px; }
.flash-card .big-symbol { display: block; margin: 22px 0; font-size: 86px; font-weight: 800; line-height: 1; }
.flash-card .big-name { display: block; margin: 17px 0 8px; font-size: 52px; font-weight: 800; }
.flash-card .answer { display: block; color: #65718a; font-size: 15px; line-height: 1.8; }
.main-button { width: 100%; margin-top: 14px; padding: 13px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 16px; }
.score { padding: 8px 12px; border-radius: 999px; background: #e7edff; color: var(--blue); font-size: 13px; font-weight: 700; }
.quiz-card, .result { padding: 20px; border-radius: 20px; background: white; box-shadow: var(--shadow); }
.question { margin-bottom: 16px; font-size: 20px; font-weight: 800; line-height: 1.5; }
.option { width: 100%; margin-top: 10px; padding: 13px; border: 2px solid #edf0f6; border-radius: 13px; background: white; color: var(--deep); text-align: left; }
.option.correct { border-color: #77cb98; background: #effaf3; }.option.wrong { border-color: #ef9292; background: #fff1f1; }
.explain { margin: 15px 0 0; color: #6f7b91; font-size: 14px; line-height: 1.7; }
.result { padding: 42px 20px; text-align: center; }.result b { display: block; margin: 15px; color: var(--blue); font-size: 58px; }
.bottom-nav {
  position: fixed; right: 0; bottom: 0; left: 0; display: flex; max-width: 680px; margin: auto;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid #edf0f6; background: rgba(255,255,255,.96);
}
.nav-item { flex: 1; padding: 4px; border: 0; background: transparent; color: #8b95a8; font-size: 12px; }
.nav-item span { display: block; margin-bottom: 3px; font-size: 22px; }.nav-item.active { color: var(--blue); font-weight: 700; }
.mask { position: fixed; inset: 0; display: flex; align-items: flex-end; z-index: 3; background: rgba(33, 45, 71, .36); }
.hidden { display: none; }
.detail-card { position: relative; width: 100%; max-width: 680px; margin: 0 auto; padding: 27px 22px calc(22px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: white; }
.close-button { position: absolute; top: 15px; right: 17px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f0f3f8; color: #78849b; font-size: 23px; line-height: 30px; }
.detail-symbol { font-size: 75px; font-weight: 800; line-height: 1; }.detail-name { margin-left: 12px; font-size: 28px; font-weight: 800; }
.detail-meta { margin-top: 14px; color: #65718a; font-size: 14px; line-height: 1.9; }
.detail-intro { margin-top: 13px; padding: 13px; border-radius: 13px; background: #f6f8fc; color: #59657b; font-size: 14px; line-height: 1.7; }
@media (max-width: 350px) { .element { min-height: 74px; }.element .symbol { font-size: 23px; } }
