/* ============================================================
 * 47字体网 · 全站样式
 * ============================================================ */
:root {
  --primary: #4f6ef7;
  --primary-2: #7c5cff;
  --grad: linear-gradient(135deg, #4f6ef7 0%, #7c5cff 100%);
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2333;
  --text-2: #6b7280;
  --border: #e8eaf2;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 35, 51, .06);
  --shadow-hover: 0 10px 30px rgba(79, 110, 247, .18);
  --hot: #ff5a5f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- 导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar .container { display: flex; align-items: center; height: 62px; gap: 26px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; }
.logo-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad);
  color: #fff; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .5px;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-links > a {
  padding: 8px 14px; border-radius: 8px; font-size: 15px; color: #444;
  transition: .18s;
}
.nav-links > a:hover { background: #eef1fe; color: var(--primary); }
.nav-links > a.active { color: var(--primary); font-weight: 600; }
.nav-cta {
  margin-left: auto;
  background: var(--grad); color: #fff !important;
  padding: 9px 20px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(79, 110, 247, .35);
  transition: .18s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79, 110, 247, .45); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1d2340 0%, #2b2660 55%, #45218a 100%);
  color: #fff; padding: 64px 0 88px;
  position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .35; pointer-events: none;
}
.hero::before { width: 420px; height: 420px; background: #4f6ef7; top: -160px; right: -80px; }
.hero::after  { width: 340px; height: 340px; background: #b34fff; bottom: -180px; left: -60px; }
.hero .container { position: relative; z-index: 1; text-align: center; }
.hero h1 { font-size: 40px; font-weight: 800; letter-spacing: 1px; }
.hero h1 .hl {
  background: linear-gradient(90deg, #8fb0ff, #c39bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { margin-top: 14px; font-size: 16px; color: rgba(255,255,255,.72); }
.hero-stats { display: flex; justify-content: center; gap: 44px; margin-top: 26px; }
.hero-stats b { font-size: 26px; display: block; }
.hero-stats span { font-size: 13px; color: rgba(255,255,255,.6); }

/* 搜索框 */

/* ---------- 分类 ---------- */
.filter-bar { margin: -44px auto 0; position: relative; z-index: 5; }
.filter-inner {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 7px 16px; border-radius: 999px; font-size: 14px;
  background: #f1f3f9; color: #555; cursor: pointer; border: 1px solid transparent;
  transition: .15s; user-select: none;
}
.chip:hover { color: var(--primary); }
.chip.on { background: var(--grad); color: #fff; font-weight: 600; }

/* ---------- 字体网格 ---------- */
.grid-wrap { padding: 30px 0 70px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 18px; }
.section-head h2 { font-size: 22px; }
.section-head span { color: var(--text-2); font-size: 14px; }
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.font-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: .2s;
  border: 1px solid var(--border);
}
.font-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.font-preview {
  height: 118px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.font-preview img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.font-meta { padding: 12px 14px 14px; }
.font-meta h3 { font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.font-meta .tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: #f1f3f9; color: #666;
}
.tag.lic { background: #e8f7ee; color: #1a9e55; font-weight: 500; }
.font-meta .pack { margin-top: 10px; font-size: 12.5px; color: var(--primary); font-weight: 600; }
.empty-tip { text-align: center; color: var(--text-2); padding: 60px 0; grid-column: 1/-1; }

/* 视图切换按钮 */
.view-switch { display: flex; gap: 6px; }
.v-btn {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: #98a0b5; font-size: 15px; cursor: pointer; transition: .15s;
}
.v-btn.on { background: var(--grad); color: #fff; border-color: transparent; }

/* 列表模式 */
.font-grid.list-mode { display: flex; flex-direction: column; gap: 10px; }
.font-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 18px 10px 10px; transition: .15s;
}
.font-row:hover { transform: translateX(3px); box-shadow: var(--shadow-hover); border-color: #d8defc; }
.font-row img {
  width: 150px; height: 76px; object-fit: contain; background: #fff;
  border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0;
}
.font-row .row-main { flex: 1; min-width: 0; }
.font-row h3 { font-size: 16px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.font-row .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.font-row .row-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.font-row .row-size { font-size: 13px; color: var(--text-2); }
.font-row .row-go { font-size: 20px; color: var(--primary); font-weight: 700; }
@media (max-width: 640px) {
  .font-row .row-size { display: none; }
  .font-row img { width: 110px; height: 58px; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(18, 20, 33, .55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; max-width: 520px; width: 100%;
  overflow: hidden; animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-hero { height: 150px; display: flex; align-items: center; justify-content: center; }
.modal-hero .p-text { font-size: 44px; font-weight: 700; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.2); }
.modal-body { padding: 22px 26px 26px; }
.modal-body h3 { font-size: 20px; margin-bottom: 6px; }
.modal-info { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.modal-info .tag { font-size: 12px; padding: 4px 12px; }
.modal-body p.desc { color: var(--text-2); font-size: 14.5px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  flex: 1; height: 44px; border: none; border-radius: 10px;
  font-size: 15px; cursor: pointer; font-weight: 600; transition: .18s;
}
.btn-ghost { background: #f1f3f9; color: #555; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(79,110,247,.35); }
.btn-grad:hover { transform: translateY(-1px); }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: rgba(255,255,255,.25);
  color: #fff; font-size: 16px; cursor: pointer;
}
.modal { position: relative; }

/* ---------- 打包下载页（donate） ---------- */
.donate-hero { text-align: center; padding: 58px 0 10px; }
.donate-hero h1 { font-size: 32px; font-weight: 800; }
.donate-hero h1 em { font-style: normal; color: var(--primary); }
.donate-hero p { color: var(--text-2); margin-top: 12px; max-width: 640px; margin-left: auto; margin-right: auto; }
.story {
  max-width: 760px; margin: 26px auto 0; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 28px; color: #444; font-size: 14.5px;
  border-left: 4px solid var(--primary);
}

.pack-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; max-width: 1080px; margin: 36px auto 0;
}
@media (max-width: 1000px) { .pack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .pack-grid { grid-template-columns: 1fr; } }
.pack-card {
  background: var(--card); border-radius: 18px; padding: 28px 24px;
  box-shadow: var(--shadow); text-align: center; position: relative;
  border: 2px solid transparent; transition: .2s; display: flex; flex-direction: column;
}
.pack-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.pack-card.hot { border-color: var(--hot); }
.pack-card .badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--hot); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 14px; border-radius: 999px; letter-spacing: 1px;
}
.pack-price { font-size: 40px; font-weight: 800; }
.pack-price small { font-size: 16px; font-weight: 600; color: var(--text-2); }
.pack-name { color: var(--text-2); margin-top: 2px; font-weight: 600; }
.pack-feats { list-style: none; margin: 18px 0 20px; flex: 1; }
.pack-feats li { font-size: 13.5px; color: #555; padding: 5px 0; }
.pack-feats li::before { content: "✓ "; color: #1a9e55; font-weight: 700; }
.pack-btn {
  height: 46px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700;
  transition: .18s;
}
.pack-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,110,247,.4); }

/* 支付区 */
.pay-zone {
  max-width: 860px; margin: 46px auto 0; background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow); padding: 34px 34px 30px;
  text-align: center;
}
.pay-zone h2 { font-size: 22px; }
.pay-current {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px;
  background: #f1f3f9; border-radius: 999px; padding: 8px 20px; font-size: 14.5px; color: #555;
}
.pay-current b { color: var(--text); }
.pay-price {
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  padding: 2px 14px; border-radius: 999px;
}
.pay-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 34px;
  align-items: start; margin-top: 26px; text-align: left;
}
.qr-card {
  background: #fff; border: 2px solid #07c160; border-radius: 16px;
  overflow: hidden; text-align: center;
  box-shadow: 0 6px 24px rgba(7, 193, 96, .18);
}
.qr-card-head {
  background: #07c160; color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: 2px; padding: 9px 0;
}
.qr-card img, .qr-card .qr-placeholder { width: 100%; display: block; }
.qr-card .qr-placeholder {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #98a0b5; gap: 8px; font-size: 14px;
}
.qr-card .qr-placeholder .big { font-size: 40px; }
.qr-scan-tip { font-size: 13px; color: #555; padding: 10px 0 2px; font-weight: 600; }
.qr-amount {
  font-size: 26px; font-weight: 800; color: #07c160; padding: 2px 0 16px;
  font-family: "DIN Alternate", "PingFang SC", sans-serif;
}
.pay-steps-tl h3 { font-size: 16px; margin-bottom: 14px; }
.pay-steps-tl ol { list-style: none; padding: 0; position: relative; }
.pay-steps-tl ol::before {
  content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px;
  width: 2px; background: #e3e9ff;
}
.pay-steps-tl li {
  position: relative; padding: 0 0 18px 40px; font-size: 14px; color: #444;
}
.pay-steps-tl li::before {
  content: counter(list-item); counter-increment: list-item;
  position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  background: var(--grad); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; box-shadow: 0 3px 8px rgba(79,110,247,.3);
}
.pay-steps-tl li b { color: var(--text); }
.note-bar {
  background: #fff7e6; border: 1px solid #ffe1ad; border-radius: 10px;
  padding: 11px 16px; font-size: 13.5px; color: #8a5b00; font-weight: 600;
  margin-top: 6px;
}
@media (max-width: 760px) {
  .pay-grid { grid-template-columns: 1fr; }
  .qr-card { max-width: 300px; margin: 0 auto; }
}

.pay-steps {
  margin: 22px auto 0; text-align: left;
  background: #f6f8ff; border: 1px solid #e3e9ff; border-radius: 14px; padding: 18px 22px;
}
.pay-steps h3 { font-size: 15px; margin-bottom: 10px; color: var(--primary); }
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 1020px; margin: 50px auto 0;
}
.panel {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 26px 28px;
}
.panel h2 { font-size: 19px; margin-bottom: 16px; }
.log-list { list-style: none; max-height: 320px; overflow: auto; }
.log-list li {
  display: flex; gap: 12px; padding: 8px 0; font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
}
.log-list li:last-child { border-bottom: none; }
.log-date { color: var(--primary); font-weight: 600; white-space: nowrap; }
.donor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 320px; overflow: auto; }
.donor {
  background: #f8f9fd; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 8px; text-align: center;
}
.donor b { display: block; font-size: 13px; }
.donor span { font-size: 12px; color: var(--text-2); }
.donor.ghost { color: #b6bccd; border-style: dashed; background: transparent; }

/* ---------- 页脚 ---------- */
footer { background: #1d2340; color: rgba(255,255,255,.65); padding: 40px 0 30px; margin-top: 60px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.foot-brand .logo { color: #fff; margin-bottom: 12px; }
.foot-brand p { font-size: 13px; max-width: 340px; }
.foot-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.foot-col a { display: block; font-size: 13px; padding: 4px 0; color: rgba(255,255,255,.6); }
.foot-col a:hover { color: #fff; }
.foot-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.copyright { text-align: center; margin-top: 34px; font-size: 12.5px; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
.beian { text-align: center; margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.38); }
.beian a { color: rgba(255,255,255,.55); text-decoration: none; }
.beian a:hover { color: #fff; text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-links > a:not(.nav-cta) { font-size: 12px; padding: 4px 6px; }
  .hero h1 { font-size: 28px; }
  .hero-stats { gap: 24px; }
  .two-col { grid-template-columns: 1fr; }
  .font-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .font-preview .p-text { font-size: 24px; }
}

/* 站长好友二维码行 */
.friend-qr-row {
  display: flex; align-items: center; gap: 14px;
  background: #f0faf4; border: 1px solid #bfe9d2; border-radius: 12px;
  padding: 12px 16px; margin-top: 16px;
}
.friend-qr-box { width: 92px; height: 92px; flex-shrink: 0; background: #fff; border-radius: 8px; overflow: hidden; }
.friend-qr-box img { width: 100%; height: 100%; object-fit: contain; }
.friend-qr-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #98a0b5; text-align: center; padding: 4px;
}
.friend-txt { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: #444; }
.friend-txt b { font-size: 14.5px; color: #07c160; }

/* ============================================================
 * Pixabay 风视觉升级层 v2（卡片交互/质感/hero融合）
 * ============================================================ */

/* hero 内嵌分类快捷 chips（悬浮于 hero 底缘） */
.hero .hero-cats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 30px; position: relative; z-index: 2;
}
.hero .hero-cats a {
  padding: 8px 20px; border-radius: 999px; background: rgba(255,255,255,.14);
  color: #fff; text-decoration: none; font-size: 14px; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.22); transition: all .2s;
}
.hero .hero-cats a:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }

/* 搜索框放大（Pixabay 式中央大搜索） */
.hero .search-box { max-width: 640px; margin: 30px auto 0; display: flex; }
.hero .search-box input {
  flex: 1; padding: 16px 24px; font-size: 16px; border-radius: 999px 0 0 999px;
  border: none; outline: none; background: #fff; color: var(--text);
}
.hero .search-box .s-btn {
  padding: 0 30px; border: none; border-radius: 0 999px 999px 0;
  background: #ff5a5f; color: #fff; font-size: 18px; cursor: pointer; transition: background .2s;
}
.hero .search-box .s-btn:hover { background: #ff454b; }

/* 卡片：Pixabay 式 hover（上浮/阴影/图片缩放/下载浮层） */
.font-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,.08); transition: all .25s cubic-bezier(.2,.7,.3,1);
  position: relative; will-change: transform;
}
.font-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(16,24,40,.14);
}
.font-card .font-preview { overflow: hidden; }
.font-card .font-preview img {
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.font-card:hover .font-preview img { transform: scale(1.05); }

/* hover 下载浮层（卡片底部滑入） */
.font-card .dl-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(16,24,40,.72));
  padding: 30px 14px 12px; display: flex; justify-content: flex-end; align-items: flex-end;
  opacity: 0; transition: opacity .22s; pointer-events: none;
}
.font-card:hover .dl-overlay { opacity: 1; }
.font-card .dl-overlay .ov-btn {
  background: var(--primary); color: #fff; font-size: 13px; padding: 7px 16px;
  border-radius: 8px; font-weight: 500;
}
/* 卡片 meta 质感 */
.font-card .font-meta { padding: 12px 14px 14px; }
.font-card .font-meta h3 { font-size: 15px; margin: 0 0 8px; }
.font-card .font-meta .pack { font-size: 12px; color: var(--text-2); }

/* 列表行 hover 同步 */
.font-row { transition: all .2s; }
.font-row:hover { transform: translateX(4px); box-shadow: 0 6px 20px rgba(16,24,40,.10); }

/* 热度卡同步质感 */
.hot-card { transition: all .25s cubic-bezier(.2,.7,.3,1); }
.hot-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(16,24,40,.13); }

/* 筛选 chips：Pixabay 式圆角胶囊 + hover 动效 */
.filter-bar .chip, .filter-inner .chip {
  transition: all .18s; border: 1px solid transparent;
}
.filter-bar .chip:hover, .filter-inner .chip:hover { transform: translateY(-1px); }
.filter-bar .chip.on, .filter-inner .chip.on { border-color: var(--primary); }

/* 网格密度微调（更接近 Pixabay 多列） */
.font-grid { gap: 18px; }

/* hero 高度收紧 + 渐变更柔和 */
.hero { padding: 64px 0 74px; }

/* 移动端导航修复（375px 下链接不折行、不消失） */
@media (max-width: 768px) {
  .navbar .container { gap: 10px; padding: 0 12px; }
  .navbar .nav-links a {
    font-size: 12px; margin-left: 0; padding: 4px 5px;
    white-space: nowrap; flex-shrink: 0;
  }
  .navbar .nav-links { flex-wrap: nowrap; gap: 0; }
  .logo { font-size: 15px; white-space: nowrap; flex-shrink: 0; }
  .logo-badge { font-size: 13px; width: 30px; height: 30px; }
}
