/* 乡音集 · 通用样式（浅色 · 新中式） */
:root {
  --bg: #faf7f1;
  --paper: #fffdf8;
  --ink: #2b2620;
  --muted: #7a7268;
  --red: #b03a2e;
  --red-dark: #8e2e24;
  --gold: #c9a227;
  --line: #e8e0d3;
  --shadow: 0 2px 12px rgba(60, 45, 20, .08);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: min(1120px, 92%); margin: 0 auto; padding: 28px 0 60px; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(1120px, 92%); margin: 0 auto;
  display: flex; align-items: center; gap: 24px; height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .seal {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--red); color: #fff;
  font-family: "Songti SC", "SimSun", serif; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; letter-spacing: 1px;
}
.brand .name { font-family: "Songti SC", "SimSun", serif; font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: 3px; display: block; margin-top: -3px; }
nav.main-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main-nav a {
  text-decoration: none; color: var(--muted); font-size: 15px;
  padding: 7px 14px; border-radius: 999px; transition: all .2s;
}
nav.main-nav a:hover { color: var(--red); background: rgba(176, 58, 46, .07); }
nav.main-nav a.nav-hot { color: var(--red); font-weight: 600; }
nav.main-nav a.active { color: #fff; background: var(--red); font-weight: 500; }

/* ===== 首页 Hero ===== */
.hero { text-align: center; padding: 34px 0 8px; }
.hero h1 {
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(30px, 4.6vw, 46px); letter-spacing: 6px; color: var(--ink);
}
.hero h1 .accent { color: var(--red); }
.hero p.sub { color: var(--muted); margin-top: 10px; font-size: 15.5px; letter-spacing: 1px; }
.hero .stats { display: flex; justify-content: center; gap: 34px; margin-top: 22px; }
.hero .stats b { font-size: 24px; color: var(--red); font-family: "Songti SC", serif; }
.hero .stats span { display: block; font-size: 12.5px; color: var(--muted); letter-spacing: 2px; }

/* ===== 工具条 ===== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 26px 0 18px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar input[type="search"] {
  flex: 1; min-width: 200px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14.5px; outline: none;
}
.toolbar input[type="search"]:focus { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 5px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== 卡片 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.d-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.d-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(60, 45, 20, .13); }
.d-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--red), var(--gold));
}
.d-card .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-card h3 { font-family: "Songti SC", serif; font-size: 19px; letter-spacing: 1px; }
.d-card .tag {
  font-size: 11.5px; color: var(--red); background: rgba(176, 58, 46, .08);
  padding: 2px 9px; border-radius: 999px; letter-spacing: 1px;
}
.d-card .rep { font-size: 12.5px; color: var(--muted); }
.d-card .sample {
  background: #f6f1e7; border-radius: 10px; padding: 10px 13px;
  font-size: 14.5px; color: #4a4238;
}
.d-card .meaning { font-size: 12.5px; color: var(--muted); }
.d-card .desc { font-size: 13px; color: var(--muted); flex: 1; }
.card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 14px; padding: 8px 18px; transition: all .18s;
  font-family: inherit;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-danger { background: transparent; border: 1px solid #e0c2be; color: var(--red); }
.btn-danger:hover { background: rgba(176,58,46,.07); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.playing { animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176, 58, 46, .4); }
  50% { box-shadow: 0 0 0 7px rgba(176, 58, 46, 0); }
}

/* ===== 面板 / 表单 ===== */
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.panel h2 { font-family: "Songti SC", serif; font-size: 21px; letter-spacing: 2px; margin-bottom: 6px; }
.panel h2 .accent { color: var(--red); }
.panel .hint { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 5px; }
.field textarea, .field select, .field input[type="text"], .field input[type="password"] {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 15px; font-family: inherit; outline: none; color: var(--ink);
}
.field textarea:focus, .field select:focus, .field input:focus { border-color: var(--red); }
.field textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 180px; }
input[type="range"] { accent-color: var(--red); width: 100%; }
.range-val { font-size: 12.5px; color: var(--red); }

/* ===== 录音列表 ===== */
.rec-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; margin-bottom: 10px;
}
.rec-item .meta { flex: 1; min-width: 200px; }
.rec-item .meta b { font-size: 15px; }
.rec-item .meta span { display: block; font-size: 12.5px; color: var(--muted); }
audio { height: 36px; }
.badge {
  display: inline-block; font-size: 11.5px; padding: 2px 10px; border-radius: 999px;
  background: rgba(176, 58, 46, .08); color: var(--red); letter-spacing: 1px;
}
.badge.gray { background: #efece5; color: var(--muted); }

/* ===== 跟读测评 ===== */
.phrase-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.phrase-item .ptext { font-size: 20px; font-family: "Songti SC", serif; letter-spacing: 1px; }
.phrase-item .pmean { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.score-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%; font-weight: 700; font-size: 18px;
  color: #fff; font-family: "Songti SC", serif;
}
.result-line { font-size: 13.5px; margin-top: 8px; }
.result-line .ok { color: #1e7d3e; }
.result-line .miss { color: var(--red); }
.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red);
  margin-right: 6px; animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: .2; } }

/* ===== 其他 ===== */
.note-box {
  background: #fdf6e7; border: 1px solid #ecd9a8; border-radius: 10px;
  padding: 12px 15px; font-size: 13px; color: #7a6320; margin-top: 14px;
}
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14.5px; }
.site-footer {
  border-top: 1px solid var(--line); padding: 22px 0 30px; text-align: center;
  color: var(--muted); font-size: 12.5px; letter-spacing: 1px;
}
.site-footer b { color: var(--red); font-family: "Songti SC", serif; }
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 99;
  max-width: 86vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) {
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
  nav.main-nav { margin-left: 0; }
}
