/* ============================================
   严论小说站 - 全局样式 (v1.0)
   notes.yswxstudy.cn
   中国风 + 年轻化 手机端优先响应式
   ============================================ */

/* ---- CSS 变量 ---- */
:root {
  --accent: #E8543E;
  --accent-dark: #C7452F;
  --accent-light: #FF6B55;
  --accent-bg: #FFF0ED;
  --bg-page: #FAF8F6;
  --bg-card: #FFFFFF;
  --text-primary: #2C2416;
  --text-secondary: #8B7355;
  --text-muted: #A69888;
  --border: #E8DFD5;
  --border-light: #F2EDE6;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.10);
  --shadow-card: 0 1px 8px rgba(0,0,0,0.04);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --header-height: 56px;
  --bottom-bar-height: 56px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 700; line-height: 1.3; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { margin-bottom: 32px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; display: block;
  width: 4px; height: 20px; border-radius: 2px;
  background: var(--accent);
}
.section-more {
  font-size: 0.85rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px;
}
.section-more:hover { color: var(--accent); }

/* ---- Grid ---- */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col { padding: 0 8px; flex: 1; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 50px; font-size: 0.9rem;
  font-weight: 600; transition: all 0.2s ease;
  white-space: nowrap; user-select: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(232,84,62,0.3);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,84,62,0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-outline {
  border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
}
.btn-outline:hover { background: var(--accent-bg); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--accent); background: var(--bg-page); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1rem; }

/* ---- Tags ---- */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 500; line-height: 1.6;
}
.tag-primary { background: var(--accent-bg); color: var(--accent); }
.tag-outline { border: 1px solid var(--border); color: var(--text-secondary); }
.tag-status { font-size: 0.72rem; padding: 2px 10px; border-radius: 50px; }
.tag-status.serial { background: #E8F5E9; color: #2E7D32; }
.tag-status.completed { background: #FFF3E0; color: #E65100; }

/* ---- Cards ---- */
.novel-card {
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-card);
  transition: all 0.25s ease; position: relative;
}
.novel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.novel-card .card-cover {
  position: relative; width: 100%;
  padding-top: 131.25%; /* 160:210 */
  background: var(--border-light); overflow: hidden;
}
.novel-card .card-cover img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.novel-card .card-cover .cover-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 2rem; color: var(--text-muted);
  background: linear-gradient(135deg, #F5F0EB 0%, #EDE7DE 100%);
}
.novel-card .card-body { padding: 10px 12px 14px; }
.novel-card .card-title {
  font-family: var(--font-serif); font-size: 0.95rem; font-weight: 600;
  line-height: 1.4; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.novel-card .card-meta {
  font-size: 0.72rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.novel-card .card-tags { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 0.65rem; font-weight: 700; color: #fff; padding: 0 5px;
}
.badge-gold { background: linear-gradient(135deg, #F9A825, #FF8F00); }
.badge-silver { background: linear-gradient(135deg, #9E9E9E, #757575); }
.badge-bronze { background: linear-gradient(135deg, #A1887F, #795548); }

/* ---- Pagination ---- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 24px 0;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; border-radius: var(--radius-xs);
  font-size: 0.85rem; transition: all 0.15s ease;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ---- Navbar ---- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.navbar .logo {
  font-family: var(--font-serif); font-size: 1.3rem; font-weight: 700;
  color: var(--accent); display: flex; align-items: center; gap: 6px;
}
.navbar .logo img { width: 28px; height: 28px; border-radius: 6px; }
.navbar .nav-links { display: flex; align-items: center; gap: 4px; }
.navbar .nav-links a {
  padding: 8px 14px; border-radius: 50px; font-size: 0.88rem;
  font-weight: 500; color: var(--text-secondary); transition: all 0.2s;
}
.navbar .nav-links a:hover, .navbar .nav-links a.active {
  color: var(--accent); background: var(--accent-bg);
}
.navbar .nav-actions { display: flex; align-items: center; gap: 8px; }
.navbar .user-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); }
.navbar .user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Search Bar ---- */
.search-bar {
  position: relative; display: flex; align-items: center;
}
.search-bar input {
  width: 200px; height: 36px; padding: 0 36px 0 14px;
  border: 1px solid var(--border); border-radius: 50px;
  background: var(--bg-page); font-size: 0.85rem;
  transition: all 0.3s ease; outline: none;
}
.search-bar input:focus { width: 280px; border-color: var(--accent); background: #fff; }
.search-bar button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 40px 16px 24px; margin-top: 48px;
}
.footer-brand { text-align: center; margin-bottom: 20px; }
.footer-brand .brand-name {
  font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
}
.footer-brand .brand-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.footer-links {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px;
}
.footer-links a { font-size: 0.8rem; color: var(--text-secondary); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { text-align: center; font-size: 0.72rem; color: var(--text-muted); line-height: 1.8; }

/* ---- Load More ---- */
.load-more {
  text-align: center; padding: 16px 0;
}
.load-more .btn { min-width: 160px; }
.load-more .loading-text { display: none; }
.load-more.loading .btn-text { display: none; }
.load-more.loading .loading-text { display: inline-flex; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed; bottom: 80px; right: 20px; z-index: 99;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-secondary);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: all 0.3s ease; cursor: pointer; border: 1px solid var(--border);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Empty State ---- */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state .empty-text { font-size: 0.9rem; }

/* ---- Toast ---- */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 24px; border-radius: 50px; font-size: 0.85rem; font-weight: 500;
  background: var(--text-primary); color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  pointer-events: auto; white-space: nowrap;
}
.toast.success { background: #2E7D32; }
.toast.error { background: var(--accent-dark); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ---- Loading Spinner ---- */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, #fff 50%, var(--border-light) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-cover { padding-top: 131.25%; border-radius: var(--radius); }
.skeleton-title { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton-text { height: 12px; width: 60%; }

/* ---- Reader Basics ---- */
.reader-content {
  max-width: 700px; margin: 0 auto; padding: 24px 20px;
  font-family: var(--font-serif); line-height: 2;
  word-break: break-word;
}
.reader-content p { margin-bottom: 1em; text-indent: 2em; }
.reader-content .chapter-title {
  text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 32px;
}

/* Font size classes */
.fs-sm { font-size: 14px; }
.fs-md { font-size: 16px; }
.fs-lg { font-size: 18px; }
.fs-xl { font-size: 20px; }

/* Reading themes */
.theme-light { background: #FFFFFF; color: #2C2416; }
.theme-warm { background: #F5ECD7; color: #3E3225; }
.theme-dark { background: #2B2B2B; color: #C8C8C8; }

/* ---- Horizontal Scroll ---- */
.h-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; -ms-overflow-style: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll-item { flex-shrink: 0; }

/* ---- Tabs ---- */
.tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-item {
  padding: 12px 20px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  transition: all 0.2s; cursor: pointer;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Banner ---- */
.banner-wrapper {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.banner-slide {
  display: flex; position: relative; height: 280px;
  background: linear-gradient(135deg, #3E3225 0%, #5C4B37 100%);
}
.banner-slide .banner-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.5;
}
.banner-slide .banner-info {
  position: relative; z-index: 1; padding: 32px 40px;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 60%; color: #fff;
}
.banner-slide .banner-novel-title {
  font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; margin-bottom: 8px;
}
.banner-slide .banner-desc {
  font-size: 0.85rem; opacity: 0.85; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 16px;
}
.banner-slide .banner-btn { align-self: flex-start; }
.banner-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.banner-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.4); transition: all 0.3s; cursor: pointer;
}
.banner-dots .dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* ---- Chapter List ---- */
.chapter-list { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.chapter-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  font-weight: 600; font-family: var(--font-serif);
}
.chapter-list-item {
  display: flex; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s; gap: 12px;
}
.chapter-list-item:hover { background: var(--bg-page); }
.chapter-list-item:last-child { border-bottom: none; }
.chapter-list-item .ch-num {
  min-width: 32px; font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
}
.chapter-list-item .ch-title { flex: 1; font-size: 0.9rem; font-weight: 500; }
.chapter-list-item .ch-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ---- Rank List ---- */
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  margin-bottom: 8px; transition: transform 0.2s;
}
.rank-item:hover { transform: translateX(4px); }
.rank-num {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; border-radius: 6px; flex-shrink: 0;
}
.rank-num.top1 { background: #FFF8E1; color: #F9A825; }
.rank-num.top2 { background: #F5F5F5; color: #9E9E9E; }
.rank-num.top3 { background: #EFEBE9; color: #8D6E63; }
.rank-num.normal { color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .banner-slide { height: 200px; }
  .banner-slide .banner-info { padding: 20px 24px; max-width: 80%; }
  .banner-slide .banner-novel-title { font-size: 1.3rem; }
  .navbar .nav-links { display: none; }
  .search-bar input { width: 140px; }
  .search-bar input:focus { width: 200px; }
  .reader-content { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .section-title { font-size: 1.1rem; }
  .banner-slide { height: 160px; }
  .banner-slide .banner-info { padding: 16px; max-width: 100%; }
  .banner-slide .banner-novel-title { font-size: 1.1rem; }
  .banner-slide .banner-desc { -webkit-line-clamp: 2; font-size: 0.75rem; }
  .banner-slide .banner-btn { padding: 6px 14px; font-size: 0.78rem; }
  .btn { padding: 8px 16px; font-size: 0.82rem; }
  .novel-card .card-body { padding: 8px 10px 12px; }
  .novel-card .card-title { font-size: 0.85rem; }
  .footer-links { gap: 12px; }
}
