/* ============================================================
   小说在线 · 青绿书城风样式
   主题色：青 #10a37f / 深青 #0b8a6b / 金 #c9a04a / 青墨 #16312b
   ============================================================ */

:root {
  --teal: #10a37f;
  --teal-deep: #0b8a6b;
  --teal-ink: #073d31;
  --teal-soft: #e6f7f1;
  --gold: #c9a04a;
  --ink: #16312b;
  --ink-2: #4a6259;
  --ink-3: #8ba097;
  --bg: #f7fbf9;
  --card: #ffffff;
  --line: #dfece6;
  --shadow: 0 10px 30px rgba(16, 163, 127, .10);
  --shadow-lg: 0 16px 44px rgba(22, 49, 43, .14);
  --radius: 16px;
  --container: 1150px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 251, 249, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 26px; height: 70px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; color: var(--ink); white-space: nowrap;
}
.logo em {
  font-style: normal;
  background: linear-gradient(120deg, var(--teal), var(--teal-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.logo-mark { width: 38px; height: 38px; flex: none; display: flex; align-items: center; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--ink-2);
  transition: all .25s;
}
.main-nav a:hover { color: var(--teal); background: var(--teal-soft); }
.main-nav a.active { color: #fff; background: linear-gradient(120deg, var(--teal), var(--teal-deep)); box-shadow: 0 6px 16px rgba(16, 163, 127, .35); }

.search-box {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  width: 230px; height: 40px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--ink-3);
  transition: all .25s;
}
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(16, 163, 127, .12); }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink); font-family: inherit;
}
.search-box input::placeholder { color: var(--ink-3); }

.nav-toggle {
  display: none; border: none; background: none; cursor: pointer;
  padding: 8px; color: var(--ink); border-radius: 8px;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 480px at 88% -10%, rgba(16, 163, 127, .14), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(201, 160, 74, .12), transparent 60%),
    linear-gradient(180deg, #eef9f4, var(--bg));
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(16, 163, 127, .12) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  opacity: .5;
}

.hero-inner {
  position: relative;
  display: flex; align-items: center; gap: 48px;
  padding: 76px 0 88px;
}
.hero-text { flex: 1 1 54%; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: #fff; border: 1px solid #bfe6d8;
  color: var(--teal-deep); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(16, 163, 127, .12);
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(16, 163, 127, .55);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 163, 127, .5); }
  70% { box-shadow: 0 0 0 9px rgba(16, 163, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
}

.hero h1 {
  margin: 22px 0 16px;
  font-size: 52px; line-height: 1.24; font-weight: 900; letter-spacing: 1px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--teal) 10%, var(--teal-deep) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.hero .lead { max-width: 520px; font-size: 16.5px; color: var(--ink-2); margin-bottom: 30px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 999px;
  font-size: 15.5px; font-weight: 700;
  transition: all .25s; cursor: pointer; border: none;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--teal), var(--teal-deep));
  box-shadow: 0 10px 24px rgba(16, 163, 127, .4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(16, 163, 127, .5); }
.btn-ghost { color: var(--ink); background: #fff; border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-deep); }

.hero-stats { display: flex; gap: 34px; margin-top: 36px; }
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; font-weight: 900; color: var(--ink); }
.hero-stats span { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* 热榜面板（右侧视觉） */
.hero-visual { flex: 0 1 46%; position: relative; display: flex; justify-content: center; }

.rank-panel {
  width: 330px; max-width: 100%;
  background: var(--ink);
  border-radius: 20px;
  padding: 22px 24px 20px;
  color: #e4efeb;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.6deg);
  transition: transform .4s;
}
.rank-panel:hover { transform: rotate(0deg) translateY(-4px); }

.rank-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: #cfe3db; margin-bottom: 14px;
}
.r-badge {
  font-size: 11px; padding: 2.5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #d7e6e0;
}

.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin-bottom: 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 12px; font-size: 14px;
}
.rank-row i {
  font-style: normal; width: 24px; height: 24px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 12.5px; font-weight: 900; color: #fff;
  background: rgba(255, 255, 255, .18);
}
.rank-row.top1 i { background: linear-gradient(135deg, #f2b84b, #e58c1c); }
.rank-row.top2 i { background: linear-gradient(135deg, #a9b4c0, #77808c); }
.rank-row.top3 i { background: linear-gradient(135deg, #c98a5f, #a8633b); }
.rank-row span { font-weight: 800; color: #fff; }
.rank-row em { font-style: normal; margin-left: auto; font-size: 12px; color: #9fb8ae; }

.rank-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; margin: 14px 0 10px; }
.rank-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 4px;
}
.rank-foot { font-size: 11.5px; color: #7f988e; text-align: center; }

.float-chip {
  position: absolute;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  background: #fff; box-shadow: var(--shadow);
  animation: floaty 4.5s ease-in-out infinite;
}
.chip1 { top: 6%; left: 2%; color: var(--teal-deep); }
.chip2 { top: 46%; right: -4%; color: #b8862b; animation-delay: 1.2s; }
.chip3 { bottom: 2%; left: 6%; color: var(--teal); animation-delay: 2.3s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* ---------------- 通用区块 ---------------- */
.section { padding: 66px 0; }
.section-alt { background: #edf7f2; }

.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 34px; font-weight: 900; letter-spacing: 1px; }
.section-head h2 span {
  background: linear-gradient(120deg, var(--teal), var(--teal-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section-head p { color: var(--ink-3); font-size: 14.5px; margin-top: 8px; }

/* ---------------- 精选书单 ---------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(22, 49, 43, .05);
  transition: all .3s;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #bfe6d8;
}

.cover { position: relative; overflow: hidden; aspect-ratio: 400 / 560; background: #eef4f1; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.book-card:hover .cover img { transform: scale(1.06); }

.rank {
  position: absolute; top: 14px; left: 14px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 900; font-size: 18px; color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  box-shadow: 0 6px 14px rgba(16, 163, 127, .45);
}

.book-body { padding: 18px 20px 20px; }
.book-body h3 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }

.author { font-size: 13.5px; color: var(--ink-3); margin-bottom: 10px; }
.tag {
  font-style: normal;
  display: inline-block;
  margin-left: 6px; padding: 2px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700;
  color: var(--teal-deep); background: var(--teal-soft);
}

.intro {
  font-size: 14px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em; margin-bottom: 12px;
}

.meta { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.meta b { color: var(--teal-deep); font-size: 14px; }

.read-btn {
  width: 100%;
  padding: 11px 0; border-radius: 12px;
  border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  color: #fff;
  background: linear-gradient(120deg, var(--teal), var(--teal-deep));
  box-shadow: 0 8px 18px rgba(16, 163, 127, .32);
  transition: all .25s;
}
.read-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(16, 163, 127, .42); }

/* ---------------- 热榜风云 ---------------- */
.rank-list { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }

.rank-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  transition: all .25s;
}
.rank-item:hover { border-color: #bfe6d8; transform: translateX(4px); box-shadow: var(--shadow); }

.rank-item > i {
  font-style: normal; width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 14.5px; font-weight: 900; color: #fff;
  background: #c6d4ce;
}
.r-1 { background: linear-gradient(135deg, #f2b84b, #e58c1c) !important; }
.r-2 { background: linear-gradient(135deg, #a9b4c0, #77808c) !important; }
.r-3 { background: linear-gradient(135deg, #c98a5f, #a8633b) !important; }

.r-name { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.r-tag {
  flex: none; padding: 2.5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--teal-deep); background: var(--teal-soft);
}
.r-desc { flex: 1; font-style: normal; font-size: 13px; color: var(--ink-3); }
.heat { font-style: normal; font-size: 13.5px; font-weight: 800; color: #e58c1c; white-space: nowrap; }

/* ---------------- 新书速递 ---------------- */
.news-list { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.news-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  transition: all .25s;
}
.news-item:hover { border-color: #bfe6d8; transform: translateX(4px); box-shadow: var(--shadow); }
.news-item a { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); }
.news-item a:hover { color: var(--teal-deep); }
.news-item > span:last-child { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

.n-tag { flex: none; padding: 3.5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.t-fire { color: #e58c1c; background: #fdf3e3; }
.t-new { color: var(--teal-deep); background: var(--teal-soft); }
.t-god { color: #b8862b; background: #fdf4df; }
.t-pub { color: #7a5cff; background: #f1ecff; }

/* ---------------- 分类书库 ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 16px; font-weight: 700; color: var(--ink);
  transition: all .28s;
}
.cat-item:hover {
  transform: translateY(-4px);
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(16, 163, 127, .35);
}
.cat-icon { font-size: 30px; }

/* ---------------- 关于本站 ---------------- */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.about-item {
  padding: 32px 28px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center;
  transition: all .28s;
}
.about-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.about-item svg { width: 46px; height: 46px; margin: 0 auto 16px; color: var(--teal); }
.about-item h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.about-item p { font-size: 14px; color: var(--ink-2); }

/* ---------------- 页脚 ---------------- */
.site-footer { margin-top: 20px; background: var(--ink); color: #a9c4ba; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
  padding: 54px 0 40px;
}

.footer-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; max-width: 300px; color: #7f9d91; }

.footer-col h4 { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; color: #a9c4ba; transition: color .2s; }
.footer-col a:hover { color: #4fd0aa; }

.footer-bottom { padding: 20px 0 26px; border-top: 1px solid rgba(255, 255, 255, .10); }
.footer-bottom p { font-size: 12.5px; line-height: 1.8; color: #7f9d91; }

/* ---------------- Toast / 返回顶部 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 200;
  transform: translate(-50%, 20px);
  padding: 13px 24px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 14.5px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all .35s;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.back-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 150;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  box-shadow: 0 10px 22px rgba(16, 163, 127, .45);
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: all .3s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { transform: translateY(-3px); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { flex-direction: column; gap: 60px; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-visual { width: 100%; }
  .search-box { width: 170px; }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed; top: 70px; left: 0; right: 0; z-index: 99;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 10px 20px 16px;
    transform: translateY(-130%);
    transition: transform .32s;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 12px 16px; border-radius: 10px; }
  .search-box { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }
  .hero h1 { font-size: 40px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .float-chip.chip2 { right: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero-inner { padding: 52px 0 64px; }
  .hero h1 { font-size: 34px; }
  .book-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .section { padding: 52px 0; }
  .section-head h2 { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-stats { gap: 24px; }
  .news-item { flex-wrap: wrap; }
  .news-item > span:last-child { margin-left: auto; }
}