:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B7CF6;
  --secondary: #F472B6;
  --accent: #F59E0B;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-dark: #0F172A;
  --bg-card-dark: #1E293B;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  cursor: none;
}

body a, body button, body input, body textarea, body select, body .clickable {
  cursor: none;
}

/* ====== Sunflower Cursor ====== */
.sunflower-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  font-size: 28px;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: transform 0.08s ease, opacity 0.3s ease;
  will-change: transform;
  filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.4));
}
.sunflower-cursor.spin {
  animation: sunflowerSpin 0.6s ease-in-out;
}
@keyframes sunflowerSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}
.sunflower-cursor.hover {
  font-size: 36px;
  filter: drop-shadow(0 3px 10px rgba(255, 215, 0, 0.7));
}

/* ====== Cursor Trail ====== */
.cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99998;
  font-size: 10px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: transform, opacity;
}
.cursor-trail.show {
  opacity: 0.5;
}
.cursor-trail.fade {
  opacity: 0;
  transform: translateY(-20px) scale(0.3) rotate(45deg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

header .logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

header .logo span { font-size: 24px; }

header nav { display: flex; gap: 8px; }

header nav a {
  color: rgba(255,255,255,0.9);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  transition: var(--transition);
}

header nav a:hover, header nav a.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: calc(100vh - 120px);
}

.section { display: none; }
.section.active { display: block; }

.hero {
  position: relative;
  text-align: center;
  padding: 50px 0 36px;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* ====== Hero Background Blobs ====== */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(108,99,255,0.04) 0%, rgba(244,114,182,0.04) 50%, rgba(245,158,11,0.02) 100%);
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: blobFloat 12s ease-in-out infinite;
}
.hero-blob-1 {
  width: 300px; height: 300px;
  background: rgba(108,99,255,0.15);
  top: -80px; left: -60px;
  animation-delay: 0s;
}
.hero-blob-2 {
  width: 250px; height: 250px;
  background: rgba(244,114,182,0.12);
  bottom: -60px; right: -40px;
  animation-delay: -4s;
}
.hero-blob-3 {
  width: 200px; height: 200px;
  background: rgba(245,158,11,0.08);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -20px) scale(1.05); }
  50% { transform: translate(-10px, 10px) scale(0.95); }
  75% { transform: translate(15px, 15px) scale(1.02); }
}

/* ====== Hero Content ====== */
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.15);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-highlight {
  position: relative;
  display: inline-block;
}
.hero-highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -2px;
  right: -2px;
  height: 6px;
  background: rgba(244,114,182,0.2);
  border-radius: 3px;
  transform: translateY(4px);
}

.hero-quote-mark {
  font-size: 28px;
  opacity: 0.3;
  vertical-align: middle;
  display: inline-block;
  font-family: Georgia, serif;
}
.hero-quote-mark:first-child {
  margin-right: 4px;
  transform: translateY(-4px);
}
.hero-quote-mark:last-child {
  margin-left: 4px;
  transform: translateY(4px);
}

.hero p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ====== Mood Word Rotator ====== */
.mood-rotator {
  position: relative;
  display: inline-block;
  min-width: 50px;
  height: 24px;
  vertical-align: bottom;
}
.mood-word {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.mood-word.active {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Hero Decorative Icons ====== */
.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-deco-icon {
  position: absolute;
  font-size: 20px;
  opacity: 0.15;
  animation: decoFloat 6s ease-in-out infinite;
}
@keyframes decoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  50% { transform: translateY(-12px) rotate(10deg); opacity: 0.25; }
}

/* ====== Hero Daily Quote ====== */
.hero-daily {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-daily-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.hero-daily-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 0 2px 2px 0;
}
.hero-daily-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.12);
  border-color: var(--primary-light);
}
.hero-daily-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-daily-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  text-align: left;
}
.hero-daily-author {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 6px;
}
.hero-daily-skeleton {
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.search-bar {
  display: flex;
  max-width: 600px;
  margin: 24px auto;
  gap: 8px;
}

.search-bar input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  background: var(--bg-card);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.search-bar button {
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.search-bar button:hover { background: var(--primary-dark); }

/* Search Suggestions */
.search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 4px;
}
.search-suggestions.show { display: block; }
.search-suggestions .suggest-title {
  padding: 8px 14px 4px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}
.search-suggestions .suggest-title:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.search-suggestions .suggest-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.search-suggestions .suggest-item:hover { background: rgba(108,99,255,0.04); }
.search-suggestions .suggest-item .suggest-name { font-size: 14px; color: var(--text); }
.search-suggestions .suggest-item .suggest-name mark { background: rgba(245,158,11,0.25); color: var(--text); border-radius: 2px; padding: 0 2px; }
.search-suggestions .suggest-item .suggest-meta { font-size: 12px; color: var(--text-light); white-space: nowrap; }

/* Book Results */
.book-results-section {
  margin-bottom: 24px;
}
.book-results-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  padding: 0 4px;
}
.book-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}
.book-card .book-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.book-card .book-card-author {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 6px;
}
.book-card .book-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.book-card .book-card-category {
  font-size: 11px;
  color: var(--text-light);
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 4px;
}

/* Book Detail */
.book-detail .book-detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.book-detail .book-detail-icon {
  font-size: 40px;
  line-height: 1;
}
.book-detail .book-detail-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.book-detail .book-detail-author {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 2px;
}
.book-detail .book-detail-category {
  font-size: 13px;
  color: var(--text-light);
}
.book-detail .book-detail-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-line;
}
.book-detail .related-books {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.book-detail .related-book-item {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.book-detail .related-book-item:hover { background: rgba(108,99,255,0.06); }
.book-detail .related-book-item .related-book-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.book-detail .related-book-item .related-book-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .book-results-grid { grid-template-columns: 1fr; }
}

.tag-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}

.tag-filter .tag-btn {
  padding: 6px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  color: var(--text-secondary);
}

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

.tag-filter .tag-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.quote-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
}

.quote-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.quote-card .content {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 12px;
  color: var(--text);
}

.quote-card .meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.quote-card .meta .author {
  font-weight: 500;
}

.quote-card .meta .source {
  color: var(--text-light);
}

.quote-card .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quote-card .tags .tag {
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(108, 99, 255, 0.08);
  color: var(--primary);
}

.quote-card .card-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quote-card .card-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.quote-card .card-actions button:hover {
  color: var(--primary);
  background: rgba(108, 99, 255, 0.06);
}

.detail-page {
  max-width: 720px;
  margin: 0 auto;
}

.detail-page .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.detail-page .back:hover {
  background: var(--border);
  color: var(--text);
}

.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.detail-card .content {
  font-size: 20px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: var(--text);
  font-weight: 500;
}

.detail-card .author-line {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.detail-card .source-line {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.detail-card .detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.detail-card .detail-tags .tag {
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 13px;
  background: rgba(108, 99, 255, 0.08);
  color: var(--primary);
}

.detail-card .copy-btn {
  padding: 10px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.detail-card .copy-btn:hover { background: var(--primary-dark); }

.detail-card .detail-stats {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-light);
}

/* Admin */
.admin-page {
  max-width: 1000px;
  margin: 0 auto;
}

.admin-login {
  max-width: 400px;
  margin: 80px auto;
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.admin-login h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
}

.admin-login .form-group {
  margin-bottom: 16px;
}

.admin-login label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.admin-login input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.admin-login input:focus {
  border-color: var(--primary);
}

.admin-login .btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.admin-login .btn-primary:hover { background: var(--primary-dark); }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 { font-size: 22px; }
.admin-header .logout-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.admin-header .logout-btn:hover { background: var(--border); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card .number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-toolbar .btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

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

.admin-toolbar .btn-primary:hover { background: var(--primary-dark); }

.admin-toolbar .btn:hover { border-color: var(--primary); color: var(--primary); }

.admin-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: rgba(108, 99, 255, 0.02); }

.admin-table .preview {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table .action-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  margin-right: 4px;
}

.admin-table .edit-btn { background: rgba(108,99,255,0.1); color: var(--primary); }
.admin-table .edit-btn:hover { background: var(--primary); color: white; }
.admin-table .del-btn { background: rgba(239,68,68,0.1); color: #EF4444; }
.admin-table .del-btn:hover { background: #EF4444; color: white; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h3 { margin-bottom: 20px; font-size: 18px; }

.modal .form-group { margin-bottom: 14px; }

.modal label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal input, .modal textarea, .modal select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.modal textarea { min-height: 80px; resize: vertical; }

.modal input:focus, .modal textarea:focus { border-color: var(--primary); }

.modal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal .modal-actions button {
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.modal .modal-actions .btn-cancel { background: var(--bg); }
.modal .modal-actions .btn-cancel:hover { background: var(--border); }
.modal .modal-actions .btn-save { background: var(--primary); color: white; border-color: var(--primary); }
.modal .modal-actions .btn-save:hover { background: var(--primary-dark); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.pagination button:hover, .pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }
.toast.success { background: #10B981; }
.toast.error { background: #EF4444; }

.tag-manager {
  margin-top: 20px;
}

.tag-manager .tag-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.tag-manager .tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.tag-manager .tag-item .remove-btn {
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  background: none;
  border: none;
}

.tag-manager .tag-item .remove-btn:hover { color: #EF4444; }

footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-light);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  header .header-inner { height: 52px; }
  header .logo { font-size: 17px; }
  header nav a { padding: 4px 10px; font-size: 13px; }
  .hero { padding: 30px 0 24px; margin-bottom: 0; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero-quote-mark { font-size: 20px; }
  .hero-blob-1 { width: 200px; height: 200px; }
  .hero-blob-2 { width: 160px; height: 160px; }
  .hero-blob-3 { width: 120px; height: 120px; }
  .hero-daily-card { padding: 14px 18px; }
  .hero-daily-text { font-size: 14px; }
  .hero-deco-icon { display: none; }
  .quote-grid { grid-template-columns: 1fr; gap: 12px; }
  .detail-card { padding: 24px; }
  .detail-card .content { font-size: 17px; }
  .admin-table .preview { max-width: 160px; }
  .search-bar input { padding: 10px 16px; font-size: 14px; }
  .search-bar button { padding: 10px 20px; font-size: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Comment Section */
.comment-section {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.comment-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text);
}

.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  resize: vertical;
}

.comment-form textarea:focus {
  border-color: var(--primary);
}

.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.comment-user {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.comment-time {
  font-size: 12px;
  color: var(--text-light);
}

.comment-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.empty-comment {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 14px;
}

/* Auth */
.login-user-btn, .register-user-btn, .logout-user-btn {
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.login-user-btn:hover, .register-user-btn:hover, .logout-user-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Admin Status Tags */
.status-tag { padding: 2px 10px; border-radius: 50px; font-size: 12px; font-weight: 500; }
.status-pending { background: rgba(245,158,11,0.12); color: #F59E0B; }
.status-approved { background: rgba(16,185,129,0.12); color: #10B981; }
.status-rejected { background: rgba(239,68,68,0.12); color: #EF4444; }

/* ====== 阅读器 ====== */
.reader-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}
.reader-header {
  text-align: center;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.reader-book-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.reader-chapter-title {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.reader-content {
  line-height: 2;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px;
  color: var(--text);
  font-size: 18px;
}
.reader-content p {
  text-indent: 2em;
  margin-bottom: 0.5em;
}
.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.reader-nav-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity .2s;
}
.reader-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.reader-nav-btn:not(:disabled):hover {
  opacity: 0.9;
}
.reader-progress {
  font-size: 13px;
  color: var(--text-secondary);
}
.reader-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}
.reader-ctrl-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.reader-ctrl-btn:hover {
  background: var(--bg);
}

/* ====== 章节列表 ====== */
.book-chapters {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.chapter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background .15s;
  border: 1px solid var(--border);
}
.chapter-item:hover {
  background: var(--primary);
  color: #fff;
}
.chapter-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  min-width: 20px;
}
.chapter-item:hover .chapter-num {
  color: #fff;
}
.chapter-title {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark-mode-btn, .music-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: var(--transition);
  margin-left: 4px;
}
.dark-mode-btn:hover, .music-btn:hover { border-color: var(--primary); }
.music-btn.playing {
  border-color: var(--secondary);
  color: var(--secondary);
  animation: pulse 2s ease infinite;
}
.music-btn.playing::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1.2s ease infinite;
}

.like-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}
.like-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.like-btn.liked { border-color: var(--secondary); color: var(--secondary); background: rgba(244,114,182,0.08); }

body.dark {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --text: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-light: #64748B;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
}
body.dark header { background: rgba(15,23,42,0.95); border-bottom-color: #334155; }
body.dark .quote-card { background: var(--bg-card); }
body.dark .tag:hover { background: rgba(108,99,255,0.2) !important; }
body.dark .search-bar input { background: var(--bg-card); color: var(--text); border-color: var(--border); }
body.dark .detail-card { background: var(--bg-card); }
body.dark .comment-item { background: var(--bg-card); }
body.dark .book-card { background: var(--bg-card); }
body.dark .modal-content { background: var(--bg-card); }
body.dark .search-suggestions { background: var(--bg-card); border-color: var(--border); }
body.dark .pagination button { background: var(--bg-card); color: var(--text); border-color: var(--border); }
body.dark .pagination button:hover { background: var(--primary); }
body.dark .pagination button.active { background: var(--primary); }
body.dark .hero-bg { background: linear-gradient(135deg, rgba(108,99,255,0.08) 0%, rgba(244,114,182,0.06) 50%, rgba(245,158,11,0.04) 100%); }
body.dark .hero-blob-1 { background: rgba(108,99,255,0.2); }
body.dark .hero-blob-2 { background: rgba(244,114,182,0.15); }
body.dark .hero-blob-3 { background: rgba(245,158,11,0.1); }
body.dark .hero-daily-card { background: var(--bg-card); border-color: var(--border); }
body.dark .hero-daily-card:hover { border-color: var(--primary-light); }
body.dark .hero-badge { background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.25); }
body.dark .reader-content { background: var(--bg-card); }
body.dark .admin-panel { background: var(--bg-card); }
body.dark .admin-stats .stat-card { background: var(--bg-card); }
body.dark .admin-table th { background: #1a2332; }
body.dark .empty-comment { color: var(--text-secondary); }
body.dark .floating-particle { opacity: 0.15; }
body.dark .section.active { animation: none; }

/* ====== Keyframe Animations ====== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(2deg); }
  66% { transform: translateY(6px) rotate(-1deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 4px rgba(108,99,255,0.2); }
  50% { box-shadow: 0 0 16px rgba(108,99,255,0.4); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ====== Section Transitions ====== */
.section {
  animation: fadeIn 0.35s ease;
}

.hero {
  animation: fadeInDown 0.5s ease both;
}

/* ====== Card Entrance Animations (JS-managed via IntersectionObserver) ====== */

/* ====== Enhanced Card Hover ====== */
.quote-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quote-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 32px -8px rgba(108,99,255,0.15), 0 8px 16px -4px rgba(0,0,0,0.06);
  border-color: var(--primary-light);
}
.quote-card:active {
  transform: translateY(-1px) scale(0.99);
}

.tag:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.tag-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.tag-btn:hover {
  transform: translateY(-1px);
}
.tag-btn:active {
  transform: scale(0.95);
}

/* ====== Like Button Animation ====== */
.like-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.like-btn:hover {
  transform: scale(1.08);
}
.like-btn:active {
  transform: scale(0.9);
}
.like-btn.liked {
  animation: heartBeat 0.4s ease;
}

/* ====== Modal Animated Entrance ====== */
.modal-overlay {
  transition: opacity 0.25s ease;
}
.modal-overlay.show .modal {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ====== Toast Entrance ====== */
.toast {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.3s ease;
}
.toast.show {
  animation: fadeInUp 0.3s ease both;
}

/* ====== Detail Card ====== */
.detail-card {
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ====== Book Card Hover ====== */
.book-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(108,99,255,0.15);
}

/* ====== Pagination Button ====== */
.pagination button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pagination button:active {
  transform: scale(0.92);
}

/* ====== Copy/Save Button Ripple ====== */
.copy-btn, .btn-save, .btn-primary {
  position: relative;
  overflow: hidden;
}
.copy-btn::after, .btn-save::after, .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.copy-btn:active::after, .btn-save:active::after, .btn-primary:active::after {
  opacity: 1;
}

/* ====== Skeleton Loading ====== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 4px;
}
.skeleton-line:last-child { width: 60%; }

/* ====== Ambient Floating Particles ====== */
.floating-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.floating-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: float 8s ease-in-out infinite;
}
.floating-particle:nth-child(1) { width: 60px; height: 60px; background: var(--primary); top: 10%; left: 5%; animation-duration: 9s; animation-delay: 0s; }
.floating-particle:nth-child(2) { width: 40px; height: 40px; background: var(--secondary); top: 30%; left: 85%; animation-duration: 11s; animation-delay: 1s; }
.floating-particle:nth-child(3) { width: 80px; height: 80px; background: var(--primary-light); top: 55%; left: 10%; animation-duration: 13s; animation-delay: 2s; }
.floating-particle:nth-child(4) { width: 30px; height: 30px; background: var(--accent); top: 70%; left: 75%; animation-duration: 10s; animation-delay: 0.5s; }
.floating-particle:nth-child(5) { width: 50px; height: 50px; background: var(--secondary); top: 85%; left: 50%; animation-duration: 12s; animation-delay: 3s; }
.floating-particle:nth-child(6) { width: 35px; height: 35px; background: var(--primary); top: 15%; left: 60%; animation-duration: 8s; animation-delay: 1.5s; }
.floating-particle:nth-child(7) { width: 45px; height: 45px; background: var(--accent); top: 45%; left: 30%; animation-duration: 14s; animation-delay: 0.8s; }
.floating-particle:nth-child(8) { width: 25px; height: 25px; background: var(--primary-light); top: 90%; left: 20%; animation-duration: 9.5s; animation-delay: 2.5s; }

/* ====== Comment Item Entrance ====== */
.comment-item {
  animation: slideInRight 0.4s ease both;
}
.comment-item:nth-child(1) { animation-delay: 0.05s; }
.comment-item:nth-child(2) { animation-delay: 0.10s; }
.comment-item:nth-child(3) { animation-delay: 0.15s; }
.comment-item:nth-child(4) { animation-delay: 0.20s; }
.comment-item:nth-child(5) { animation-delay: 0.25s; }

/* ====== Admin Section Entrance ====== */
.admin-section.active {
  animation: fadeInUp 0.35s ease both;
}

/* ====== Dark Mode Toggle Animation ====== */
.dark-mode-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark-mode-btn:hover {
  transform: rotate(20deg) scale(1.1);
}
.dark-mode-btn:active {
  transform: rotate(40deg) scale(0.9);
}

/* ====== Search Suggestions ====== */
.search-suggestions.show {
  animation: fadeInUp 0.25s ease both;
}

@media (max-width: 480px) {
  .reader-content { font-size: 16px; padding: 0 8px; }
  .chapters-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .reader-nav { flex-direction: column; gap: 12px; }
  .reader-controls { bottom: 12px; right: 12px; }
}
