/* 图览云 · 前台视觉规范（V2 美化版）
   风格：政务极简 / 干净高级 / 文化平台质感
   主色：藏青  点缀：浅金
   无花哨动画、无轮播特效；PC / 平板 / 手机 三档自适应 */

:root {
  --navy: #1f3a5f;
  --navy-deep: #15293f;
  --navy-2: #2c4a72;
  --gold: #c9a86a;
  --gold-light: #e3cda0;
  --gold-soft: #f0e6cf;
  --bg: #eef1f5;
  --paper: #f7f9fb;
  --text: #1f2a37;
  --muted: #6b7785;
  --line: #e4e8ef;
  --card: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(21, 41, 63, 0.06), 0 4px 10px rgba(21, 41, 63, 0.05);
  --shadow-md: 0 6px 16px rgba(21, 41, 63, 0.10), 0 2px 4px rgba(21, 41, 63, 0.06);
  --shadow-lg: 0 16px 40px rgba(21, 41, 63, 0.18);
  /* 品类 accent */
  --c-read: #c9a86a;
  --c-red: #c0392b;
  --c-sci: #3a8a7a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 10px rgba(21, 41, 63, 0.18);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 10px 28px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .logo {
  font-size: 22px; font-weight: 800; letter-spacing: 3px;
  font-family: "STZhongsong", "Microsoft YaHei", serif;
}
.brand .logo span { color: var(--gold-light); }
.brand .sub {
  font-size: 12px; color: rgba(255, 255, 255, 0.62); letter-spacing: 2px;
}

/* 筛选工具栏 */
.filters {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group .label {
  font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-right: 2px;
}
.tag {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.tag:hover { border-color: var(--gold); color: #fff; }
.tag.active {
  background: var(--gold); border-color: var(--gold);
  color: var(--navy-deep); font-weight: 700;
}

/* ---------- 主体 ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 26px 28px 120px; }
.section-tip {
  color: var(--muted); font-size: 13px; margin: 2px 0 18px;
  display: flex; align-items: center; gap: 8px;
}
.section-tip::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold-light));
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-light); }
.card .thumb {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 品类标签（浮于封面左上角） */
.card .chip {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(15, 26, 40, 0.82); color: var(--gold-light);
  font-size: 11px; letter-spacing: 0.5px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(2px);
}
.card .chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.cat-red .chip .dot { background: var(--c-red); }
.cat-science .chip .dot { background: var(--c-sci); }
.card .name {
  padding: 13px 15px 15px;
  font-size: 15px; font-weight: 700; color: var(--navy-deep);
  line-height: 1.45; min-height: 58px;
  display: flex; align-items: center;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 15px; }

/* 水印（克制，不抢眼） */
.wm::after {
  content: "图览云";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.10);
  transform: rotate(-22deg); pointer-events: none;
}

/* ---------- 悬浮按钮 ---------- */
.fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 60;
  background: var(--navy); color: #fff;
  border: 2px solid var(--gold); border-radius: 999px;
  padding: 14px 22px; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 8px 22px rgba(21, 41, 63, 0.32);
  letter-spacing: 1px; transition: transform .15s, background .15s;
}
.fab:hover { background: var(--navy-deep); transform: translateY(-2px); }

/* ---------- 底部 ---------- */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--navy-deep); color: rgba(255, 255, 255, 0.82);
  text-align: center; font-size: 13px; padding: 9px 0;
  letter-spacing: 1px; z-index: 40;
}
.footer b { color: var(--gold-light); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(12, 20, 32, 0.6);
  z-index: 100; display: none; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 48px 16px;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.mask.show { display: flex; }
.modal {
  background: #fff; width: 100%; max-width: 760px;
  border-radius: 14px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  background: var(--navy); color: #fff;
  padding: 18px 24px; display: flex; align-items: center; justify-content: space-between;
}
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 1px; font-family: "Microsoft YaHei", "PingFang SC", serif; }
.modal-head .close {
  background: transparent; border: none; color: rgba(255, 255, 255, 0.85);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.modal-head .close:hover { color: var(--gold-light); }
.modal-body { padding: 24px; }

/* 图集 */
.gallery {
  position: relative; background: #0f1a28; border-radius: 10px;
  overflow: hidden; aspect-ratio: 3 / 4; margin-bottom: 22px;
}
.gallery img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.42); color: #fff; border: none;
  width: 42px; height: 42px; border-radius: 50%; font-size: 22px; cursor: pointer;
  transition: background .15s;
}
.gallery .nav:hover { background: rgba(0, 0, 0, 0.62); }
.gallery .nav.prev { left: 10px; } .gallery .nav.next { right: 10px; }
.gallery .count {
  position: absolute; right: 12px; bottom: 10px; color: #fff; font-size: 12px;
  background: rgba(0, 0, 0, 0.42); padding: 2px 9px; border-radius: 999px;
}
.gallery .dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px; z-index: 3;
}
.gallery .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45); transition: width .2s, background .2s;
}
.gallery .dot.on { background: #fff; width: 16px; border-radius: 4px; }

/* 三档合作模式 */
.coop { display: grid; gap: 12px; margin-bottom: 24px; }
.coop .item {
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 6px; padding: 13px 16px; background: var(--paper);
}
.coop .item h4 { margin: 0 0 5px; font-size: 15px; color: var(--navy); }
.coop .item p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* 大按钮 */
.btn-row { display: flex; gap: 14px; }
.btn-big {
  flex: 1; border: none; border-radius: 8px; padding: 15px 0;
  font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: 1px;
  transition: transform .12s, filter .15s;
}
.btn-big:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy-deep); }
.btn-gold:hover { filter: brightness(1.05); }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--navy); font-weight: 700; margin-bottom: 7px; }
.field label .req { color: #c0392b; margin-left: 2px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.field input:focus, .field textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(44, 74, 114, 0.12);
}
.field textarea { resize: vertical; min-height: 72px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; margin-bottom: 16px; }
.form-note { font-size: 12px; color: var(--muted); margin-top: -8px; margin-bottom: 14px; }
.success-box { text-align: center; padding: 34px 10px; }
.success-box .ico {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 30px; line-height: 58px;
  margin: 0 auto 14px;
}
.success-box p { font-size: 15px; color: var(--text); margin: 0; }

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .container { padding: 22px 20px 116px; }
  .topbar-inner { padding: 10px 20px 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
}

/* 触摸设备禁用 hover 残留态 */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
  .tag:hover { border-color: rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.88); }
  .tag.active:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
  .fab:hover { background: var(--navy); transform: none; }
  .btn-primary:hover { background: var(--navy); }
  .btn-gold:hover { filter: none; }
}

/* ---------- 手机端 ---------- */
@media (max-width: 720px) {
  .topbar-inner { padding: 8px 12px 10px; gap: 8px; }
  .brand .logo { font-size: 18px; letter-spacing: 1px; }
  .brand .sub { font-size: 10px; letter-spacing: 1px; }

  .filters {
    flex-direction: column; align-items: stretch; gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 10px;
  }
  .filter-group { gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-group .label { display: none; }
  .tag { flex: 0 0 auto; padding: 7px 13px; font-size: 12px; }

  /* 品类：四等分分段控件（仿 iOS segmented） */
  #catGroup {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  }
  #catGroup .tag { flex: none; text-align: center; padding: 8px 0; border: none; border-radius: 0; background: transparent; }
  #catGroup .tag + .tag { border-left: 1px solid rgba(255, 255, 255, 0.25); }

  .container { padding: 14px 12px 104px; }
  .section-tip { margin: 2px 0 12px; font-size: 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .name { font-size: 13px; padding: 10px 11px 12px; min-height: 44px; line-height: 1.35; }
  .card .chip { font-size: 10px; padding: 3px 8px 3px 6px; top: 8px; left: 8px; }
  .wm::after { font-size: 15px; letter-spacing: 3px; }

  /* 详情弹窗全屏 */
  .mask { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; border-radius: 0; min-height: 100%; }
  .modal-head { position: sticky; top: 0; z-index: 5; padding: 14px 16px; }
  .modal-head h2 { font-size: 17px; }
  .modal-body { padding: 16px 14px 44px; }
  .gallery { margin-bottom: 16px; }
  .gallery .nav { width: 46px; height: 46px; font-size: 28px; }
  .gallery .nav.prev { left: 6px; } .gallery .nav.next { right: 6px; }
  .coop { gap: 10px; margin-bottom: 18px; }
  .coop .item { padding: 11px 13px; }
  .coop .item h4 { font-size: 14px; } .coop .item p { font-size: 12px; line-height: 1.5; }

  .field input, .field textarea { font-size: 16px; padding: 12px; }
  .field-row { flex-direction: column; gap: 0; }
  .field-row .field { margin-bottom: 16px; }

  .btn-row { flex-direction: column; gap: 12px; }
  .btn-big { padding: 14px 0; font-size: 16px; }

  .fab { right: 14px; bottom: 52px; padding: 13px 18px; font-size: 14px; letter-spacing: 0.5px; }
  .footer { font-size: 12px; padding: 7px 0; }
}

@media (max-width: 380px) {
  .topbar-inner { padding: 7px 10px 9px; }
  .grid { gap: 10px; }
  .card .name { font-size: 12px; padding: 9px 9px 10px; min-height: 40px; }
}
