/* kusanagi —— 极简对比投票站样式。移动端优先，深浅色双主题。 */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --card: #ffffff;
  --border: #e6e8ec;
  --text: #14161a;
  --muted: #6b7280;
  --accent: #5b6cff;
  --a: #3b82f6;
  --b: #f97316;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,18,24,.04), 0 8px 24px rgba(16,18,24,.06);
  --maxw: 920px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --bg-soft: #11141b;
    --card: #14171f;
    --border: #232733;
    --text: #e7e9ee;
    --muted: #8b93a3;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --card: #14171f;
  --border: #232733;
  --text: #e7e9ee;
  --muted: #8b93a3;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--muted); font-size: .95rem; }
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { border-color: var(--muted); }

/* Hero */
.hero { padding: 2.5rem 0 1.25rem; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 .3rem; letter-spacing: -.03em; }
.hero p { margin: 0; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; padding-bottom: 3rem; }
@media (min-width: 680px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .85rem;
}
.card-link { display: block; }
.card-link:hover { text-decoration: none; }
.vs { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: 0; letter-spacing: -.01em; flex-wrap: wrap; }
.vs span { font-weight: 700; }
.vs em { color: var(--muted); font-style: normal; font-size: .8rem; font-weight: 600; padding: .05rem .4rem; border: 1px solid var(--border); border-radius: 6px; }
.vs-lg { font-size: clamp(1.4rem, 4vw, 2rem); }
.card-title { margin: .1rem 0 0; font-weight: 500; }
.card-desc { margin: 0; font-size: .92rem; }

/* Poll bar */
.poll { display: flex; flex-direction: column; gap: .4rem; }
.poll-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg-soft); }
.poll-lg .poll-bar { height: 30px; }
.poll-bar span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; font-weight: 600; transition: width .4s ease; }
.bar-a { background: var(--a); }
.bar-b { background: var(--b); }
.poll-meta { display: flex; justify-content: space-between; font-size: .82rem; }
.heat { margin: .2rem 0 0; font-size: .85rem; text-align: center; }

/* Buttons */
.vote-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  padding: .6rem .8rem; border-radius: 10px; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: transform .06s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-a { box-shadow: inset 3px 0 0 var(--a); }
.btn-b { box-shadow: inset 3px 0 0 var(--b); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); padding: .35rem .6rem; font-size: .82rem; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.card-foot { margin: 0; font-size: .85rem; display: flex; justify-content: space-between; }

/* Detail */
.breadcrumb { padding: 1.25rem 0 .5rem; font-size: .85rem; }
.detail { max-width: 680px; margin: 0 auto; padding-bottom: 3rem; }
.detail-title { font-size: 1.15rem; font-weight: 500; margin: .4rem 0; }
.detail-desc { margin: 0 0 1.5rem; }
.vote-detail { display: flex; flex-direction: column; gap: .7rem; margin: 1.5rem 0; }
.reason-label { font-size: .9rem; font-weight: 600; }
.reason-input {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: .95rem;
}
.reason-input:focus { outline: none; border-color: var(--a); }
.vote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.voted-note { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; margin: 1.5rem 0; font-size: .92rem; }

/* Reasons */
.reasons { margin-top: 2rem; }
.reasons h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.reason-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.reason-item {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem;
}
.reason-tag { font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; white-space: nowrap; }
.reason-a .reason-tag { background: color-mix(in srgb, var(--a) 18%, transparent); color: var(--a); }
.reason-b .reason-tag { background: color-mix(in srgb, var(--b) 18%, transparent); color: var(--b); }
.reason-text { flex: 1; min-width: 50%; }
.reason-time { font-size: .78rem; }

/* Ranking */
.rank-list { list-style: none; counter-reset: r; padding: 0; margin: 0 0 3rem; display: flex; flex-direction: column; gap: .55rem; }
.rank-item {
  counter-increment: r; display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem;
}
.rank-item::before {
  content: counter(r); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted);
  min-width: 1.6rem; text-align: center; font-size: 1.05rem;
}
.rank-item:nth-child(1)::before { color: #f5b301; }
.rank-item:nth-child(2)::before { color: #9aa3b2; }
.rank-item:nth-child(3)::before { color: #cd7f32; }
.rank-link { flex: 1; display: flex; flex-direction: column; }
.rank-link:hover { text-decoration: none; }
.rank-vs { font-weight: 600; }
.rank-vs em { font-style: normal; color: var(--muted); font-size: .85em; }
.rank-title { font-size: .85rem; }
.rank-heat { font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rank-heat small { font-weight: 400; font-size: .65rem; color: var(--muted); }

/* Admin */
.admin-form { gap: .8rem; max-width: 100%; margin-bottom: 2rem; }
.admin-form h2, .admin-list h2 { margin-top: 0; font-size: 1.1rem; }
.admin-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 600; }
.admin-form input, .admin-form textarea {
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit; font-weight: 400;
}
.admin-form input:focus, .admin-form textarea:focus { outline: none; border-color: var(--a); }
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.flash { background: color-mix(in srgb, var(--a) 12%, transparent); border: 1px solid color-mix(in srgb, var(--a) 35%, var(--border)); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.5rem; font-size: .9rem; }

/* Footer & misc */
.empty { text-align: center; padding: 4rem 0; color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.5rem 0; }
.site-footer p { margin: .15rem 0; font-size: .85rem; }
