/* ==========================================================================
   深色主题 - 现代化漫画阅读APP样式
   ========================================================================== */

:root {
  /* 颜色系统 */
  --primary: #FF8C42;
  --primary-light: #FFA666;
  --primary-dark: #E67A30;
  --secondary: #6C5CE7;
  --accent: #00D9FF;
  
  /* 深色背景 */
  --bg-primary: #0F1419;
  --bg-secondary: #1A1F29;
  --bg-card: #1E242E;
  --bg-elevated: #252D3A;
  
  /* 文字颜色 */
  --text-primary: #FFFFFF;
  --text-secondary: #B8C5D6;
  --text-muted: #7A8899;
  --text-disabled: #4A5568;
  
  /* 边框和分割线 */
  --border: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.06);
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
}

/* ==========================================================================
   基础重置
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:active {
  opacity: 0.7;
}

img {
  max-width: 100%;
  display: block;
}

button {
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* ==========================================================================
   顶部导航栏
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-logo img {
  height: 28px;
  width: auto;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link.active {
  color: var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-icon:active {
  color: var(--primary);
}

/* ==========================================================================
   搜索框
   ========================================================================== */
.search-bar {
  position: relative;
  margin: var(--space-lg);
}

.search-input {
  width: 100%;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-lg) 0 44px;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-elevated);
}

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

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* ==========================================================================
   Banner 轮播
   ========================================================================== */
.banner-container {
  margin: var(--space-lg);
  margin-top: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}

.banner-slide {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xl) var(--space-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.banner-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.banner-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.banner-dots {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.3s ease;
}

.banner-dot.active {
  width: 20px;
  border-radius: 3px;
  background: var(--primary);
}

/* ==========================================================================
   内容区块
   ========================================================================== */
.content-section {
  margin-bottom: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-more svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   漫画卡片 - 竖版（首页列表）
   ========================================================================== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: 0 var(--space-lg);
}

.book-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.book-card:active {
  transform: scale(0.98);
}

.book-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.book-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  z-index: 2;
}

.book-badge.serialized {
  background: var(--secondary);
}

.book-badge.finished {
  background: var(--accent);
}

.book-rating {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.rating-star {
  color: #FFD700;
  font-size: 12px;
}

.rating-text {
  color: white;
}

.book-info {
  padding: var(--space-sm) 0;
}

.book-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.book-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   横版卡片（推荐、更新）
   ========================================================================== */
.books-horizontal {
  display: flex;
  gap: var(--space-lg);
  padding: 0 var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.books-horizontal::-webkit-scrollbar {
  display: none;
}

.book-card-h {
  flex: 0 0 140px;
  scroll-snap-align: start;
}

.book-card-h .book-cover {
  width: 140px;
}

/* ==========================================================================
   详情页
   ========================================================================== */
.detail-container {
  min-height: 100vh;
  background: var(--bg-primary);
}

.detail-header {
  position: relative;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--bg-secondary);
}

.detail-back {
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.detail-content {
  display: flex;
  gap: var(--space-lg);
}

.detail-cover {
  flex: 0 0 120px;
}

.detail-cover img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-sm);
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rating-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.meta-row {
  display: flex;
  gap: var(--space-md);
}

.meta-label {
  color: var(--text-muted);
}

.detail-desc {
  padding: var(--space-xl) var(--space-lg);
}

.desc-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.desc-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.chapters-section {
  padding: var(--space-lg);
}

.chapters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.chapters-title {
  font-size: 18px;
  font-weight: 700;
}

.chapters-more {
  font-size: 13px;
  color: var(--primary);
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.chapter-item {
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.chapter-item:active {
  background: var(--bg-elevated);
  border-color: var(--primary);
  transform: scale(0.98);
}

.chapter-item.locked {
  color: var(--text-muted);
  opacity: 0.7;
}

.chapter-item.locked .lock-icon {
  font-size: 12px;
  opacity: 0.6;
}

.action-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-md);
}

.btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

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

.btn-secondary:active {
  background: var(--bg-card);
  transform: scale(0.98);
}

/* ==========================================================================
   阅读页面
   ========================================================================== */
.reader-container {
  background: #000;
  min-height: 100vh;
}

.reader-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.reader-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  padding: 0 var(--space-md);
}

.reader-images {
  width: 100%;
}

.reader-image {
  width: 100%;
  display: block;
  background: #000;
}

.reader-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.reader-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   底部导航
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item-icon {
  width: 24px;
  height: 24px;
}

.nav-item-text {
  font-size: 11px;
  font-weight: 500;
}

/* ==========================================================================
   加载动画
   ========================================================================== */
.loading {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.loading-item {
  flex: 1;
  height: 200px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================================================
   工具类
   ========================================================================== */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .chapters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .books-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .chapters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   搜索页面
   ========================================================================== */
.search-page {
  min-height: 100vh;
  background: var(--bg-primary);
  padding: var(--space-lg);
}

.search-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.search-back {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-back:active {
  background: var(--bg-elevated);
  transform: scale(0.95);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-lg) 0 48px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-elevated);
}

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

.search-clear {
  position: absolute;
  right: var(--space-md);
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-cancel,
.search-btn {
  padding: 0 var(--space-lg);
  height: 48px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-btn {
  background: var(--primary);
  border-radius: var(--radius-lg);
  color: white;
}

.search-cancel:active,
.search-btn:active {
  opacity: 0.7;
}

.search-hot,
.search-history {
  margin-bottom: var(--space-xl);
}

.search-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.search-clear-history {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.search-tag {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.search-tag:active {
  background: var(--bg-elevated);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(0.98);
}

/* ==========================================================================
   搜索结果页面
   ========================================================================== */
.search-result-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

.search-result-info {
  padding: var(--space-lg);
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.search-result-info .highlight {
  color: var(--primary);
  font-weight: 600;
}

.search-results {
  padding: var(--space-lg);
  padding-bottom: 100px; /* 为分页和底部菜单留出空间 */
}

.result-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  transition: all 0.2s ease;
}

.result-item:active {
  background: var(--bg-card);
  transform: scale(0.99);
}

.result-link {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.result-cover {
  position: relative;
  width: 80px;
  height: 106px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

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

.result-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  color: white;
}

.result-badge.finished {
  background: var(--accent);
}

.result-badge.serialized {
  background: var(--secondary);
}

.result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-author {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.result-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.result-meta {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
}

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

.meta-item.meta-update-time {
  color: var(--accent2);
  font-weight: 500;
}

.result-read-btn {
  align-self: center;
  padding: 8px 20px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-read-btn:active {
  background: var(--primary-dark);
  transform: scale(0.95);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state p {
  margin: 0;
  font-size: 16px;
}

.empty-hint {
  font-size: 14px;
  color: var(--text-disabled);
  margin-top: 8px !important;
}

/* ==========================================================================
   登录/注册页面
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-logo svg {
  margin-bottom: var(--space-lg);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

.auth-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-lg);
}

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-input-wrapper {
  position: relative;
}

.form-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-lg) 0 48px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-elevated);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.btn-block {
  width: 100%;
  margin-top: var(--space-xl);
}

.auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.auth-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.auth-link:active {
  color: var(--primary);
}

/* Toast 消息 */
@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
}

/* ==========================================================================
   账户页面
   ========================================================================== */
.account-page {
  min-height: 100vh;
  background: var(--bg-primary);
  padding-bottom: 80px;
}

.account-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: var(--space-2xl) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.account-avatar-section {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.account-avatar {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.account-info {
  flex: 1;
}

.account-name {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 0 0 4px 0;
}

.account-id {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.account-stats {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.stat-value.vip-badge {
  color: #FFD700;
}

.stat-value.normal-badge {
  color: rgba(255, 255, 255, 0.9);
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
}

.account-sections {
  padding: 0 var(--space-lg);
}

.account-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-icon {
  color: var(--primary);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--primary);
  border-radius: var(--radius-md);
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.account-btn:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

.account-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

.info-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: var(--space-sm);
  transition: all 0.2s ease;
}

.account-menu-item:last-child {
  margin-bottom: 0;
}

.account-menu-item:active {
  background: var(--bg-elevated);
  transform: scale(0.99);
}

.account-menu-item.highlight {
  border-color: var(--primary);
  background: rgba(255, 140, 66, 0.1);
}

.account-menu-item svg:first-child {
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-menu-item.highlight svg:first-child {
  color: var(--primary);
}

.account-menu-item span {
  flex: 1;
}

.menu-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   书架/历史页面
   ========================================================================== */
.shelf-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

.shelf-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.shelf-tabs {
  display: flex;
  gap: var(--space-lg);
}

.shelf-tab {
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease;
}

.shelf-tab.active {
  color: var(--primary);
}

.shelf-tab.active::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.shelf-edit-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.shelf-edit-btn:active {
  background: var(--bg-elevated);
  transform: scale(0.95);
}

.shelf-content,
.history-content {
  padding: var(--space-lg);
  min-height: calc(100vh - 140px);
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.shelf-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.shelf-item:active {
  transform: scale(0.98);
}

.shelf-item-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.shelf-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-item-info {
  padding: var(--space-sm) 0;
}

.shelf-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.history-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.history-item:active {
  background: var(--bg-card);
  transform: scale(0.99);
}

.history-link {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.history-cover {
  width: 80px;
  height: 106px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

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

.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.history-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-chapter {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-continue-btn {
  align-self: center;
  padding: 8px 20px;
  background: var(--primary);
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.history-continue-btn:active {
  background: var(--primary-dark);
  transform: scale(0.95);
}

/* ==========================================================================
   响应式 - 书架页面
   ========================================================================== */
@media (min-width: 768px) {
  .shelf-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .shelf-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}


/* ==========================================================================
   搜索结果分页样式
   ========================================================================== */
.pagination-wrapper {
  padding: 20px;
  padding-bottom: 80px;
  text-align: center;
}

.pagination {
  display: flex;
  gap: 8px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.pagination .page-link {
  display: inline-block;
  padding: 8px 12px;
  min-width: 36px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination .page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 140, 66, 0.1);
}

.pagination .page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  cursor: default;
  font-weight: 600;
}

.pagination .page-ellipsis {
  display: inline-block;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
}
