:root {
  --bg: #faf6ec;
  --text: #111;
  --muted: #555;
  --accent: #8a5a2b;
  --border: #e0d5b8;
  --card-bg: #fff;
}
[data-theme="dark"] {
  --bg: #16140f;
  --text: #ece6d8;
  --muted: #b8ae95;
  --accent: #d8b46a;
  --border: #3a3325;
  --card-bg: #201d16;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Noto Sans TC", "Noto Serif TC", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--accent); }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.site-logo {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.05em;
}
.site-search input {
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  min-width: 220px;
}
.breadcrumb {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.site-footer {
  margin-top: 60px;
  padding: 24px 20px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.disclaimer { max-width: 640px; margin: 8px auto 0; }

.card-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 20px 0 36px; }
.card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  text-decoration: none;
  color: var(--text);
}
.card:hover { border-color: var(--accent); }
.card .card-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.card .card-sub { font-size: 13px; color: var(--muted); }
.card .card-pending { font-size: 12px; color: #9a3324; }

.fav-card { position: relative; padding-right: 40px; }
.fav-card .card-link { display: block; text-decoration: none; color: inherit; }
.fav-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav-remove:hover { border-color: var(--accent); color: var(--accent); }

.section-title { font-size: 20px; margin: 40px 0 12px; border-left: 4px solid var(--accent); padding-left: 10px; }

.status-note {
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  color: var(--muted);
}

.search-box { margin: 20px 0; }
.search-box input { width: 100%; font-size: 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
#search-results .card-list { margin-top: 16px; }

.char-list { margin: 20px 0 36px; display: flex; flex-direction: column; gap: 14px; }
.char-entry {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}
.char-word { font-size: 26px; flex-shrink: 0; min-width: 2.5em; }
.char-note p { margin: 0 0 6px; }
.char-used-in { font-size: 13px; color: var(--muted); }
.char-used-in a { color: var(--accent); }

.donate-link { margin: 8px 0 0; }
.donate-link a { color: inherit; }
