/* ============================================================
   安神AIGC · 科技感博客样式
   ============================================================ */
:root {
  --bg: #060912;
  --bg-soft: #0b1120;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(120, 160, 255, 0.16);
  --border-strong: rgba(120, 200, 255, 0.4);
  --text: #e6edf6;
  --muted: #93a3bd;
  --faint: #5c6b85;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #a855f7;
  --emerald: #34d399;
  --amber: #fbbf24;
  --glow-cyan: rgba(34, 211, 238, 0.35);
  --glow-violet: rgba(168, 85, 247, 0.3);
  --radius: 16px;
  --maxw: 1080px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- 科技感背景：网格 + 光晕 ---- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(800px 600px at 95% 5%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--bg);
}
.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- 顶部导航 ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 9, 18, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
}
.brand .brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 16px var(--glow-cyan);
}
.brand b {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: #fff; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---- 导航下拉菜单（运营管理） ---- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.nav-dropdown-toggle:hover { color: var(--text); background: var(--surface); }
.nav-dropdown.open .nav-dropdown-toggle { color: var(--text); background: var(--surface); }
.nav-dropdown-caret { transition: transform .2s ease; opacity: .8; }
.nav-dropdown.open .nav-dropdown-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(14, 19, 35, 0.98);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 70;
}
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

/* 右侧操作区（主题切换 / 登录 / 汉堡） */
.nav-right { display: flex; align-items: center; gap: 10px; }

/* 汉堡按钮：桌面端隐藏 */
.nav-toggle { display: none; }

/* ---- 移动端：汉堡菜单折叠 ---- */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
  }
  .nav-toggle .bar {
    display: block;
    width: 18px; height: 2px;
    margin: 0 auto;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
  }
  .nav-toggle.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open .bar:nth-child(2) { opacity: 0; }
  .nav-toggle.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 16px;
    background: rgba(6, 9, 18, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6);
    display: none;
    z-index: 60;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }
  /* 移动端下拉菜单：从悬浮面板改为普通可展开区块 */
  .nav-dropdown { width: 100%; display: flex; flex-direction: column; }
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
  }
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 12px;
    gap: 0;
    min-width: auto;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-dropdown-menu a { padding-left: 22px; }
}
html.theme-light .nav-toggle { background: var(--surface); border-color: var(--border); }
html.theme-light .nav-links {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: var(--border);
}
html.theme-light .nav-dropdown-menu { background: rgba(255, 255, 255, 0.98); border-color: var(--border-strong); }
html.theme-light .nav-dropdown-menu a:hover { background: var(--surface); }
html.theme-light .nav-dropdown-toggle:hover { color: var(--text); background: var(--surface); }
html.theme-light .nav-dropdown.open .nav-dropdown-toggle { background: var(--surface); }

/* ---- 通用区块 ---- */
.section { padding: 54px 0; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}
h1, h2, h3 { line-height: 1.25; font-weight: 700; }
.grad-text {
  background: linear-gradient(100deg, #fff 10%, var(--cyan) 45%, var(--violet) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Hero ---- */
.hero { padding: 84px 0 40px; position: relative; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); margin: 6px 0 14px; letter-spacing: -.5px; }
.hero p.lead { color: var(--muted); font-size: 17px; max-width: 640px; }
.hero .pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.pill {
  font-family: var(--mono); font-size: 12.5px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--surface);
}
.pill b { color: var(--cyan); }

/* ---- 卡片网格 ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 26px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 50px -20px rgba(34, 211, 238, 0.35);
}
.card .cover { height: 168px; position: relative; overflow: hidden; }
.card .cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6,9,18,.85));
}
.card .cover .badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  padding: 4px 9px; border-radius: 7px; color: #04121a; font-weight: 700;
  background: rgba(255,255,255,.85);
}
.card .cover .pin {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px;
  padding: 4px 9px; border-radius: 7px; color: var(--amber);
  border: 1px solid rgba(251,191,36,.5); background: rgba(251,191,36,.1);
}
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 18px; margin: 0; }
.card h3 a { color: var(--text); }
.card .excerpt { color: var(--muted); font-size: 14px; margin: 0; flex: 1; }
.card .meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}
.card .meta .cat { color: var(--cyan); }
.tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono); font-size: 11.5px;
  padding: 3px 9px; border-radius: 7px;
  color: var(--muted); border: 1px solid var(--border); background: var(--surface);
  transition: .2s;
}
.tag:hover { color: #fff; border-color: var(--border-strong); box-shadow: 0 0 12px var(--glow-cyan); }
.tag .n { color: var(--cyan); }

/* 封面渐变 */
.grad-cyan    { background: linear-gradient(135deg, #0ea5e9, #22d3ee 60%, #6366f1); }
.grad-violet  { background: linear-gradient(135deg, #7c3aed, #a855f7 55%, #ec4899); }
.grad-emerald { background: linear-gradient(135deg, #059669, #34d399 55%, #22d3ee); }
.grad-amber   { background: linear-gradient(135deg, #d97706, #fbbf24 55%, #f472b6); }
.grad-aurora  { background: linear-gradient(135deg, #22d3ee, #6366f1 45%, #a855f7 80%, #ec4899); }

/* ---- 置顶大卡片（精选）—— table 布局，左右并排 ---- */
.featured {
  display: block;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.12), 0 0 0 1px rgba(99,102,241,.12) !important;
}
.featured table { border-collapse: collapse; width: 100%; }
.featured td:first-child { /* 左侧头像区 */ }
.featured td:last-child { /* 右侧信息区 */ }
/* 精选卡片内文字样式 */
.featured .feat-eyebrow { color: var(--cyan); font-size: 13px; letter-spacing: .3px; }
.featured td:last-child h2 { font-size: 23px; margin: 0; line-height: 1.32; font-weight: 700; color: var(--text); }
.featured td:last-child p { color: var(--muted); margin: 0; font-size: 14.5px; line-height: 1.65; }

@media (max-width: 760px) {
  .featured table,
  .featured tbody,
  .featured tr { display: flex; flex-direction: column; }
  .featured td { display: block; width: 100% !important; }
  .featured td:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding: 18px 14px !important;
  }
  .featured td:first-child img { width: 100px !important; height: 100px !important; border-radius: 20px; }
  .featured td:last-child { padding: 18px 18px 22px !important; }
  .featured td:last-child h2 { font-size: 20px; line-height: 1.3; }
  .featured td:last-child p { font-size: 14px; line-height: 1.62; }
}
@media (max-width: 480px) {
  .featured td:first-child img { width: 80px !important; height: 80px !important; border-radius: 16px; }
  .featured td:first-child { padding: 14px 10px !important; }
  .featured td:last-child { padding: 14px !important; }
  .featured td:last-child h2 { font-size: 18px; }
}
/* ---- 文章正文 Markdown 表格 ---- */
.article { overflow-x: auto; }
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.article th {
  background: rgba(34, 211, 238, .06);
  color: var(--cyan);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid var(--border);
}
.article th:last-child { border-right: none; }
.article td {
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.article td:last-child { border-right: none; }
.article tr:last-child td { border-bottom: none; }
.article tr:hover td { background: rgba(34, 211, 238, .03); }
/* ---- 标签页 ---- */
.tagcloud { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.tagcloud .tag { font-size: 14px; padding: 8px 14px; }
.tagcloud .tag .n { margin-left: 6px; }
.tag-group { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 22px; }
.tag-group h3 { font-family: var(--mono); font-size: 15px; color: var(--cyan); margin: 0 0 14px; }
.tag-group .links { display: flex; flex-direction: column; gap: 10px; }
.tag-group .links a {
  color: var(--text); padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); display: flex; justify-content: space-between;
  transition: .2s;
}
.tag-group .links a:hover { border-color: var(--border-strong); transform: translateX(4px); }
.tag-group .links a span { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* ---- 关于页 ---- */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 36px; margin-top: 30px; align-items: start; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }
.avatar {
  width: 100%; aspect-ratio: 1; border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: grid; place-items: center;
  box-shadow: 0 0 50px -10px var(--glow-violet);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 28px; }
.about-card h2 { margin-top: 0; }
.skills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.skill { font-family: var(--mono); font-size: 13px; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border); color: var(--cyan); background: var(--surface); }
.stat-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.stat { flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.stat b { font-size: 26px; background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; }
.stat span { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* ---- 运营统计页 ---- */
.stat-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0 22px; }
.stat-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; background: var(--surface); }
.stat-card b { font-size: 30px; background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; font-family: var(--mono); }
.stat-card span { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
@media (max-width: 600px) { .stat-summary { grid-template-columns: 1fr; } }

.stat-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; }
.stat-table th, .stat-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.stat-table thead th { color: var(--faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.stat-table tbody tr { transition: background .12s ease; }
.stat-table tbody tr:hover { background: rgba(34, 211, 238, .06); }
.stat-table .col-rank { width: 44px; color: var(--faint); }
.stat-table .col-ttl a { color: var(--text); font-weight: 600; text-decoration: none; }
.stat-table .col-ttl a:hover { color: var(--cyan); }
.stat-table .col-num { color: var(--muted); width: 90px; font-variant-numeric: tabular-nums; }
.stat-table .col-num.views { color: var(--cyan); }
.stat-table .col-num.likes { color: #ff5d7a; }
.stat-table .col-num.comments { color: var(--violet); }

/* ---- 页脚 ---- */
.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 40px 0 50px; color: var(--faint); font-size: 13px; }
.footer a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.footer a:hover { color: var(--cyan); }

.footer-wrap { display: flex; flex-direction: column; gap: 22px; }

.footer-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr 120px;
  gap: 36px;
  align-items: start;
}

.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text) !important;
}
.footer-logo { width: 28px; height: 28px; border-radius: 6px; }
.footer-brand-name { color: var(--text); }
.footer-tagline { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 320px; }
.footer-copy { font-size: 12px; color: var(--faint); font-family: var(--mono); }
.footer-copy a { color: var(--faint); text-decoration: none; }
.footer-copy a:hover { color: var(--cyan); }

.footer-links-groups { display: flex; gap: 40px; }
.footer-group h4 { margin: 0 0 10px; font-size: 13px; color: var(--text); font-weight: 600; }
.footer-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-group ul li a { color: var(--muted); font-size: 12.5px; }
.footer-group ul li a:hover { color: var(--cyan); }

.footer-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-qr img { width: 100px; height: 100px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.footer-qr span { font-size: 11px; color: var(--faint); }

.footer-disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}
.footer-disclaimer p { margin: 0 0 6px; }
.footer-disclaimer p:last-child { margin-bottom: 0; }

.footer-social { display: flex; gap: 10px; align-items: center; }
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .15s ease;
}
.footer-social-link:hover { background: rgba(8,145,178,0.12); border-color: var(--cyan); color: var(--cyan); }
.footer-social-link svg { display: block; }

@media (max-width: 860px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-qr { align-items: flex-start; }
}
@media (max-width: 640px) {
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .footer-links-groups { gap: 28px; }
  .footer-qr { flex-direction: row; align-items: center; gap: 12px; }
  .footer-qr img { width: 72px; height: 72px; }
}

/* ---- 空状态 / 加载 ---- */
.empty { text-align: center; color: var(--faint); padding: 60px 0; font-family: var(--mono); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.section-title h2 { font-size: 22px; margin: 0; }
.section-title .count { font-family: var(--mono); font-size: 13px; color: var(--faint); }

/* ============================================================
   用户系统 / 互动（登录 · 点赞 · 评论）
   ============================================================ */
.auth-slot { margin-left: auto; display: flex; align-items: center; }
.theme-toggle {
  margin-left: 4px;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.auth-hint { font-family: var(--mono); font-size: 12px; color: var(--faint); opacity: .8; }

.btn-primary {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  color: #04121a; border: none;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px -4px var(--glow-cyan);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px -2px var(--glow-violet); }
.btn-primary:disabled { opacity: .5; cursor: default; transform: none; }
.btn-ghost {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #04121a;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 14px -3px var(--glow-cyan);
}
.user-name { font-size: 13px; color: var(--text); font-family: var(--mono); }

/* ---- 登录弹窗 ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 8, 14, .72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  position: relative; width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 26px 26px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.modal-tabs button {
  flex: 1; padding: 9px; border-radius: 9px; cursor: pointer; font-family: var(--mono); font-size: 13px;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.modal-tabs button.active {
  color: #04121a; border: none; font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: var(--mono);
}
.auth-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.auth-msg { font-size: 12.5px; min-height: 16px; font-family: var(--mono); color: var(--muted); }
.auth-msg.err { color: #ff6b81; }
.auth-msg.ok { color: var(--cyan); }

/* 弹窗头部（邮箱优先引导） */
.modal-head { margin-bottom: 16px; }
.modal-title { font-size: 19px; font-weight: 800; margin: 0 0 4px; letter-spacing: .3px; }
.modal-sub { margin: 0; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.modal-sub b { color: var(--cyan); }

/* 邮箱注册引导（微信邮箱 / QQ 邮箱） */
.auth-tip {
  margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--faint);
  font-family: var(--mono); text-align: center;
}
.auth-tip a { color: var(--violet); text-decoration: none; border-bottom: 1px dashed var(--violet); }
.auth-tip a:hover { color: var(--cyan); border-color: var(--cyan); }

/* GitHub 次要说明 */
.github-note {
  margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--faint);
  font-family: var(--mono); text-align: center;
}

/* GitHub 三方登录 */
.oauth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 14px;
  color: var(--faint); font-family: var(--mono); font-size: 12px;
}
.oauth-divider::before, .oauth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.btn-github {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; color: #fff;
  background: #24292f; border: 1px solid #3d444d;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn-github:hover { transform: translateY(-1px); background: #32383f; box-shadow: 0 0 22px -6px rgba(255,255,255,.25); }
.btn-github:disabled { opacity: .6; cursor: default; transform: none; }
.btn-github .gh-icon { flex: 0 0 auto; }

/* 登录态头像（支持 GitHub 头像图） */
.user-avatar-img {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 14px -3px var(--glow-cyan); border: 1px solid var(--border);
}

/* ---- 点赞 ---- */
.like-row { display: flex; align-items: center; gap: 14px; margin: 34px 0 10px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 10px 18px; border-radius: 12px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  transition: all .15s ease;
}
.like-btn .like-icon { font-size: 16px; transition: transform .15s ease; }
.like-btn:hover { border-color: var(--border-strong); color: var(--text); }
.like-btn.liked {
  color: #ff5d7a; border-color: rgba(255,93,122,.5);
  background: rgba(255,93,122,.08); box-shadow: 0 0 20px -6px rgba(255,93,122,.6);
}
.like-btn.liked .like-icon { transform: scale(1.15); }
.like-btn:disabled { opacity: .6; cursor: default; }
.like-tip { font-size: 12px; color: var(--faint); font-family: var(--mono); }

/* 卡片上的点赞 */
.card-like {
  margin-left: auto; cursor: pointer; background: transparent; border: none;
  color: var(--faint); font-family: var(--mono); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px;
  transition: color .15s ease;
}
.card-like:hover { color: var(--text); }
.card-like.liked { color: #ff5d7a; }
.card-like .cl-count { font-variant-numeric: tabular-nums; }

/* ---- 评论 ---- */
.comments { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 24px; }
.cmt-title { font-size: 18px; margin: 0 0 16px; }
.cmt-title span { color: var(--faint); font-family: var(--mono); font-size: 14px; }
.cmt-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.cmt-form textarea {
  width: 100%; box-sizing: border-box; resize: vertical; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; font-size: 14px; font-family: inherit; line-height: 1.6;
}
.cmt-form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.cmt-form .btn-primary { align-self: flex-end; }
.cmt-list { display: flex; flex-direction: column; gap: 16px; }
.cmt-item { display: flex; gap: 12px; }
.cmt-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #04121a;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}
.cmt-body { flex: 1; }
.cmt-head { display: flex; align-items: baseline; gap: 10px; }
.cmt-name { font-weight: 700; font-size: 14px; color: var(--text); font-family: var(--mono); }
.cmt-time { font-size: 12px; color: var(--faint); font-family: var(--mono); }
.cmt-text { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.cmt-empty, .cmt-loading { color: var(--faint); font-family: var(--mono); font-size: 13px; padding: 14px 0; }

/* ============================================================
   图片封面（动态文章）
   ============================================================ */
.cover.has-img { background-size: cover; background-position: center; }

/* ============================================================
   写文章编辑器（publish.html）
   ============================================================ */
.editor {
  display: grid; grid-template-columns: 1fr 290px; gap: 22px;
  margin-top: 18px; align-items: start;
}
.editor-main { display: flex; flex-direction: column; gap: 12px; }
.ed-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: var(--mono);
}
.ed-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.ed-title { font-size: 20px; font-weight: 800; letter-spacing: .3px; }

.ed-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-toolbar button {
  font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px;
  transition: all .15s ease;
}
.ed-toolbar button:hover { color: var(--text); border-color: var(--border-strong); box-shadow: 0 0 12px -4px var(--glow-cyan); }
.ed-upload-tip { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.ed-upload-tip.err { color: #ff6b81; }

.ed-body {
  width: 100%; box-sizing: border-box; min-height: 380px; resize: vertical;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 14px 16px; line-height: 1.7;
  font-size: 14px; font-family: var(--mono);
}
.ed-body:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }

.editor-side {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
}
.ed-field { display: flex; flex-direction: column; gap: 7px; }
.ed-field > label { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.ed-field input[type=text], .ed-field input:not([type]) {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; font-family: var(--mono);
}
.ed-field input:focus { outline: none; border-color: var(--cyan); }
.ed-field .cbx { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }

.cover-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cover-picker .sw {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
}
.cover-picker .sw.active { border-color: #fff; box-shadow: 0 0 12px -2px var(--glow-cyan); }
.cover-picker .cover-up {
  height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1px dashed var(--border-strong);
}
.cover-picker .cover-up:hover { color: var(--text); }
.cover-preview {
  height: 96px; border-radius: 10px; margin-top: 4px;
  background-size: cover; background-position: center;
}

.ed-publish { width: 100%; padding: 12px; font-size: 14px; }
.ed-msg { font-family: var(--mono); font-size: 12.5px; min-height: 16px; color: var(--muted); text-align: center; }
.ed-msg.err { color: #ff6b81; }
.ed-msg.ok { color: var(--cyan); }

.ed-preview-wrap { margin-top: 26px; border-top: 1px dashed var(--border); padding-top: 18px; }
.ed-preview-wrap .eyebrow { margin-bottom: 10px; }

/* 已发布列表 */
.ed-mine { margin-top: 34px; }
.mine-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mine-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
}
.mine-item .mi-title { flex: 1; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.mine-item .mi-title:hover { color: var(--cyan); }
.mi-pin { font-family: var(--mono); font-size: 11px; color: var(--cyan); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; margin-right: 8px; }
.mine-item .mi-cat { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.mine-item .mi-date { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.mine-item .mi-del {
  cursor: pointer; background: transparent; color: var(--faint);
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; font-size: 12px; font-family: var(--mono);
}
.mine-item .mi-del:hover { color: #ff6b81; border-color: rgba(255,107,129,.5); }
.mine-item .mi-edit {
  cursor: pointer; background: transparent; color: var(--faint);
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; font-size: 12px; font-family: var(--mono);
}
.mine-item .mi-edit:hover { color: var(--cyan); border-color: var(--border-strong); }
.mi-default { font-family: var(--mono); font-size: 11px; color: var(--violet); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; }
.ed-cancel { width: 100%; padding: 10px; font-size: 13px; margin-top: 8px; }

@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  .mine-item { flex-wrap: wrap; }
}

/* ===== 可见性徽标（卡片 / 精选 / 列表） ===== */
.card .cover .vis {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 7px;
}
.featured .vis {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
}
.vis-vip { color: #ffd479; border: 1px solid rgba(255,212,121,.55); background: rgba(255,212,121,.12); }
.vis-login { color: var(--cyan); border: 1px solid var(--border-strong); background: rgba(56,224,225,.1); }
.vis-private { color: #ff8aa0; border: 1px solid rgba(255,138,160,.5); background: rgba(255,138,160,.12); }

/* ===== 文章详情无权限门禁 ===== */
.post-gate {
  text-align: center; padding: 56px 20px; border: 1px solid var(--border);
  border-radius: 16px; background: rgba(255,255,255,.02);
}
.post-gate .gate-icon { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.post-gate h2 { margin: 0 0 10px; font-size: 22px; }
.post-gate p { color: var(--muted); margin: 0 0 14px; }
.post-gate .gate-teaser {
  max-width: 560px; margin: 0 auto 18px; color: var(--faint);
  font-size: 13.5px; line-height: 1.7;
}
.post-gate .gate-tip { font-size: 12.5px; color: var(--faint); font-family: var(--mono); }
.post-gate .gate-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ===== 编辑页：可见性选择 / 用户 VIP 授权 ===== */
.ed-field select#f-visibility {
  width: 100%; padding: 9px 11px; border-radius: 9px;
  background: rgba(255,255,255,.04); color: var(--text);
  border: 1px solid var(--border); font-family: var(--mono); font-size: 13px;
}
.hint { color: var(--faint); font-size: 12.5px; margin: 0 0 14px; line-height: 1.6; }
.hint b { color: var(--amber); }

.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.user-item .u-mail { flex: 1; font-family: var(--mono); font-size: 13.5px; color: var(--text); word-break: break-all; }
.user-item .u-tier {
  font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
}
.user-item .u-tier.vip { color: #ffd479; border: 1px solid rgba(255,212,121,.55); background: rgba(255,212,121,.12); }
.user-item .u-tier.normal { color: var(--muted); border: 1px solid var(--border); }
.user-item .u-btn {
  font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  padding: 7px 14px; border-radius: 9px; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  transition: border-color .15s ease, color .15s ease;
}
.user-item .u-btn:hover { border-color: var(--border-strong); color: var(--cyan); }
.user-item .u-btn:disabled { opacity: .5; cursor: default; }
.user-item .u-date { font-family: var(--mono); font-size: 12px; color: var(--faint); white-space: nowrap; }

/* 用户管理：搜索 + 分组筛选工具条 */
.users-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.users-toolbar .ed-input { flex: 1; min-width: 200px; margin: 0; }
.user-filter { display: inline-flex; gap: 6px; }
.user-filter .uf-btn {
  font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  padding: 8px 16px; border-radius: 9px; color: var(--muted);
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.user-filter .uf-btn:hover { color: var(--text); border-color: var(--border-strong); }
.user-filter .uf-btn.active {
  color: var(--cyan); border-color: var(--cyan);
  background: rgba(34,211,238,.1);
}
@media (max-width: 560px) {
  .users-toolbar { flex-direction: column; align-items: stretch; }
  .user-filter { justify-content: space-between; }
  .user-filter .uf-btn { flex: 1; text-align: center; }
}

/* 文章权限管理：列表 + 内联下拉 */
.perm-list { display: flex; flex-direction: column; gap: 10px; }
.perm-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.perm-item .perm-title {
  flex: 1; min-width: 220px; color: var(--text); text-decoration: none;
  font-size: 14.5px; font-weight: 600;
}
.perm-item .perm-title:hover { color: var(--cyan); }
.perm-item .perm-cat { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.perm-item .perm-status { font-family: var(--mono); font-size: 12px; min-width: 56px; white-space: nowrap; }
.perm-item .perm-status.saving { color: var(--muted); }
.perm-item .perm-status.ok { color: var(--cyan); }
.perm-item .perm-status.err { color: #ff8aa0; }
.perm-item .perm-select {
  font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  padding: 8px 12px; border-radius: 9px; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  transition: border-color .15s ease, color .15s ease;
}
.perm-item .perm-select:hover { border-color: var(--border-strong); }
.perm-item .perm-select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.perm-item .perm-select:disabled { opacity: .6; cursor: default; }
.perm-item .perm-del {
  font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  padding: 8px 12px; border-radius: 9px; color: #ff8aa0;
  background: rgba(255,138,160,.08); border: 1px solid rgba(255,138,160,.35);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.perm-item .perm-del:hover { background: rgba(255,138,160,.18); border-color: #ff8aa0; }
.perm-item .perm-del:disabled { opacity: .6; cursor: default; }
.perm-item .perm-static-note {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 4px 8px; border: 1px dashed var(--border); border-radius: 8px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .perm-item { gap: 8px; }
  .perm-item .perm-title { min-width: 100%; }
  .perm-item .perm-select { width: 100%; }
}

.mi-vis {
  font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}
.mi-vis.vis-vip { color: #ffd479; border: 1px solid rgba(255,212,121,.55); background: rgba(255,212,121,.12); }
.mi-vis.vis-login { color: var(--cyan); border: 1px solid var(--border-strong); background: rgba(56,224,225,.1); }
.mi-vis.vis-private { color: #ff8aa0; border: 1px solid rgba(255,138,160,.5); background: rgba(255,138,160,.12); }

/* ---- 锁定卡片（VIP / 登录 / 私有，列表仅露标题诱饵）---- */
.card.locked { border-style: dashed; border-color: var(--border-strong); }
.card.locked:hover { transform: translateY(-3px); border-color: var(--violet); }
.card.locked .cover { filter: saturate(.45) brightness(.62); }
.card.locked .lock-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 42px; text-shadow: 0 2px 14px rgba(0,0,0,.6); pointer-events: none;
}
.card.locked .excerpt-locked { font-style: italic; color: var(--faint); flex: 1; }
.card.locked .lock-cta {
  color: var(--violet); font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  margin-left: auto; white-space: nowrap;
}
.card.locked .meta { display: flex; align-items: center; gap: 10px; }

/* 标签/分类页里的锁定条目 */
.tag-group a .lock-mark { color: var(--violet); margin-left: 5px; font-size: 12px; }

/* ============================================================
   浅色主题（默认深色；在 <html> 上添加 .theme-light 启用）
   通过覆盖 CSS 变量 + 少量硬编码颜色规则实现，深色主题原样不变。
   ============================================================ */
html.theme-light {
  color-scheme: light;
  --bg: #eef1f6;
  --bg-soft: #e3e8f0;
  --surface: rgba(15, 23, 42, 0.035);
  --surface-2: rgba(15, 23, 42, 0.06);
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.26);
  --text: #0f1b2d;
  --muted: #4a5a73;
  --faint: #7a879c;
  --cyan: #0891b2;
  --blue: #2563eb;
  --violet: #7c3aed;
  --emerald: #059669;
  --amber: #b45309;
  --glow-cyan: rgba(8, 145, 178, 0.22);
  --glow-violet: rgba(124, 58, 237, 0.18);
  --grid: rgba(15, 23, 42, 0.06);
}

/* 切换时的平滑过渡（仅浅色激活期间生效） */
html.theme-light *,
html.theme-light *::before,
html.theme-light *::after {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

/* 背景：浅色基底 + 柔和光晕 + 网格 */
html.theme-light .bg-fx {
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(800px 600px at 95% 5%, rgba(168, 85, 247, 0.09), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg);
}
html.theme-light .bg-fx::before {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
}

/* 导航 */
html.theme-light .nav { background: rgba(238, 241, 246, 0.88); border-bottom-color: rgba(15, 23, 42, 0.10); }

/* 全局链接 / 导航激活态 */
html.theme-light a:hover { color: var(--violet); }
html.theme-light .nav-links a.active { color: var(--cyan); font-weight: 700; }

/* ===== 渐变文字（background-clip:text + color:transparent）=====
   深色模式下白→彩渐变很漂亮，但浅色下有两个风险：
   ① bg-clip 失效时整段渐变变成背景条 + 文字全透明不可见
   ② 即使生效，起始色不够深时与浅底对比度不足
   浅色模式下 background-clip:text 渲染为色带+文字透明，
  因此彻底禁用渐变裁剪，全部改用深色实字。 */

html.theme-light .grad-text,
html.theme-light .brand b,
html.theme-light .stat b,
html.theme-light .stat-card b {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}
/* 品牌名用深蓝 */
html.theme-light .brand b { color: #0c4a6e !important; -webkit-text-fill-color: #0c4a6e !important; }
/* 统计数字用主题青色强调 */
html.theme-light .stat b,
html.theme-light .stat-card b { color: var(--cyan) !important; -webkit-text-fill-color: var(--cyan) !important; font-weight: 800 !important; }

/* 标签 hover（原 #fff） */
html.theme-light .tag:hover { color: var(--text); border-color: var(--border-strong); box-shadow: 0 0 10px var(--glow-cyan); }

/* ===== 文章正文排版：原为浅蓝灰/白色文字，浅色主题需全部改深 ===== */
html.theme-light .article h3 { color: var(--text); }
html.theme-light .article p,
html.theme-light .article ul,
html.theme-light .article ol,
html.theme-light .article li { color: #33425a; }
html.theme-light .article blockquote { color: #33425a; background: linear-gradient(90deg, rgba(8,145,178,.07), transparent); }
html.theme-light .article code {
  background: rgba(15, 23, 42, 0.07);
  color: #0b6b78;
}
html.theme-light .article pre { background: #e7ecf3; border-color: var(--border); }
html.theme-light .article pre code { color: #1f2d3d; }
html.theme-light .article th { color: #0f172a; background: rgba(15, 23, 42, 0.04); border-color: rgba(15, 23, 42, 0.10); }
html.theme-light .article td { color: #33425a; border-color: rgba(15, 23, 42, 0.08); }
html.theme-light .article table { border-color: rgba(15, 23, 42, 0.12); }
html.theme-light .article tr:hover td { background: rgba(8, 145, 178, .04); }

/* ---- 上下篇导航 ---- */
.pager {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.pager-link:hover {
  border-color: var(--cyan);
  background: rgba(8, 145, 178, .08);
  color: var(--text);
  transform: translateY(-2px);
}
.pager-prev { align-items: flex-start; text-align: left; }
.pager-next { align-items: flex-end; text-align: right; }
.pager-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: .02em;
}
.pager-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.pager-link:hover .pager-title { color: var(--text); }
html.theme-light .pager-link:hover { color: var(--text); }

/* 登录弹窗遮罩：原深色 scrim 在浅色下过重 */
html.theme-light .modal-overlay { background: rgba(15, 23, 42, 0.35); }
html.theme-light .modal { box-shadow: 0 20px 50px -15px rgba(0,0,0,.12); }
html.theme-light .modal-sub { color: #475569; }
html.theme-light .modal-sub b { color: #0e7490; }
html.theme-light .auth-tip { color: #64748b; }
html.theme-light .auth-tip a { color: #7c3aed; border-color: #7c3aed; }
html.theme-light .auth-tip a:hover { color: #0e7490; border-color: #0e7490; }
html.theme-light .github-note { color: #94a3b8; }

/* 封面色块选中描边（原 #fff 在浅色下不可见） */
html.theme-light .cover-picker .sw.active { border-color: var(--text); }

/* 封面遮罩：原 rgba(6,9,18,.85) 太暗 → 减轻 */
html.theme-light .card .cover::after { background: linear-gradient(180deg, transparent 50%, rgba(15,23,42,.35)); }
/* 封面分类徽标：白色背景在浅色下 OK，微调边框 */
html.theme-light .card .cover .badge { background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.15); }

/* 精选卡片 —— 浅色主题优化 */
html.theme-light .featured { background: var(--bg); }
html.theme-light .featured td:last-child div { background: transparent; }
html.theme-light .featured table {
  box-shadow: 0 0 0 1px rgba(15,23,42,.10), 0 12px 32px -16px rgba(99,102,241,.08);
}
html.theme-light .featured td:first-child {
  border-right-color: var(--border);
  background:
    radial-gradient(circle at 50% 48%, rgba(8,145,178,.07), transparent 70%),
    radial-gradient(circle at 65% 55%, rgba(124,58,237,.05), transparent 65%),
    linear-gradient(160deg, #f8fafc, #f1f5f9);
}
html.theme-light .featured td:first-child img {
  box-shadow: 0 0 24px rgba(8,145,178,.12), 0 0 48px rgba(124,58,237,.06), 0 4px 16px rgba(0,0,0,.08);
}
/* 浅色下文字颜色加深 */
html.theme-light .featured .feat-eyebrow { color: #0369a1; font-weight: 600; }
html.theme-light .featured td:last-child h2 { color: #0f172a; }
html.theme-light .featured td:last-child p { color: #475569; }
html.theme-light .featured td:last-child .meta { color: #94a3b8; }

/* 各类「近透明/白底面」在浅色下需改为可见的微调面 */
html.theme-light .post-gate { background: var(--surface); border-color: var(--border); }
html.theme-light .ed-field select#f-visibility { background: var(--surface); color: var(--text); }
html.theme-light .user-item { background: var(--surface); border-color: var(--border); }
html.theme-light .user-item .u-btn { background: var(--surface-2); color: var(--text); }
html.theme-light .user-filter .uf-btn { background: var(--surface); color: var(--text); }
html.theme-light .perm-item { background: var(--surface); border-color: var(--border); }
html.theme-light .perm-item .perm-select { background: var(--surface-2); color: var(--text); }

/* 头像渐变容器：降低光晕强度 */
html.theme-light .avatar { box-shadow: 0 0 30px -8px var(--glow-violet); }

/* 权限徽标：浅色下加深文字以保证对比度（列表与卡片） */
html.theme-light .mi-vis.vis-vip,
html.theme-light .vis-vip { color: #8a6d10; background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.45); }
html.theme-light .mi-vis.vis-private,
html.theme-light .vis-private { color: #c2415b; background: rgba(194, 65, 91, 0.08); border-color: rgba(194, 65, 91, 0.35); }
html.theme-light .mi-vis.vis-login,
html.theme-light .vis-login { color: #0c7ba0; background: rgba(8, 145, 178, 0.10); border-color: rgba(8, 145, 178, 0.35); }

/* 用户组标签 */
html.theme-light .user-item .u-tier.vip { color: #8a6d10; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
html.theme-light .user-item .u-tier.normal { color: var(--muted); background: var(--surface); }

/* 按钮/交互元素微调 */
html.theme-light .btn-primary { box-shadow: 0 0 14px -3px var(--glow-cyan); }
html.theme-light .theme-toggle { background: var(--surface); border-color: var(--border); }

/* ============================================================
   第二梯队增强：搜索 / 进度条 / 回到顶部 / TOC / 代码复制
   ============================================================ */

/* ---- 搜索框 ---- */
.search-bar { position: relative; max-width: 560px; }
.search-input {
  width: 100%;
  padding: 13px 40px 13px 16px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(34,211,238,.10); }
.search-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--surface-2); color: var(--muted);
  cursor: pointer; font-size: 18px; line-height: 1;
}
.search-clear:hover { color: var(--text); }

/* ---- 阅读进度条（顶部）---- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 150; pointer-events: none;
}
.reading-progress .bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 10px var(--glow-cyan);
  transition: width .08s linear;
}

/* ---- 回到顶部按钮 ---- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 140;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
  color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease, color .15s ease;
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---- 文章页两栏布局 + TOC ---- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.post-col { min-width: 0; }
.toc-col { position: sticky; top: 84px; align-self: start; }
@media (max-width: 980px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; }
  .toc-col { display: none; }
}
.toc {
  border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px;
  background: var(--surface); max-height: calc(100vh - 120px); overflow-y: auto;
}
.toc-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px;
}
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-item a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent; transition: .15s ease; line-height: 1.5;
}
.toc-item a:hover { color: var(--text); background: var(--surface-2); }
.toc-item a.active { color: var(--cyan); border-left-color: var(--cyan); background: rgba(34,211,238,.06); }
.toc-item.sub a { padding-left: 22px; font-size: 13px; }
/* 锚点跳转时避开顶部固定导航 */
.article h2, .article h3 { scroll-margin-top: 84px; }

/* ---- 代码块复制按钮 ---- */
.article pre { position: relative; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--mono); font-size: 12px;
  padding: 4px 10px; border-radius: 7px; cursor: pointer;
  color: var(--muted); background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  opacity: 0; transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}
.article pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.copied { color: var(--emerald); border-color: var(--emerald); opacity: 1; }

/* ===== 浅色主题适配 ===== */
html.theme-light .search-input { background: #fff; border-color: rgba(15,23,42,.15); color: #0f172a; }
html.theme-light .search-input::placeholder { color: #94a3b8; }
html.theme-light .search-clear { background: rgba(15,23,42,.06); color: #475569; }
html.theme-light .footer-group ul li a:hover,
html.theme-light .footer-copy a:hover,
html.theme-light .footer-social-link:hover { color: #0e7490; border-color: #0e7490; }
html.theme-light .toc { background: #fff; border-color: rgba(15,23,42,.12); }
html.theme-light .toc-item a { color: #475569; }
html.theme-light .toc-item a:hover { color: #0f172a; background: rgba(15,23,42,.04); }
html.theme-light .toc-item a.active { color: #0e7490; border-left-color: #0e7490; background: rgba(8,145,178,.06); }
html.theme-light .copy-btn { background: rgba(15,23,42,.05); color: #475569; border-color: rgba(15,23,42,.15); }
html.theme-light .copy-btn:hover { color: #0f172a; border-color: rgba(15,23,42,.3); }
html.theme-light .copy-btn.copied { color: #0e7490; border-color: #0e7490; }
html.theme-light .to-top { background: #fff; border-color: rgba(15,23,42,.18); color: #0f172a; box-shadow: 0 8px 20px -8px rgba(0,0,0,.15); }
html.theme-light .to-top:hover { color: #0e7490; border-color: #0e7490; }

/* ===== AIGC 工具合集页 ===== */
.tools-hero { padding: 30px 0 14px; }
.tools-hero h1 { font-size: 30px; margin: 10px 0 14px; line-height: 1.25; }
.tools-hero .lead { color: var(--muted); line-height: 1.7; max-width: 900px; margin: 0; }
.tools-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* 分类锚点导航（吸顶，位于站点导航下方） */
.tools-nav {
  position: sticky; top: 64px; z-index: 45;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 0; margin: 18px 0 6px;
  background: linear-gradient(var(--bg), var(--bg));
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.tools-nav-item {
  flex: 0 0 auto; white-space: nowrap;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  transition: all .15s ease;
}
.tools-nav-item:hover { color: var(--cyan); border-color: var(--cyan); }

.tools-section { padding: 32px 0 6px; border-top: 1px solid var(--border); margin-top: 10px; }
.tools-section:first-of-type { border-top: none; }
.tools-section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tools-section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(34,211,238,.12); color: var(--cyan);
  font-weight: 700; font-size: 15px;
}
.tools-section-head h2 { font-size: 21px; margin: 0; }
.tools-section-note { width: 100%; color: var(--faint); font-size: 13px; margin: 2px 0 0; }

.tool-group { margin-bottom: 24px; }
.tool-group-title {
  font-size: 13px; color: var(--cyan); font-weight: 600;
  margin-bottom: 12px; padding-left: 10px; border-left: 3px solid var(--cyan);
}

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 17px 17px; display: flex; flex-direction: column; gap: 9px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 14px 30px -16px rgba(34,211,238,.45); }
.tool-head { display: flex; align-items: center; }
.tool-name {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.3;
}
a.tool-name:hover { color: var(--cyan); }
.tool-name svg { opacity: .55; flex: 0 0 auto; }
a.tool-name:hover svg { opacity: 1; }
.tool-companion-wrap { margin-top: -4px; }
.tool-companion { font-size: 11.5px; color: var(--faint); text-decoration: none; }
a.tool-companion:hover { color: var(--cyan); }
.tool-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tool-tag {
  font-size: 11px; color: var(--muted);
  background: rgba(120,160,255,.08); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}

/* 新手推荐 */
.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.starter-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 17px; display: flex; flex-direction: column; gap: 8px;
}
.starter-scene { font-size: 14px; color: var(--text); font-weight: 600; }
.starter-tools { font-size: 13px; color: var(--cyan); }

@media (max-width: 980px) { .tool-grid, .starter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .tool-grid, .starter-grid { grid-template-columns: 1fr; }
  .tools-hero h1 { font-size: 24px; }
  .tools-nav { top: 56px; }
}

/* 浅色主题适配 */
html.theme-light .tools-nav { background: linear-gradient(var(--bg), var(--bg)); }
html.theme-light .tool-card,
html.theme-light .starter-card { background: #fff; }
html.theme-light .tool-tag { background: rgba(15,23,42,.04); color: #475569; }
html.theme-light .tool-name { color: #0f1b2d; }
html.theme-light .tools-section-num { background: rgba(8,145,178,.1); }
