/*
 * hair-theme.css —— biquge.hair「武侠江湖分站」内页专属主题（水墨宣纸）
 * 全部规则 scoped 在 html.theme-hair 之下：未激活时完全惰性，绝不影响其余 13 个域。
 * 仅覆盖内页（分类/榜单/详情/阅读器/会员/历史/登录）；首页由 frontend/hair/index.html 自包含处理。
 * 设计语言与首页一致：暖宣纸底 + 浓墨正文 + 朱砂印章红强调 + 竹青次强调 + 楷体 display。
 * 阅读器改暖宣纸护眼（墨色宋楷正文，舒适行高），非暗底。
 * 无外链资源；动画仅 transform/opacity。
 */

html.theme-hair {
  --paper: #f4ecda;
  --paper-2: #efe4cd;
  --panel: #ece0c6;
  --panel-2: #e4d5b6;
  --line: rgba(34, 29, 22, 0.18);
  --line-soft: rgba(34, 29, 22, 0.09);
  --ink: #221d16;
  --ink-soft: #453a2c;
  --muted: #8b7d63;
  --cinnabar: #a5301f;
  --cinnabar-deep: #83251a;
  --bamboo: #4b6144;
  --gold: #9a7b3f;
  --shadow: 0 18px 38px rgba(74, 54, 26, 0.16);
  --shadow-soft: 0 8px 20px rgba(74, 54, 26, 0.10);
  --display: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 基底 ---------- */
html.theme-hair,
html.theme-hair body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
html.theme-hair body {
  background:
    radial-gradient(760px 420px at 6% -8%, rgba(165, 48, 31, 0.07), transparent 60%),
    radial-gradient(880px 520px at 102% 2%, rgba(75, 97, 68, 0.09), transparent 56%),
    repeating-linear-gradient(0deg, rgba(34, 29, 22, 0.014) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #f6efdf 0%, var(--paper) 30%, #efe4cd 100%);
  background-attachment: fixed;
}
html.theme-hair a { color: inherit; }
html.theme-hair ::selection { background: rgba(165, 48, 31, 0.20); }

/* ---------- 顶部导航 ---------- */
html.theme-hair .nav {
  background: linear-gradient(180deg, rgba(246, 239, 223, 0.94), rgba(246, 239, 223, 0.62));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}
html.theme-hair .nav a,
html.theme-hair .nav .logo,
html.theme-hair .nav-link {
  color: var(--ink-soft);
  transition: color 0.22s var(--ease);
}
html.theme-hair .nav .logo {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: 0.06em;
}
html.theme-hair .nav a:hover,
html.theme-hair .nav-link:hover { color: var(--cinnabar); }
html.theme-hair .nav-link.active,
html.theme-hair .nav a.active {
  color: var(--cinnabar);
  border-bottom: 2px solid var(--cinnabar);
}

/* ---------- 通用按钮 / 表单 ---------- */
html.theme-hair .btn,
html.theme-hair button.btn {
  background: rgba(165, 48, 31, 0.08);
  color: var(--cinnabar);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform 0.18s var(--ease), background 0.22s var(--ease), color 0.22s var(--ease);
}
html.theme-hair .btn:hover { background: rgba(165, 48, 31, 0.14); transform: translateY(-1px); }
html.theme-hair .btn:active { transform: translateY(0); }
html.theme-hair .btn-primary {
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep));
  color: #f7ede0;
  border: 1px solid var(--cinnabar-deep);
  font-weight: 600;
}
html.theme-hair .btn-primary:hover { box-shadow: 0 6px 16px rgba(165, 48, 31, 0.32); }
html.theme-hair .btn-link { color: var(--bamboo); }
html.theme-hair .btn-link:hover { color: var(--cinnabar); }

html.theme-hair input,
html.theme-hair select,
html.theme-hair textarea,
html.theme-hair .search-container input,
html.theme-hair .search-container select {
  background: rgba(236, 224, 198, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
}
html.theme-hair input::placeholder,
html.theme-hair textarea::placeholder { color: #a3947a; }
html.theme-hair input:focus,
html.theme-hair select:focus,
html.theme-hair textarea:focus {
  outline: none;
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(165, 48, 31, 0.12);
}
html.theme-hair .search-container button {
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep));
  color: #f7ede0;
  border: 1px solid var(--cinnabar-deep);
}
html.theme-hair .search-container button:hover { box-shadow: 0 6px 16px rgba(165, 48, 31, 0.32); }

/* ---------- 书卡（分类/搜索/列表通用） ---------- */
html.theme-hair .novel-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
html.theme-hair .novel-card:hover {
  transform: translateY(-4px);
  border-color: var(--cinnabar);
  box-shadow: var(--shadow);
}
html.theme-hair .novel-cover-fallback {
  background: linear-gradient(135deg, #6d4a2a, #3f2a17);
  color: var(--paper);
  font-family: var(--display);
}
html.theme-hair .novel-card-info h3,
html.theme-hair .novel-card-info h2 {
  color: var(--ink);
  font-family: var(--display);
}
html.theme-hair .author { color: var(--muted); }
html.theme-hair .novel-category {
  color: var(--bamboo);
  background: rgba(75, 97, 68, 0.10);
  border: 1px solid rgba(75, 97, 68, 0.28);
  border-radius: 999px;
}
html.theme-hair .novel-desc,
html.theme-hair .novel-description { color: var(--ink-soft); }
html.theme-hair .chapter-count { color: var(--cinnabar); }
html.theme-hair .premium-badge {
  background: rgba(165, 48, 31, 0.14);
  color: var(--cinnabar);
  border: 1px solid rgba(165, 48, 31, 0.4);
}

/* ---------- 分类页 ---------- */
html.theme-hair .category-intro-kicker { color: var(--bamboo); letter-spacing: 0.18em; }
html.theme-hair .category-intro-title { color: var(--ink); font-family: var(--display); }
html.theme-hair .category-intro-copy,
html.theme-hair .category-intro-meta { color: var(--ink-soft); }
html.theme-hair .category-sidebar-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
}
html.theme-hair .category-link {
  color: var(--ink-soft);
  border-radius: 3px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
html.theme-hair .category-link:hover { background: rgba(165, 48, 31, 0.08); color: var(--cinnabar); }
html.theme-hair .category-link.active { background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep)); color: #f7ede0; }
html.theme-hair .category-count { color: var(--muted); }
html.theme-hair .category-current-label { color: var(--ink); font-family: var(--display); }

/* ---------- 分页 ---------- */
html.theme-hair .pagination button,
html.theme-hair .pagination a {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
html.theme-hair .pagination button:hover,
html.theme-hair .pagination a:hover { background: rgba(165, 48, 31, 0.10); color: var(--cinnabar); }
html.theme-hair .pagination .active,
html.theme-hair .pagination button.active {
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep));
  color: #f7ede0;
  border-color: var(--cinnabar-deep);
}

/* ---------- 详情页 ---------- */
html.theme-hair .novel-detail-cover-wrap,
html.theme-hair .novel-detail-cover {
  border-radius: 3px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
html.theme-hair .novel-detail-cover-fallback {
  background: linear-gradient(135deg, #6d4a2a, #3f2a17);
  color: var(--paper);
  font-family: var(--display);
}
html.theme-hair .novel-meta { color: var(--ink-soft); }
html.theme-hair .novel-meta strong { color: var(--ink); }

/* ---------- 章节列表 ---------- */
html.theme-hair .chapter-list-container,
html.theme-hair .chapter-list-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
}
html.theme-hair .chapter-list-header,
html.theme-hair .chapter-list-copy { color: var(--ink); font-family: var(--display); }
html.theme-hair .chapter-item {
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
html.theme-hair .chapter-item:hover { background: rgba(165, 48, 31, 0.07); color: var(--cinnabar); }
html.theme-hair .chapter-item.premium { color: var(--cinnabar); }
html.theme-hair .chapter-list-progress { color: var(--bamboo); }
html.theme-hair .chapter-list-load-more {
  background: rgba(165, 48, 31, 0.08);
  color: var(--cinnabar);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ---------- 阅读器（暖宣纸护眼，宋楷正文，舒适行高） ---------- */
html.theme-hair .reader-container { background: transparent; }
html.theme-hair .chapter-content {
  background: linear-gradient(180deg, #f7f0e0, #f1e7d1);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
html.theme-hair .chapter-content h2 {
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: 0.02em;
}
html.theme-hair .chapter-text {
  font-family: var(--display);
  font-size: clamp(1.06rem, 1rem + 0.35vw, 1.28rem);
  line-height: 2.05;
  color: #2b2419;
  letter-spacing: 0.01em;
}
html.theme-hair .chapter-meta,
html.theme-hair .chapter-skip-notice { color: var(--muted); }
html.theme-hair .reader-nav,
html.theme-hair .reader-secondary-nav {
  background: rgba(246, 239, 223, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
html.theme-hair .reader-secondary-action,
html.theme-hair .reader-action-btn {
  background: rgba(165, 48, 31, 0.08);
  color: var(--cinnabar);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform 0.18s var(--ease), background 0.22s var(--ease);
}
html.theme-hair .reader-secondary-action:hover,
html.theme-hair .reader-action-btn:hover { background: rgba(165, 48, 31, 0.14); transform: translateY(-1px); }
html.theme-hair .reader-action-bar {
  background: rgba(246, 239, 223, 0.94);
  border-top: 1px solid var(--line);
}
html.theme-hair .reader-modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
html.theme-hair .reader-modal-header { color: var(--ink); font-family: var(--display); border-bottom: 1px solid var(--line); }
html.theme-hair .reader-modal-close { color: var(--muted); }
html.theme-hair .reader-modal-close:hover { color: var(--cinnabar); }
html.theme-hair .catalog-chapters { border-color: var(--line); }
html.theme-hair .catalog-chapter-item {
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
html.theme-hair .catalog-chapter-item:hover { background: rgba(165, 48, 31, 0.07); color: var(--cinnabar); }
html.theme-hair .catalog-chapter-item.active { color: var(--cinnabar); background: rgba(165, 48, 31, 0.12); }
html.theme-hair .reader-membership-prompt {
  background: rgba(165, 48, 31, 0.08);
  border: 1px solid rgba(165, 48, 31, 0.4);
  border-radius: 4px;
  color: var(--ink);
}

/* ---------- 榜单页 ---------- */
html.theme-hair .ranking-controls,
html.theme-hair .ranking-tabs { border-bottom: 1px solid var(--line); }
html.theme-hair .ranking-tab {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
html.theme-hair .ranking-tab:hover { color: var(--ink); }
html.theme-hair .ranking-tab.active { color: var(--cinnabar); border-bottom: 2px solid var(--cinnabar); }
html.theme-hair .ranking-filter select { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
html.theme-hair .ranking-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
}
html.theme-hair .ranking-item {
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.18s var(--ease);
}
html.theme-hair .ranking-item:hover { background: rgba(165, 48, 31, 0.05); }
html.theme-hair .ranking-rank { color: var(--muted); font-family: var(--display); }
html.theme-hair .ranking-rank.rank-1 { color: var(--cinnabar); }
html.theme-hair .ranking-rank.rank-2 { color: var(--bamboo); }
html.theme-hair .ranking-rank.rank-3 { color: var(--gold); }
html.theme-hair .ranking-cover { border-radius: 3px; box-shadow: var(--shadow-soft); }
html.theme-hair .ranking-info h3 { color: var(--ink); font-family: var(--display); }
html.theme-hair .ranking-info .author,
html.theme-hair .ranking-meta { color: var(--muted); }
html.theme-hair .ranking-category { color: var(--bamboo); }

/* ---------- 页脚 ---------- */
html.theme-hair .site-footer {
  background: linear-gradient(180deg, transparent, rgba(228, 213, 182, 0.5));
  border-top: 1px solid var(--line);
  color: var(--muted);
}
html.theme-hair .site-footer-group h2 { color: var(--ink); font-family: var(--display); }
html.theme-hair .site-footer a { color: var(--muted); transition: color 0.2s var(--ease); }
html.theme-hair .site-footer a:hover { color: var(--cinnabar); }

/* ---------- 无结果/占位 ---------- */
html.theme-hair .no-results { color: var(--muted); }
