/* ===== 小升初英语2 · 湖南小学毕业总复习 ===== */
:root {
  --bg: #eef7f5;
  --card: #ffffff;
  --ink: #1f3a3a;
  --ink-soft: #5a7575;
  --brand: #1e9b8a;
  --brand-dark: #147a6c;
  --brand-soft: #d8f3ee;
  --green: #3d9b6a;
  --green-soft: #e2f5eb;
  --red: #d45b5b;
  --red-soft: #fdeaea;
  --blue: #3a7ec2;
  --blue-soft: #e6f1fb;
  --yellow: #e6b422;
  --yellow-soft: #fff8e0;
  --purple: #7b68ee;
  --purple-soft: #ede9fe;
  --shadow: 0 4px 16px rgba(30, 100, 90, .10);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #c8ebe4 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, #d4e8f7 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 20px 18px 60px; }

/* ---- 顶部 ---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 6px;
}
.topbar .logo { font-size: 1.9rem; }
.topbar h1 { font-size: 1.35rem; }
.topbar .sub { color: var(--ink-soft); font-size: .85rem; }
.btn-home {
  margin-left: auto; text-decoration: none; color: var(--brand-dark);
  background: #fff; border: 2px solid var(--brand); border-radius: 999px;
  padding: 6px 16px; font-size: .9rem; font-weight: 600;
}
.btn-home:hover { background: var(--brand); color: #fff; }

/* ---- 英雄区 ---- */
.hero {
  background: linear-gradient(135deg, #2bb5a0, #1e8fc4);
  color: #fff; border-radius: var(--radius);
  padding: 26px 28px; margin: 14px 0 24px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -30px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero h2 { font-size: 1.5rem; margin-bottom: 6px; position: relative; }
.hero p { opacity: .92; font-size: .95rem; position: relative; }
.hero .stats { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; position: relative; }
.hero .stat b { font-size: 1.5rem; display: block; }
.hero .stat span { font-size: .82rem; opacity: .9; }

/* ---- 专题卡片 ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; background: var(--brand-soft);
}
.card h3 { font-size: 1.12rem; }
.card .desc { color: var(--ink-soft); font-size: .85rem; flex: 1; }
.card .meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); }
.progress {
  height: 10px; border-radius: 999px; background: #dceae7; overflow: hidden;
}
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4ecdc4, var(--brand));
  transition: width .4s ease;
}
.card .go {
  align-self: flex-start; text-decoration: none; font-weight: 600;
  color: #fff; background: var(--brand); border-radius: 999px;
  padding: 8px 22px; font-size: .92rem;
}
.card .go:hover { background: var(--brand-dark); }
.card.review { border: 2px dashed var(--red); }
.card.review .go { background: var(--red); }

.section-title { font-size: 1.1rem; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }
.foot-note { text-align: center; color: var(--ink-soft); font-size: .8rem; margin-top: 40px; }
.link-reset { color: var(--ink-soft); font-size: .8rem; background: none; border: none; cursor: pointer; text-decoration: underline; }

/* ---- 做题页 ---- */
.dots { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.dot {
  width: 34px; height: 34px; border-radius: 10px; border: 2px solid #cfe3df;
  background: #fff; color: var(--ink-soft); font-size: .85rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.dot.cur { border-color: var(--brand); color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(30,155,138,.18); }
.dot.right { background: var(--green-soft); border-color: var(--green); color: #2c7a54; }
.dot.wrong { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.dot.half { background: var(--yellow-soft); border-color: var(--yellow); color: #9a7a00; }

/* ---- 过关子题 ---- */
.subq {
  margin-top: 18px; border: 2px solid var(--yellow); border-radius: var(--radius);
  background: var(--yellow-soft); padding: 20px;
  animation: pop .3s ease;
}
.subq-head { font-size: 1.1rem; font-weight: 700; color: #9a7a00; }
.subq-tip { font-size: .85rem; color: var(--ink-soft); margin: 4px 0 12px; }

.qcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stars { color: var(--yellow); letter-spacing: 2px; font-size: 1rem; }
.stars .off { color: #d5e5e1; }
.tag {
  font-size: .75rem; background: var(--blue-soft); color: var(--blue);
  border-radius: 999px; padding: 2px 10px; font-weight: 600;
}
.qtext { font-size: 1.12rem; line-height: 1.9; }
.qtext .en { font-family: Georgia, "Times New Roman", serif; }
.qtext .passage {
  background: #f4faf8; border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 14px 16px; margin: 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem; line-height: 1.85;
}
.qtext .blank { color: var(--brand-dark); font-weight: 700; letter-spacing: 2px; }
.qtext .fig-box {
  margin: 12px 0; padding: 14px;
  background: #f8fbfa; border-radius: 12px;
  border: 1px dashed #b8d4cd;
}

.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.choice {
  text-align: left; background: #f5fbf9; border: 2px solid #d5e8e3;
  border-radius: 12px; padding: 12px 16px; font-size: 1rem; cursor: pointer;
  font-family: inherit; color: var(--ink);
}
.choice:hover { border-color: var(--brand); }
.choice.picked { border-color: var(--brand); background: var(--brand-soft); }
.choice.right { border-color: var(--green); background: var(--green-soft); }
.choice.wrong { border-color: var(--red); background: var(--red-soft); }
.choice:disabled { cursor: default; }

.answer-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.answer-row input {
  flex: 1; min-width: 180px; font-size: 1.15rem; padding: 10px 16px;
  border: 2px solid #d5e8e3; border-radius: 12px; font-family: inherit;
  background: #f5fbf9; color: var(--ink);
}
.answer-row input:focus { outline: none; border-color: var(--brand); background: #fff; }
.unit-hint { font-size: .8rem; color: var(--ink-soft); margin-top: 6px; }

.btn {
  border: none; border-radius: 999px; padding: 11px 26px; font-size: 1rem;
  font-weight: 600; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: #b8cfc9; cursor: default; }
.btn.ghost { background: #fff; color: var(--brand-dark); border: 2px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.gray { background: #e2eeeb; color: var(--ink-soft); }
.btn.gray:hover { background: #d0e3de; }
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.feedback {
  margin-top: 16px; border-radius: 12px; padding: 14px 18px; font-weight: 600;
  display: none;
}
.feedback.show { display: block; animation: pop .25s ease; }
.feedback.ok { background: var(--green-soft); color: #23714e; }
.feedback.no { background: var(--red-soft); color: #b03a3a; }
.feedback.mid { background: var(--yellow-soft); color: #8a6d00; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.solution {
  margin-top: 16px; background: var(--blue-soft); border-radius: 12px;
  padding: 12px 20px;
}
.solution summary {
  cursor: pointer; font-weight: 700; color: var(--blue);
  padding: 4px 0; list-style: none;
}
.solution summary::before { content: '▸ '; }
.solution[open] summary::before { content: '▾ '; }
.solution summary::-webkit-details-marker { display: none; }
.solution .steps { white-space: pre-line; margin-top: 8px; }
.solution .final { margin-top: 10px; font-weight: 700; color: var(--brand-dark); padding-bottom: 4px; }

.finish { text-align: center; padding: 50px 20px; }
.finish .big { font-size: 3.2rem; }
.finish h2 { margin: 12px 0 6px; }
.finish p { color: var(--ink-soft); }
.finish .actions { justify-content: center; }

.shake { animation: shake .3s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* ---- 自定义弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 58, 58, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 99; animation: fadein .2s ease; padding: 20px;
}
.modal {
  background: #fff; border-radius: 20px; box-shadow: 0 12px 40px rgba(31,58,58,.25);
  max-width: 380px; width: 100%; padding: 28px 26px; text-align: center;
  animation: modalpop .25s ease;
}
.modal .m-icon { font-size: 2.4rem; }
.modal .m-title { font-size: 1.15rem; font-weight: 700; margin: 8px 0 6px; }
.modal .m-text { color: var(--ink-soft); font-size: .95rem; }
.modal .m-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.modal .m-actions .btn { padding: 10px 24px; font-size: .95rem; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalpop { from { transform: scale(.9) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* ---- 知识手册页 ---- */
.guide-wrap { max-width: 920px; }
.hero-guide {
  background: linear-gradient(135deg, #7b68ee, #3a7ec2);
}
.guide-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 18px 0 28px;
}
.guide-toc a {
  background: #fff; border-radius: 12px; padding: 12px 14px;
  text-decoration: none; color: var(--ink); font-size: .92rem;
  box-shadow: var(--shadow); border-left: 4px solid var(--brand);
  transition: transform .12s ease;
}
.guide-toc a:hover { transform: translateY(-2px); background: var(--brand-soft); }
.guide-section {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
  margin-bottom: 18px;
}
.guide-section h2 {
  font-size: 1.2rem; color: var(--brand-dark);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-soft);
}
.guide-section h3 {
  font-size: 1.05rem; color: var(--ink);
  margin: 16px 0 8px;
}
.guide-section p, .guide-section li {
  font-size: .95rem; color: var(--ink-soft);
  margin: 6px 0;
}
.guide-section ul { padding-left: 22px; }
.guide-section code {
  background: var(--brand-soft); color: var(--brand-dark);
  padding: 1px 6px; border-radius: 6px; font-family: inherit;
  font-size: .92rem;
}
.guide-section .en {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
}
.guide-box {
  background: #f4faf8; border-radius: 12px; padding: 14px 16px;
  margin: 10px 0;
}
.guide-box.yellow { background: var(--yellow-soft); }
.guide-box.blue { background: var(--blue-soft); }
.guide-box.purple { background: var(--purple-soft); }
.guide-table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: .92rem;
}
.guide-table th, .guide-table td {
  border: 1px solid #d5e8e3; padding: 8px 10px;
  text-align: left;
}
.guide-table th {
  background: var(--brand-soft); color: var(--brand-dark);
}

@media (max-width: 560px) {
  html { font-size: 16px; }
  .qcard { padding: 18px; }
  .hero { padding: 20px; }
  .guide-toc { grid-template-columns: 1fr; }
}
