/* ========================================
   《我在"县"场》— 公共样式
   暖色叙事风 / Warm Narrative
   参考记者故事视觉，整体提亮
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1A1A23;
  background: #F2EFE9;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* --- Colors --- */
:root {
  --red: #C44545;
  --red-dark: #9E3535;
  --red-light: #FDF4F4;
  --blue: #3A6BA5;
  --blue-dark: #2A4F7C;
  --blue-light: #ECF3FA;
  --navy: #1B2D4A;
  --green: #5B9A6F;
  --green-light: #EDF6F0;
  --warn: #C08A2D;
  --warn-light: #FBF3E0;
  --text: #1A1A23;
  --text-secondary: #6B6B6B;
  --text-light: #A8A29E;
  --bg: #F2EFE9;
  --white: #FDFBF7;
  --card: #FFFFFF;
  --border: #E2DBCF;
  --border-light: #F0EBE2;
  --shadow-sm: 0 1px 3px rgba(28,22,18,0.04);
  --shadow: 0 2px 10px rgba(28,22,18,0.06);
  --shadow-md: 0 4px 20px rgba(28,22,18,0.10);
  --radius: 10px;
  --radius-lg: 14px;
}

/* --- View switching (投稿站) --- */
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.err.shake { animation: shake .4s ease; }

.muted { color: var(--text-secondary); }
.center { text-align: center; }

/* ============================================================
   投稿站（移动端优先）
   ============================================================ */
/* 投稿站：移动端优先，PC 端铺全屏（背景全宽，内容居中） */
.site-main { max-width: 100%; margin: 0 auto; padding: 0; min-height: 100vh; background: var(--border-light); }

/* PC 端：把除 hero 外的子页面 view 全宽展示 */
@media (min-width: 768px) {
  .site-main #view-home { width: 100%; }  /* 首页铺全屏 */
  .site-main #view-rules,
  .site-main #view-verify,
  .site-main #view-submit,
  .site-main #view-history,
  .site-main #view-works { width: 100%; background: transparent; box-shadow: none; min-height: 100vh; }
  /* 表单/规则/验证/历史类页面：收窄到 720px 居中（适合阅读和填写） */
  .site-main #view-rules .rules-card,
  .site-main #view-history .history-list,
  .site-main #view-submit .form-card,
  .site-main #view-verify .verify-card { max-width: 720px; margin: 0 auto; }
  /* 往期作品：1080px 居中（多列网格需要更宽） */
  .site-main #view-works .works-list { max-width: 1080px; margin: 0 auto; }
  .site-main #view-rules .page-head,
  .site-main #view-works .page-head,
  .site-main #view-history .page-head,
  .site-main #view-submit .page-head,
  .site-main #view-verify .page-head { padding-left: 16px; padding-right: 16px; }
  .site-main #view-rules .page-head h1,
  .site-main #view-history .page-head h1,
  .site-main #view-submit .page-head h1,
  .site-main #view-verify .page-head h1 { position: absolute; left: 50%; transform: translateX(-50%); }
  .site-main #view-works .page-head h1 { position: absolute; left: 50%; transform: translateX(-50%); }
  /* 往期作品 PC 端 3 列网格 */
  .site-main #view-works .works-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 24px 24px; }
  .site-main #view-works .work-card { flex-direction: column; }
  .site-main #view-works .work-cover { width: 100%; height: 180px; }
  .site-main #view-works .work-card-simple { padding: 18px 20px; }
}
@media (min-width: 1024px) and (max-width: 1280px) {
  .site-main #view-works .works-list { grid-template-columns: repeat(2, 1fr); }
}

/* Hero - 新首页：使用切图，标题和按钮绝对定位，背景图用 contain 居中不裁剪 */
.hero { position: relative; min-height: 100vh; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #FDE8D0 0%, #F5CBA0 30%, #E86B4C 70%, #C42020 100%);
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: url('../images/mobile-bg.png');
  /* 背景图原始尺寸、居中，不裁剪不缩放 */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
@media (min-width: 768px) {
  .hero-bg::before { background-image: url('../images/pc-bg.png'); }
}

/* 标题：绝对定位在顶部 */
.hero-titles {
  position: absolute; z-index: 2; top: 9vh; left: 0; right: 0;
  text-align: center; pointer-events: none;
}
.hero-title-pic, .hero-subtitle-pic { display: block; }
.hero-title-pic img, .hero-subtitle-pic img { margin: 0 auto; max-width: 100%; height: auto; }
.hero-title-pic img { max-width: 62vw; }
.hero-subtitle-pic img { max-width: 52vw; margin-top: 8px; }

/* 按钮：绝对定位在底部 */
.hero-buttons {
  position: absolute; z-index: 2; bottom: 5vh; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 300px;
  display: flex; flex-direction: column; gap: 12px;
}
.hero-btn { display: block; line-height: 0; transition: transform .2s, opacity .2s; pointer-events: auto; }
.hero-btn:active { transform: scale(.98); opacity: .92; }
.hero-btn img { width: 100%; height: auto; }

@media (min-width: 768px) {
  .hero-titles { top: 6vh; }
  .hero-title-pic img { max-width: 360px; }
  .hero-subtitle-pic img { max-width: 300px; margin-top: 10px; }
  .hero-buttons {
    bottom: 6vh;
    flex-direction: row; justify-content: center; gap: 28px;
    max-width: 540px;
  }
  .hero-btn { width: 150px; }
}

/* 通用页头 */
.page-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 16px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
  position: relative;
  min-height: 48px;
}
.page-head h1 { position: absolute; left: 50%; transform: translateX(-50%); font-size: 22px; margin: 0; letter-spacing: 1px; color: var(--navy); font-weight: 700; text-align: center; white-space: nowrap; }
.back-btn { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--blue); font-size: 15px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.back-btn::before { content: '\2039'; font-size: 1.5rem; line-height: 1; margin-right: 2px; font-weight: 300; }
.history-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

/* 活动规则 */
.rules-card { margin: 0 16px; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px 20px; }
.rules-card h3 { margin: 20px 0 6px; font-size: 15px; color: var(--red); letter-spacing: 0.5px; }
.rules-card h3:first-child { margin-top: 0; }
.rules-card p { margin: 0 0 6px; font-size: 14px; color: #3a3530; line-height: 1.85; }
.rules-tip { margin-top: 16px; color: var(--text-light); font-size: 12px; }

/* 投稿表单 */
.form-card { margin: 12px 16px; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; margin-bottom: 7px; font-size: 14px; letter-spacing: 0.3px; color: var(--text); }
.req { color: var(--red); margin-left: 2px; }
.hint { font-size: 12px; color: var(--text-light); margin-top: 5px; letter-spacing: 0.2px; display: inline-block; }
.char-count { font-size: 12px; color: var(--text-light); margin-top: 5px; letter-spacing: 0.2px; text-align: left; }
.char-count.warning { color: var(--red); }
.hint-line { display: flex; align-items: baseline; gap: 10px; margin-top: 5px; }
.hint-line .hint { margin-top: 0; }
.hint-line .char-count { margin-top: 0; }
.field input[type=text], .field input[type=number], .field input[type=tel], .field select, .field textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 15px;
  font-family: inherit; background: var(--white); width: 100%; transition: border-color .25s, box-shadow .25s; outline: none;
  letter-spacing: 0.2px;
}
.field select { font-size: 15px; }
.field select option { font-size: 15px; padding: 8px 6px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(58,107,165,0.18);
  outline: none; background: #FCFCFD;
}
.field input, .field select, .field textarea { transition: border-color .25s, box-shadow .25s, background .25s; }
select, option { font-family: inherit; }
.filters select option, .filters input, .filters select { font-size: 13px; }
.field textarea { resize: vertical; }
.err { color: var(--red); font-size: 12px; margin-top: 4px; min-height: 0; }
.thumb { margin-top: 10px; }
.thumb img { max-height: 160px; max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

/* 大块上传区 */
.uploader {
  position: relative; border: 2px dashed #D9D2C5; border-radius: 12px;
  background: #FBF9F4; padding: 24px 18px; text-align: center;
  cursor: pointer; transition: all .2s; user-select: none;
  width: 100%; box-sizing: border-box;
}
.uploader:hover, .uploader.drag { border-color: var(--red); background: #FDF4F4; }
.uploader.uploader-error { border-color: var(--red); background: #FFF5F5; animation: shake .4s ease; }
.uploader input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
/* 未上传态 */
.uploader-empty { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.uploader-ico { font-size: 36px; line-height: 1; margin-bottom: 4px; opacity: 0.85; }
.uploader-main { font-size: 15px; color: var(--text); font-weight: 600; letter-spacing: 0.5px; }
.uploader-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0.3px; }
/* 已上传态 */
.uploader-filled { display: none; align-items: center; gap: 12px; padding: 6px; text-align: left; }
.uploader.has-file .uploader-empty { display: none; }
.uploader.has-file .uploader-filled { display: flex; }
.uploader.has-file { cursor: default; padding: 12px; }
.uploader.has-file input[type=file] { display: none; }
.uploader-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; background: var(--border-light); }
.uploader-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.uploader-name { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-all; line-height: 1.4; }
.uploader-actions { display: flex; gap: 6px; }
.uploader-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all .15s; }
.uploader-btn:hover { border-color: var(--blue); color: var(--blue); }
.uploader-remove:hover { border-color: var(--red); color: var(--red); }

/* 手机验证码行 */
.phone-row { display: flex; gap: 10px; }
.phone-row input { flex: 1; }
.phone-row input:disabled { background: var(--border-light); color: var(--text-light); }
.code-btn {
  flex-shrink: 0; padding: 12px 16px; border: 1px solid var(--blue); border-radius: 8px;
  background: var(--blue-light); color: var(--blue-dark); font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: all .2s; letter-spacing: 0.3px;
}
.code-btn:hover:not(:disabled) { background: var(--blue); color: #fff; }
.code-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--border); background: var(--border-light); color: var(--text-light); }

/* 防刷滑块验证 */
.captcha { user-select: none; -webkit-user-select: none; touch-action: none; }
.captcha-track {
  position: relative; height: 44px; background: var(--border-light); border-radius: 22px;
  border: 1px solid var(--border); overflow: hidden; cursor: pointer;
}
.captcha-bg { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: linear-gradient(90deg, var(--green-light), var(--blue-light)); transition: width .15s; }
.captcha-target {
  position: absolute; top: 4px; left: 16px; width: 36px; height: 36px;
  border-radius: 6px; background: rgba(196, 69, 69, 0.18); border: 1.5px dashed var(--red);
}
.captcha-target::after { content: '拼图'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--red); font-weight: 600; }
.captcha-handle {
  position: absolute; top: 4px; left: 4px; width: 36px; height: 36px;
  background: var(--white); border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--blue);
  font-weight: 700; transition: left .15s; cursor: grab;
}
.captcha-handle:active { cursor: grabbing; }
.captcha-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; letter-spacing: 0.3px; display: inline-block; margin-right: 12px; }
.captcha-refresh { display: inline-block; font-size: 12px; color: var(--blue); cursor: pointer; user-select: none; }
.captcha-refresh:hover { color: var(--blue-dark); }
.captcha-status { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 4px; min-height: 16px; }
.captcha.ok .captcha-handle { left: calc(100% - 40px); }
.captcha.ok .captcha-bg { width: 100%; }
.captcha.ok .captcha-handle { color: var(--green); }

/* 弹窗拼图滑块验证码 */
.captcha-overlay { z-index: 120; }
.captcha-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.captcha-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.captcha-close:hover { background: rgba(255,255,255,0.95); color: var(--text); }
.captcha-canvas-wrap {
  position: relative;
  width: 280px;
  height: 158px;
  margin: 16px auto 0;
  background: #f5f5f5;
  overflow: hidden;
  border-radius: 10px;
}
.captcha-canvas-wrap canvas { position: absolute; left: 0; top: 0; }
#puzzle-bg { z-index: 1; }
#puzzle-piece { z-index: 2; }
.puzzle-slider-wrap { padding: 16px 20px 8px; }
.puzzle-slider-track {
  position: relative;
  height: 44px;
  background: #e9e9e9;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
}
.puzzle-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7fd3a0, #4caf7f);
  border-radius: 22px;
  transition: width .05s linear;
}
.puzzle-slider-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: #999;
  cursor: grab;
  z-index: 2;
  transition: left .05s linear;
}
.puzzle-slider-handle:active { cursor: grabbing; }
.puzzle-slider-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #999;
  pointer-events: none;
  z-index: 1;
}
.captcha-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 14px;
}
.captcha-refresh-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-refresh-btn:hover { border-color: var(--blue); color: var(--blue); }
.captcha-status { font-size: 13px; font-weight: 600; min-height: 18px; }
.captcha-status.ok { color: var(--green); }
.captcha-status.err { color: var(--red); }
.captcha-box.ok .puzzle-slider-fill { background: var(--green); }
.captcha-box.ok .puzzle-slider-handle { color: var(--green); }

.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.btn-block { width: 100%; }
.submit-msg {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--green-light); color: #3D6B53; border: 1px solid #C3DECE; font-weight: 600; font-size: 14px;
}

/* 提交成功强提醒弹窗 */
.success-modal { padding: 36px 28px 28px; text-align: center; max-width: 360px; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #3D6B53); color: #fff;
  font-size: 40px; font-weight: 700; line-height: 72px;
  margin: 0 auto 18px; box-shadow: 0 6px 20px rgba(91, 154, 111, 0.3);
  animation: success-pop .4s cubic-bezier(.18,1.4,.4,1) both;
}
@keyframes success-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.success-title { margin: 0 0 12px; color: var(--navy); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.success-tip { margin: 0 0 6px; font-size: 14px; color: var(--text); line-height: 1.7; }
.success-tip strong { color: var(--green); font-weight: 600; }
.success-sub { margin: 0 0 22px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.success-btn {
  width: 100%; padding: 12px; background: linear-gradient(145deg, var(--red), var(--red-dark));
  color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: 1px; box-shadow: 0 4px 12px rgba(196, 69, 69, 0.25);
  transition: transform .15s, box-shadow .2s;
}
.success-btn:hover { box-shadow: 0 6px 16px rgba(196, 69, 69, 0.35); }
.success-btn:active { transform: translateY(1px); }

/* 往期作品 */
.works-list { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.work-card { display: flex; background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .2s; }
.work-card:active { transform: scale(.99); }
.work-cover { width: 110px; height: 110px; object-fit: cover; flex-shrink: 0; background: var(--border-light); }
.work-cover-empty { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.work-card-simple { display: flex; flex-direction: column; padding: 18px 20px; gap: 8px; }
.work-card-simple .work-title { font-size: 16px; }
.work-card-simple .work-go { align-self: flex-start; }
.work-body { padding: 14px 16px; flex: 1; min-width: 0; }
.work-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; color: var(--navy); }
.work-meta { font-size: 12px; color: var(--text-secondary); }
.work-go { margin-top: 8px; color: var(--blue); font-weight: 600; font-size: 13px; }

@media (min-width: 600px) {
  .hero-title { font-size: 54px; }
  .hero-entries { flex-direction: row; max-width: 600px; }
  .hero-btn { flex: 1; flex-direction: column; gap: 8px; padding: 24px 12px; }
}

/* ============================================================
   后台管理
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.topbar .container { padding: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--navy); }
.brand-sub { font-size: 12px; color: var(--text-secondary); letter-spacing: 0.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.nav-badge {
  background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 600;
}

.container { max-width: 100%; margin: 0 auto; padding: 24px 32px 60px; }

/* Stats (可点击筛选) */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); text-align: center; border-top: 3px solid var(--border); transition: all .2s; }
.stat-filter { cursor: pointer; position: relative; }
.stat-filter:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-filter.active { box-shadow: 0 0 0 2px var(--red), var(--shadow-md); border-top-color: var(--red); }
.stat-filter.active .stat-num { color: var(--red); }
.stat-gold { border-top-color: var(--warn); }
.stat-gold.active { box-shadow: 0 0 0 2px var(--warn), var(--shadow-md); border-top-color: var(--warn); }
.stat-gold.active .stat-num { color: var(--warn); }
.stat-warn { border-top-color: #D4943B; }
.stat-mute { border-top-color: var(--text-light); }
.stat-mute.active { box-shadow: 0 0 0 2px var(--text-secondary), var(--shadow-md); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--text); }
.stat-gold .stat-num { color: var(--warn); }
.stat-warn .stat-num { color: #D4943B; }
.stat-mute .stat-num { color: var(--text-light); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0.3px; }

/* Card */
.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-title { margin: 0 0 14px; font-size: 16px; color: var(--navy); letter-spacing: 0.5px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 0; padding: 0 0; align-items: flex-end; }
.tab {
  padding: 12px 24px; font-size: 15px; font-weight: 600; cursor: pointer; border: none;
  background: transparent; color: var(--text-secondary);
  border-radius: 10px 10px 0 0; transition: all .2s; letter-spacing: 0.5px;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--red); background: rgba(196, 69, 69, 0.04); }
.tab.active { color: var(--red); background: var(--white); border-bottom-color: var(--white); box-shadow: 0 -1px 6px rgba(28,22,18,0.04); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .3s ease; }
.tab-panel.active.card { border-top-left-radius: 0; }

/* Toolbar / Filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.toolbar-actions { display: flex; gap: 10px; margin-left: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1; }
.filters input, .filters select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; background: var(--white);
  transition: border-color .2s; outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--blue); }
.bulk-toolbar { justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 14px; }
.bulk-left, .bulk-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-label { color: var(--text-secondary); font-size: 13px; }
.bulk-left select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: var(--white); }

/* Table */
.table-wrap { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 4px 0; }
.data-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table thead th { background: transparent; color: var(--text-light); font-weight: 500; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; border-bottom: 1.5px solid var(--border); padding: 14px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FAF7F2; }
.data-table td.title-cell { white-space: normal; max-width: 220px; font-weight: 600; color: var(--navy); line-height: 1.4; }
.op-cell { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }
.op-cell select { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 12px; background: var(--white); flex-shrink: 0; max-width: 78px; }
.mini-btn { border: 1px solid var(--border); background: var(--white); border-radius: 6px; padding: 4px 9px; font-size: 12px; cursor: pointer; color: var(--text-secondary); transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.mini-btn:hover { border-color: var(--blue); color: var(--blue); }
.mini-btn.gold { color: var(--warn); border-color: #E8D5A8; }
.mini-btn.gold:hover { background: var(--warn-light); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.mini-btn.primary { color: var(--blue); border-color: var(--blue); }
.mini-btn.primary:hover { background: var(--blue-light); }
.mini-btn.warn { color: var(--warn); border-color: #E0C88A; }
.mini-btn.warn:hover { background: var(--warn-light); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.table-empty { text-align: center; color: var(--text-light); padding: 40px; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; line-height: 1.5; }
.badge.pending { background: var(--warn-light); color: var(--warn); }
.badge.selected { background: var(--green-light); color: #3D6B53; }
.badge.rejected { background: var(--border-light); color: var(--text-secondary); }

/* 发布状态标签 */
.pub-flag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--green-light); color: #3D6B53; letter-spacing: 0.3px; vertical-align: middle; margin-left: 4px; }
.unpub-flag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--border-light); color: var(--text-light); letter-spacing: 0.3px; vertical-align: middle; margin-left: 4px; }

/* 批量发布按钮禁用态 */
#btn-bulk-publish:disabled { opacity: 0.5; cursor: not-allowed; }
.news-status-row { margin-top: 4px; }

/* Buttons */
.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 9px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit; letter-spacing: 0.3px;
}
.btn:disabled, .btn[disabled] { cursor: not-allowed; opacity: 0.7; }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { background: linear-gradient(145deg, var(--red), var(--red-dark)); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-ghost { background: var(--white); border-color: var(--border); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(27,45,74,0.4); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 0; width: 100%; max-width: 460px; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-sm { max-width: 380px; padding: 24px; }
.modal-sm h3 { margin: 0 0 18px; color: var(--navy); letter-spacing: 1px; font-size: 18px; text-align: center; font-weight: 700; }
.modal-lg { max-width: 640px; max-height: 86vh; overflow-y: auto; }
.modal-xl { max-width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 56px 14px; background: var(--white); border-bottom: 1px solid var(--border-light); position: relative; }
.modal-head h3 { margin: 0; font-size: 20px; color: var(--navy); font-weight: 700; letter-spacing: 1px; }
.modal-close { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-light); transition: color .2s; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; border-top: 1px solid var(--border-light); margin-top: 0; background: var(--white); }
.modal > .modal-actions { margin-top: 0; }
.modal-lg .detail-content { padding: 18px 24px; }

/* Login form */
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: 0.3px; }
.login-field input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px;
  font-size: 14px; background: var(--white); outline: none; transition: border-color .25s, box-shadow .25s;
}
.login-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(58,107,165,0.1); }
.login-hint { font-size: 12px; color: var(--text-light); margin-top: 10px; text-align: center; letter-spacing: 0.3px; }

/* Detail */
.detail-content { padding: 18px 24px; }
.detail-content .d-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border-light); }
.detail-content .d-label { width: 96px; color: var(--text-secondary); flex-shrink: 0; font-size: 13px; }
.detail-content .d-val { flex: 1; word-break: break-all; font-size: 14px; }
.detail-content img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin-top: 6px; }
.detail-content img.d-img { max-width: 200px; max-height: 200px; cursor: zoom-in; transition: transform .2s, box-shadow .2s; }
.detail-content img.d-img:hover { transform: scale(1.02); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }

/* Lightbox 图片放大 */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox-mask { position: absolute; inset: 0; background: rgba(15, 15, 25, 0.85); backdrop-filter: blur(2px); }
.lightbox-body { position: relative; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.4); background: #fff; }
.lightbox-caption { color: #fff; font-size: 13px; margin-top: 12px; letter-spacing: 0.5px; opacity: 0.85; }
.lightbox-close { position: fixed; top: 18px; right: 24px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Cert */
.modal-xl { max-width: 920px; }
.modal-xl .cert-wrap { padding: 20px 24px; background: var(--border-light); }
#cert-canvas { width: 100%; max-width: 760px; height: auto; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); display: block; margin: 0 auto; }
#cert-preview-wrap { padding: 20px 24px; background: var(--border-light); text-align: center; }
#cert-preview-wrap img { width: 100%; max-width: 760px; height: auto; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); display: inline-block; -webkit-touch-callout: default; }
.cert-preview-hint { padding: 0 24px 12px; text-align: center; color: var(--text-secondary); font-size: 13px; letter-spacing: 0.5px; }
.d-link { color: var(--blue); word-break: break-all; text-decoration: none; border-bottom: 1px dashed var(--blue); }
.d-link:hover { color: var(--navy); border-bottom-style: solid; }

/* News link management */
.news-form { background: var(--border-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.news-grid { display: grid; grid-template-columns: 1.4fr 1.4fr auto; gap: 10px; align-items: stretch; }
.news-grid > button { align-self: stretch; padding: 0 18px; }
.news-grid input[type=text], .news-grid input[type=file] {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 13px; font-family: inherit; background: var(--white); width: 100%;
  outline: none; transition: border-color .2s;
}
.news-grid input:focus { border-color: var(--blue); }
.news-form .err { margin: 8px 0; }
.news-list-head { display: grid; grid-template-columns: 1fr 180px; gap: 12px; padding: 12px 16px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); border-top: 1.5px solid var(--border); border-bottom: 1px solid var(--border-light); font-weight: 500; margin-top: 16px; }
.news-list { display: flex; flex-direction: column; background: var(--white); }
.news-item { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-light); transition: background .2s; }
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: #FAF7F2; }
.news-info { min-width: 0; }
.news-title { font-weight: 700; font-size: 14px; color: var(--navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-url { font-size: 12px; color: var(--blue); word-break: break-all; margin-top: 4px; }
.news-ops { display: flex; gap: 6px; justify-content: flex-end; }
.news-ops .mini-btn { flex: 1; min-width: 60px; }
.pub-tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--green-light); color: #3D6B53; letter-spacing: 0.3px; vertical-align: middle; }

/* 验证页 */
.verify-card { margin: 16px; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px 22px; text-align: center; }
.verify-ico { font-size: 48px; margin-bottom: 12px; }
.verify-tip { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.verify-card .field { text-align: left; margin-bottom: 18px; }
.verify-hint { font-size: 12px; color: var(--text-light); margin-top: 16px; letter-spacing: 0.3px; }
.field .verify-hint { margin-top: 4px; }

/* 我的历史投稿 */
.history-btn {
  border: 1px solid var(--border); background: var(--white);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--blue);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.history-btn:hover { border-color: var(--blue); background: var(--blue-light); }
.history-list { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.history-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; border: 1px solid var(--border-light); cursor: pointer; transition: box-shadow .2s, transform .2s; }
.history-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.history-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-light); }
.history-card-arrow { font-size: 12px; color: var(--blue); font-weight: 600; }
.history-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.history-title { font-weight: 700; font-size: 15px; color: var(--navy); flex: 1; }
.history-badge { flex-shrink: 0; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.history-badge.pending { background: var(--blue-light); color: var(--blue-dark); }
.history-badge.selected { background: var(--green-light); color: #3D6B53; }
.history-badge.rejected { background: var(--border-light); color: var(--text-secondary); }
.history-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-secondary); }
.history-pub { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--green-light); color: #3D6B53; }
.history-actions { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-light); }

/* 后台导出行 */
.export-toolbar { justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 14px; }

/* 自定义日期范围（独立行） */
.date-range { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; background: var(--border-light); border: 1px solid var(--border); border-radius: 8px; }
.date-range[hidden] { display: none; }
.date-range-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.3px; }
.date-range input[type=date] { border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 13px; background: var(--white); font-family: inherit; }
.date-range-sep { color: var(--text-secondary); font-size: 13px; }

/* 后台多列统计 */
.stats-row-4 { grid-template-columns: repeat(4, 1fr); }
.stats-row-6 { grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stats-row-6 .stat-card { padding: 14px 8px; }
.stats-row-6 .stat-num { font-size: 24px; }
.stats-row-6 .stat-label { font-size: 12px; }
/* 组间距：总量/审核/发布 三组之间加大间距 */
.stats-row-6 .stat-card.stat-sep-pending { margin-left: 28px; }
.stats-row-6 .stat-card.stat-sep-pub { margin-left: 28px; }
.stat-pending { border-top-color: #D4943B; }
.stat-pending.active { box-shadow: 0 0 0 2px #D4943B, var(--shadow-md); }
.stat-pending.active .stat-num { color: #D4943B; }
.stat-pending .stat-num { color: #D4943B; }
.stat-pub { border-top-color: var(--green); }
.stat-pub.active { box-shadow: 0 0 0 2px var(--green), var(--shadow-md); border-top-color: var(--green); }
.stat-pub.active .stat-num { color: var(--green); }
.stat-pub .stat-num { color: var(--green); }

/* Responsive */
@media (max-width: 720px) {
  .stats-row, .stats-row-4 { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .tab { padding: 10px 16px; font-size: 14px; }
}
@media (max-width: 480px) {
  .stats-row, .stats-row-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 24px; }
  .stat-card { padding: 14px 10px; }
  .hero-title { font-size: 36px; }
}

/* ===== Toast 浮层提示 ===== */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 14px 24px; border-radius: 10px;
  font-size: 15px; font-weight: 600; line-height: 1.5;
  text-align: center; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  animation: toastIn .35s ease-out, toastOut .35s ease-in 2.5s forwards;
  max-width: 90vw;
}
.toast--success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.toast--error   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.toast--info    { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-16px); }
}
