/* 灌南高级中学神人榜 · 样式（浅色主题） */
:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #2c2a28;
  --ink-2: #6b665e;
  --line: #ece7de;
  --primary: #ff6b35;
  --primary-2: #ff8e53;
  --primary-ink: #fff;
  --red: #e63946;
  --star: #ffb400;
  --ok: #2e9e5b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(60, 40, 10, .08);
  --shadow-lg: 0 18px 60px rgba(60, 40, 10, .18);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
img { display: block; }

/* ---------- 顶部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 252, 246, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.logo:hover { color: var(--primary); }

.btn {
  border: none; cursor: pointer; font-family: inherit;
  border-radius: 999px; padding: 10px 22px; font-size: 15px; font-weight: 600;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--primary-ink); box-shadow: 0 6px 18px rgba(255, 107, 53, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 107, 53, .42); }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: rgba(255, 107, 53, .08); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #fff0f0; color: var(--red); border: 1.5px solid #ffd6d6; }
.btn-danger:hover { background: #ffe4e4; }
.btn-ok { background: #ecf9f1; color: var(--ok); border: 1.5px solid #c9ecd6; }
.btn-ok:hover { background: #dff5e8; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, #fff4e2 0%, #ffe8d6 55%, #ffdcc7 100%); }
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 44px 20px 36px; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(135deg, #e85d1f, #ff9a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { margin-top: 10px; color: #8a6a4a; font-size: 15px; }
.stats { margin: 22px auto 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat-chip {
  background: #fff; border-radius: 14px; padding: 10px 18px;
  box-shadow: var(--shadow); display: flex; align-items: baseline; gap: 8px;
}
.stat-chip b { font-size: 20px; color: var(--primary); }
.stat-chip span { font-size: 13px; color: var(--ink-2); }
.rules {
  margin: 26px auto 0; max-width: 680px; text-align: left;
  background: rgba(255, 255, 255, .75); border: 1px dashed #ecc8a8;
  border-radius: 14px; padding: 14px 20px; font-size: 13px; color: #7a6450;
}
.rules-title { font-weight: 700; color: #a05c2a; margin-bottom: 6px; }
.rules ul { padding-left: 18px; }
.rules li { margin: 3px 0; }

/* ---------- 主区 ---------- */
.main { max-width: 1080px; margin: 0 auto; padding: 8px 20px 60px; }
.tabs { display: flex; gap: 10px; margin: 22px 0 14px; }
.tab {
  border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 10px 20px; border-radius: 999px; background: #fff; color: var(--ink-2);
  box-shadow: var(--shadow); transition: all .15s;
}
.tab:hover { transform: translateY(-1px); }
.tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 20px rgba(255, 107, 53, .35); }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.sorts { display: flex; gap: 8px; flex-wrap: wrap; }
.sort {
  border: 1.5px solid var(--line); cursor: pointer; font-family: inherit;
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600;
  border-radius: 999px; padding: 6px 14px; transition: all .12s;
}
.sort:hover { border-color: var(--primary); color: var(--primary); }
.sort.active { background: #fff1e8; border-color: var(--primary); color: var(--primary); }
.toolbar-hint { font-size: 13px; color: var(--ink-2); }

/* ---------- 卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-photo { position: relative; aspect-ratio: 4 / 3; background: #f3efe7; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.rank-badge {
  position: absolute; top: 10px; left: 10px; width: 34px; height: 34px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow);
}
.merged-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(46, 158, 91, .92);
  color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 17px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-title .detail { font-size: 12px; color: var(--ink-2); font-weight: 500; background: #f4efe6; border-radius: 8px; padding: 2px 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; background: #fff1e8; color: #d05f20; border-radius: 8px; padding: 2px 9px; font-weight: 600; }
.card-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score { font-weight: 800; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.stars-sm { color: var(--star); font-size: 13px; letter-spacing: 1px; }
.meta { font-size: 12px; color: var(--ink-2); }
.card-intro {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.loadmore-wrap { text-align: center; margin-top: 26px; }
.empty { text-align: center; padding: 60px 0; color: var(--ink-2); }
.empty-emoji { font-size: 48px; margin-bottom: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 20, 10, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  position: relative; padding: 26px;
  animation: pop .18s ease;
}
.modal-lg { max-width: 760px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: #f4efe6; color: var(--ink-2);
  font-size: 15px; cursor: pointer; z-index: 5;
}
.modal-close:hover { background: #ffe4d6; color: var(--red); }
.modal h2 { font-size: 21px; margin-bottom: 4px; }
.form-tip { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }

/* 详情布局 */
.detail-top { display: grid; grid-template-columns: 240px 1fr; gap: 22px; }
.detail-photo { border-radius: 14px; overflow: hidden; aspect-ratio: 4/4.4; background: #f3efe7; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 10px; }
.detail-name { font-size: 24px; font-weight: 900; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.detail-name .detail { font-size: 14px; color: var(--ink-2); background: #f4efe6; padding: 3px 10px; border-radius: 8px; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, #7c5cff, #a78bfa); color: #fff;
  padding: 3px 10px; border-radius: 999px;
}
.detail-intro { font-size: 14.5px; color: #3d3832; background: #fff8ef; border: 1px dashed #f0cbaa; border-radius: 12px; padding: 12px 14px; line-height: 1.7; }
.rate-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rate-stars { font-size: 30px; cursor: pointer; letter-spacing: 3px; user-select: none; }
.rate-stars .off { color: #ddd5c8; }
.rate-stars .on { color: var(--star); text-shadow: 0 2px 6px rgba(255, 180, 0, .4); }
.rate-num { font-size: 14px; color: var(--ink-2); }
.detail-meta { font-size: 13px; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.detail-comments { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.comment-form { display: flex; gap: 10px; margin: 12px 0 16px; flex-wrap: wrap; }
.comment-form input {
  flex: 0 0 130px; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 14px; background: #fdfbf7;
}
.comment-form textarea {
  flex: 1; min-width: 220px; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-family: inherit; font-size: 14px; resize: vertical; min-height: 44px; background: #fdfbf7;
}
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item { background: #faf7f1; border-radius: 12px; padding: 10px 14px; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.comment-head b { color: var(--ink); font-size: 13px; }
.comment-head .time { margin-left: auto; }
.comment-text { font-size: 14px; }
.comment-foot { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; }
.comment-foot button {
  border: none; background: none; cursor: pointer; font-family: inherit; font-size: 12.5px; color: var(--ink-2); padding: 0;
}
.comment-foot button.liked { color: var(--red); font-weight: 700; }
.comment-foot button:hover { color: var(--primary); }
.empty-comments { text-align: center; color: var(--ink-2); font-size: 13px; padding: 14px 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-2); font-size: 12px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 13px;
  font-family: inherit; font-size: 14.5px; background: #fdfbf7; outline: none; transition: border .12s;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.field textarea { resize: vertical; min-height: 120px; }
.counter { text-align: right; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 110px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2);
  border-radius: 12px; padding: 10px 8px; transition: all .12s;
}
.seg button.active { border-color: var(--primary); background: #fff1e8; color: var(--primary); }
.photo-upload { display: flex; gap: 14px; align-items: center; }
.photo-preview {
  width: 84px; height: 84px; border-radius: 14px; overflow: hidden; flex: none;
  background: #f4efe6; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 12px;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn {
  border: 1.5px dashed #d8c9b2; background: #fdfaf4; color: #a08050; cursor: pointer;
  border-radius: 12px; padding: 12px 18px; font-family: inherit; font-size: 13px;
}
.upload-btn:hover { border-color: var(--primary); color: var(--primary); }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check-row input { margin-top: 4px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2c2a28; color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transition: all .25s;
  z-index: 300; max-width: 86vw; text-align: center; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: #1f7a45; }
#toast.err { background: #c0392b; }

/* ---------- 管理后台 ---------- */
.admin-view { max-width: 1080px; margin: 0 auto; padding: 26px 20px 80px; }
.admin-view h2 { font-size: 22px; margin-bottom: 4px; }
.admin-login { max-width: 380px; margin: 60px auto; text-align: center; }
.admin-login input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 15px; margin: 14px 0; background: #fff;
}
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.admin-card { background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.admin-card b { font-size: 26px; color: var(--primary); display: block; }
.admin-card span { font-size: 13px; color: var(--ink-2); }
.admin-section { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 20px; }
.admin-section h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-review {
  background: #f6f2ff; border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
  color: #5b4a8a; margin: 8px 0; border: 1px dashed #cdbdf5;
}
.ai-review .bad { color: var(--red); font-weight: 600; }
.merge-sel { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.merge-sel select { border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 13px; background: #fff; }
.item-row { border-top: 1px solid var(--line); padding: 12px 0; }
.item-row:first-of-type { border-top: none; }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-head b { font-size: 15px; }
.item-head .status-tag { font-size: 12px; border-radius: 8px; padding: 2px 9px; font-weight: 600; }
.status-published { background: #ecf9f1; color: var(--ok); }
.status-pending { background: #fff3e0; color: #d9822b; }
.status-hidden { background: #f1efec; color: var(--ink-2); }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.edit-panel { background: #faf7f1; border-radius: 12px; padding: 12px; margin-top: 10px; }
.edit-panel label { font-size: 12.5px; font-weight: 700; display: block; margin: 8px 0 4px; }
.edit-panel input, .edit-panel textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 11px;
  font-family: inherit; font-size: 13.5px; background: #fff;
}
.report-item { border-top: 1px solid var(--line); padding: 10px 0; font-size: 13.5px; }
.report-item:first-of-type { border-top: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.toggle-row:last-child { border-bottom: none; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px; background: #ddd5c8; cursor: pointer; transition: background .15s;
}
.slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff; transition: transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .detail-top { grid-template-columns: 1fr; }
  .detail-photo { max-width: 260px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .hero-inner { padding: 30px 16px 26px; }
  .main { padding: 4px 14px 50px; }
  .modal { padding: 20px 16px; }
}
