/* ============================================================
   PanHub 资源聚合站 - 首页样式 v2
   排版参考：栏头式多栏目杂志布局（最新/热门/分类浏览）
   纯本地资源，无外部 CDN 依赖；全部手写实现
   ============================================================ */
:root {
  --brand: #fd6853;
  --brand-deep: #ff521e;
  --brand-grad: linear-gradient(120deg, #ff8a5c, #fd6853 52%, #f2422b);
  --ink: #2a3342;
  --muted: #7a8194;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #ececec;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(40, 40, 60, .04);
}
.hd-inner { display: flex; align-items: center; gap: 26px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-grad);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(253, 104, 83, .38);
}
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.logo-text em {
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--brand-deep);
  margin-left: 6px; background: #fff1ed;
  padding: 1px 8px; border-radius: 20px; vertical-align: 2px;
}
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  padding: 7px 14px; border-radius: 9px; font-size: 14.5px; color: #454e63;
  white-space: nowrap; font-weight: 500; transition: .15s;
}
.mainnav a:hover { background: #fff1ed; color: var(--brand-deep); }
.mainnav a.active { color: var(--brand-deep); font-weight: 700; background: #fff1ed; }

.quicksearch { display: flex; align-items: center; background: #f5f6f8; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.quicksearch input { border: 0; outline: 0; background: transparent; padding: 8px 14px; width: 168px; font-size: 13px; color: var(--ink); }
.quicksearch button { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; display: flex; }
.quicksearch button:hover { color: var(--brand-deep); }

/* 顶栏登录态 */
.hd-auth { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hd-login {
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: #fff; background: var(--brand-grad);
  box-shadow: 0 4px 12px rgba(253, 104, 83, .32); transition: .15s;
}
.hd-login:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hd-user { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: #3c4356; }
.hd-user:hover { color: var(--brand-deep); }
.hd-ava {
  width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.hd-logout { font-size: 12.5px; color: var(--muted); }
.hd-logout:hover { color: #cf2b1f; }

/* ---------- Hero：左文右图 ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(680px 300px at 88% 10%, rgba(253, 104, 83, .12), transparent 60%),
    radial-gradient(520px 260px at 8% 90%, rgba(255, 138, 92, .10), transparent 60%),
    linear-gradient(180deg, #fff6f1 0%, #ffeee6 100%);
}
.hero-grid { padding-top: 52px; padding-bottom: 96px; }
.hero-left { text-align: center; }
.hero-left h1 { font-size: 36px; font-weight: 800; letter-spacing: .5px; color: #262d3d; }
.hero-left h1 em {
  font-style: normal; color: var(--brand-deep);
  background: linear-gradient(transparent 66%, #ffd6c9 66%);
  padding: 0 3px;
}
.hero-sub { margin-top: 12px; font-size: 15px; color: #6d7488; }
.bigsearch {
  margin: 26px auto 0; max-width: 620px; display: flex; align-items: center;
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px;
  border: 1px solid #ffe2d7;
  box-shadow: 0 12px 30px rgba(242, 66, 43, .12);
}
.bs-ico { color: #b3aab2; flex-shrink: 0; }
.bigsearch input { flex: 1; border: 0; outline: 0; font-size: 15px; padding: 11px 12px; color: var(--ink); background: transparent; }
.bigsearch button {
  border: 0; border-radius: 999px; padding: 12px 34px;
  background: var(--brand-grad);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 4px;
  box-shadow: 0 6px 16px rgba(253, 104, 83, .35);
  transition: .15s;
}
.bigsearch button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hotwords { margin-top: 15px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px 12px; font-size: 13px; }
.hw-label { color: #98908e; }
.hotwords a { color: #5c5450; background: rgba(255, 255, 255, .8); border: 1px solid #ffe0d4; padding: 2px 12px; border-radius: 20px; transition: .15s; }
.hotwords a:hover { color: var(--brand-deep); border-color: var(--brand); background: #fff; }

.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 74px; display: block; }

/* ---------- 统计卡条 ---------- */
.statsbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -34px; position: relative; z-index: 2; }
.stats-card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(50, 45, 60, .06);
  padding: 14px 18px; display: flex; align-items: center; gap: 13px;
}
.st-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; }
.st-ico.s1 { background: #fff1ed; }
.st-ico.s2 { background: #eefaf1; }
.st-ico.s3 { background: #eef4ff; }
.st-ico.s4 { background: #fff8e8; }
.stats-card b { display: block; font-size: 20px; font-weight: 800; line-height: 1.3; }
.stats-card span { font-size: 12.5px; color: var(--muted); }

/* ---------- 演示数据提示 ---------- */
.demo-tip { margin-top: 14px; padding: 9px 16px; border-radius: 10px; font-size: 13px; background: #fff8e6; border: 1px solid #ffe3a3; color: #8a6116; }
.demo-tip code { background: rgba(0, 0, 0, .06); padding: 0 5px; border-radius: 4px; font-size: 12px; }

/* ---------- 栏目通用 ---------- */
.nx-sec { padding-top: 34px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: #262d3d; }
.sec-head h2 .bar { width: 5px; height: 20px; border-radius: 4px; background: var(--brand-grad); }
.sec-head .more { font-size: 13.5px; color: var(--muted); transition: .15s; }
.sec-head .more:hover { color: var(--brand-deep); }
.sec-head .sn { font-size: 13px; color: var(--muted); }
.sec-head .sn a { color: var(--brand-deep); }

/* ---------- 卡片栅格 ---------- */
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(60, 40, 35, .12); border-color: #ffd9cd; }

.cover { position: relative; display: flex; align-items: center; justify-content: center; height: 132px; }
.cover-emoji { font-size: 42px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .22)); }
.ftype {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0, 0, 0, .32); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 6px; letter-spacing: 1px; backdrop-filter: blur(3px);
}
.cat-tag {
  position: absolute; right: 10px; top: 10px;
  background: rgba(255, 255, 255, .9); color: #5a5060; font-size: 11.5px;
  padding: 2px 9px; border-radius: 20px;
}
.cover.c1 { background: linear-gradient(135deg, #ffb199, #ff7a59); }
.cover.c2 { background: linear-gradient(135deg, #c2a6f2, #f6a6d8); }
.cover.c3 { background: linear-gradient(135deg, #7ee8c7, #3bb2e8); }
.cover.c4 { background: linear-gradient(135deg, #ffd88a, #ff9e6d); }
.cover.c5 { background: linear-gradient(135deg, #8fd3ff, #5ba9f9); }
.cover.c6 { background: linear-gradient(135deg, #ffa5b4, #ff7e8a); }

.card-body { padding: 12px 14px 13px; display: flex; flex-direction: column; flex: 1; }
.card-title {
  font-size: 14.5px; font-weight: 700; line-height: 1.45; height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: 8px; font-size: 12px; color: #9aa0b2; display: flex; align-items: center; flex-wrap: wrap; }
.card-meta .size { color: var(--brand-deep); font-weight: 600; }
.card-meta .dot { margin: 0 6px; font-style: normal; color: #d5d8e2; }
.card-meta .hotnum { color: #f2762b; }

.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pans { display: flex; gap: 4px; flex-wrap: wrap; }
.pan { font-style: normal; font-size: 11px; color: #fff; padding: 2px 8px; border-radius: 5px; font-weight: 600; }
.p-baidu  { background: #12b7f5; }
.p-quark  { background: #5b65ff; }
.p-aliyun { background: #ff6a00; }
.p-lanzou { background: #0dbf5c; }
.p-123pan { background: #00b7c3; }
.p-direct { background: #6b7280; }

.btn-dl {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; border-radius: 8px; padding: 7px 15px;
  background: var(--brand-grad);
  color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: .15s;
}
.btn-dl:hover { filter: brightness(1.08); box-shadow: 0 6px 14px rgba(253, 104, 83, .38); }

/* 空状态 */
.empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty-emoji { font-size: 46px; margin-bottom: 10px; }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 6px 15px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 13.5px; color: #4a5165; transition: .15s;
}
.chip b { font-weight: 600; color: #b3b8c7; font-size: 12px; margin-left: 3px; }
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.on { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 600; }
.chip.on b { color: rgba(255, 255, 255, .8); }

/* ---------- 双栏：热门榜 + 公告 ---------- */
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px 18px; }
.panel + .panel { margin-top: 16px; }
.panel h4 { font-size: 15px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.p-text { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.p-text b { color: var(--ink); user-select: all; }
.chans { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chans .pan { font-size: 12px; padding: 4px 12px; }

.sec-left .panel, .sec-left .hotpanel { margin: 0; }
.top10 { list-style: none; counter-reset: hot; }
.top10 li {
  counter-increment: hot; display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed #f0eef0;
}
.top10 li:last-child { border-bottom: 0; }
.top10 li::before {
  content: counter(hot); flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: #f3f0f1; color: #a39ba4;
}
.top10 li:nth-child(1)::before { background: linear-gradient(135deg, #ff8a5c, #f2422b); color: #fff; }
.top10 li:nth-child(2)::before { background: linear-gradient(135deg, #ffa25c, #ff6a3d); color: #fff; }
.top10 li:nth-child(3)::before { background: linear-gradient(135deg, #ffb75e, #f2872b); color: #fff; }
.top10 a {
  flex: 1; font-size: 13px; color: #3c4356;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top10 a:hover { color: var(--brand-deep); }
.top10 span { flex-shrink: 0; font-size: 11.5px; color: #f2762b; font-weight: 700; }

/* ---------- 分页 ---------- */
.pager { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.pg { padding: 7px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; color: #4a5165; }
a.pg:hover { border-color: var(--brand); color: var(--brand-deep); }
.pg.on { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; }
.pg-sep, .total-pg { border: 0; background: transparent; color: var(--muted); }

/* ---------- 页脚 ---------- */
.footer { background: #23262e; color: #9aa0ae; margin-top: 46px; }
.ft-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 30px; padding-top: 38px; padding-bottom: 26px; }
.ft-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.ft-logo b { color: #fff; font-size: 16.5px; }
.ft-brand p { font-size: 12.5px; line-height: 1.9; }
.ft-col h5 { color: #fff; font-size: 14px; margin-bottom: 12px; font-weight: 700; }
.ft-col a { display: block; font-size: 13px; padding: 3.5px 0; transition: .15s; }
.ft-col a:hover { color: var(--brand); }
.ft-bar { border-top: 1px solid #33363f; padding-top: 16px; padding-bottom: 20px; text-align: center; font-size: 12px; color: #7d8290; }

/* ---------- 下载弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(25, 28, 36, .55); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; width: min(540px, calc(100vw - 36px)); max-height: 78vh;
  background: #fff; border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(10, 12, 20, .35);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); }
.modal-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.modal-title b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-emoji { font-size: 20px; }
.mclose {
  border: 0; background: #f3f4f6; color: #6b7390; width: 28px; height: 28px;
  border-radius: 8px; font-size: 19px; line-height: 1; flex-shrink: 0; transition: .15s;
}
.mclose:hover { background: #ffe5e5; color: #e5484d; }
.modal-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.m-fav {
  border: 1px solid #f0c9bd; background: #fff; color: #ff521e;
  height: 28px; padding: 0 12px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0; transition: .15s;
}
.m-fav:hover:not(:disabled) { background: #fff1ed; }
.m-fav.on { background: var(--brand-grad, #fd6853); border-color: transparent; color: #fff; }
.m-fav:disabled { opacity: .55; cursor: wait; }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
  transition: .15s;
}
.link-row:hover { border-color: #ffc9b8; background: #fffaf8; }
.link-row .pan { font-size: 12px; padding: 4px 11px; flex-shrink: 0; }
.link-url { flex: 1; min-width: 0; font-size: 12.5px; color: #4a5165; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passcode {
  flex-shrink: 0; font-size: 12px; color: #b25e00; background: #fff4dd;
  border: 1px dashed #f0c274; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  font-weight: 700; letter-spacing: 1px;
}
.passcode:hover { background: #ffeec7; }
.passcode.copied { color: #0d7a43; background: #dcf7e7; border-color: #7ed4a4; }
.open-pan {
  flex-shrink: 0; border: 0; border-radius: 8px; padding: 7px 14px;
  background: var(--brand-grad);
  color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none; transition: .15s;
}
.open-pan:hover { filter: brightness(1.08); }
.modal-foot { padding: 11px 18px; border-top: 1px solid var(--line); font-size: 12px; color: #9aa0b2; text-align: center; }
.m-loading, .m-error { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13.5px; }
.m-error .big { font-size: 34px; display: block; margin-bottom: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(3, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .cols2 { grid-template-columns: 1fr; }
  .hero-grid { padding-bottom: 76px; }
  .statsbar { grid-template-columns: repeat(2, 1fr); }
  .ft-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .mainnav, .quicksearch { display: none; }
  .hd-inner { justify-content: space-between; }
  .hero-left h1 { font-size: 26px; }
  .hero-sub { font-size: 13.5px; }
  .hero-grid { padding-top: 34px; }
  .bigsearch input { font-size: 14px; }
  .bigsearch button { padding: 10px 20px; letter-spacing: 2px; }
  .statsbar { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: -26px; }
  .g4, .g3 { grid-template-columns: 1fr; }
  .sec-head h2 { font-size: 17px; }
}
