/* ==================== 墨香书阁 - 古风典雅主题 ==================== */

/* 古风配色 - 日间模式（宣纸质感） */
:root {
  --bg-primary: #f7f1e3;
  --bg-secondary: #f0e8d6;
  --bg-tertiary: #e8dcc4;
  --text-primary: #2c1810;
  --text-secondary: #5c4033;
  --text-muted: #8b7355;
  --border-color: #c9b896;
  --border-light: #dccba6;
  --accent: #a52a2a;
  --accent-hover: #8b1a1a;
  --accent-light: #f5e6d3;
  --accent-gold: #b8860b;
  --success: #556b2f;
  --warning: #b8860b;
  --danger: #a52a2a;
  --ink-black: #1a0f08;
  --paper-cream: #faf6ea;

  --shadow-sm: 0 2px 4px rgba(44, 24, 16, 0.08);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.1);
  --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "宋体", Georgia, serif;
  --font-kai: "KaiTi", "STKaiti", "楷体", "Noto Serif SC", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;

  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-primary: #14161b;
  --bg-secondary: #1c1f26;
  --bg-tertiary: #252830;
  --text-primary: #e8eaed;
  --text-secondary: #b4b8c0;
  --text-muted: #7c808a;
  --border-color: #383b44;
  --border-light: #2c2f38;
  --accent: #c95353;
  --accent-hover: #dd6868;
  --accent-light: #251c22;
  --accent-gold: #c9a227;
  --success: #5a8a3a;
  --warning: #c9a227;
  --danger: #c95353;
  --ink-black: #0a0c10;
  --paper-cream: #1a1d24;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  transition: var(--transition);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(165, 42, 42, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(184, 134, 11, 0.02) 0%, transparent 50%);
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(80, 100, 140, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(100, 80, 120, 0.03) 0%, transparent 50%);
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }

input, textarea, select {
  font-family: var(--font-serif);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--paper-cream);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.1);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.8; }

/* ==================== 导航栏 ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--accent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border-light) inset;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-family: var(--font-kai);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 2px;
}
.navbar-brand:hover { color: var(--accent); }
.navbar-brand .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--paper-cream);
  border-radius: 4px;
  font-size: 18px;
  font-family: var(--font-kai);
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.navbar-nav { display: flex; align-items: center; gap: 32px; }
.navbar-nav a {
  font-family: var(--font-kai);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
  position: relative;
  padding: 4px 0;
}
.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--accent); }
.navbar-nav a:hover::after, .navbar-nav a.active::after { width: 100%; }
.navbar-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  font-family: var(--font-kai);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: 1px;
}
.btn-primary {
  background: var(--accent);
  color: var(--paper-cream);
  border: 1px solid var(--accent);
  box-shadow: 2px 2px 0 rgba(44, 24, 16, 0.15);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--paper-cream);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(44, 24, 16, 0.2);
}
.btn-secondary {
  background: var(--paper-cream);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--paper-cream); }
.btn-danger { background: var(--danger); color: var(--paper-cream); }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-block { width: 100%; }

/* ==================== 容器 ==================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ==================== 首页 Hero ==================== */
.hero {
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
}
.hero::before, .hero::after {
  content: '❖';
  position: absolute;
  top: 50%;
  font-size: 24px;
  color: var(--border-color);
  opacity: 0.5;
}
.hero::before { left: 10%; }
.hero::after { right: 10%; }
.hero h1 {
  font-family: var(--font-kai);
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: 8px;
  display: inline-block;
  position: relative;
  padding-bottom: 16px;
}
.hero h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.hero p {
  font-family: var(--font-kai);
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  letter-spacing: 3px;
}
.search-box {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
}
.search-box input {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-serif);
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-color);
}
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.filter-tab {
  padding: 8px 18px;
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  letter-spacing: 1px;
}
.filter-tab:hover { color: var(--accent); }
.filter-tab.active {
  background: var(--paper-cream);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* ==================== 小说卡片 ==================== */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}
.novel-card {
  background: var(--paper-cream);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.novel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold), var(--accent));
  opacity: 0.8;
}
.novel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.novel-card:hover::before { opacity: 1; height: 5px; }
.novel-card-cover {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}
.novel-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.novel-card-badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 4px 12px;
  font-family: var(--font-kai);
  font-size: 12px;
  font-weight: 600;
  border-radius: 2px;
  background: var(--accent);
  color: var(--paper-cream);
  letter-spacing: 1px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.novel-card-badge.ongoing { background: var(--success); }
.novel-card-badge.completed { background: var(--text-muted); }
.novel-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.novel-card-title {
  font-family: var(--font-kai);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: 1px;
}
.novel-card-author {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-kai);
}
.novel-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.novel-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}
.novel-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-kai);
}
.novel-card-category {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 2px;
  font-weight: 500;
  font-family: var(--font-kai);
  border: 1px solid var(--border-light);
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 48px 0;
}
.pagination button {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--paper-cream);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.pagination button.active {
  background: var(--accent);
  color: var(--paper-cream);
  border-color: var(--accent);
  font-weight: 600;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== 小说详情页 ==================== */
.novel-detail { padding: 48px 0; }
.novel-detail-header {
  display: flex;
  gap: 48px;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}
.novel-detail-header::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0; right: 0;
  height: 1px;
  background: var(--border-color);
}
.novel-detail-cover {
  width: 240px;
  height: 340px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--border-color);
  outline: 1px solid var(--border-light);
  outline-offset: -8px;
}
.novel-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.novel-detail-info { flex: 1; }
.novel-detail-title {
  font-family: var(--font-kai);
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: 3px;
  color: var(--text-primary);
}
.novel-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-kai);
}
.novel-detail-meta span { display: flex; align-items: center; gap: 4px; }
.novel-detail-desc {
  font-size: 16px;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 28px;
  white-space: pre-wrap;
  text-indent: 2em;
  padding: 20px;
  background: var(--paper-cream);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.novel-detail-actions { display: flex; gap: 14px; }

.chapter-list-section { margin-top: 56px; }
.section-title {
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 2px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
}
.section-title .count {
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 2px;
  letter-spacing: 1px;
}
.chapter-list {
  background: var(--paper-cream);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}
.chapter-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border-bottom: 1px dashed var(--border-light);
}
.chapter-list-item:last-child { border-bottom: none; }
.chapter-list-item:hover {
  background: var(--accent-light);
  padding-left: 24px;
}
.chapter-list-item .chapter-title {
  font-family: var(--font-kai);
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 1px;
}
.chapter-list-item:hover .chapter-title { color: var(--accent); }
.chapter-list-item .chapter-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-kai);
}

/* ==================== 阅读页 ==================== */
.reader-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.reader-header {
  text-align: center;
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.reader-header::after {
  content: '❖';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  padding: 0 16px;
  color: var(--accent);
  font-size: 16px;
}
.reader-novel-title {
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.reader-chapter-title {
  font-family: var(--font-kai);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  letter-spacing: 3px;
}
.reader-content {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 2.2;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  text-align: justify;
}
.reader-content p { margin-bottom: 1.6em; text-indent: 2em; }
.reader-footer {
  margin-top: 72px;
  padding-top: 36px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
}
.reader-footer::before {
  content: '❖';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  padding: 0 16px;
  color: var(--accent);
  font-size: 16px;
}
.reader-nav { flex: 1; }
.reader-nav button {
  width: 100%;
  padding: 16px;
  font-family: var(--font-kai);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--paper-cream);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  letter-spacing: 1px;
}
.reader-nav button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.reader-nav button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 阅读设置 */
.reader-settings { position: fixed; bottom: 28px; right: 28px; z-index: 50; }
.reader-settings-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper-cream);
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 2px solid var(--paper-cream);
}
.reader-settings-btn:hover { transform: scale(1.1); }
.reader-settings-panel {
  position: absolute;
  bottom: 64px; right: 0;
  background: var(--paper-cream);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  display: none;
}
.reader-settings-panel.show { display: block; }
.settings-group { margin-bottom: 18px; }
.settings-group:last-child { margin-bottom: 0; }
.settings-label {
  font-family: var(--font-kai);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: block;
  letter-spacing: 1px;
}
.settings-row { display: flex; gap: 8px; align-items: center; }
.settings-row button {
  flex: 1;
  padding: 8px;
  font-family: var(--font-kai);
  font-size: 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: var(--transition);
}
.settings-row button:hover { border-color: var(--accent); color: var(--accent); }
.settings-row button.active {
  background: var(--accent);
  color: var(--paper-cream);
  border-color: var(--accent);
}

/* ==================== 登录页 ==================== */
.login-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper-cream);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  border-top: 4px solid var(--accent);
}
.login-card::before {
  content: '墨';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  background: var(--accent);
  color: var(--paper-cream);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kai);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}
.login-card h2 {
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 4px;
  color: var(--text-primary);
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 36px;
  font-family: var(--font-kai);
  letter-spacing: 2px;
}
.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}
.form-group input, .form-group textarea, .form-group select { width: 100%; }
.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  display: none;
  font-family: var(--font-kai);
}
.form-error.show { display: block; }

/* ==================== 后台管理 ==================== */
.admin-layout { display: flex; min-height: calc(100vh - 68px); }
.admin-sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 28px 0;
  flex-shrink: 0;
}
.admin-sidebar-nav { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; }
.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-kai);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  letter-spacing: 1px;
}
.admin-sidebar-item:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
  padding-left: 22px;
}
.admin-sidebar-item.active {
  background: var(--accent);
  color: var(--paper-cream);
  box-shadow: 2px 2px 0 rgba(44, 24, 16, 0.15);
}
.admin-sidebar-item .icon { font-size: 18px; }
.admin-main {
  flex: 1;
  padding: 36px;
  overflow-x: auto;
  background: var(--bg-primary);
}
.admin-page-title {
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 2px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--paper-cream);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: var(--transition);
  border-top: 3px solid var(--accent);
  position: relative;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-label {
  font-family: var(--font-kai);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 1px;
}
.stat-card-value {
  font-family: var(--font-kai);
  font-size: 34px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.stat-card-icon { float: right; font-size: 32px; opacity: 0.25; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-cream);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.data-table th {
  background: var(--bg-secondary);
  padding: 16px;
  text-align: left;
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  letter-spacing: 1px;
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-serif);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--accent-light); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions button {
  padding: 5px 12px;
  font-family: var(--font-kai);
  font-size: 12px;
  border-radius: 2px;
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 1px;
}
.btn-edit { background: var(--accent-light); color: var(--accent); border: 1px solid var(--border-light); }
.btn-edit:hover { background: var(--accent); color: var(--paper-cream); }
.btn-delete { background: #fae8e8; color: var(--danger); border: 1px solid #f0c8c8; }
.btn-delete:hover { background: var(--danger); color: var(--paper-cream); }
.btn-publish { background: #e8efe0; color: var(--success); border: 1px solid #c8d8b0; }
.btn-publish:hover { background: var(--success); color: var(--paper-cream); }
.btn-draft { background: #faf0dc; color: var(--warning); border: 1px solid #f0dca8; }
.btn-draft:hover { background: var(--warning); color: var(--paper-cream); }

.status-badge {
  display: inline-block;
  padding: 3px 12px;
  font-family: var(--font-kai);
  font-size: 12px;
  font-weight: 600;
  border-radius: 2px;
  letter-spacing: 1px;
}
.status-ongoing { background: #e8efe0; color: var(--success); }
.status-completed { background: var(--bg-tertiary); color: var(--text-muted); }
.status-paused { background: #faf0dc; color: var(--warning); }
.status-published { background: #e8efe0; color: var(--success); }
.status-draft { background: #faf0dc; color: var(--warning); }

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 15, 8, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--paper-cream);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--accent);
}
.modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-kai);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}
.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-tertiary); color: var(--accent); }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.modal-large { max-width: 820px; }

.chapter-editor textarea {
  width: 100%;
  min-height: 400px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 52px; margin-bottom: 18px; opacity: 0.4; }
.empty-state p {
  font-family: var(--font-kai);
  font-size: 16px;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.toast-container {
  position: fixed;
  top: 88px; right: 28px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-kai);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
  letter-spacing: 1px;
  border-left: 3px solid;
}
.toast-success { background: var(--paper-cream); color: var(--success); border-color: var(--success); }
.toast-error { background: var(--paper-cream); color: var(--danger); border-color: var(--danger); }
.toast-info { background: var(--paper-cream); color: var(--accent); border-color: var(--accent); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 页脚 */
.footer {
  border-top: 2px solid var(--accent);
  padding: 36px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 64px;
  background: var(--bg-secondary);
  font-family: var(--font-kai);
  letter-spacing: 1px;
}
.footer p { margin-bottom: 6px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; height: 60px; }
  .navbar-nav { display: none; }
  .navbar-brand { font-size: 20px; letter-spacing: 1px; }
  .navbar-brand .logo-icon { width: 32px; height: 32px; font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 32px; letter-spacing: 4px; }
  .hero p { font-size: 15px; letter-spacing: 1px; }
  .hero::before, .hero::after { display: none; }
  .novel-grid { grid-template-columns: 1fr; gap: 20px; }
  .novel-detail-header { flex-direction: column; gap: 28px; }
  .novel-detail-cover { width: 100%; height: 220px; font-size: 60px; }
  .novel-detail-title { font-size: 28px; letter-spacing: 2px; }
  .novel-detail-desc { padding: 16px; }
  .reader-container { padding: 32px 16px 64px; }
  .reader-chapter-title { font-size: 24px; letter-spacing: 2px; }
  .reader-content { font-size: 16px; line-height: 2; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: 14px 0; }
  .admin-sidebar-nav { flex-direction: row; overflow-x: auto; padding: 0 12px; }
  .admin-sidebar-item { white-space: nowrap; padding: 10px 14px; }
  .admin-main { padding: 24px 16px; }
  .admin-page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat-card { padding: 18px; }
  .stat-card-value { font-size: 26px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .login-card { padding: 36px 24px; }
  .filter-bar { gap: 10px; }
  .search-box { flex-direction: column; }
  .section-title { font-size: 22px; }
  .modal-body { padding: 20px; }
  .modal-header { padding: 18px 20px 14px; }
  .modal-footer { padding: 14px 20px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .novel-card-cover { height: 150px; font-size: 40px; }
  .reader-footer { flex-direction: column; }
  .novel-detail-actions { flex-direction: column; }
  .novel-detail-actions .btn { width: 100%; }
}
