/* ===========================================================
   PokePlanet 复刻版 · 全新视觉风格
   浅色 · 石墨绿主色 · 圆角卡片
   =========================================================== */

:root {
  --bg:        #f4f6f5;
  --surface:   #ffffff;
  --surface-2: #eef2f0;
  --ink:       #17211f;
  --ink-2:     #3c4a47;
  --muted:     #77857f;
  --line:      #e2e8e5;
  --brand:     #14705c;
  --brand-2:   #22a181;
  --brand-soft:#e6f4ef;
  --excellent: #12a37a;
  --good:      #3b82f6;
  --average:   #e9913a;
  --improve:   #e05555;
  --shadow-sm: 0 1px 2px rgba(20,40,35,.05), 0 2px 8px rgba(20,40,35,.04);
  --shadow-md: 0 2px 6px rgba(20,40,35,.06), 0 12px 28px rgba(20,40,35,.07);
  --radius:    18px;
  --radius-lg: 26px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70rem 40rem at 12% -10%, rgba(34,161,129,.10), transparent 60%),
    radial-gradient(50rem 35rem at 100% 0%, rgba(59,130,246,.07), transparent 60%);
}
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.shell { max-width: 760px; margin: 0 auto; padding: 22px 18px 120px; }
.shell-narrow { max-width: 620px; }

/* ---------------- 顶部 ---------------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 2px 26px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  font-size: 19px; box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand .ghost-btn { margin-left: auto; }

.topbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 16px; color: var(--ink-2); }
.topbar > span:first-of-type { flex: 1; text-align: center; font-weight: 600; }
.topbar-pad { width: 38px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding-bottom: 3px; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); }

.badge {
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; display: inline-block;
}

/* ---------------- 首页 ---------------- */
.hero { padding: 10px 2px 26px; }
.hero-kicker {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.hero-title { font-size: 32px; line-height: 1.28; margin-bottom: 12px; }
.hero-sub { margin: 0; color: var(--muted); font-size: 15px; }

.cards { display: grid; gap: 14px; }
.card {
  position: relative; overflow: hidden; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 22px 20px; cursor: pointer; transition: .2s; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cfe3dc; }
.card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px;
  border-radius: 50%; background: var(--brand-soft); opacity: .7; z-index: 0;
}
.card > * { position: relative; z-index: 1; }
.card-no {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.card-title { font-size: 19px; margin-bottom: 8px; }
.card-desc { color: var(--muted); font-size: 14px; margin: 0; }
.card-meta { display: flex; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.card-meta b { color: var(--brand); font-weight: 700; }

.notice {
  margin-top: 22px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-2); font-size: 13px;
}
.notice strong { display: block; margin-bottom: 4px; font-size: 13px; }
.notice p { margin: 0; }

/* ---------------- 通用面板 ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 16px; margin-bottom: 14px; }
.prose p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.prose p:last-child { margin-bottom: 0; }

.dot-list { margin: 0; padding: 0; list-style: none; }
.dot-list li {
  position: relative; padding-left: 18px; margin-bottom: 10px;
  color: var(--ink-2); font-size: 14.5px;
}
.dot-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--brand-2);
}
.fineprint { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; line-height: 1.7; }
.fineprint.center { text-align: center; margin-top: 18px; }

.intro-head { padding: 4px 2px 20px; }
.intro-head h1 { font-size: 26px; line-height: 1.35; margin-bottom: 12px; }
.intro-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.meta-row { display: flex; gap: 12px; margin-top: 18px; }
.meta-item {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.meta-item span { display: block; font-size: 12px; color: var(--muted); }
.meta-item strong { font-size: 16px; color: var(--brand); }

/* ---------------- 按钮 ---------------- */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border: none; cursor: pointer; border-radius: 14px; padding: 15px 24px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(20,112,92,.22); transition: .18s;
}
.primary-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 9px 15px; font-size: 14px; color: var(--ink-2); transition: .15s;
}
.ghost-btn:hover { background: var(--surface-2); }
.text-btn {
  background: none; border: none; cursor: pointer; color: var(--brand);
  font-size: 14px; font-weight: 600; padding: 4px;
}
.mini-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; margin-left: 6px;
}
.wide { flex: 1; }
.sticky-action {
  position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, rgba(244,246,245,0));
}
.two-col { display: flex; gap: 12px; }
.two-col > * { flex: 1; }

/* ---------------- 答题 ---------------- */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 26px; }
.progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s;
}
.q-wrap { min-height: 320px; }
.q-index {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--brand); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px;
}
.q-text { font-size: 21px; line-height: 1.55; margin: 16px 0 24px; }
.options { display: grid; gap: 11px; }
.option {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px 18px; font-size: 15.5px; color: var(--ink-2); transition: .16s;
}
.option:hover { border-color: #bfd9d0; background: #fbfdfc; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.option .tick {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cbd5d1; flex: none;
  display: grid; place-items: center; font-size: 13px; color: transparent; transition: .16s;
}
.option.selected .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.quiz-nav { display: flex; gap: 12px; margin-top: 26px; }
.quiz-nav button { padding: 14px; border-radius: 14px; font-size: 15px; }
.quiz-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; min-height: 20px; }
.highlight-unanswered { animation: shake .5s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

/* ---------------- 报告 ---------------- */
.report-head { padding: 6px 2px 22px; }
.report-kicker { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.report-head h1 { font-size: 26px; margin-bottom: 12px; }
.report-sum { margin: 0; color: var(--ink-2); font-size: 15px; }

.radar-panel { text-align: center; }
.radar-panel h2 { text-align: center; }
#radar { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

.dims { display: grid; gap: 14px; margin-bottom: 16px; }
.dim {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.dim-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dim-title { font-size: 17px; font-weight: 700; }
.dim-score { font-size: 22px; font-weight: 800; margin-left: auto; }
.dim-chip {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.dim-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.dim-bar > div { height: 100%; border-radius: 999px; }
.dim-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.85; }
.dim-advice {
  margin-top: 14px; padding: 12px 14px; border-radius: 0 12px 12px 0;
  border-left: 3px solid var(--brand-2); background: rgba(34,161,129,.07);
  font-size: 13.5px; color: var(--ink-2);
}
.dim-advice strong { display: block; margin-bottom: 6px; }
.dim-advice p { margin: 0 0 4px; padding-left: 10px; }
.dim-advice p:last-child { margin-bottom: 0; }

.g-excellent { color: var(--excellent); } .bg-excellent { background: var(--excellent); }
.g-good      { color: var(--good);      } .bg-good      { background: var(--good); }
.g-average   { color: var(--average);   } .bg-average   { background: var(--average); }
.g-improvement { color: var(--improve); } .bg-improvement { background: var(--improve); }
.g-default   { color: var(--muted);     } .bg-default   { background: var(--muted); }

.answers { margin-top: 14px; display: grid; gap: 10px; }
.answer-row {
  display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2);
  padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.answer-row:last-child { border-bottom: none; padding-bottom: 0; }
.answer-row span:first-child { flex: none; width: 34px; color: var(--muted); font-weight: 600; }
.answer-row b { color: var(--brand); font-weight: 700; }

/* ---------------- 记录 ---------------- */
.record {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px; transition: .16s; box-shadow: var(--shadow-sm);
}
.record:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.record-time { font-size: 12.5px; color: var(--muted); }
.record-del {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 20px; padding: 4px 8px; border-radius: 8px; flex: none;
}
.record-del:hover { background: #fdeaea; color: var(--improve); }
.empty { text-align: center; padding: 70px 0; color: var(--muted); }
.empty-emoji { font-size: 42px; margin-bottom: 10px; }
.empty p { margin: 0 0 18px; }

/* ---------------- 弹窗 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(16,28,25,.42); backdrop-filter: blur(3px); padding: 20px;
}
.modal {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow-md);
  animation: pop .22s ease-out;
}
.modal.wide { max-width: 420px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal h3 { font-size: 19px; margin-bottom: 6px; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.code-row { display: flex; gap: 10px; }
.code-row input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-size: 15px; letter-spacing: .06em; background: var(--surface-2);
}
.code-row input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.code-row .primary-btn { padding: 13px 20px; font-size: 15px; flex: none; }
.code-tip { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.code-tip code {
  background: var(--brand-soft); color: var(--brand); padding: 2px 7px;
  border-radius: 6px; font-weight: 700; letter-spacing: .08em;
}
.modal-error { color: var(--improve); font-size: 13px; margin: 10px 0 0; }
.modal-cancel { display: block; margin: 16px auto 0; }
.poster-box {
  background: var(--surface-2); border-radius: var(--radius); padding: 10px;
  max-height: 52vh; overflow: auto; margin-bottom: 16px; text-align: center;
}
.poster-box img { width: 100%; border-radius: 10px; display: block; }

@media (max-width: 420px) {
  .hero-title { font-size: 27px; }
  .q-text { font-size: 19px; }
  .shell { padding: 18px 14px 110px; }
}
