:root {
  --bg: #fff6ee;
  --ink: #2a3344;
  --muted: #5c6b64;
  --card: #ffffff;
  --line: #eadfd4;
  --green: #0f8a6e;
  --orange: #d97706;
  --red: #c2410c;
  --blue: #2563eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
body {
  max-width: 840px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
h1 { font-size: 22px; margin: 8px 0 4px; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
button, .btn {
  appearance: none; border: 0; border-radius: 12px; padding: 12px 16px;
  background: var(--green); color: #fff; font-size: 15px; cursor: pointer;
  display: inline-block; text-decoration: none; text-align: center;
}
.anan-bar {
  display: flex; align-items: center; gap: 10px; margin: -4px 0 12px;
  font-size: 13px; color: var(--muted);
}
.anan-bar a { color: var(--green); text-decoration: none; }
.anan-bar span { margin-left: auto; font-weight: 700; color: var(--ink); }
.nav .anan-bar {
  margin: 0 0 0 4px; padding: 0 0 0 10px;
  border-left: 1px solid var(--line);
}
.nav .anan-bar span { margin-left: 0; }
.home-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.home-tile {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 14px; text-decoration: none; color: var(--ink);
}
.home-tile b { display: block; font-size: 18px; margin-bottom: 6px; }
.home-tile span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.qr { display: block; width: 180px; height: 180px; object-fit: contain; margin: 10px auto 0; border-radius: 12px; background: #fff; }
button.ghost { background: #eef4f1; color: var(--ink); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.score {
  display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px;
}
.score b { font-size: 36px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metrics .score b { font-size: 30px; }
.lab { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag.lag, .tag.weak { background: #fee2e2; color: var(--red); }
.tag.ok, .tag.fair { background: #dcfce7; color: var(--green); }
.tag.ahead, .tag.good { background: #dbeafe; color: var(--blue); }
.tag.rusty { background: #fef3c7; color: var(--orange); }
.tag.strong { background: #ede9fe; color: #6d28d9; }
.seg { display: flex; gap: 8px; margin-bottom: 10px; }
.seg button { background: #eef4f1; color: var(--ink); padding: 8px 12px; font-size: 13px; }
.seg button.on { background: var(--green); color: #fff; }
.kind { display: flex; gap: 8px; margin: 8px 0; }
.kind label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); font-size: 13px; }
.kind input { width: auto; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.thumbs img { width: 100%; height: 72px; object-fit: cover; border-radius: 8px; background: #eee; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.kp { font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kp:last-child { border-bottom: 0; }
.plist .kp { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nav {
  order: -1;
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px; margin: -16px -16px 16px; padding: 12px 16px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.nav::before {
  content: "安安";
  margin-right: auto;
  font-weight: 800; color: var(--green); font-size: 18px;
  padding: 6px 4px;
}
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent;
}
.nav a:hover { background: #f4f7f5; color: var(--ink); }
.nav a.on { color: var(--green); background: #e6f6f1; border-color: #cde8df; }
.soon { color: var(--muted); font-size: 14px; line-height: 1.7; }
#chart { width: 100%; height: 180px; display: block; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2a3344; color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; display: none; z-index: 30;
}
.dict-list { margin-top: 8px; }
.dict-row {
  display: grid; grid-template-columns: 28px 1fr 1.2fr; gap: 8px;
  align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.dict-row:last-child { border-bottom: 0; }
.dict-row .en i { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }
.dict-row .en.hide { color: transparent; text-shadow: 0 0 8px rgba(42,51,68,.35); }
.dict-row .en.hide i { display: none; }
.speak-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.speak-item:last-child { border-bottom: 0; }
.speak-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.speak-item .en { font-size: 18px; font-weight: 700; }
.speak-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.speak-actions button { padding: 8px 12px; font-size: 13px; }
.overall { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.overall h2 { margin-bottom: 8px; }
.q-item { margin: 12px 0; }
.q-item label { font-weight: 600; }
.review-box { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.review-box ul { margin: 6px 0 12px 18px; padding: 0; }
@media print {
  .nav, .anan-bar, .toast, #paceCard, #speakCard, #wrongCard, #essayCard, .plist, button, .sub { display: none !important; }
  body { background: #fff; padding: 0; }
  #dictCard { border: 0; }
}
@media (max-width: 520px) {
  body { padding: 12px; }
  .nav { margin: -12px -12px 12px; padding: 10px 10px; }
  .nav a { font-size: 13px; padding: 7px 8px; }
  .row3 { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .dict-row { grid-template-columns: 24px 1fr; }
  .dict-row .en { grid-column: 2; }
}
