/* ===== 质量之星评选 通用样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #163a66;
  --navy-dark: #0f2a4b;
  --red: #c8161d;
  --red-dark: #a51117;
  --gold: #e8a93c;
  --ink: #23303f;
  --muted: #6b7a8d;
  --line: #e4e9f0;
  --bg: #f2f5f9;
  --card: #ffffff;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--navy); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ===== 顶部横幅 ===== */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, #1d4d85 100%);
  color: #fff;
  padding: 38px 0 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}
.hero .badge {
  display: inline-block; font-size: 13px; letter-spacing: 3px;
  border: 1px solid rgba(255,255,255,.55); border-radius: 20px;
  padding: 4px 16px; margin-bottom: 14px; color: #ffe8d6;
}
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.hero h1 .star { color: var(--gold); }
.hero p.sub { margin-top: 10px; font-size: 15px; color: #d7e3f2; }
.hero .stats { margin-top: 18px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .stats .item {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; padding: 8px 18px; min-width: 110px;
}
.hero .stats .num { font-size: 22px; font-weight: 800; color: #ffd98a; }
.hero .stats .lab { font-size: 12px; color: #cdd9ea; }

/* ===== 规则提示条 ===== */
.notice {
  background: #fff7ec; border: 1px solid #f3dcb4; color: #8a5b16;
  font-size: 13.5px; border-radius: 8px; padding: 10px 14px; margin: 20px 0 4px;
}
.notice b { color: var(--red-dark); }

/* ===== 候选人卡片网格 ===== */
.grid {
  display: grid; gap: 18px; margin: 22px 0 40px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 14px rgba(20,45,80,.06);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,45,80,.12); }
.card .top {
  padding: 16px 16px 12px; border-bottom: 1px dashed var(--line);
  display: flex; align-items: center; gap: 12px;
}
.rank {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff; background: #9fb0c3;
}
.rank.r1 { background: linear-gradient(135deg,#f6c45c,#e0931a); }
.rank.r2 { background: linear-gradient(135deg,#c7d2df,#93a6bc); }
.rank.r3 { background: linear-gradient(135deg,#e0a06f,#c0743c); }
.card .who h3 { font-size: 18px; font-weight: 800; }
.card .who .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card .who .tags { margin-top: 6px; }
.tag {
  display: inline-block; font-size: 12px; background: #eef3fa; color: var(--navy);
  border-radius: 4px; padding: 1px 8px; margin-right: 5px;
}
.card .body { padding: 12px 16px; font-size: 13.5px; flex: 1; }
.sec-title { font-size: 12.5px; font-weight: 700; color: var(--navy); margin: 6px 0 4px; }
.clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5;
  overflow: hidden; white-space: pre-wrap; word-break: break-word; color: #3a4757;
}
.clamp.open { -webkit-line-clamp: unset; display: block; }
.more-btn {
  color: var(--red); font-size: 13px; cursor: pointer; background: none; border: none;
  padding: 0; margin-top: 4px; font-weight: 600;
}
.honors { color: #4a586a; white-space: pre-wrap; word-break: break-word; }
.honors .none { color: #aab5c2; }

.card .foot {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fafcfe;
}
.vote-count { line-height: 1.1; }
.vote-count .n { font-size: 22px; font-weight: 800; color: var(--red); }
.vote-count .u { font-size: 12px; color: var(--muted); }
.btn {
  border: none; cursor: pointer; border-radius: 8px; font-size: 15px; font-weight: 700;
  padding: 10px 22px; color: #fff; background: linear-gradient(135deg, var(--red), var(--red-dark));
  transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled, .btn.disabled { background: #b9c2cd; cursor: not-allowed; opacity: .85; }
.btn.mined { background: linear-gradient(135deg,#3a9d5d,#2c7d49); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.navy { background: linear-gradient(135deg,#2b5a92,#1d4270); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* 已投票全局状态 */
.voted-banner {
  background: #eaf7ef; border: 1px solid #bfe5cc; color: #257043;
  border-radius: 8px; padding: 10px 14px; margin-top: 18px; font-size: 14px; text-align: center;
}

/* ===== 轻提示 toast ===== */
#toast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%) translateY(-20px);
  background: rgba(20,35,55,.94); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999; max-width: 90%;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: rgba(180,30,35,.95); }
#toast.ok { background: rgba(34,120,70,.95); }

/* ===== 页脚 ===== */
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 22px 0 34px; }
.footer a { color: var(--muted); }

/* ===== 后台 ===== */
.login-box { max-width: 380px; margin: 70px auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 30px 28px; box-shadow: 0 12px 30px rgba(20,45,80,.1); }
.login-box h2 { text-align: center; color: var(--navy); margin-bottom: 6px; }
.login-box p.tip { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #3a4757; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #d4dce6; border-radius: 8px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #6f97c4; box-shadow: 0 0 0 3px rgba(43,90,146,.12); }
.err-msg { background: #fdecec; border: 1px solid #f5c2c2; color: #b3261e; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.ok-msg { background: #eaf7ef; border: 1px solid #bfe5cc; color: #257043; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }

.admin-bar { background: var(--navy-dark); color: #fff; }
.admin-bar .in { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.admin-bar .brand { font-weight: 800; font-size: 16px; }
.admin-bar .brand span { color: var(--gold); }
.admin-bar nav a { color: #cdd9ea; font-size: 14px; margin-left: 18px; }
.admin-bar nav a:hover, .admin-bar nav a.active { color: #fff; }
.admin-bar nav a.out { color: #ffb4b4; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 22px 0; }
.panel h3 { font-size: 16px; color: var(--navy); margin-bottom: 14px; }
.cards-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); margin: 22px 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-card .n { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-card .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.tbl th { background: #f0f4f9; color: var(--navy); font-weight: 700; white-space: nowrap; }
table.tbl tr:nth-child(even) td { background: #fafbfd; }
.bar-wrap { background: #eef1f5; border-radius: 6px; height: 14px; width: 160px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar-fill { background: linear-gradient(90deg,#e07a3c,var(--red)); height: 100%; display: block; }
.row-actions a { margin-right: 8px; font-size: 13px; }
.pager { margin-top: 14px; font-size: 14px; }
.pager a, .pager span { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; margin-right: 5px; }
.pager span.cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 13.5px; }
.filter-form select { padding: 7px; border: 1px solid #d4dce6; border-radius: 7px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .hero h1 { font-size: 23px; }
  .grid { grid-template-columns: 1fr; }
  .admin-bar nav a { margin-left: 11px; font-size: 13px; }
}
