/* 火麒麟导航 · 原创卡片式模板样式
   同一份样式同时用于苹果CMS模板与本地预览页 */

:root {
  --bg: #070a12;
  --bg-2: #0b101c;
  --panel: rgba(17, 23, 38, 0.72);
  --panel-solid: #101624;
  --panel-hover: rgba(24, 32, 52, 0.92);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --text-2: #b8c0d2;
  --muted: #7f899f;
  --accent: #ff4d4f;
  --accent-2: #ffb547;
  --accent-soft: rgba(255, 77, 79, 0.13);
  --gold-soft: rgba(255, 181, 71, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1440px;
  --header-h: 68px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eceff7;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --panel-hover: #ffffff;
  --border: rgba(20, 30, 55, 0.09);
  --border-strong: rgba(20, 30, 55, 0.18);
  --text: #172033;
  --text-2: #4a5568;
  --muted: #7b8497;
  --accent: #e63c40;
  --accent-2: #e89516;
  --accent-soft: rgba(230, 60, 64, 0.09);
  --gold-soft: rgba(232, 149, 22, 0.1);
  --shadow: 0 16px 40px rgba(30, 40, 70, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(680px 420px at 12% -8%, rgba(255, 77, 79, 0.16), transparent 68%),
    radial-gradient(760px 480px at 88% 4%, rgba(255, 181, 71, 0.12), transparent 70%),
    radial-gradient(900px 600px at 50% 100%, rgba(60, 90, 200, 0.1), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(680px 420px at 12% -8%, rgba(255, 77, 79, 0.09), transparent 68%),
    radial-gradient(760px 480px at 88% 4%, rgba(255, 181, 71, 0.09), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

html[data-theme="light"] body::after {
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(20, 30, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 30, 55, 0.035) 1px, transparent 1px);
}

.scale-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; color: var(--text); opacity: 0.05; }
html[data-theme="light"] .scale-bg { opacity: 0.08; }
.ql-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

.mc { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), #d92d45 55%, var(--accent-2));
  box-shadow: 0 8px 24px rgba(255, 77, 79, 0.32);
  color: #fff;
}

.brand-mark svg { width: 23px; height: 23px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: 0.06em; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; }

.topnav { display: flex; align-items: center; gap: 4px; height: 100%; }
.topnav a {
  position: relative;
  flex: none;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
}
.topnav a:hover, .topnav a.active { color: var(--text); background: var(--accent-soft); }
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 16px; height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* 全部分类下拉面板 */
.nav-drop { position: relative; height: 100%; display: flex; align-items: center; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-2);
  font-size: 13px; font-weight: 600;
  transition: all 0.2s;
}
.nav-drop-btn > svg:first-child { width: 15px; height: 15px; color: var(--accent-2); }
.nav-drop-btn .nav-caret { width: 14px; height: 14px; transition: transform 0.2s; }
.nav-drop:hover .nav-drop-btn, .nav-drop.open .nav-drop-btn { color: var(--text); border-color: var(--accent); }
.nav-drop:hover .nav-caret, .nav-drop.open .nav-caret { transform: rotate(180deg); }
.nav-drop-panel {
  position: absolute; top: calc(100% - 6px); left: 0;
  width: 440px; padding: 18px;
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--panel-solid);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 80;
}
.nav-drop:hover .nav-drop-panel, .nav-drop.open .nav-drop-panel { opacity: 1; visibility: visible; transform: none; }
.drop-title { margin: 0 0 12px 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.drop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid transparent;
  color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: all 0.18s;
}
.drop-item:hover { background: var(--accent-soft); border-color: var(--border); color: var(--text); transform: translateX(2px); }
.drop-item .cat-glyph { width: 17px; height: 17px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text-2);
  transition: all 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-hover); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
html[data-theme="light"] .icon-sun { display: none; }
html:not([data-theme="light"]) .icon-moon { display: none; }

.post-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 0; border-radius: 11px;
  background: linear-gradient(120deg, var(--accent), #f06a35 60%, var(--accent-2));
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 8px 24px rgba(255, 77, 79, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 77, 79, 0.38); }
.post-btn svg { width: 16px; height: 16px; }

/* ---------- 首屏 ---------- */
.hero { position: relative; padding: 66px 0 30px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero-title {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.18;
}
.hero-title .grad {
  position: relative;
  background: linear-gradient(100deg, var(--accent) 10%, #ff7a45 48%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-title .grad::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 7px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  clip-path: polygon(0 65%, 8% 18%, 18% 78%, 30% 12%, 42% 72%, 55% 22%, 68% 82%, 80% 16%, 92% 72%, 100% 28%, 100% 100%, 0 100%);
  opacity: 0.8;
}
.hero-sub { margin: 16px auto 0; max-width: 620px; color: var(--muted); font-size: 15px; }

.search-panel {
  width: min(760px, 100%);
  margin: 32px auto 0;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.engine-tabs { display: flex; align-items: center; gap: 4px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.engine-tab {
  padding: 5px 12px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  transition: all 0.2s;
}
.engine-tab:hover { color: var(--text); }
.engine-tab.active {
  background: linear-gradient(120deg, var(--accent-soft), var(--gold-soft));
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.search-form { display: flex; align-items: center; gap: 10px; }
.search-input-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.search-input-wrap > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%; height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-go {
  flex: none; height: 48px; padding: 0 24px;
  border: 0; border-radius: 13px;
  background: linear-gradient(120deg, var(--accent), #f06a35 60%, var(--accent-2));
  color: #fff; font-weight: 800; letter-spacing: 0.04em;
  box-shadow: 0 10px 26px rgba(255, 77, 79, 0.26);
  transition: transform 0.2s, box-shadow 0.2s;
}
.search-go:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255, 77, 79, 0.4); }
.search-go svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }

.hero-stats { display: flex; justify-content: center; gap: 38px; margin-top: 26px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.stat svg { width: 16px; height: 16px; color: var(--accent-2); }

/* ---------- 分类筛选 ---------- */
.quickcats {
  display: flex; gap: 8px;
  margin: 30px 0 4px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quickcats::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip.active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #f0663a 58%, var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 77, 79, 0.24);
}

/* ---------- 主体布局 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; padding-bottom: 60px; }
.section { margin-top: 26px; }
.cat-section.is-hidden { display: none; }
.cat-section .card-grid { margin-top: 2px; }
.cat-section .section-title::before { display: none; }
.cat-title-wrap { display: flex; align-items: center; gap: 11px; }
.cat-glyph {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--accent-2);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.cat-index {
  font-size: 24px; font-weight: 800; line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  opacity: 0.72;
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 11px; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: 0.01em; }
.section-title::before { content: ""; width: 4px; height: 19px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.section-desc { margin: 4px 0 0 15px; color: var(--muted); font-size: 12px; }
.section-more { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; transition: color 0.2s; }
.section-more:hover { color: var(--accent-2); }
.section-more span { margin-left: 3px; }

/* ---------- 精选大卡片 ---------- */
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 118px; padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(200px 120px at 100% 0%, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.25s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(255, 120, 90, 0.42); box-shadow: var(--shadow); }
.feature-card:hover::before { opacity: 1; }
.feature-card > * { position: relative; }
.feature-card .card-logo { width: 54px; height: 54px; font-size: 22px; border-radius: 15px; }
.feature-card .card-name { font-size: 16px; }
.feature-card .card-desc { -webkit-line-clamp: 2; }
.feature-index {
  position: absolute; top: 10px; right: 14px;
  font-size: 32px; font-weight: 900; line-height: 1;
  color: var(--text); opacity: 0.06;
}

/* ---------- 网址卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.site-card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 158px; padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.site-card > * { position: relative; z-index: 1; }
.site-card::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 0; z-index: 0;
  background: linear-gradient(0deg, rgba(255, 77, 79, 0.24), rgba(255, 181, 71, 0.09) 58%, transparent);
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.site-card:hover::before { height: 72%; }
.site-card::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px transparent;
  background: radial-gradient(180px 100px at 100% 0%, var(--accent-soft), transparent 72%);
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.site-card:hover { transform: translateY(-5px); border-color: rgba(255, 120, 90, 0.42); background: var(--panel-hover); box-shadow: var(--shadow); }
.site-card:hover::after { opacity: 1; }
.site-card.is-hidden { display: none; }
.card-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.card-body { min-width: 0; }
.card-logo {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, hsl(var(--h, 8) 78% 58%), hsl(calc(var(--h, 8) + 42) 72% 46%));
  color: #fff;
  font-size: 17px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.card-logo img { width: 100%; height: 100%; object-fit: cover; }
.card-name {
  display: block; min-width: 0;
  font-size: 14px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-host { display: block; min-width: 0; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 12px 0 0;
  color: var(--text-2); font-size: 12px; line-height: 1.65;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.card-tag {
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 11px; font-weight: 600;
}
.card-arrow {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted);
  transition: all 0.2s;
}
.card-arrow svg { width: 14px; height: 14px; }
.site-card:hover .card-arrow { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateX(2px); }
.card-detail { color: var(--muted); font-size: 11px; transition: color 0.2s; }
.card-detail:hover { color: var(--accent-2); }
.empty-state {
  grid-column: 1 / -1;
  padding: 50px 20px; text-align: center;
  color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.result-count { color: var(--muted); font-size: 12px; }
.section-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sort-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sort-tab {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  transition: all 0.2s ease;
}
.sort-tab:hover { color: var(--text); border-color: var(--border-strong); }
.sort-tab.active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #f0663a 58%, var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 77, 79, 0.22);
}

/* ---------- 侧栏 ---------- */
.side-col { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.side-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.side-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 800; }
.side-title svg { width: 17px; height: 17px; color: var(--accent-2); }
.side-action { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 2px 4px; }
.side-action:hover { color: var(--accent-2); }

.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-item { display: flex; gap: 11px; align-items: flex-start; }
.article-cover {
  flex: none; width: 52px; height: 52px;
  border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border);
  background: linear-gradient(140deg, var(--accent-soft), var(--gold-soft));
}
.article-item .a-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.5;
  transition: color 0.2s;
}
.article-item:hover .a-title { color: var(--accent-2); }
.a-meta { display: flex; gap: 10px; margin-top: 5px; color: var(--muted); font-size: 11px; }

.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px; transition: background 0.2s; }
.rank-item:hover { background: var(--accent-soft); }
.rank-num {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; background: var(--bg-2); color: var(--muted); font-size: 11px; font-weight: 800;
}
.rank-item:nth-child(1) .rank-num { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; }
.rank-item:nth-child(2) .rank-num, .rank-item:nth-child(3) .rank-num { background: var(--gold-soft); color: var(--accent-2); }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.rank-hits { color: var(--muted); font-size: 11px; }

.mini-banner {
  position: relative; overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.2), rgba(255, 181, 71, 0.1) 55%, rgba(255, 255, 255, 0.03));
}
.mini-banner h4 { margin: 0 0 6px; font-size: 15px; }
.mini-banner p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.mini-banner button {
  width: 100%; height: 36px; border: 0; border-radius: 10px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 13px;
}

/* ---------- 工具按钮 ---------- */
.tools { position: fixed; right: 22px; bottom: 28px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.tool-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--panel-solid); color: var(--text-2);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.tool-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.tool-btn svg { width: 18px; height: 18px; }

/* ---------- 页脚 ---------- */
.footer { position: relative; border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: 12px; }
.footer::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 132px; height: 13px;
  background: radial-gradient(circle at 6px 6px, var(--accent) 2px, transparent 2.6px) 0 0 / 13px 13px repeat-x;
  opacity: 0.55;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-nav { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-nav a { color: var(--text-2); font-weight: 600; }
.footer-links-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; line-height: 1.8; }
.footer-links-row .flk-label { color: var(--muted); }
.footer-links-row a { color: var(--text-2); }
.footer-legal { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
.footer-legal a { color: var(--accent-2); }
.footer-stati { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-stati a { color: var(--muted); }
.footer-runtime b { color: var(--accent-2); font-weight: 600; }
.beian-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 3px; background: #4c6ef5; color: #fff; font-size: 10px; vertical-align: -2px; }
.footer a:hover { color: var(--accent-2); }

/* ---------- 弹层与提示 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(440px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--panel-solid);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  padding: 26px;
  animation: pop 0.22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal p { color: var(--muted); font-size: 13px; }
.modal fieldset { border: 0; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.modal label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.modal input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-2); color: var(--text); outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-submit {
  margin-top: 16px; width: 100%; height: 42px;
  border: 0; border-radius: 10px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800;
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 120;
  transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all 0.25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 留言本 ---------- */
.gbook-form { margin-top: 18px; }
.gbook-textarea {
  width: 100%; min-height: 110px; padding: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--text); outline: none; resize: vertical;
  line-height: 1.7;
}
.gbook-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gbook-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gbook-input {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--text); outline: none;
}
.gbook-input:focus { border-color: var(--accent); }
.gbook-input.name { width: 180px; }
.gbook-input.verify { width: 120px; }
.gbook-code { height: 40px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.gbook-submit { margin-left: auto; }
.gbook-list { display: flex; flex-direction: column; gap: 12px; }
.gbook-item {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); padding: 16px;
}
.gbook-head { display: flex; align-items: center; gap: 10px; }
.gbook-avatar {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 13px; font-weight: 800;
}
.gbook-name { font-size: 13px; font-weight: 700; }
.gbook-time { color: var(--muted); font-size: 11px; }
.gbook-content { margin: 10px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.gbook-reply {
  margin-top: 10px; padding: 10px 12px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 8px 8px 0;
  background: var(--gold-soft);
  color: var(--text-2); font-size: 12px;
}
.gbook-empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 14px; }

/* ---------- 内页通用 ---------- */
.page-head {
  position: relative;
  margin: 32px 0 4px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(500px 220px at 90% 0%, var(--accent-soft), transparent 70%),
    var(--panel);
  overflow: hidden;
}
.crumb { display: flex; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.crumb a:hover { color: var(--accent-2); }
.page-title { margin: 0; font-size: 26px; font-weight: 900; }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 640px; }

.detail-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.detail-hero .card-logo { width: 76px; height: 76px; border-radius: 20px; font-size: 30px; }
.detail-title { margin: 0; font-size: 26px; font-weight: 900; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 8px; }
.detail-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: 11px;
  font-weight: 700; font-size: 13px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary { border: 0; background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 24px rgba(255, 77, 79, 0.22); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255, 77, 79, 0.35); }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.article-body { color: var(--text-2); line-height: 1.9; font-size: 14px; }
.article-body img { max-width: 100%; border-radius: 12px; margin: 12px 0; }
.article-body h2, .article-body h3 { color: var(--text); margin: 24px 0 10px; }
.article-body p { margin: 12px 0; }

.mac-paging { display: flex; justify-content: center; margin: 30px 0 10px; }
.mac-paging .page {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  list-style: none; margin: 0; padding: 0;
}
.mac-paging .page li { margin: 0; }
.mac-paging .page a, .mac-paging .page span {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-2); font-size: 12px;
}
.mac-paging .page .active a, .mac-paging .page a:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .mc { width: calc(100% - 28px); }
  .topbar {
    height: auto;
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 0 6px;
  }
  .brand-sub { display: none; }
  .topnav {
    order: 3;
    width: 100%; height: auto;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 7px 12px; font-size: 13px; }
  .nav-drop { height: auto; }
  .nav-drop-btn { padding: 7px 12px; font-size: 13px; }
  .nav-drop-panel {
    position: fixed;
    top: calc(var(--header-h) + 24px);
    left: 14px; right: 14px;
    width: auto;
    max-height: 60vh; overflow-y: auto;
    z-index: 70;
  }
  .post-btn { width: 38px; padding: 0; justify-content: center; }
  .post-btn span { display: none; }
  .hero { padding: 44px 0 18px; }
  .hero-stats { gap: 18px; }
  .search-panel { padding: 9px; }
  .search-form { flex-wrap: wrap; }
  .search-go { width: 100%; }
  .featured-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-col { grid-template-columns: 1fr; }
  .tools { right: 14px; bottom: 18px; }
  .page-head { padding: 20px; }
  .detail-title { font-size: 21px; }
}

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
  .site-card { min-height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
