

:root {
  --primary: #8a3ffc;
  --primary-2: #a855f7;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.09), rgba(168, 85, 247, 0.09));

  --ink: #111114;
  --ink-2: #4b4e5a;
  --ink-3: #8b8fa0;
  --line: #e8e9f0;
  --bg: #ffffff;
  --card: #ffffff;
  --bar-bg: #1e1e24;
  --bar-ink: #ffffff;

  --radius: 0px;
  --shadow: none;

  --header-h: 50px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --container: 1180px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 12px; }

/* ============================ 顶栏（深色，对齐参考站） ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bar-bg);
  padding-top: var(--safe-top);
}
.header-inner {
  position: relative;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--container); margin: 0 auto; padding: 0 6px;
}
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 0;
  background: transparent; color: var(--bar-ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto; transition: color 0.2s;
}
.icon-btn:hover, .icon-btn:active { color: var(--primary-2); }
.icon-btn svg { width: 23px; height: 23px; }

/* 双行居中 logo：FANS(紫) / TOPIS(白色小字大字距) */
.logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; line-height: 1; white-space: nowrap;
}
.logo .logo-top {
  display: block; font-size: 21px; font-weight: 900; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #9d5cff 0%, #c26af6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.logo .logo-sub {
  display: block; margin-top: 3px; font-size: 9px; font-weight: 600;
  letter-spacing: 5px; text-indent: 5px; color: var(--bar-ink); text-transform: uppercase;
}

/* 移动端搜索框隐藏，PC 显示 */
.header-search { display: none; }

/* 顶部导航（PC） */
.top-nav { display: none; }

/* ============================ 移动端抽屉菜单（深色） ============================ */
.drawer-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none;
  transition: opacity 0.28s;
}
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 201;
  width: min(80vw, 320px);
  background: var(--bar-bg); color: var(--bar-ink);
  transform: translateX(-104%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-top)) 0 16px;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.drawer-title {
  font-weight: 900; font-size: 19px; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #9d5cff 0%, #c26af6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.drawer-nav { flex: 1; overflow-y: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; }
.drawer-nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; font-weight: 600; font-size: 15.5px;
  color: rgba(255, 255, 255, 0.85); transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.drawer-nav a:active, .drawer-nav a.active {
  background: rgba(255, 255, 255, 0.06); color: #fff;
  border-left-color: var(--primary-2);
}
.drawer-nav a svg { width: 19px; height: 19px; opacity: 0.75; }
.drawer-foot { padding: 12px 18px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; color: rgba(255, 255, 255, 0.5); }
.drawer-foot a { color: var(--primary-2); font-weight: 600; }

/* ============================ 广告位 ============================
   不带任何提示文字与背景色。
   首页第一个广告位预留 200px；其余广告位自然撑开。 */
.ad-slot { width: 100%; overflow: hidden; }
.ad-home-top { min-height: 200px; }
.ad-inlist { padding: 14px 0; }

/* ============================ Hero（全宽大图，对齐参考站） ============================ */
.hero { padding: 0; }
.hero-grid {
  display: grid; gap: 2px; background: var(--bg);
}
.hero-main { position: relative; display: block; overflow: hidden; }
.hero-main img { width: 100%; aspect-ratio: 360 / 268; object-fit: cover; }
.hero-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 100%);
  padding: 34px 12px 10px;
}
.hero-title {
  color: #fff; font-weight: 800; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 17.5px; line-height: 1.32; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.hero-meta { color: rgba(255, 255, 255, 0.85); font-size: 11.5px; margin-top: 6px; font-weight: 500; }
.hero-meta b { color: #fff; font-weight: 700; }

.hero-sub {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc(50% - 1px);
  gap: 2px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.hero-sub::-webkit-scrollbar { display: none; }
.hero-small { position: relative; display: block; overflow: hidden; scroll-snap-align: start; }
.hero-small img { width: 100%; aspect-ratio: 179 / 132; object-fit: cover; }
.hero-small .hero-overlay { padding: 22px 8px 8px; }
.hero-small .hero-title { font-size: 12.5px; -webkit-line-clamp: 3; }

/* 分类角标（仅 hero 大图使用，参考站同款紫色块） */
.hero-cat {
  position: absolute; top: 0; left: 0;
  background: var(--grad); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px;
}

/* ============================ 区块标题（杂志风下划线） ============================ */
.section { padding: 18px 0 4px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px; border-bottom: 2px solid var(--ink);
}
.section-title {
  font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
  margin: 0; padding-bottom: 7px; position: relative; line-height: 1.2;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; min-width: 64px; height: 2px; background: var(--grad);
}
.section-more { font-size: 12.5px; color: var(--ink-3); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; padding-bottom: 6px; transition: color 0.2s; }
.section-more:hover { color: var(--primary); }
.section-more svg { width: 13px; height: 13px; }

/* ============================ 文章卡片（扁平杂志风） ============================ */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.card {
  background: var(--card); display: flex; flex-direction: column;
  padding: 14px 0 16px; border-bottom: 1px solid var(--line);
}
.card-thumb { position: relative; overflow: hidden; margin: 0 0 10px; }
.card-thumb img { width: 100%; aspect-ratio: 360 / 200; object-fit: cover; }
.card-body { display: flex; flex-direction: column; }
.card-title {
  font-size: 16.5px; font-weight: 800; line-height: 1.32; margin: 0; color: var(--ink);
  letter-spacing: -0.2px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.2s;
}
.card:hover .card-title { color: var(--primary); }
.card-meta {
  margin-top: 8px; display: flex; align-items: center; font-size: 11.5px; color: var(--ink-3);
}
.card-meta .meta-author { color: var(--ink); font-weight: 700; }
.card-meta .meta-sep { margin: 0 6px; color: var(--ink-3); }
.card-meta .meta-comments {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-3); font-weight: 700;
}
.card-meta .meta-comments svg { width: 14px; height: 14px; }

/* 无图占位（渐变 + 首字母） */
.thumb-fallback {
  width: 100%; aspect-ratio: 360 / 200; display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: rgba(255, 255, 255, 0.92);
  font-size: 34px; font-weight: 800;
}

/* 横向滑动行（首页分类行） */
.hscroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
  gap: 12px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin: 0 -2px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
.hscroll .card { border-bottom: 0; padding: 0; }
.hscroll .card-thumb img { aspect-ratio: 300 / 168; }
.hscroll .card-title { font-size: 13.5px; -webkit-line-clamp: 2; }

/* ============================ 加载更多 ============================ */
.load-wrap { display: flex; justify-content: center; padding: 20px 0 8px; }
.btn-more {
  border: 0; cursor: pointer; padding: 12px 38px;
  font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  color: #fff; background: var(--grad); transition: opacity 0.15s, transform 0.15s;
}
.btn-more:hover { opacity: 0.9; }
.btn-more:active { transform: scale(0.97); }
.btn-more[disabled] { opacity: 0.5; cursor: default; }

.search-hero { padding: 18px 0 6px; }
.page-head { padding: 18px 0 4px; }
.page-title { font-size: 21px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3px; margin: 0 0 4px; }
.page-sub { color: var(--ink-3); font-size: 13px; margin: 0; }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--primary); font-weight: 700; }

.search-box { position: relative; }
.search-box input {
  width: 100%; height: 48px; border-radius: 0;
  border: 2px solid var(--ink); background: #fff;
  padding: 0 48px 0 46px; font-size: 16px; color: var(--ink); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.search-box .icon-search-lead { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); }
.search-box .icon-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--line); color: var(--ink-2); width: 30px; height: 30px;
  border-radius: 999px; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search-box.has-value .icon-clear { display: inline-flex; }
.hot-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hot-words-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-3); margin: 16px 0 0; }
.hot-word {
  border: 1px solid var(--line); cursor: pointer; background: #fff;
  color: var(--ink-2); padding: 7px 14px; font-size: 13px;
  font-weight: 600; transition: all 0.18s;
}
.hot-word:hover { border-color: var(--primary); color: var(--primary); background: #faf7ff; }
.result-count { font-size: 13px; color: var(--ink-3); margin: 14px 0 2px; }
.result-count b { color: var(--primary); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 54px; height: 54px; opacity: 0.35; margin: 0 auto 12px; }
.empty p { margin: 0; font-size: 14.5px; }

/* ============================ 详情页 ============================ */
.article { padding-top: 4px; }
.article-head { padding: 12px 0 0; }
.article-cat a {
  display: inline-block; background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 4px 12px;
}
.article-title {
  font-size: 23px; font-weight: 900; line-height: 1.28; letter-spacing: -0.3px;
  margin: 12px 0 10px; color: var(--ink);
}
.article-meta {
  display: flex; align-items: center; font-size: 12.5px; color: var(--ink-3);
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.article-meta .meta-author { color: var(--ink); font-weight: 700; }
.article-meta .meta-sep { margin: 0 6px; }
.article-meta .meta-comments { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.article-meta .meta-comments svg { width: 15px; height: 15px; }

.article-fig { margin: 16px 0; }
.article-fig img { width: 100%; }

.article-content { padding: 8px 0 4px; }
.article-content p {
  font-size: 16px; line-height: 1.85; color: #30323a;
  margin: 0 0 18px; word-break: break-word;
}

.article-pending {
  border: 1px dashed var(--line); padding: 34px 20px; text-align: center;
  color: var(--ink-3); font-size: 14.5px; margin: 18px 0;
}
.article-pending p { margin: 0 0 12px; }
.article-pending p:last-child { margin-bottom: 0; }
.btn-origin {
  display: inline-block; border: 2px solid var(--ink); background: #fff;
  color: var(--ink); font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 11px 22px; transition: all 0.18s;
}
.btn-origin:hover { background: var(--ink); color: #fff; }

.related-grid { grid-template-columns: repeat(2, 1fr); gap: 0 20px; }

.policy { border-top: 2px solid var(--ink); margin: 14px 0 0; padding-top: 6px; }
.policy h2 { font-size: 15.5px; margin: 24px 0 8px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.3px; }
.policy p, .policy li { font-size: 14.5px; color: var(--ink-2); }
.policy ul { padding-left: 20px; }
.policy .update-date { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 16px; }

.site-footer {
  margin-top: 36px;
  background: var(--bar-bg); color: #9a9db0;
  padding: 30px 0 calc(22px + var(--safe-bottom));
}
.footer-grid { display: grid; gap: 26px; }
.footer-logo { font-size: 19px; font-weight: 900; color: #fff; margin: 0 0 8px; letter-spacing: 0.5px; }
.footer-logo span { background: linear-gradient(135deg, #9d5cff 0%, #c26af6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.footer-desc { font-size: 13.5px; line-height: 1.7; margin: 0; max-width: 340px; }
.footer-col h4 { color: #fff; font-size: 13px; margin: 0 0 12px; letter-spacing: 1px; text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { font-size: 13.5px; color: #9a9db0; transition: color 0.2s; }
.footer-col a:hover { color: #c9a6ff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.09); margin-top: 26px; padding-top: 16px;
  font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
}
.footer-bottom a { color: #9a9db0; }
.footer-bottom a:hover { color: #c9a6ff; }

.to-top {
  position: fixed; right: 14px; bottom: calc(20px + var(--safe-bottom)); z-index: 90;
  width: 40px; height: 40px; border: 0; cursor: pointer;
  background: var(--bar-bg); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--primary); }
.to-top svg { width: 19px; height: 19px; }

.skeleton { background: var(--card); }
.skeleton .sk-img { aspect-ratio: 360 / 200; background: linear-gradient(90deg, #eceef5 25%, #f6f7fb 45%, #eceef5 65%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton .sk-line { height: 12px; border-radius: 0; margin: 12px 0; background: linear-gradient(90deg, #eceef5 25%, #f6f7fb 45%, #eceef5 65%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton .sk-line.w60 { width: 60%; }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -80% 0; } }

@media (min-width: 600px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
  .hero-main img { aspect-ratio: 720 / 380; }
  .hscroll { grid-auto-columns: 38%; }
  .policy { padding-top: 10px; }
}

@media (min-width: 960px) {
  :root { --header-h: 60px; }

  .header-inner { padding: 0 12px; }
  .logo { position: static; transform: none; display: flex; align-items: center; gap: 10px; }
  .logo .logo-top { font-size: 24px; }
  .logo .logo-sub { margin-top: 2px; font-size: 10px; }

  .menu-btn, .search-btn { display: none; }
  .header-search {
    display: block; margin-left: auto;
    position: relative; width: 300px;
  }
  .header-search input {
    width: 100%; height: 40px; border-radius: 0;
    border: 2px solid var(--ink); background: #fff;
    padding: 0 14px 0 40px; font-size: 14px; color: var(--ink); outline: none;
    transition: border-color 0.2s;
  }
  .header-search input:focus { border-color: var(--primary); }
  .header-search svg {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--ink-3);
  }
  .top-nav { display: flex; align-items: center; margin-left: 26px; }
  .top-nav a {
    padding: 8px 15px; font-weight: 700; font-size: 13.5px;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.88); transition: all 0.18s; white-space: nowrap;
  }
  .top-nav a:hover, .top-nav a.active { color: #fff; background: var(--primary); }

  .hero { padding-top: 0; max-width: calc(var(--container) - 24px); margin: 18px auto 0; }
  /* PC：大图高度由右侧 2x2 小卡撑起的总高度决定，底部对齐，不会超出右边 */
  .hero-grid {grid-template-columns: 2fr 1fr;gap: 2px;align-items: stretch;max-height: 520px;}
  .hero-sub {
    grid-auto-flow: row; grid-template-columns: 1fr 1fr;
    gap: 18px 10px; overflow: visible;
  }
  .hero-small img { aspect-ratio: 1 / 1; }
  .hero-main { height: 100%; }
  .hero-main img { height: 100%; aspect-ratio: auto; }
  .hero-title { font-size: 23px; }
  .hero-small .hero-title { font-size: 13px; -webkit-line-clamp: 3; }
  .hero-overlay { padding: 40px 16px 12px; }

  .section-title { font-size: 18px; }
  .post-grid { grid-template-columns: repeat(4, 1fr); gap: 0 24px; }
  .card { padding: 18px 0 20px; }
  .card-title { font-size: 16px; }

  /* PC：分类推荐行改为固定 4 列网格，不滑动 */
  .hscroll {
    grid-auto-flow: row; grid-auto-columns: unset;
    grid-template-columns: repeat(4, 1fr); gap: 0 24px;
    overflow: visible; padding: 0; margin: 0;
  }
  .hscroll .card { padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
  .hscroll .card-thumb img { aspect-ratio: 360 / 200; }
  .hscroll .card-title { font-size: 15.5px; -webkit-line-clamp: 3; }

  .page-title { font-size: 27px; }
  .search-hero { padding-top: 28px; }

  /* 详情页 PC：更大标题与正文字号 */
  .article-title { font-size: 32px; margin-top: 14px; }
  .article-content p { font-size: 17px; }
  .article-fig { margin: 22px 0; }

  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }

  .layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; align-items: start; }
  .layout-2col .side { position: sticky; top: calc(var(--header-h) + var(--safe-top) + 16px); display: grid; gap: 16px; }
  .layout-2col .side .card-title { font-size: 14px; -webkit-line-clamp: 2; }
  .layout-2col .side .card-thumb img { aspect-ratio: 300 / 168; }
}
