/* === 静态小说阅读网站 - 全局样式 === */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Inter:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600&display=swap');

/* --- CSS 变量（主题系统） --- */
:root {
  /* 浅色模式 - 琥珀金 + 暖灰 */
  --bg-primary: #faf9f6;
  /* 暖白背景 */
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f2eb;
  --text-primary: #27272a;
  /* ZINC-800 */
  --text-secondary: #52525b;
  /* ZINC-600 */
  --text-muted: #a1a1aa;
  /* ZINC-400 */
  --heading-color: #18181b;
  /* ZINC-900 */
  --link-color: #d97706;
  /* AMBER-600 */
  --link-hover: #b45309;
  /* AMBER-700 */
  --border-color: #e4e4e7;
  /* ZINC-200 */
  --border-light: #f4f4f5;
  /* ZINC-100 */
  --accent-color: #d97706;
  /* AMBER-600 */
  --accent-light: #fef3c7;
  /* AMBER-100 */
  --shadow-color: rgba(0, 0, 0, 0.04);
  --shadow-medium: rgba(0, 0, 0, 0.08);
  /* 修复未定义变量 */
  --overlay-bg: rgba(250, 249, 246, 0.85);
  /* 增加通透感 */
  --card-hover-shadow: rgba(0, 0, 0, 0.08);
  --progress-bg: #e4e4e7;
  --progress-fill: #d97706;
  --tag-bg: #f4f4f5;
  --tag-color: #52525b;
  --btn-bg: #d97706;
  --btn-color: #ffffff;
  --btn-hover: #b45309;
  --input-bg: #ffffff;
  --input-border: #d4d4d8;
  --scrollbar-track: #f4f4f5;
  --scrollbar-thumb: #d4d4d8;

  /* 排版 */
  --font-body: 'Noto Serif SC', 'Source Han Serif SC', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-body: 18px;
  --line-height-body: 1.8;
  --max-width-reading: 740px;
  --max-width-content: 1100px;
  --paragraph-spacing: 1.25em;

  /* 动画 */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 夜间模式 - 深蓝灰 + 琥珀金 */
[data-theme="dark"] {
  --bg-primary: #18181b;
  /* ZINC-900 */
  --bg-secondary: #27272a;
  /* ZINC-800 */
  --bg-tertiary: #3f3f46;
  /* ZINC-700 */
  --text-primary: #e4e4e7;
  /* ZINC-200 */
  --text-secondary: #a1a1aa;
  /* ZINC-400 */
  --text-muted: #71717a;
  /* ZINC-500 */
  --heading-color: #fafafa;
  /* ZINC-50 */
  --link-color: #fbbf24;
  /* AMBER-400 */
  --link-hover: #fcd34d;
  /* AMBER-300 */
  --border-color: #3f3f46;
  /* ZINC-700 */
  --border-light: #27272a;
  /* ZINC-800 */
  --accent-color: #fbbf24;
  /* AMBER-400 */
  --accent-light: #451a03;
  /* AMBER-950 (背景色用) */
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.5);
  --overlay-bg: rgba(24, 24, 27, 0.85);
  --card-hover-shadow: rgba(0, 0, 0, 0.5);
  --progress-bg: #3f3f46;
  --progress-fill: #fbbf24;
  --tag-bg: #3f3f46;
  --tag-color: #fbbf24;
  --btn-bg: #d97706;
  /* 稍微深一点以便阅读文字 */
  --btn-color: #ffffff;
  --btn-hover: #b45309;
  --input-bg: #27272a;
  --input-border: #52525b;
  --scrollbar-track: #27272a;
  --scrollbar-thumb: #52525b;
}

/* --- 全局重置 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  /* 修复 iOS 点击延迟 */
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: var(--line-height-body);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* --- 登录页 --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity var(--transition-slow);
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-box {
  text-align: center;
  max-width: 360px;
  padding: 48px 40px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-color);
}

.auth-box .auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.auth-box h2 {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--heading-color);
  margin-bottom: 8px;
}

.auth-box p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.auth-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--transition-fast);
  text-align: center;
  letter-spacing: 2px;
}

.auth-box input:focus {
  border-color: var(--accent-color);
}

.auth-box .auth-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--btn-bg);
  color: var(--btn-color);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.auth-box .auth-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.auth-box .auth-error {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 12px;
  min-height: 20px;
}

/* --- 导航栏 --- */
.header {
  position: sticky;
  top: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.header.hidden {
  transform: translateY(-100%);
}

.header-inner {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo .logo-icon {
  font-size: 1.5rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav a,
.header-nav button {
  color: var(--text-secondary);
  font-size: 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: color var(--transition-fast);
  padding: 4px 8px;
  border-radius: 6px;
}

.header-nav a:hover,
.header-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* 阅读页导航 */
.reader-header {
  padding: 10px 24px;
}

.reader-header .header-inner {
  padding: 0;
}

.reader-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reader-breadcrumb .sep {
  color: var(--text-muted);
}

/* 进度条 */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--progress-fill);
  z-index: 200;
  transition: width 0.1s linear;
}

/* --- 首页 --- */
.page-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.page-hero h1 {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 8px;
}

.page-hero .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* 搜索栏 */
.search-container {
  max-width: 480px;
  margin: 24px auto 32px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 44px 12px 20px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

[data-theme="dark"] .search-input:focus {
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* 搜索结果 */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-medium);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-tertiary);
}

.search-result-item .result-type {
  font-size: 0.75rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-item .result-title {
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-top: 2px;
}

.search-result-item .result-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* 分类筛选 */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  justify-content: center;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.filter-btn.active {
  background: var(--btn-bg);
  color: var(--btn-color);
  border-color: var(--btn-bg);
}

/* 小说卡片网格 */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.novel-card {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.novel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--card-hover-shadow);
  border-color: var(--accent-color);
}

.novel-cover {
  flex-shrink: 0;
  width: 80px;
  height: 110px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cover-char {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.novel-info {
  flex: 1;
  min-width: 0;
}

.novel-title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-author {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.novel-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.novel-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.novel-category {
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 4px;
}

.novel-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 4px;
  font-size: 0.75rem;
}

/* --- 小说详情页 --- */
.novel-detail {
  max-width: var(--max-width-reading);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.novel-detail-header {
  text-align: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.novel-detail-header h1 {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 8px;
}

.novel-detail-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.novel-detail-meta .meta-sep {
  color: var(--border-color);
}

.novel-detail-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 16px;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.novel-detail-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.novel-detail-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-primary {
  padding: 10px 28px;
  background: var(--btn-bg);
  color: var(--btn-color);
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
  color: var(--btn-color);
}

.btn-outline {
  padding: 10px 28px;
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover {
  background: var(--accent-color);
  color: var(--btn-color);
}

/* 章节列表 */
.chapter-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chapter-list-header h2 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--heading-color);
}

.chapter-list-header .chapter-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.chapter-list {
  display: flex;
  flex-direction: column;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.chapter-item:hover {
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.chapter-item .chapter-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.chapter-item .chapter-title {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

/* --- 阅读页 --- */
.reader-container {
  max-width: var(--max-width-reading);
  margin: 0 auto;
  padding: 40px 24px 80px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.chapter-heading {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}

.chapter-content {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--text-primary);
}

.chapter-content p {
  margin-bottom: var(--paragraph-spacing);
  text-indent: 2em;
}

.chapter-content p:last-child {
  margin-bottom: 0;
}

/* 章节导航 */
.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border-color);
}

.nav-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-btn.prev-btn,
.nav-btn.next-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.nav-btn.prev-btn:hover,
.nav-btn.next-btn:hover {
  background: var(--btn-bg);
  color: var(--btn-color);
  border-color: var(--btn-bg);
}

.nav-btn.disabled {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-light);
  cursor: default;
}

/* 浮动设置面板 */
.settings-fab {
  position: fixed;
  bottom: 32px;
  bottom: calc(32px + env(safe-area-inset-bottom));
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-color);
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--shadow-medium);
  transition: all var(--transition-normal);
  z-index: 90;
}

.settings-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px var(--shadow-medium);
}

.settings-panel {
  position: fixed;
  bottom: 92px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  right: 32px;
  width: 260px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px var(--shadow-medium);
  z-index: 90;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: all var(--transition-normal);
}

.settings-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.setting-group {
  margin-bottom: 16px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-options {
  display: flex;
  gap: 6px;
}

.setting-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.setting-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.setting-btn.active {
  background: var(--btn-bg);
  color: var(--btn-color);
  border-color: var(--btn-bg);
}

.theme-toggle-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
}

/* --- 页脚 --- */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border-light);
}

/* --- 响应式适配 (移动端优化) --- */
@media (max-width: 768px) {
  :root {
    --font-size-body: 17px;
    --paragraph-spacing: 1.1em;
  }

  /* 基础布局 */
  .header-inner {
    padding: 10px 16px;
  }

  .site-logo {
    font-size: 1.1rem;
  }

  .page-container {
    padding: 24px 16px 48px;
  }

  .page-hero {
    padding: 32px 0 24px;
  }

  .page-hero h1 {
    font-size: 1.75rem;
  }

  /* 首页小说列表 */
  .novel-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .novel-card {
    padding: 16px;
  }

  /* 详情页 */
  .novel-detail {
    padding: 24px 16px 48px;
  }

  .novel-detail-header h1 {
    font-size: 1.5rem;
  }

  .novel-detail-actions {
    flex-direction: column;
    gap: 10px;
  }

  .novel-detail-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  /* 阅读页 */
  .reader-container {
    padding: 24px 16px 64px;
  }

  .chapter-heading {
    font-size: 1.25rem;
    padding-bottom: 24px;
    margin-bottom: 24px;
  }

  .chapter-content {
    font-size: 1.05rem;
    line-height: 1.75;
    /* 手机上行高稍微压缩一点点 */
  }

  .chapter-content p {
    margin-bottom: 1em;
  }

  /* 章节导航 - 保持横向，增加间距 */
  .chapter-nav {
    flex-direction: row;
    gap: 12px;
  }

  .nav-btn {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    font-size: 0.8125rem;
    justify-content: center;
  }

  /* 设置面板手机适配 */
  .settings-fab {
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .settings-panel {
    width: calc(100% - 32px);
    right: 16px;
    left: 16px;
    bottom: 80px;
    padding: 20px;
  }

  /* 阅读页面包屑路径截断 */
  .reader-breadcrumb {
    font-size: 0.8125rem;
    max-width: calc(100vw - 120px);
  }

  .reader-breadcrumb a:first-child+span+a {
    max-width: 100px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-body: 16px;
  }

  .site-logo .logo-icon {
    font-size: 1.25rem;
  }

  .novel-card .novel-title {
    font-size: 1rem;
  }

  .novel-cover {
    width: 70px;
    height: 96px;
  }

  .cover-char {
    font-size: 1.75rem;
  }

  .auth-box {
    padding: 32px 24px;
    margin: 16px;
  }
}

/* --- 动画 --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.novel-card {
  animation: fadeIn var(--transition-slow) backwards;
}

.novel-card:nth-child(1) {
  animation-delay: 0.05s;
}

.novel-card:nth-child(2) {
  animation-delay: 0.1s;
}

.novel-card:nth-child(3) {
  animation-delay: 0.15s;
}

.novel-card:nth-child(4) {
  animation-delay: 0.2s;
}

.novel-card:nth-child(5) {
  animation-delay: 0.25s;
}

.novel-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.empty-state p {
  font-size: 1rem;
}

/* --- 阅读模式 - 点击翻页 --- */
.click-nav-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 80;
  /* 低于设置按钮(90)和头部(100) */
  display: flex;
  visibility: hidden;
  /* 默认不可见 */
  pointer-events: none;
  /* 默认不阻挡点击 */
}

.click-nav-layer.active {
  visibility: visible;
  pointer-events: auto;
}

.nav-zone {
  height: 100%;
  /* background: rgba(0, 255, 0, 0.1); 调试用 */
}

.nav-zone.left {
  width: 30%;
  cursor: w-resize;
}

.nav-zone.center {
  width: 40%;
  cursor: default;
}

.nav-zone.right {
  width: 30%;
  cursor: e-resize;
}

.wide-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* 速度滑块 */
.slide-container {
  padding: 0 4px;
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  margin: 10px 0;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--btn-bg);
  cursor: pointer;
  transition: background .15s ease-in-out;
}

.speed-slider::-webkit-slider-thumb:hover {
  background: var(--btn-hover);
}