:root {
  --bg: #12140f;
  --bg-soft: #191c16;
  --surface: #1f231c;
  --surface-2: #262b22;
  --line: #343a2e;
  --line-soft: #2a2f25;
  --text: #e8e9e0;
  --text-2: #a8ac9c;
  --text-3: #767b6c;
  --accent: #b8d94a;
  --accent-dim: #8ba833;
  --accent-bg: #2a3318;
  --warm: #e8a33d;
  --warm-bg: #33270f;
  --red: #d96b5a;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.01em; }

.site-header {
  height: 64px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6vw;
  position: sticky;
  top: 0;
  background: rgba(18,20,15,0.92);
  backdrop-filter: blur(12px);
  z-index: 50;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.logo b { display:block; font-weight:600; line-height:1.1; }
.logo small { display:block; color:var(--text-3); font-size:10px; font-weight:400; line-height:1.2; letter-spacing:0; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #12140f;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.site-header nav { display: flex; gap: 28px; font-size: 14px; color: var(--text-2); }
.site-header nav a:hover { color: var(--accent); }

/* ---------- 首页 hero ---------- */
.hero { padding: 92px 6vw 76px; border-bottom: 1px solid var(--line-soft); }
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-tagline {
  display: inline-block; font-size: 12px; letter-spacing: 0.12em;
  color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: 999px; padding: 4px 14px; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.25; letter-spacing: -0.03em; }
.hero p { color: var(--text-2); font-size: 15px; line-height: 1.9; margin: 22px 0 34px; }
.search-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 16px; max-width: 620px; margin: 0 auto;
  transition: border-color .2s;
}
.search-wrap:focus-within { border-color: var(--accent-dim); }
.search-icon { color: var(--text-3); flex-shrink: 0; }
.search-wrap input {
  flex: 1; background: none; border: 0; outline: none; color: var(--text);
  font-size: 15px; padding: 16px 12px; min-width: 0;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-wrap kbd {
  font-size: 11px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 7px; font-family: var(--font);
}
.hero-stats { margin-top: 18px; font-size: 13px; color: var(--text-3); }
.hero-stats strong { color: var(--accent); font-size: 15px; }
.hero-steps { display:flex; justify-content:center; gap:22px; flex-wrap:wrap; margin-top:24px; color:var(--text-2); font-size:12px; }
.hero-steps span { display:flex; align-items:center; gap:7px; }
.hero-steps i { display:grid; place-items:center; width:21px; height:21px; border:1px solid var(--accent-dim); border-radius:50%; color:var(--accent); font-style:normal; font-size:11px; }

/* ---------- 词条列表 ---------- */
.section { padding: 56px 6vw; max-width: 1200px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 22px; }
.section-head span { font-size: 13px; color: var(--text-3); }
.ind-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.ind-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.ind-btn:hover { border-color: var(--text-3); color: var(--text); }
.ind-btn--active { background: var(--accent-bg); border-color: var(--accent-dim); color: var(--accent); }

.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.term-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px 22px;
  transition: border-color .18s, transform .18s, background .18s;
  display: block;
}
.term-card:hover { border-color: var(--accent-dim); background: var(--surface-2); transform: translateY(-2px); }
.term-card[hidden] { display: none !important; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.card-abbr { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.card-debate {
  font-size: 11px; color: var(--warm); background: var(--warm-bg);
  padding: 2px 9px; border-radius: 999px;
}
.card-full { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.card-plain { font-size: 13px; color: var(--text-2); line-height: 1.7; min-height: 44px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.card-tags span { font-size: 11px; color: var(--text-3); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }
.empty { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 14px; }

.section--about { border-top: 1px solid var(--line-soft); }
.section--about h2 { font-size: 18px; margin-bottom: 14px; }
.section--about p { color: var(--text-2); font-size: 14px; max-width: 720px; line-height: 1.9; }

/* ---------- 词条详情页 ---------- */
.term-page { max-width: 860px; margin: 0 auto; padding: 32px 6vw 72px; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 28px; }
.breadcrumb a:hover { color: var(--accent); }
.term-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding: 32px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; margin-bottom: 28px;
}
.term-abbr { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.term-full { margin-top: 14px; }
.full-en { font-size: 15px; color: var(--accent); font-weight: 500; }
.full-zh { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tag { font-size: 12px; color: var(--text-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.badge--debate { color: var(--warm); background: var(--warm-bg); }
.badge--stable { color: var(--accent); background: var(--accent-bg); }
.term-hero-side { border-left: 1px solid var(--line); padding-left: 32px; display: flex; flex-direction: column; justify-content: center; }
.side-label { font-size: 12px; color: var(--text-3); letter-spacing: 0.05em; margin-bottom: 10px; }
.term-hero-side p { margin: 0; font-size: 15px; line-height: 1.85; }

.block { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 16px; }
.block h2 { font-size: 17px; margin-bottom: 18px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.block-head h2 { margin: 0; }
.block-hint { font-size: 12px; color: var(--text-3); }
.block--read { border-color: var(--line); }

.variant { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.variant:last-child { border-bottom: 0; padding-bottom: 4px; }
.vote-btn {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3);
  display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.vote-btn:hover { color: var(--red); border-color: var(--red); }
.vote-btn.voted { color: #12140f; background: var(--red); border-color: var(--red); }
.variant-body { flex: 1; min-width: 0; }
.variant-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.variant-label { font-size: 17px; font-weight: 600; }
.variant--top .variant-label { color: var(--accent); }
.variant-ipa { font-size: 13px; color: var(--text-2); font-family: "Times New Roman", serif; }
.speak-btn {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg);
  border: 1px solid var(--accent-dim); color: var(--accent);
  font-size: 10px; cursor: pointer; display: grid; place-items: center; padding-left: 2px;
}
.speak-btn:hover { background: var(--accent); color: #12140f; }
.variant-desc { font-size: 13px; color: var(--text-3); margin: 4px 0 10px; }
.vote-bar { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.vote-bar span { display: block; height: 100%; background: var(--accent-dim); border-radius: 999px; transition: width .35s; }
.variant--top .vote-bar span { background: var(--accent); }
.variant-pct { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.vote-note { font-size: 12px; color: var(--text-3); margin-top: 14px; }

.scene { margin: 0; padding: 18px 22px; background: var(--bg-soft); border-left: 3px solid var(--accent-dim); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.9; color: var(--text); }
.misread { display: flex; gap: 14px; align-items: flex-start; }
.misread-icon { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--warm-bg); color: var(--warm); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.misread p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.85; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.rel-card { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 12px 14px; transition: border-color .15s; }
.rel-card:hover { border-color: var(--accent-dim); }
.rel-card strong { display: block; font-size: 15px; }
.rel-card span { font-size: 12px; color: var(--text-3); }
.block--share { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.block--share h2 { margin-bottom: 4px; }
.share-sub { font-size: 13px; color: var(--text-3); margin: 0; }
.share-btn { background: var(--accent); color: #12140f; border: 0; border-radius: 9px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.share-btn:hover { background: #c9e85c; }

.site-footer {
  border-top: 1px solid var(--line-soft); padding: 24px 6vw;
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3);
}

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 9px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .term-hero { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .term-hero-side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
  .term-abbr { font-size: 40px; }
  .block { padding: 22px 20px; }
  .section { padding: 44px 5vw; }
  .hero { padding: 64px 5vw 56px; }
  .site-header { padding: 0 5vw; }
  .site-header nav { gap: 16px; }
  .logo small { display:none; }
  .block--share { flex-direction: column; align-items: flex-start; }
}

/* ============ 社区补充 ============ */
.nav-community { color: var(--accent) !important; }
.auth-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 8px; padding: 6px 16px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.auth-btn:hover, .auth-btn.authed { border-color: var(--accent-dim); color: var(--accent); }

.section-link { font-size: 13px; color: var(--accent); }
.section-link:hover { text-decoration: underline; }
.section-desc { color: var(--text-2); font-size: 13px; margin: -8px 0 20px; }
.section--community { border-top: 1px solid var(--line-soft); }
.community-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 12px; }
.community-empty { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.contribute-btn {
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 9px; padding: 11px 20px; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: all .15s;
}
.contribute-btn:hover { background: var(--accent); color: #12140f; }

.community-page { max-width: 1140px; margin: 0 auto; padding: 56px 6vw 80px; }
.community-hero { text-align: center; margin-bottom: 48px; }
.community-hero h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.3; letter-spacing: -0.03em; margin-bottom: 18px; }
.community-hero p { color: var(--text-2); font-size: 15px; line-height: 1.9; max-width: 620px; margin: 0 auto; }
.community-grid { display: grid; grid-template-columns: 400px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .community-grid { grid-template-columns: 1fr; } }

.submit-panel, .endorse-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
}
.submit-panel h2, .endorse-panel h2 { font-size: 18px; margin-bottom: 6px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.user-name { font-size: 12px; color: var(--accent); }
.panel-sub { font-size: 12px; color: var(--text-3); margin: 0 0 20px; }
#submit-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
#submit-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
#submit-form label em { color: var(--red); font-style: normal; }
#submit-form input, #submit-form select, #submit-form textarea {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 14px; outline: none; resize: vertical;
  font-family: inherit;
}
#submit-form input:focus, #submit-form select:focus, #submit-form textarea:focus { border-color: var(--accent-dim); }
#submit-form input::placeholder, #submit-form textarea::placeholder { color: var(--text-3); }
.submit-btn {
  background: var(--accent); color: #12140f; border: 0; border-radius: 9px;
  padding: 13px 20px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.submit-btn:hover { background: #c9e85c; }
.submit-hint { font-size: 11px; color: var(--text-3); line-height: 1.7; margin: 0; }

.submission-list { display: flex; flex-direction: column; gap: 14px; }
.sub-card { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 18px 20px; }
.sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sub-abbr { font-size: 18px; font-weight: 700; }
.sub-tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.sub-tag--pending { color: var(--warm); background: var(--warm-bg); }
.sub-tag--approved { color: var(--accent); background: var(--accent-bg); }
.sub-full { font-size: 13px; color: var(--accent); }
.sub-industry { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.sub-read { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.sub-read span { color: var(--text-3); margin-right: 6px; }
.sub-scene { font-size: 13px; color: var(--text); line-height: 1.8; margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--accent-dim); }
.sub-note { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.sub-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.endorse-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.endorse-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.endorse-btn b { color: var(--accent); margin-left: 4px; }
.endorse-btn:disabled, .submit-btn:disabled { opacity: .55; cursor: wait; }
.sub-foot { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.text-btn { border: 0; background: none; color: var(--text-2); padding: 7px 5px; cursor: pointer; font: inherit; font-size: 12px; }
.text-btn:hover, .text-btn:focus-visible { color: var(--accent); text-decoration: underline; }
.my-section { margin-top: 38px; border-top: 1px solid var(--line); padding-top: 24px; }
.my-section h2 { margin: 0 0 8px; font-size: 18px; }
.my-section > p { color: var(--text-2); font-size: 12px; line-height: 1.7; }
.my-submission { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 10px 0; font-size: 13px; }
.admin-auth { display: flex; gap: 8px; max-width: 480px; }
.admin-auth input { flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px; }
.endorse-btn:disabled, .submit-btn:disabled { opacity: .55; cursor: wait; }
.sub-foot { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.text-btn { border: 0; background: none; color: var(--text-2); padding: 7px 5px; cursor: pointer; font: inherit; font-size: 12px; }
.text-btn:hover, .text-btn:focus-visible { color: var(--accent); text-decoration: underline; }
.my-section { margin-top: 38px; border-top: 1px solid var(--line); padding-top: 24px; }
.my-section h2 { margin: 0 0 8px; font-size: 18px; }
.my-section > p { color: var(--text-2); font-size: 12px; line-height: 1.7; }
.my-submission { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 10px 0; font-size: 13px; }
.admin-auth { display: flex; gap: 8px; max-width: 480px; }
.admin-auth input { flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px; }
.sub-by { font-size: 11px; color: var(--text-3); }
