:root {
  --bg: #070a13;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.10);
  --text: #eef2ff;
  --muted: #94a1c6;
  --accent: #6ee7ff;
  --accent2: #9b8cff;
  --gold: #ffd166;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 700px at 15% -10%, rgba(110, 231, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(155, 140, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- 顶栏 ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 18px;
}

.brand .mark { color: var(--accent); }

.tagline {
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

/* ---------- Hero ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 10px 20px 60px; }

.hero { padding: clamp(20px, 5vw, 52px) 0 26px; }

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5.5vw, 46px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.grad {
  background: linear-gradient(100deg, #6ee7ff, #9b8cff 60%, #ffd166);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.sub b { color: var(--text); font-variant-numeric: tabular-nums; }

.searchbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

#q {
  flex: 1;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, background .2s;
}

#q:focus {
  border-color: rgba(110, 231, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

#q::placeholder { color: #6d7896; }

#randomBtn {
  width: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

#randomBtn:hover { background: rgba(255, 255, 255, 0.09); }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.filters select option { background: #10162b; }

.ghost {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.ghost:hover { background: rgba(255, 255, 255, 0.09); }

/* ---------- 结果 ---------- */
.results { margin-top: 10px; }

.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 2px 14px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.hint { font-size: 12px; opacity: 0.8; }

.list { display: flex; flex-direction: column; }

.word {
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
  cursor: pointer;
  transition: background .18s;
}

.word:hover { background: rgba(255, 255, 255, 0.025); }

.word-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1.2fr) auto;
  gap: 14px;
  align-items: baseline;
}

.w {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--text);
  overflow-wrap: anywhere;
}

.ipa {
  font-family: "Segoe UI", "Lucida Sans Unicode", sans-serif;
  color: var(--accent);
  font-size: 14px;
  margin-left: 8px;
}

.cn { color: #cfd8f5; font-size: 15px; }

.badge {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.word-body {
  display: none;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.8;
}

.word.open .word-body { display: block; }

.word-body .row { margin-bottom: 8px; }
.word-body .row:last-child { margin-bottom: 0; }
.word-body .k {
  display: inline-block;
  min-width: 62px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}

.word-body .eg { color: #dfe6ff; }
.word-body .eg-cn { color: var(--muted); font-size: 13px; }

.coll { color: var(--gold); }

.more {
  display: block;
  margin: 22px auto 0;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.more:hover { background: rgba(255, 255, 255, 0.09); }

.empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}

.hidden { display: none !important; }

/* ---------- 页脚 ---------- */
footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 50px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

footer a { color: var(--muted); }
.dot { opacity: .5; }

@media (max-width: 640px) {
  .word-head { grid-template-columns: 1fr; gap: 6px; }
  .badge { justify-self: start; }
  .hint { display: none; }
}
