﻿/* ============================================================
   pages.css — 非首页页面的视觉层（2026.11 重做）
   只在 articles / links / tools / publish / article-detail / 404 加载
   首页 hero 与星空背景不受影响
   ============================================================ */

/* ---------- 局部变量 ---------- */
:root {
  --pg-line: rgba(255, 255, 255, 0.09);
  --pg-line-strong: rgba(255, 255, 255, 0.18);
  --pg-surface: var(--bg-secondary);
  --pg-surface-2: var(--bg-card);
  --pg-radius: 16px;
  --pg-radius-sm: 10px;
  --pg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pg-max: 1120px;
  --pg-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', monospace;
  --pg-accent: #6366f1;
  --pg-accent-soft: rgba(99, 102, 241, 0.14);
}

[data-theme="light"] {
  --pg-line: rgba(18, 18, 28, 0.09);
  --pg-line-strong: rgba(18, 18, 28, 0.2);
  --pg-surface: #ffffff;
  --pg-surface-2: #fbfbfd;
}

/* ---------- 容器 ---------- */
.container {
  max-width: var(--pg-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============================================================
   页头：左边标题文字，右边一张 banner 图做装饰
   图片通过 --pg-banner-img 指定（默认 banner1），用 ::after 铺在底层，
   再用 mask 让图从中间往右逐渐显出来、左侧完全透明，文字永远落在纯背景色上，
   深浅主题都不用调透明度。不做轮播（每几秒换一张会让人觉得页面在闪）
   ============================================================ */
.page-banner,
.page-hero,
.article-banner {
  --pg-banner-img: url('/images/banner1.jpg');
  background-color: var(--bg-primary) !important;
  background-image: none !important;
  height: auto !important;
  min-height: clamp(220px, 26vw, 300px) !important;
  display: block !important;
  overflow: visible !important;
  padding: clamp(44px, 7vw, 92px) 0 clamp(22px, 3.2vw, 36px);
  margin-top: var(--nav-height);
  border-bottom: 1px solid var(--pg-line);
  position: relative;
  isolation: isolate;
}

/* 装饰图：只铺右侧，左侧虚化融进背景色，别抢标题的注意力 */
.page-banner::after,
.page-hero::after,
.article-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--pg-banner-img);
  background-size: cover;
  background-position: center 50%;
  background-repeat: no-repeat;
  opacity: 0.62;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 36%, rgba(0, 0, 0, 0.26) 58%, rgba(0, 0, 0, 0.68) 82%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 36%, rgba(0, 0, 0, 0.26) 58%, rgba(0, 0, 0, 0.68) 82%, #000 100%);
}

/* 深色主题：图再压暗一点，浅色标题才压得住 */
[data-theme="dark"] .page-banner::after,
[data-theme="dark"] .page-hero::after,
[data-theme="dark"] .article-banner::after {
  background-image: linear-gradient(rgba(6, 8, 12, 0.45), rgba(6, 8, 12, 0.45)), var(--pg-banner-img);
  background-size: auto, cover;
  background-position: center, center 50%;
  opacity: 0.5;
}

.page-banner .carousel-overlay,
.page-hero .carousel-overlay,
.article-banner .carousel-overlay,
.banner-carousel .carousel-overlay,
.carousel-dots,
.banner-dots {
  display: none !important;
}

.page-banner .page-banner-content,
.page-banner .banner-content,
.page-hero .hero-content,
.article-banner .banner-content {
  position: relative;
  z-index: 2;
  max-width: var(--pg-max);
  margin: 0 auto;
  padding: 0 24px;
  text-align: left;
}

/* 微型眉标 */
.page-banner-subtitle::before,
.hero-subtitle::before {
  content: 'BAI-1234';
  display: block;
  font-family: var(--pg-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.page-banner-title,
.hero-title,
.article-banner-title {
  color: var(--text-primary) !important;
  font-size: clamp(1.85rem, 4.4vw, 3.05rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.045em !important;
  line-height: 1.08 !important;
  margin: 0 !important;
  text-align: left;
}

.page-banner-subtitle,
.hero-subtitle {
  color: var(--text-secondary) !important;
  font-size: 0.93rem !important;
  line-height: 1.7 !important;
  margin: 14px 0 0 !important;
  max-width: 46ch;
}

.page-hero .hero-icon {
  display: none;
}

/* 详情页头部的 meta */
.article-banner-meta,
.article-banner-meta span,
.article-banner-meta a {
  color: var(--text-secondary) !important;
}

/* ============================================================
   按钮：统一成克制的一体化样式
   ============================================================ */
.btn-submit,
.btn-add-tool,
.comment-submit-btn,
.form-actions .btn-primary,
.action-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  transition: background 0.18s var(--pg-ease), border-color 0.18s var(--pg-ease),
    transform 0.18s var(--pg-ease), opacity 0.18s var(--pg-ease);
}

.btn-submit,
.btn-add-tool,
.comment-submit-btn {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid transparent !important;
  padding: 9px 18px !important;
  box-shadow: none !important;
}

.btn-submit:hover,
.btn-add-tool:hover,
.comment-submit-btn:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

/* ============================================================
   表单控件
   ============================================================ */
input[type="text"],
input[type="url"],
input[type="search"],
textarea,
select {
  font-family: inherit;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius-sm);
  color: var(--text-primary);
  transition: border-color 0.18s var(--pg-ease), box-shadow 0.18s var(--pg-ease);
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ---------- 搜索框 ---------- */
.search-bar {
  position: relative;
  margin-bottom: 18px;
}

.search-bar input,
.links-search .search-wrapper input,
.toolbar-search input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-size: 0.92rem;
  border-radius: 12px;
}

.search-bar .search-bar-icon,
.links-search .search-icon,
.toolbar-search i {
  left: 16px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.links-search {
  margin-bottom: 18px;
}

.links-search .search-wrapper {
  position: relative;
}

/* ---------- 胶囊筛选 ---------- */
.category-filter,
.category-nav,
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--pg-line);
  padding-bottom: 18px;
}

.filter-pill,
.cat-pill {
  padding: 7px 14px !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  font-weight: 450 !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer;
  transition: color 0.16s var(--pg-ease), background 0.16s var(--pg-ease),
    border-color 0.16s var(--pg-ease);
}

.filter-pill:hover,
.cat-pill:hover {
  color: var(--text-primary) !important;
  background: var(--bg-hover) !important;
}

.filter-pill.active,
.cat-pill.active {
  color: var(--text-primary) !important;
  background: var(--bg-hover) !important;
  border-color: var(--pg-line-strong) !important;
}

/* 分类后面的数字 */
.filter-pill .pill-count {
  margin-left: 6px;
  font-style: normal;
  font-size: 0.7rem;
  font-family: var(--pg-mono);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.filter-pill.active .pill-count { color: var(--text-secondary); }

/* 管理态的“新建分类” */
.filter-pill.pill-new {
  color: var(--pg-accent) !important;
  border-color: var(--pg-accent-soft, rgba(99, 102, 241, 0.35)) !important;
  background: transparent !important;
}

.filter-pill.pill-new:hover {
  background: var(--pg-accent-soft, rgba(99, 102, 241, 0.12)) !important;
}

/* 侧栏分类的删除小按钮 */
.sidebar-categories a { position: relative; }
.sidebar-categories .cat-right {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.sidebar-categories .cat-del {
  width: 16px;
  height: 16px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.sidebar-categories .cat-del:hover {
  color: #fff;
  background: #e5484d;
  border-color: #e5484d;
  opacity: 1;
}

/* 列表页排序下拉 */
.articles-sort {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23888'/></svg>") no-repeat right 9px center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
.articles-sort:hover { color: var(--text-primary); border-color: var(--pg-line-strong); }
.articles-sort:focus { border-color: var(--pg-accent); }

/* 计数行里的「发布文章」：描边小按钮，别抢文章的视觉重量 */
.articles-info .btn-submit {
  padding: 7px 14px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--pg-accent) !important;
  border: 1px solid var(--pg-accent) !important;
  box-shadow: none !important;
}
.articles-info .btn-submit:hover {
  background: var(--pg-accent-soft) !important;
  transform: none !important;
}

/* 发布页：分类下拉 + 新建按钮 */
.cat-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-select-row select { flex: 1; }
.cat-add-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s var(--pg-ease);
}
.cat-add-btn:hover {
  color: var(--pg-accent);
  border-color: var(--pg-accent);
  background: var(--pg-accent-soft);
}


/* ---------- 计数行 ---------- */
.articles-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
}

.articles-info .count {
  font-family: var(--pg-mono);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   文章列表：横向条目 + 细分隔线
   ============================================================ */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: clamp(24px, 3.4vw, 56px);
  padding: clamp(26px, 3.6vw, 44px) 0 72px;
  align-items: start;
}

.content-main {
  min-width: 0;
}

.article-grid {
  display: block !important;
  gap: 0 !important;
}

.article-card {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pg-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 22px 0 !important;
  transition: border-color 0.2s var(--pg-ease);
}

.article-card:hover {
  border-bottom-color: var(--pg-line-strong) !important;
}

.card-cover-link,
.card-cover {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.card-cover {
  aspect-ratio: 16 / 10;
  background: var(--bg-tertiary);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: transform 0.6s var(--pg-ease), filter 0.3s var(--pg-ease);
}

.article-card:hover .card-cover img {
  transform: scale(1.05);
}

.card-body {
  padding: 0 !important;
  min-width: 0;
}

.card-category {
  display: inline-block;
  font-family: var(--pg-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent) !important;
  background: transparent !important;
  padding: 0 !important;
    border: 0 !important;
  border-radius: 0 !important;
}

.card-date {
  font-size: 0.72rem;
  color: var(--text-tertiary) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.card-date i {
  display: none;
}

.card-title {
  font-size: clamp(1.02rem, 1.6vw, 1.26rem) !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.022em !important;
  color: var(--text-primary);
  margin: 8px 0 0 !important;
  transition: color 0.18s var(--pg-ease);
}

.card-title-link {
  text-decoration: none;
}

.article-card:hover .card-title {
  color: var(--accent);
}

.card-excerpt {
  font-size: 0.89rem !important;
  line-height: 1.72 !important;
  color: var(--text-secondary) !important;
  margin: 8px 0 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.card-likes {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.card-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.card-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ============================================================
   侧栏
   ============================================================ */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-card {
  background: none !important;
  border: 0 !important;
  border-top: 1px solid var(--pg-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 20px 0 !important;
}

.sidebar-card:first-child {
  border-top: 0 !important;
  padding-top: 0 !important;
}

.sidebar-card-title {
  font-family: var(--pg-mono) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  color: var(--text-tertiary) !important;
  font-weight: 500 !important;
  margin-bottom: 14px !important;
}

.sidebar-profile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  overflow: hidden;
  border: 1px solid var(--pg-line-strong);
  background: var(--bg-secondary);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: var(--text-primary) !important;
}

.profile-bio {
  font-size: 0.8rem !important;
  line-height: 1.7 !important;
  color: var(--text-tertiary) !important;
}

.sidebar-categories a,
.sidebar-categories li {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 !important;
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--pg-ease);
}

.sidebar-categories a:hover {
  color: var(--accent) !important;
}

.sidebar-categories i {
  display: none;
}

.cat-count {
  font-family: var(--pg-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.tag-cloud {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
}

.tag,
.tag-cloud .tag {
  font-size: 0.76rem !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--pg-line) !important;
  color: var(--text-secondary) !important;
  transition: border-color 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.tag:hover {
  border-color: var(--pg-line-strong) !important;
  color: var(--text-primary) !important;
}

/* ============================================================
   链接页
   ============================================================ */
.links-content {
  padding: clamp(26px, 3.6vw, 44px) 0 72px !important;
  max-width: var(--pg-max);
  margin: 0 auto;
}

.link-section {
  margin-bottom: 46px !important;
}

.link-section-title {
  font-family: var(--pg-mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary) !important;
  font-weight: 500 !important;
  margin: 0 0 16px !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-section-title i {
  display: none;
}

.link-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 10px !important;
}

.link-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  border: 1px solid var(--pg-line) !important;
  background: var(--pg-surface) !important;
  box-shadow: none !important;
  transition: border-color 0.18s var(--pg-ease), transform 0.18s var(--pg-ease),
    background 0.18s var(--pg-ease);
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--pg-line-strong) !important;
  background: var(--bg-hover) !important;
}

.link-card-icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  border-radius: 10px !important;
  font-size: 0.9rem !important;
  box-shadow: none !important;
  opacity: 0.96;
}

.link-card-title {
  font-size: 0.9rem !important;
  font-weight: 550 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.link-card-desc {
  font-size: 0.76rem !important;
  color: var(--text-tertiary) !important;
  line-height: 1.55;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 管理区 */
.manage-section {
  margin-top: 8px;
  border-top: 1px solid var(--pg-line);
  padding-top: 10px;
}

.manage-toggle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding: 10px 0;
  cursor: pointer;
}

.add-link-form,
.manage-links-list {
  background: var(--pg-surface) !important;
  border: 1px solid var(--pg-line) !important;
  border-radius: var(--pg-radius) !important;
  padding: 22px !important;
  box-shadow: none !important;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  height: 44px;
  padding: 0 12px;
  font-size: 0.88rem;
  width: 100%;
}

.icon-picker,
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-option {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pg-line);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.icon-option.selected,
.icon-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.color-option {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.16s var(--pg-ease);
}

.color-option.selected {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

/* ============================================================
   工具页
   ============================================================ */
.toolbar-bar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 0 20px;
  margin-bottom: 24px !important;
  border-bottom: 1px solid var(--pg-line);
  background: none !important;
}

.toolbar-search {
  flex: 1 1 220px;
  position: relative;
}

.toolbar-search input {
  height: 44px;
  border-radius: 11px;
}

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.toolbar-sort select {
  height: 44px;
  padding: 0 10px;
  font-size: 0.82rem;
  border-radius: 11px;
}

.tools-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px !important;
}

.tool-card {
  background: var(--pg-surface) !important;
  border: 1px solid var(--pg-line) !important;
  border-radius: var(--pg-radius) !important;
  padding: 20px !important;
  box-shadow: none !important;
  transition: border-color 0.18s var(--pg-ease), transform 0.18s var(--pg-ease);
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--pg-line-strong) !important;
}

.tool-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  background: var(--bg-tertiary) !important;
  color: var(--accent) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: none !important;
}

.tool-title {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  color: var(--text-primary) !important;
  margin-bottom: 6px !important;
}

.tool-desc {
  font-size: 0.78rem !important;
  line-height: 1.6;
  color: var(--text-tertiary) !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.tool-meta {
  margin-top: 14px !important;
  font-size: 0.7rem !important;
  color: var(--text-tertiary) !important;
  font-family: var(--pg-mono);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--pg-line);
  padding-top: 10px;
}

.empty-state {
  padding: 64px 20px !important;
  border: 1px dashed var(--pg-line) !important;
  border-radius: var(--pg-radius) !important;
  color: var(--text-tertiary) !important;
  font-size: 0.86rem;
  background: none !important;
}

/* ============================================================
   发布页
   ============================================================ */
.publish-content {
  padding: clamp(24px, 3.4vw, 40px) 0 80px !important;
  max-width: 880px !important;
  margin: 0 auto;
}

.publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card {
  background: var(--pg-surface) !important;
  border: 1px solid var(--pg-line) !important;
  border-radius: var(--pg-radius) !important;
  padding: 24px !important;
  box-shadow: none !important;
}

.form-card-title {
  font-family: var(--pg-mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary) !important;
  font-weight: 500 !important;
  margin-bottom: 18px !important;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pg-line);
}

.form-hint {
  font-size: 0.72rem !important;
  color: var(--text-tertiary) !important;
  margin-top: 8px;
}

.editor-container {
  border: 1px solid var(--pg-line) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--bg-secondary);
}

#contentInput,
.editor-pane textarea {
  width: 100%;
  min-height: 380px;
  padding: 20px;
  font-family: var(--pg-mono), inherit;
  font-size: 0.88rem;
  line-height: 1.8;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  resize: vertical;
}

.preview-pane {
  padding: 24px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--pg-line);
  background: var(--bg-tertiary);
}

.editor-toolbar button {
  border-radius: 7px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  padding: 6px 9px !important;
  transition: background 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.editor-toolbar button:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.form-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  position: sticky;
  bottom: 0;
  padding: 16px 0 !important;
  margin-top: 4px;
  background: linear-gradient(to top, var(--bg-primary) 72%, transparent);
}

.form-actions button,
.form-actions a {
  height: 42px;
  padding: 0 20px !important;
  border-radius: 999px !important;
  font-size: 0.85rem !important;
}

#localPublishNotice {
  border: 1px solid var(--pg-line) !important;
  border-radius: var(--pg-radius) !important;
  background: var(--bg-secondary) !important;
}

/* ============================================================
   文章详情
   ============================================================ */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: clamp(24px, 3vw, 52px);
  padding: clamp(28px, 3.6vw, 44px) 0 80px;
  align-items: start;
}

.article-body {
  font-size: 1.005rem;
  line-height: 1.86;
  color: var(--text-secondary);
  max-width: 68ch;
}

.article-body h2,
.article-body h3 {
  color: var(--text-primary);
  letter-spacing: -0.025em;
  font-weight: 600;
  line-height: 1.35;
}

.article-body h2 {
  font-size: 1.4rem;
  margin: 2.1em 0 0.7em;
  padding-top: 1.6em;
  border-top: 1px solid var(--pg-line);
}

.article-body h3 {
  font-size: 1.12rem;
  margin: 1.7em 0 0.5em;
}

.article-body p {
  margin: 0 0 1.15em;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-light);
  transition: border-color 0.16s var(--pg-ease);
}

.article-body a:hover {
  border-bottom-color: var(--accent);
}

.article-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 18px;
  margin: 1.4em 0;
  color: var(--text-tertiary);
  background: none;
}

.article-body code {
  font-family: var(--pg-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-tertiary);
}

.article-body pre {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--pg-line) !important;
  border-radius: 12px;
  padding: 18px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
}

.article-body img {
  border-radius: 12px;
  max-width: 100%;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 1.4em 0;
}

.article-body th,
.article-body td {
  border-bottom: 1px solid var(--pg-line);
  padding: 10px 12px;
  text-align: left;
}

.article-body th {
  color: var(--text-primary);
  font-weight: 550;
  border-bottom-color: var(--pg-line-strong);
}

/* 操作栏 */
.article-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px !important;
  padding: 18px 0 !important;
  border-top: 1px solid var(--pg-line) !important;
  border-bottom: 1px solid var(--pg-line) !important;
  background: none !important;
}

.action-btn {
  height: 36px;
  padding: 0 14px !important;
  border: 1px solid var(--pg-line) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem !important;
  box-shadow: none !important;
}

.action-btn:hover {
  border-color: var(--pg-line-strong) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

.action-btn.is-liked,
.action-btn.liked {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* 评论 */
.comments-section {
  margin-top: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

.comments-title {
  font-size: 0.88rem !important;
  font-weight: 550 !important;
  letter-spacing: 0.01em;
  color: var(--text-primary) !important;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pg-line);
  margin-bottom: 0 !important;
}

.comment-count {
  font-family: var(--pg-mono);
  color: var(--text-tertiary) !important;
  font-size: 0.76rem;
}

.comment-input-wrapper {
  display: flex !important;
  gap: 10px;
  padding: 16px 0 !important;
  border-bottom: 1px solid var(--pg-line) !important;
  background: none !important;
  align-items: center;
}

.comment-input-wrapper input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px !important;
  font-size: 0.86rem;
}

.comment-submit-btn {
  height: 44px;
  padding: 0 20px !important;
  white-space: nowrap;
}

.comment-item,
.comment-list > div {
  padding: 16px 0 !important;
  border-bottom: 1px solid var(--pg-line) !important;
  background: none !important;
}

/* 目录 */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
}

.toc-card {
  background: none !important;
  border: 0 !important;
  border-left: 1px solid var(--pg-line) !important;
  border-radius: 0 !important;
  padding: 0 0 0 18px !important;
  box-shadow: none !important;
}

.toc-title {
  font-family: var(--pg-mono) !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary) !important;
  margin-bottom: 12px !important;
}

.toc-list a,
.toc-card a {
  display: block;
  font-size: 0.79rem !important;
  line-height: 1.6;
  padding: 5px 0 !important;
  color: var(--text-tertiary) !important;
  border-left: 0;
  transition: color 0.16s var(--pg-ease);
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent) !important;
}

/* ============================================================
   404
   ============================================================ */
.not-found,
.error-page {
  padding: clamp(80px, 14vh, 140px) 24px;
  text-align: center;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 960px) {
  .content-layout,
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    order: 2;
    margin-top: 8px;
  }

  .sidebar-card {
    border-top: 1px solid var(--pg-line) !important;
    padding: 18px 0 !important;
  }

  .sidebar-profile {
    flex-direction: row;
    align-items: center;
  }

  .toc-sidebar {
    position: static;
    order: 3;
    margin: 8px 0 0;
  }

  .toc-card {
    border-left: 0 !important;
    border-top: 1px solid var(--pg-line) !important;
    padding: 18px 0 0 !important;
  }

  .toc-list a {
    display: inline-block;
    margin-right: 14px;
  }

  .article-grid {
    display: block !important;
  }
}

@media (max-width: 720px) {
  :root {
    --pg-max: 100%;
  }

  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .page-banner,
  .page-hero,
  .article-banner {
    padding: 30px 0 22px;
    min-height: 190px !important;
  }

  /* 窄屏：图极淡地铺在下半幅，从上往下渐显、到底部收一点，不留色带也不硬切 */
  .page-banner::after,
  .page-hero::after,
  .article-banner::after {
    background-position: center 45%;
    opacity: 0.34;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 22%, rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.5) 78%, rgba(0, 0, 0, 0.3) 100%);
    mask-image: linear-gradient(180deg, transparent 0%, transparent 22%, rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.5) 78%, rgba(0, 0, 0, 0.3) 100%);
  }

  /* 窄屏 + 深色：位置与不透明度要跟着一起改，别被桌面规则压回去 */
  [data-theme="dark"] .page-banner::after,
  [data-theme="dark"] .page-hero::after,
  [data-theme="dark"] .article-banner::after {
    background-position: center, center 45%;
    opacity: 0.34;
  }

  .page-banner .page-banner-content,
  .page-hero .hero-content,
  .article-banner .banner-content {
    padding: 0 18px;
  }

  .page-banner-subtitle::before,
  .hero-subtitle::before {
    margin-bottom: 10px;
    font-size: 0.62rem;
  }

  .article-card {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 16px 0 !important;
  }

  .card-cover {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
  }

  .card-excerpt {
    -webkit-line-clamp: 2;
    font-size: 0.84rem !important;
  }

  .card-meta {
    margin-top: 8px;
  }

  .link-grid,
  .tools-grid {
    grid-template-columns: 1fr !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .toolbar-bar {
    gap: 8px;
  }

  .toolbar-search {
    flex: 1 1 100%;
    order: 1;
  }

  .toolbar-sort {
    order: 2;
    flex: 1;
  }

  .btn-add-tool {
    order: 3;
    flex: 1 1 100%;
    height: 42px;
  }

  .form-card {
    padding: 18px !important;
  }

  #contentInput,
  .editor-pane textarea {
    min-height: 300px;
    padding: 16px;
    font-size: 0.85rem;
  }

  .article-actions {
    gap: 6px;
  }

  .action-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .article-body {
    font-size: 0.96rem;
    line-height: 1.8;
  }

  .publish-content,
  .links-content {
    padding-top: 20px !important;
  }
}

@media (max-width: 420px) {
  .article-card {
    grid-template-columns: 88px minmax(0, 1fr) !important;
  }

  .card-title {
    font-size: 0.98rem !important;
  }
}

/* ============================================================
   修正层（对既有内联样式的强覆盖）
   ============================================================ */

/* 眉标改到标题上方 */
.page-banner .page-banner-content::before,
.page-hero .hero-content::before {
  content: 'BAI-1234';
  display: block;
  font-family: var(--pg-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  text-align: left;
}

.page-banner-subtitle::before,
.hero-subtitle::before {
  content: none !important;
  display: none !important;
}

/* tools 页头：干掉旧的光斑层，装饰图由统一的 ::after 负责 */
.page-hero {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

.page-hero::before {
  display: none !important;
}

.page-hero .hero-content {
  display: block !important;
  width: auto !important;
  max-width: var(--pg-max);
  margin: 0 auto;
  padding: 0 24px !important;
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.page-hero .hero-title {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--text-primary) !important;
  text-align: left !important;
  font-weight: 600 !important;
  margin-bottom: 0 !important;
}

.page-hero .hero-subtitle {
  color: var(--text-secondary) !important;
  text-align: left !important;
  max-width: 46ch !important;
  margin-top: 14px;
}

/* 侧栏标题前的竖线去掉 */
.sidebar-card-title::before,
.sidebar-card-title::after {
  display: none !important;
}

/* 文章卡片封面撑满网格列 */
.card-cover-link,
.card-cover {
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
}

.card-cover-link {
  display: block !important;
}

/* 选中的筛选胶囊改为实心深色，提升对比 */
.filter-pill.active,
.cat-pill.active {
  background: var(--text-primary) !important;
  border-color: var(--text-primary) !important;
  color: var(--bg-primary) !important;
}

/* 链接页 / 发布页宽度与页头对齐 */
.links-content {
  max-width: var(--pg-max) !important;
  margin: 0 auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

.links-search {
  max-width: 520px;
  margin: 0 0 18px !important;
}

.links-search .search-wrapper {
  margin: 0 !important;
}

.publish-content {
  max-width: var(--pg-max) !important;
  margin: 0 auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

.publish-form {
  max-width: 920px;
}

/* 链接页：去掉重复的管理入口 */
.manage-toggle {
  display: none !important;
}

/* 表单卡片标题前的彩色图标去掉 */
.form-card-title i,
.form-card-title > div:first-child:not(:last-child) {
  display: none !important;
}

/* 工具页工具栏：去玻璃拟态 */
.toolbar-bar {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pg-line) !important;
  border-radius: 0 !important;
  padding: 0 0 18px !important;
}

.toolbar-bar .toolbar-search input,
.toolbar-sort select {
  box-shadow: none !important;
}

/* 空状态里的按钮收敛 */
.empty-state button,
.empty-state .btn-add-tool,
.empty-state .btn-submit {
  width: auto !important;
  height: 42px !important;
  min-width: 0 !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.empty-state i {
  color: var(--text-tertiary) !important;
  font-size: 1.4rem !important;
}

/* 详情页：标题尺寸、meta 排布、首个标题的横线 */
.article-banner-title {
  font-size: clamp(1.65rem, 3.4vw, 2.35rem) !important;
  line-height: 1.24 !important;
  max-width: 22ch;
}

.article-banner-meta {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin-top: 16px !important;
  font-size: 0.78rem;
}

.article-banner-meta > * {
  margin: 0 !important;
}

.article-body h2:first-child,
.article-body > h2:first-of-type {
  border-top: 0 !important;
  padding-top: 0 !important;
  margin-top: 0.2em !important;
}

.article-body > :first-child {
  margin-top: 0 !important;
}

/* 评论空状态 */
.comment-empty,
.comments-empty {
  border: 0 !important;
  color: var(--text-tertiary) !important;
}

/* 移动端对齐 */
@media (max-width: 720px) {
  .page-hero .hero-content,
  .links-content,
  .publish-content {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .article-banner-title {
    max-width: 100%;
  }

  .links-search {
    max-width: 100%;
  }
}

/* ============================================================
   微调层
   ============================================================ */

/* 文章封面：固定尺寸，避免被内在比例拉小 */
.article-card {
  grid-template-columns: 172px minmax(0, 1fr) !important;
}

.card-cover {
  width: 172px !important;
  height: 108px !important;
  aspect-ratio: auto !important;
}

.card-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* 侧栏对齐与计数徽章 */
.sidebar-profile {
  align-items: flex-start !important;
}

.profile-avatar {
  margin: 0 !important;
}

.cat-count {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  color: var(--text-tertiary) !important;
}

/* 链接页：搜索 + 管理入口同排 */
.links-search {
  display: flex !important;
  align-items: center;
  gap: 10px;
  max-width: none !important;
}

.links-search .search-wrapper {
  flex: 1 1 auto;
  max-width: 460px;
}

.manage-entry-btn {
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--pg-line);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s var(--pg-ease), color 0.18s var(--pg-ease);
}

.manage-entry-btn:hover {
  border-color: var(--pg-line-strong);
  color: var(--text-primary);
}

.manage-entry-btn i {
  font-size: 0.8rem;
}

/* 链接网格：明确的列数，避免被旧规则干扰 */
.link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.link-section {
  margin-bottom: 40px !important;
}

/* 工具页工具栏控件：描边而非白卡 */
.toolbar-search input,
.toolbar-sort select {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--pg-line) !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
}

.toolbar-search input::placeholder {
  color: var(--text-tertiary);
}

.toolbar-sort {
  color: var(--text-tertiary) !important;
}

/* 空状态：按钮改描边，标题收敛 */
.empty-state button,
.empty-state .btn-add-tool,
.empty-state .btn-submit {
  background: transparent !important;
  border: 1px solid var(--pg-line-strong) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  min-height: 42px !important;
}

.empty-state button:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: transparent !important;
}

.empty-state h3,
.empty-state .empty-title {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

/* 发布页：表单与页头左对齐 */
.publish-form {
  margin-left: 0 !important;
  margin-right: auto !important;
}

.form-actions .btn-primary,
.form-actions button[type="submit"] {
  background-image: none !important;
  background: var(--accent) !important;
  box-shadow: none !important;
}

#contentInput::placeholder,
.editor-pane textarea::placeholder {
  color: var(--text-tertiary) !important;
  opacity: 0.7;
}

/* 详情页：正文列收紧，目录贴近 */
.detail-layout {
  grid-template-columns: minmax(0, 640px) 200px !important;
  justify-content: start !important;
  column-gap: clamp(28px, 3.4vw, 56px) !important;
  padding-top: 30px !important;
}

.article-body {
  max-width: none !important;
}

/* 响应式补充 */
@media (max-width: 1100px) {
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 720px) {
  .article-card {
    grid-template-columns: 104px minmax(0, 1fr) !important;
  }

  .card-cover {
    width: 104px !important;
    height: 104px !important;
  }

  .link-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .links-search .search-wrapper {
    max-width: none;
  }

  .manage-entry-btn {
    height: 44px;
    padding: 0 14px;
  }

  .manage-entry-btn span {
    display: none;
  }
}

/* ============================================================
   对齐收口
   ============================================================ */
.links-content,
.publish-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.links-search {
  margin: 0 0 18px !important;
  justify-content: flex-start !important;
}

.links-search .search-wrapper {
  margin: 0 !important;
}

@media (max-width: 720px) {
  .links-content,
  .publish-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ============================================================
   移动端溢出收口
   ============================================================ */
.article-card,
.card-body,
.card-title,
.card-title-link {
  min-width: 0;
}

.card-title {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .sidebar-profile {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .profile-bio {
    max-width: 100%;
  }

  .sidebar-categories {
    display: block !important;
  }

  .sidebar-categories a {
    padding: 11px 0 !important;
  }

  .article-card {
    grid-template-columns: 96px minmax(0, 1fr) !important;
  }

  .card-cover {
    width: 96px !important;
    height: 96px !important;
  }

  .card-title {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }

  .card-excerpt {
    font-size: 0.82rem !important;
  }

  .filter-pill,
  .cat-pill {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
  }
}

/* 工具页下拉：去掉系统深色渲染 */
.toolbar-sort select {
  color-scheme: light !important;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 30px !important;
}

[data-theme="dark"] .toolbar-sort select {
  color-scheme: dark !important;
}

.toolbar-search input {
  height: 46px !important;
  border-radius: 12px !important;
}

@media (max-width: 720px) {
  .card-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    overflow: hidden !important;
  }

  .card-excerpt {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    overflow: hidden !important;
  }

  .sidebar-categories a {
    padding: 8px 0 !important;
  }
}

/* ============================================================
   第五层：对比度与移动端细节
   ============================================================ */

/* 表单控件：浅灰底 + 清晰描边（白底白框在白卡上看不见） */
.form-group input,
.form-group select,
.form-group textarea,
.article-form input,
.article-form select,
.article-form textarea {
  background: #f5f5f8 !important;
  border: 1px solid rgba(18, 18, 28, 0.12) !important;
  color: #14141a !important;
  box-shadow: none !important;
  border-radius: 12px !important;
  min-height: 46px;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.article-form input::placeholder,
.article-form textarea::placeholder {
  color: rgba(20, 20, 26, 0.42) !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.article-form input:focus,
.article-form select:focus,
.article-form textarea:focus {
  background: #ffffff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .article-form input,
[data-theme="dark"] .article-form select,
[data-theme="dark"] .article-form textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f2f2f7 !important;
}

/* 标签输入：去掉内层二次描边 */
.tags-input-wrapper {
  background: #f5f5f8 !important;
  border: 1px solid rgba(18, 18, 28, 0.12) !important;
  border-radius: 12px !important;
  min-height: 46px !important;
  padding: 8px 12px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 6px;
}

.tags-input-wrapper .form-input,
.tags-input-wrapper input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 28px !important;
  padding: 2px 4px !important;
  flex: 1 1 100px;
}

[data-theme="dark"] .tags-input-wrapper {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

/* 表单卡片：加一点投影脱离背景 */
.form-card {
  box-shadow: 0 1px 2px rgba(18, 18, 28, 0.04), 0 12px 32px -24px rgba(18, 18, 28, 0.18) !important;
}

[data-theme="dark"] .form-card {
  box-shadow: none !important;
}

/* 详情页移动端：去掉密集横线，评论表单整行 */
@media (max-width: 720px) {
  .article-content h2,
  .article-body h2 {
    border-top: 0 !important;
    padding-top: 0 !important;
    margin-top: 30px !important;
  }

  .comment-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .comment-form input,
  .comment-form textarea {
    width: 100% !important;
    border-radius: 12px !important;
    min-height: 46px;
  }

  .comment-form button {
    width: 100% !important;
    justify-content: center;
    border-radius: 12px !important;
    min-height: 44px;
  }
}

/* ============================================================
   第六层：不依赖变量的显式配color（工具页下拉等）
   ============================================================ */
[data-theme="light"] .toolbar-sort select {
  background-color: #ffffff !important;
  color: #14141a !important;
  border-color: rgba(18, 18, 28, 0.12) !important;
  color-scheme: light !important;
}

[data-theme="dark"] .toolbar-sort select {
  background-color: #17171f !important;
  color: #f2f2f7 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color-scheme: dark !important;
}

[data-theme="light"] .toolbar-search input {
  background-color: #ffffff !important;
  color: #14141a !important;
  border-color: rgba(18, 18, 28, 0.1) !important;
}

[data-theme="light"] .toolbar-search input::placeholder {
  color: rgba(20, 20, 26, 0.42) !important;
}

/* 正文编辑器底色 */
[data-theme="light"] #contentInput,
[data-theme="light"] .editor-pane textarea {
  background: #f5f5f8 !important;
  color: #14141a !important;
}

[data-theme="light"] #contentInput::placeholder {
  color: rgba(20, 20, 26, 0.4) !important;
}

/* 工具页排序控件：圆角高度与搜索框统一 */
.toolbar-sort select {
  height: 46px !important;
  border-radius: 12px !important;
}

/* 详情页兜底态：消掉被 4rem 图标撑大的按钮，标题别太窄 */
.not-found a i {
  font-size: 1rem !important;
  margin: 0 !important;
}

.not-found a {
  border-radius: 10px !important;
  padding: 0 22px !important;
  height: 44px !important;
}

.not-found {
  padding: 72px 20px 88px !important;
}

/* ============================================================
   第八层：毛玻璃质感 / 详情阅读 / 列表卡片 / 空状态
   ============================================================ */

/* ---------- 背景光斑：给毛玻璃一点可模糊的东西 ---------- */
body {
  background-image:
    radial-gradient(760px 460px at 12% -6%, rgba(99, 102, 241, 0.16), transparent 62%),
    radial-gradient(620px 420px at 88% 2%, rgba(56, 189, 248, 0.1), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(760px 460px at 12% -6%, rgba(99, 102, 241, 0.1), transparent 62%),
    radial-gradient(620px 420px at 88% 2%, rgba(56, 189, 248, 0.07), transparent 60%);
}

/* ---------- 通用玻璃面：只在“浮在内容上”的组件上用 ---------- */
.toolbar-bar,
.search-bar,
.links-search,
.tool-viewer-bar,
.article-actions,
.comment-input-wrapper,
.toc-card,
.sidebar-card,
.form-card,
.tool-card,
.manage-panel {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* 深色：半透明深底 + 顶部高光 */
.toolbar-bar,
.search-bar,
.links-search,
.article-actions,
.comment-input-wrapper,
.toc-card,
.sidebar-card,
.form-card,
.tool-card {
  background: rgba(20, 20, 30, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -28px rgba(0, 0, 0, 0.6);
}

/* 浅色：半透明白底 + 灰描边 */
[data-theme="light"] .toolbar-bar,
[data-theme="light"] .search-bar,
[data-theme="light"] .links-search,
[data-theme="light"] .article-actions,
[data-theme="light"] .comment-input-wrapper,
[data-theme="light"] .toc-card,
[data-theme="light"] .sidebar-card,
[data-theme="light"] .form-card,
[data-theme="light"] .tool-card {
  background: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid rgba(18, 18, 28, 0.08) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -28px rgba(18, 18, 28, 0.22);
}

/* 搜索框内部保持轻描边层次 */
.search-bar,
.links-search,
.toolbar-bar {
  padding: 10px 12px !important;
}

/* 不支持 backdrop-filter 的老浏览器：给实底兜底 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .toolbar-bar,
  .search-bar,
  .links-search,
  .article-actions,
  .comment-input-wrapper,
  .toc-card,
  .sidebar-card,
  .form-card,
  .tool-card {
    background: var(--bg-secondary) !important;
  }
}

/* ---------- 文章列表：去掉全宽横线，改成“轻玻璃条目” ---------- */
.article-grid .article-card {
  border-bottom: 0 !important;
  border-radius: 14px !important;
  padding: 20px 14px !important;
  margin: 0 -14px;
  transition: background 0.22s var(--pg-ease), transform 0.22s var(--pg-ease);
}

.article-grid .article-card + .article-card {
  margin-top: 2px;
}

.article-grid .article-card:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="light"] .article-grid .article-card:hover {
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 12px 30px -26px rgba(18, 18, 28, 0.4);
}

.article-grid .article-card:hover .card-cover img {
  transform: scale(1.04);
}

/* ---------- 详情页：正文列贴内容宽度，不再留 200px 空白 ---------- */
.detail-layout {
  grid-template-columns: minmax(0, 700px) 228px !important;
  justify-content: start;
  gap: clamp(32px, 4vw, 64px) !important;
  padding: clamp(26px, 3.2vw, 40px) 0 72px !important;
}

.detail-main {
  min-width: 0;
  max-width: 720px;
}

.article-body {
  max-width: 100% !important;
  font-size: 1.02rem;
  line-height: 1.86;
}

/* 章标题：细线改为短规则线，更贴着正文 */
.article-body h2 {
  margin: 1.9em 0 0.62em !important;
  padding-top: 1.1em !important;
  border-top: 1px solid var(--pg-line) !important;
}

.article-body h2:first-child {
  border-top: 0 !important;
  padding-top: 0 !important;
  margin-top: 0.2em !important;
}

.article-body h3 {
  margin: 1.5em 0 0.45em !important;
}

.article-body p {
  margin: 0 0 1.05em !important;
}

/* 列表、表格内的呼吸更紧 */
.article-body ul,
.article-body ol {
  margin: 0 0 1.1em !important;
  padding-left: 1.25em !important;
}

.article-body li {
  margin-bottom: 0.42em;
}

.article-body pre {
  margin: 1.2em 0 !important;
  padding: 16px 18px !important;
}

/* 目录卡：玻璃卡 + 左侧竖条当前项 */
.toc-card {
  border-left: 0 !important;
  padding: 16px 14px !important;
  border-radius: 16px !important;
}

.toc-list a,
.toc-card a {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  border-left: 2px solid transparent;
  transition: color 0.16s var(--pg-ease), background 0.16s var(--pg-ease);
}

.toc-list a:hover,
.toc-card a:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .toc-list a:hover,
[data-theme="light"] .toc-card a:hover {
  background: rgba(18, 18, 28, 0.04);
}

.toc-list a.active,
.toc-card a.active {
  color: var(--text-primary) !important;
  background: var(--accent-light) !important;
  border-left-color: var(--accent) !important;
}

/* 操作条：玻璃条，不再满宽散着 */
.article-actions {
  margin: 30px 0 4px !important;
  padding: 10px 12px !important;
  gap: 8px;
}

.article-actions .action-btn {
  border: 0 !important;
  background: transparent !important;
  border-radius: 10px !important;
  height: 38px;
  padding: 0 12px !important;
  transition: background 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.article-actions .action-btn:hover {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
}

/* ---------- 上一篇 / 下一篇 ---------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 26px 0 0;
}

.post-nav:empty {
  display: none;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s var(--pg-ease), background 0.2s var(--pg-ease), transform 0.2s var(--pg-ease);
}

[data-theme="light"] .post-nav-item {
  background: rgba(255, 255, 255, 0.7);
}

.post-nav-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

.post-nav-item.is-empty {
  border: 0;
  background: none;
  padding: 0;
}

.post-nav-label {
  font-family: var(--pg-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.post-nav-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-item:nth-child(2) {
  text-align: right;
}

.post-nav-item:nth-child(2) .post-nav-label,
.post-nav-item:nth-child(2) .post-nav-title {
  align-self: flex-end;
}

/* ---------- 相关文章 ---------- */
.related-posts {
  margin: 34px 0 0;
}

.related-posts:empty {
  display: none;
}

.related-title {
  font-family: var(--pg-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.2s var(--pg-ease), background 0.2s var(--pg-ease);
}

.related-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.related-cat {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.related-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 500;
}

/* ---------- 评论区：输入玻璃条 + 头像 + 删除按钮 ---------- */
.comment-input-wrapper {
  display: flex !important;
  gap: 8px;
  padding: 8px !important;
  border-radius: 14px !important;
  margin-bottom: 6px;
}

.comment-input-wrapper input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 100%;
}

.comment-item .comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-item .author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  margin-right: 2px;
}

.comment-item .comment-del {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  opacity: 0.6;
  transition: opacity 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.comment-item .comment-del:hover {
  opacity: 1;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ---------- 空状态收紧 ---------- */
.empty-state {
  padding: 44px 20px !important;
  min-height: 0 !important;
}

.empty-state i {
  font-size: 2rem !important;
  margin-bottom: 12px !important;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.06rem !important;
  margin-bottom: 6px !important;
}

.empty-state p {
  font-size: 0.86rem !important;
  max-width: 340px;
  margin: 0 auto;
  color: var(--text-tertiary);
}

/* ---------- 移动端：详情单列，导航条收窄 ---------- */
@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .detail-main {
    max-width: 100%;
  }

  .toc-sidebar {
    display: none !important;
  }

  .article-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-item:nth-child(2) {
    text-align: left;
  }

  .post-nav-item:nth-child(2) .post-nav-label,
  .post-nav-item:nth-child(2) .post-nav-title {
    align-self: flex-start;
  }
}

.not-found i {
  font-size: 2.5rem !important;
}

@media (min-width: 721px) {
  .article-banner-title {
    max-width: 30ch;
  }
}

/* ---------- 页脚管理入口（极轻，不打扰访客） ---------- */
.admin-entry {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  opacity: 0.55;
  transition: opacity 0.16s var(--pg-ease), color 0.16s var(--pg-ease);
}

.admin-entry:hover {
  opacity: 1;
  color: var(--accent);
}

/* ---------- 侧栏玻璃卡修正：内边距与间距（原先左右 padding 为 0） ---------- */
.sidebar {
  gap: 12px !important;
}

.sidebar-card,
.sidebar-card:first-child {
  padding: 18px 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
}

[data-theme="light"] .sidebar-card,
[data-theme="light"] .sidebar-card:first-child {
  border: 1px solid rgba(18, 18, 28, 0.08) !important;
}

/* 分类/标签行在玻璃卡里贴一点边 */
.sidebar-card .category-item,
.sidebar-card .tag-item {
  padding-left: 4px !important;
  padding-right: 4px !important;
}

/* ---------- 列表卡片负边距只在桌面用，避免移动端横向溢出 ---------- */
@media (max-width: 960px) {
  .article-grid .article-card {
    margin: 0 !important;
    padding: 18px 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }

  .article-grid .article-card:hover {
    background: none !important;
    box-shadow: none !important;
  }
}

/* ---------- 工具栏玻璃条布局修正 ---------- */
.toolbar-bar {
  padding: 12px 14px !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  overflow: visible !important;
}

.toolbar-search {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.toolbar-search input {
  width: 100% !important;
  box-sizing: border-box;
}

.toolbar-sort {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toolbar-sort > span {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

@media (max-width: 720px) {
  .toolbar-bar {
    flex-wrap: wrap !important;
  }

  .toolbar-sort {
    width: 100%;
    justify-content: space-between;
  }
}

/* 空状态再收一点 */
.empty-state {
  padding: 30px 20px !important;
}

.empty-state i {
  margin-bottom: 8px !important;
}

/* ---------- 链接页搜索：玻璃只包住输入框，不要拉成空条 ---------- */
.links-search {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.links-search .search-wrapper {
  max-width: 600px !important;
  width: 100%;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -28px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .links-search .search-wrapper {
  border: 1px solid rgba(18, 18, 28, 0.08);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -28px rgba(18, 18, 28, 0.22);
}

.links-search .search-wrapper input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  max-width: 100% !important;
}

/* 访客态：管理元素一律不可见（双保险） */
.admin-only[data-admin-hidden] {
  display: none !important;
}

/* ---------- 链接页搜索：收敛成一条居中玻璃条 ---------- */
.links-search {
  max-width: 600px !important;
  width: 100% !important;
  margin: 0 0 26px !important;
  padding: 6px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(20, 20, 30, 0.55) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -28px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="light"] .links-search {
  border: 1px solid rgba(18, 18, 28, 0.08) !important;
  background: rgba(255, 255, 255, 0.62) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -28px rgba(18, 18, 28, 0.22) !important;
}

.links-search .search-wrapper {
  flex: 1 1 auto !important;
  max-width: 100% !important;
  width: 100% !important;
  background: none !important;
}

.links-search .search-wrapper input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* ============================================
   移动端精修（内容页 ≤720px）
   ============================================ */
@media (max-width: 720px) {
  /* 正文可读性：字号回归 16px，行高放开，长内容不再挤成一段 */
  .article-body,
  .markdown-body {
    font-size: 16px !important;
    line-height: 1.95 !important;
    padding-left: 2px;
    padding-right: 2px;
  }

  .article-body p { margin: 0 0 1.15em; }
  .article-body h2 { font-size: 1.28rem; margin: 2em 0 0.75em; }
  .article-body h3 { font-size: 1.08rem; margin: 1.6em 0 0.6em; }
  .article-body ul, .article-body ol { padding-left: 1.4em; }

  .article-body pre,
  .markdown-body pre {
    padding: 14px 16px;
    font-size: 0.8rem;
    line-height: 1.7;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .article-body code { word-break: break-word; }

  .article-body table,
  .markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .article-body img,
  .markdown-body img { max-width: 100%; height: auto; border-radius: 12px; }

  /* 单列，别把工具/链接挤成两列小方块 */
  .tools-grid,
  .link-grid { grid-template-columns: 1fr !important; }

  .tool-card, .link-card { padding: 16px 18px; }

  /* 文章页操作按钮更好按 */
  .article-actions .action-btn,
  .article-actions .action-btn a { min-height: 44px; }

  /* 卡片操作按钮（编辑/删除）加大触摸区 */
  .card-action-btn { width: 34px !important; height: 34px !important; }

  .post-nav { grid-template-columns: 1fr !important; gap: 12px !important; }

  .page-banner,
  .article-banner { height: auto !important; min-height: 190px !important; }

  .section-padding { padding: 44px 0 !important; }
  .section-header { margin-bottom: 18px; }
  .section-title { font-size: 1.35rem; }
}

/* ============================================================
   详情页阅读体验（2026.11 第四轮）
   ============================================================ */

/* 顶部阅读进度条 */
.read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pg-accent), #a855f7);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
  transition: width 0.1s linear;
}

/* 阅读条：字数/时长 + 复制链接 */
.reading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 22px;
  padding: 10px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-surface);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.reading-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pg-mono);
  letter-spacing: 0.02em;
}
.reading-tools { display: inline-flex; gap: 6px; }
.reading-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--pg-line);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.16s var(--pg-ease), border-color 0.16s var(--pg-ease), background 0.16s var(--pg-ease);
}
.reading-share:hover {
  color: var(--text-primary);
  border-color: var(--pg-line-strong);
}
.reading-share:active { transform: scale(0.97); }
.reading-share i { font-size: 0.72rem; }

/* 代码块复制按钮 */
.article-body pre { position: relative; }
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #e5e7eb;
  font-size: 0.7rem;
  font-family: var(--pg-mono);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease;
}
.article-body pre:hover .code-copy { opacity: 1; }
.code-copy:hover { background: rgba(99, 102, 241, 0.7); }
.code-copy.is-copied {
  background: rgba(34, 197, 94, 0.75);
  border-color: transparent;
}

/* 图片点击放大 */
.article-body img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  cursor: zoom-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

/* 评论冷却提示 */
.comment-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}
.comment-submit-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 720px) {
  .reading-bar { margin-bottom: 16px; }
  .code-copy { opacity: 1; }
}

/* ============================================================
   交互手感（2026.11 第四轮补）
   目标：不只是「点得通」，点下去有反馈、换页有过渡、筛选不闪
   ============================================================ */

/* 1. 按压反馈：按钮类元素统一 0.16s 过渡 + 按下微缩 */
:where(.btn, .btn-primary, .btn-ghost, .btn-submit, .pill, .action-btn,
       .reading-share, .card-action-btn, .theme-toggle, .nav-link,
       .btn-preview, .btn-open, .btn-add-tool, .cat-add-btn) {
  transition: transform 0.16s var(--pg-ease),
              background-color 0.16s var(--pg-ease),
              border-color 0.16s var(--pg-ease),
              color 0.16s var(--pg-ease),
              box-shadow 0.16s var(--pg-ease);
}
:where(.pill, .action-btn, .reading-share, .card-action-btn,
       .btn-preview, .btn-open, .cat-add-btn):active {
  transform: scale(0.97);
}

/* 2. 跨页切换过渡：支持的浏览器（Edge/Chrome）自动淡入淡出，
   不支持的直接忽略，不影响原有行为 */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: vt-fade-out 0.16s ease both;
}
::view-transition-new(root) {
  animation: vt-fade-in 0.22s ease both;
}
@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 3. 筛选/排序时列表轻微淡换，避免硬切 */
#articleGrid,
.tools-grid,
.links-grid,
#linksContainer {
  transition: opacity 0.18s ease;
}
#articleGrid.is-swapping,
.tools-grid.is-swapping,
.links-grid.is-swapping,
#linksContainer.is-swapping {
  opacity: 0.5;
}

/* 4. 正文锚点跳转别被固定导航挡住 */
.article-body h2,
.article-body h3,
.article-body h4,
.toc-item,
.toc-link {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  #articleGrid, .tools-grid, .links-grid { transition: none; }
}
/* 工具卡片：整块可点（点卡片正文直接开工具页，底部按钮各管各的） */
.tool-card-hit {
  display: block;
  color: inherit;
  text-decoration: none;
}
.tool-card-hit .tool-title,
.tool-card-hit .tool-desc,
.tool-card-hit .tool-meta { color: inherit; }
.tool-card:hover {
  border-color: var(--pg-line-strong) !important;
  transform: translateY(-2px);
}
.tool-card:focus-within {
  border-color: var(--pg-accent) !important;
}

/* ============================================
   不存在（404）状态：页头收窄，不留一大块空图
   ============================================ */
body.is-notfound .page-banner,
body.is-notfound .article-banner,
body.is-notfound .page-hero {
  min-height: 150px !important;
  padding: 26px 0 22px !important;
}
body.is-notfound .page-banner::after,
body.is-notfound .article-banner::after,
body.is-notfound .page-hero::after {
  opacity: 0.5;
}
/* 不存在时，这些「有文章才有意义」的部件一律不显示（用 !important 压过内联/组件样式） */
body.is-notfound #articleActions,
body.is-notfound #readingBar,
body.is-notfound #readingInfo,
body.is-notfound #commentsSection,
body.is-notfound #tocSidebar,
body.is-notfound #bannerMeta,
body.is-notfound .article-actions,
body.is-notfound .reading-tools,
body.is-notfound .toc-sidebar {
  display: none !important;
}
/* ============================================================
   第五轮（v1.2.5）：内页对比度与视觉精修
   问题来源：浅色主题下次级/三级文字偏灰、卡片边界太弱、
   标签与分组标题几乎看不见、详情正文行宽过长。
   思路：先统一提一档对比度变量，再逐个组件收边、加层次。
   ============================================================ */

/* ---------- 1. 颜色令牌：对比度整体提一档 ---------- */
[data-theme="light"] {
  --text-secondary: #475467;          /* 4.5:1 → 7.4:1 */
  --text-tertiary: #5f6b7a;           /* 3.0:1 → 6.2:1 */
  --border-color: rgba(16, 24, 40, 0.12);
  --border-hover: rgba(16, 24, 40, 0.22);
  --bg-tertiary: #e6e8ef;
  --bg-hover: #edf0f6;
  --pg-line: rgba(16, 24, 40, 0.11);
  --pg-line-strong: rgba(16, 24, 40, 0.22);
  --scrollbar-thumb: #c2c6d2;
}

html:not([data-theme="light"]) {
  --text-secondary: #b9b9c8;
  --text-tertiary: #9494a6;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.24);
  --bg-hover: #22223e;
  --pg-line: rgba(255, 255, 255, 0.10);
  --pg-line-strong: rgba(255, 255, 255, 0.22);
}

/* ---------- 2. 页头：眉标与副标题不再发飘 ---------- */
.page-banner-subtitle::before,
.hero-subtitle::before {
  color: var(--text-secondary) !important;
  letter-spacing: 0.18em;
  font-weight: 500;
}

.page-banner-subtitle,
.hero-subtitle {
  font-weight: 500 !important;
  letter-spacing: 0.01em;
}

/* ---------- 3. 卡片：一层细边 + 一层落影，浮在页面之上 ---------- */
.article-card,
.tool-card,
.link-card,
.sidebar-card,
.related-card {
  border: 1px solid var(--border-color) !important;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 12px 28px -22px rgba(16, 24, 40, 0.30);
  transition: border-color 0.18s var(--pg-ease),
              box-shadow 0.18s var(--pg-ease),
              transform 0.18s var(--pg-ease);
}

html:not([data-theme="light"]) .article-card,
html:not([data-theme="light"]) .tool-card,
html:not([data-theme="light"]) .link-card,
html:not([data-theme="light"]) .sidebar-card,
html:not([data-theme="light"]) .related-card {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 14px 30px -22px rgba(0, 0, 0, 0.85);
}

.article-card:hover,
.tool-card:hover,
.link-card:hover {
  border-color: var(--border-hover) !important;
  box-shadow:
    0 2px 6px rgba(16, 24, 40, 0.06),
    0 18px 38px -24px rgba(16, 24, 40, 0.34);
  transform: translateY(-2px);
}

/* 卡片里的文字：标题压重、摘要压暗、元信息别再灰得看不见 */
.card-title,
.tool-title,
.link-card-title {
  font-weight: 650 !important;
  letter-spacing: -0.012em;
  color: var(--text-primary) !important;
}

.card-excerpt {
  color: var(--text-secondary) !important;
  line-height: 1.72 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date,
.card-meta,
.card-likes,
.tool-meta,
.tool-desc,
.link-card-desc {
  color: var(--text-secondary) !important;
}

.card-date i,
.card-meta i,
.tool-meta i {
  opacity: 0.85;
}

/* 分类小标签：浅底细边，不再是一抹淡紫 */
.card-category,
.meta-category {
  color: var(--accent) !important;
  background: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.22);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- 4. 筛选胶囊 / 标签：边界清楚，选中一眼可见 ---------- */
.filter-pill:not(.active),
.cat-pill:not(.active) {
  color: var(--text-secondary) !important;
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

.filter-pill:not(.active):hover,
.cat-pill:not(.active):hover {
  border-color: var(--border-hover) !important;
  color: var(--text-primary) !important;
}

.tag-cloud .tag,
.tag {
  color: var(--text-secondary) !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
}

.tag-cloud .tag:hover,
.tag:hover {
  color: var(--accent) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  background: var(--accent-light) !important;
}

/* ---------- 5. 侧栏：标题实一点，条目清楚一点 ---------- */
.sidebar-card-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  letter-spacing: -0.006em;
}

.profile-name,
.sidebar-profile .profile-name {
  color: var(--text-primary) !important;
  font-weight: 650;
}

.profile-bio {
  color: var(--text-secondary) !important;
  line-height: 1.62;
}

.sidebar-categories a,
.sidebar-categories li,
.sidebar-categories .cat-name {
  color: var(--text-secondary) !important;
}

.sidebar-categories a:hover {
  color: var(--text-primary) !important;
}

.sidebar-categories .cat-count {
  color: var(--text-tertiary) !important;
}

/* "共 N 篇" 这类小计数 */
.articles-info,
.articles-info .count {
  color: var(--text-secondary) !important;
}

.articles-info strong,
.articles-info .count strong {
  color: var(--text-primary) !important;
  font-weight: 650;
}

/* ---------- 6. 链接页：分组标题从"几乎不存在"到看得清 ---------- */
.link-section-title {
  color: var(--text-primary) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.006em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pg-line);
}

/* ---------- 7. 详情页：正文收窄、行距放松、目录变清楚 ---------- */
/* 正文列宽：700px 的中文一行接近 43 字，读起来偏累；收到 660px 约 40 字 */
.detail-main {
  max-width: 660px !important;
}

.article-body {
  max-width: 100% !important;
}

.article-body p,
.article-body li,
.markdown-body p,
.markdown-body li {
  color: var(--text-primary) !important;
  line-height: 1.88;
}

.markdown-body p {
  margin-bottom: 1.15em;
}

.article-body li::marker,
.markdown-body li::marker {
  color: var(--accent);
}

.article-body h2,
.article-body h3,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text-primary) !important;
  letter-spacing: -0.014em;
}

.toc-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.toc-item a,
.toc-list a {
  color: var(--text-secondary) !important;
  line-height: 1.7;
}

.toc-item a:hover,
.toc-list a:hover,
.toc-item.active a,
.toc-list a.active {
  color: var(--accent) !important;
}

/* 阅读条里的次要按钮 */
.reading-share {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

.reading-share:hover {
  color: var(--text-primary) !important;
  border-color: var(--border-hover) !important;
}

.reading-info {
  color: var(--text-secondary) !important;
}

/* 上一篇 / 下一篇：保留左右分列，只把边界和文字说清楚 */
.post-nav {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

.post-nav .post-nav-item:empty {
  display: none !important;
}

.post-nav .post-nav-item {
  border-color: var(--border-color) !important;
  text-align: left !important;
  align-items: flex-start !important;
  transition: border-color 0.18s var(--pg-ease), transform 0.18s var(--pg-ease);
}

/* 只有一篇时让卡片铺满整行，两篇时并排两列、都左对齐 */
.post-nav .post-nav-item .post-nav-label,
.post-nav .post-nav-item .post-nav-title {
  align-self: flex-start !important;
  text-align: left !important;
}

.post-nav .post-nav-item:hover {
  border-color: var(--border-hover) !important;
  transform: translateY(-1px);
}

.post-nav-label {
  color: var(--text-tertiary) !important;
  letter-spacing: 0.06em;
}

.post-nav-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* 同类文章 */
.related-title {
  color: var(--text-primary) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.006em;
}

.related-card {
  background: var(--bg-card);
}

.related-name {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.related-cat {
  color: var(--text-secondary) !important;
}

/* ---------- 8. 表单 / 搜索 / 下拉：focus 有明确反馈 ---------- */
.toolbar-search input,
.toolbar-sort select,
.search-bar input,
.link-search input,
.form-group input,
.form-group textarea,
.form-group select {
  border-color: var(--border-color) !important;
  color: var(--text-primary);
}

.toolbar-search input:focus,
.toolbar-sort select:focus,
.search-bar input:focus,
.link-search input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(99, 102, 241, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
  outline: none;
}

.toolbar-sort > span,
.toolbar-sort label {
  color: var(--text-secondary) !important;
}

/* ---------- 9. 页脚：三行字别再淡到看不清 ---------- */
.footer-copy,
.footer-powered {
  color: var(--text-secondary) !important;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-version {
  color: var(--text-tertiary) !important;
  opacity: 1 !important;
  font-weight: 500;
}

/* ---------- 10. 密码弹层：模糊轻一点，别把整页糊掉 ---------- */
.admin-gate {
  background: rgba(10, 12, 20, 0.5) !important;
  backdrop-filter: blur(3px) !important;
  -webkit-backdrop-filter: blur(3px) !important;
}

.admin-gate-card {
  box-shadow: 0 24px 70px -20px rgba(10, 12, 20, 0.55) !important;
}

/* ---------- 11. 移动端：筛选项好点，正文不挤 ---------- */
@media (max-width: 720px) {
  .filter-pill,
  .cat-pill {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .article-body {
    max-width: 100%;
  }

  .card-excerpt {
    -webkit-line-clamp: 3;
  }
}
/* ---------- 12. 次要按钮 / 空状态：别用"看不见"的灰 ---------- */
.btn-preview {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
  background: var(--bg-card) !important;
}

.btn-preview:hover {
  color: var(--text-primary) !important;
  border-color: var(--border-hover) !important;
  background: var(--bg-hover) !important;
}

.card-action-btn,
.comment-del {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

.card-action-btn:hover,
.comment-del:hover {
  color: var(--accent) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
}

.empty-state {
  color: var(--text-secondary) !important;
}

.empty-state p {
  color: var(--text-secondary) !important;
  font-size: 0.92rem;
}

.empty-state i {
  color: var(--text-tertiary) !important;
  opacity: 0.9;
}
/* ---------- 13. 详情页的几块白卡：统一收边 ---------- */
.toc-card,
.reading-bar,
.article-actions,
.comment-input-wrapper {
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

html:not([data-theme="light"]) .toc-card,
html:not([data-theme="light"]) .reading-bar,
html:not([data-theme="light"]) .article-actions {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
/* ---------- 14. 移动端：评论区表单改成上下排，别把按钮挤成一坨 ---------- */
@media (max-width: 720px) {
  .comment-input-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .comment-input-wrapper input {
    width: 100% !important;
    height: 44px !important;
    padding: 0 16px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 999px !important;
    background: var(--bg-secondary) !important;
  }

  .comment-input-wrapper .comment-submit-btn {
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
  }

  /* 列表卡片右侧不再顶死圆角 */
  .article-grid .article-card {
    padding-right: 10px !important;
  }
}

/* ---------- 15. 移动端：详情报头与留白收紧 ---------- */
@media (max-width: 720px) {
  .article-banner-title {
    font-size: 1.5rem !important;
    line-height: 1.34 !important;
    letter-spacing: -0.01em;
  }

  .reading-bar {
    padding: 8px 12px !important;
  }

  .related-card {
    padding: 12px 14px !important;
  }

  .comments-section {
    margin-top: 28px !important;
  }
}
/* ---------- 16. 回到顶部（长页面才浮出来） ---------- */
.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: 0 10px 26px -16px rgba(16, 24, 40, 0.5);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.22s var(--pg-ease), transform 0.22s var(--pg-ease),
    border-color 0.18s var(--pg-ease), color 0.18s var(--pg-ease);
  z-index: 48;
  cursor: pointer;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: none;
}

html:not([data-theme="light"]) .back-to-top {
  background: rgba(24, 24, 40, 0.86);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.9);
}

@media (max-width: 720px) {
  .back-to-top {
    width: 40px;
    height: 40px;
    right: 12px;
    /* 挪高一点，别压住底部的输入框和按钮 */
    bottom: 84px;
  }
}
/* ---------- 17. 工具卡的两个按钮：等高、同圆角，别一大一小 ---------- */
.tool-actions {
  gap: 10px !important;
  margin-top: 14px;
}

.tool-actions .btn-open {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px -12px rgba(99, 102, 241, 0.8);
}

.tool-actions .btn-open:hover {
  box-shadow: 0 10px 22px -12px rgba(99, 102, 241, 0.9);
}

.tool-actions .btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  font-weight: 500 !important;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .tool-actions .btn-open {
    flex: 1 1 auto;
    height: 40px;
    font-size: 0.86rem !important;
  }

  .tool-actions .btn-preview {
    height: 40px;
    padding: 0 14px !important;
    font-size: 0.82rem !important;
  }
}
/* ---------- 18. 首页 hero：图片底上必须是白字 ----------
   全局那条 .hero-title{color:var(--text-primary)} 是给浅底页面用的，
   在首页（满屏雪山图）会把标题写成近黑色，等于看不见。这里按图片底救回来。 */
.hero.banner-carousel .hero-title {
  color: #ffffff !important;
  text-shadow: 0 2px 24px rgba(6, 8, 14, 0.45), 0 1px 3px rgba(6, 8, 14, 0.5);
}

.hero.banner-carousel .hero-title .accent {
  color: #c4c0ff !important;
}

.hero.banner-carousel .hero-subtitle {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 12px rgba(6, 8, 14, 0.45);
}

.hero.banner-carousel .hero-subtitle::before {
  color: rgba(255, 255, 255, 0.72) !important;
  text-shadow: 0 1px 10px rgba(6, 8, 14, 0.45);
}

/* 轮播切换时文字也别闪成黑 */
.hero.banner-carousel .hero-content,
.hero.banner-carousel .carousel-content {
  color: #fff;
}

@media (max-width: 720px) {
  .hero.banner-carousel .hero-title {
    font-size: clamp(2rem, 11vw, 2.6rem) !important;
  }

  .hero.banner-carousel .hero-subtitle {
    font-size: 0.9rem !important;
    margin-top: 12px !important;
  }
}
/* ---------- 19. 首页：深色大图上，未滚动的导航也得是白字 ----------
   浅色主题下 navbar 是半透明白底，压在深色图上就成了"浅灰蒙层 + 深灰字"，
   "首页"这种 active 白字反而看不见。这里在首页顶部统一成深玻璃 + 白字。 */
body:has(.hero.banner-carousel) .navbar:not(.scrolled) {
  background: rgba(10, 12, 18, 0.32) !important;
  border-bottom-color: transparent !important;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

body:has(.hero.banner-carousel) .navbar:not(.scrolled) .navbar-logo,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .navbar-logo span,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .nav-link,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .theme-toggle,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .hamburger {
  color: #ffffff !important;
}

body:has(.hero.banner-carousel) .navbar:not(.scrolled) .nav-link {
  opacity: 0.82;
}

body:has(.hero.banner-carousel) .navbar:not(.scrolled) .nav-link:hover,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .nav-link.active {
  opacity: 1;
  color: #ffffff !important;
}

/* 图标也要跟着翻白（FA 图标颜色继承自按钮） */
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .theme-toggle i,
body:has(.hero.banner-carousel) .navbar:not(.scrolled) .hamburger i {
  color: #ffffff !important;
}

/* "向下滚动"这个提示原本是浅灰，落在亮海面上同样看不清 */
body:has(.hero.banner-carousel) .scroll-indicator,
body:has(.hero.banner-carousel) .scroll-indicator span,
body:has(.hero.banner-carousel) .scroll-indicator i {
  color: rgba(255, 255, 255, 0.78) !important;
  text-shadow: 0 1px 12px rgba(6, 8, 14, 0.5);
}
/* ---------- 20. 首页移动端：两个入口按钮并排等宽，别一上一下凑不齐 ---------- */
@media (max-width: 720px) {
  .hero.banner-carousel .hero-buttons {
    flex-direction: row !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    justify-content: center;
    gap: 10px !important;
    width: 100%;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero.banner-carousel .hero-buttons .btn-primary,
  .hero.banner-carousel .hero-buttons .btn-outline {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 13px 10px !important;
    font-size: 0.88rem !important;
    white-space: nowrap;
  }

  .hero.banner-carousel .hero-subtitle {
    margin-bottom: 26px !important;
  }
}