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

:root {
  --text: #1a1a1a;
  --text-2: #666;
  --text-3: #999;
  --line: #ececec;
  --bg: #ffffff;
  --accent: #1a1a1a;
  --hover: #4a7de2;
}

html { -webkit-text-size-adjust: 100%; }

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;
  display: flex;
  flex-direction: column;
}

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

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; flex: 1; }

.tip { color: var(--text-3); text-align: center; padding: 80px 0; font-size: 15px; }

.footer {
  padding: 24px 0 32px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.footer-copy { margin: 0; }
.footer-icp { margin: 6px 0 0; }
.footer-icp a { color: var(--text-3); }
.footer-icp a:hover { color: var(--text-2); }
.footer-disclaimer {
  margin: 10px 0 0;
  padding: 0 20px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ========== 首页 ========== */
.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.home-logo { text-align: center; color: #1a1a1a; margin-bottom: 44px; }
.home-logo-img { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto; }
.home-logo h1 { font-size: 44px; font-weight: 700; letter-spacing: 6px; margin-top: 14px; }
.home-slogan { color: var(--text-3); font-size: 15px; letter-spacing: 2px; margin-top: 10px; }

/* 首页 banner（替换图片时保持文件名 banner.jpg 即可） */
.home-banner {
  width: 100%;
  max-width: 560px;
  margin-top: 28px;
}
.home-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.home-search {
  display: flex;
  width: 100%;
  max-width: 560px;
  border: 1.5px solid #e0e0e0;
  border-radius: 28px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
  background: #fff;
}
.home-search:focus-within { border-color: #c8c8c8; box-shadow: 0 6px 24px rgba(0,0,0,.07); }

.home-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 15px 24px;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}

.home-search button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0 28px;
  font-size: 15px;
  cursor: pointer;
}
.home-search button:hover { background: #333; }

/* ========== 顶栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }

.topbar-search {
  display: flex;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.topbar-search input { flex: 1; border: none; outline: none; padding: 8px 16px; font-size: 14px; background: transparent; }
.topbar-search button { border: none; background: transparent; color: var(--text-2); padding: 0 14px; cursor: pointer; }
.topbar-search button:hover { color: var(--text); }

/* ========== 搜索结果 ========== */
.result-count { color: var(--text-3); font-size: 14px; margin-bottom: 18px; }

.result-list { list-style: none; }
.result-item { padding: 18px 4px; border-bottom: 1px solid var(--line); }
.result-title { font-size: 18px; font-weight: 600; }
.result-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* ========== 书籍详情 ========== */
.book-head { display: flex; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.book-cover { width: 120px; height: 168px; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.12); flex-shrink: 0; background: #f5f5f5; }
.book-info { flex: 1; min-width: 0; }
.book-title { font-size: 26px; font-weight: 700; }
.book-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-2); font-size: 14px; margin-top: 10px; }
.book-intro { color: var(--text-2); font-size: 14px; margin-top: 14px; line-height: 1.8; }
.btn-start {
  display: inline-block;
  margin-top: 18px;
  padding: 9px 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 22px;
  font-size: 15px;
}
.btn-start:hover { background: #333; color: #fff; }

.chapter-box { padding-top: 24px; }
.chapter-box-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.chapter-list { list-style: none; columns: 2; column-gap: 32px; }
.chapter-list li { break-inside: avoid; }
.chapter-list a {
  display: block;
  padding: 7px 0;
  font-size: 14.5px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-list a:hover { color: var(--hover); }

/* ========== 阅读页 ========== */
.read-toolbar { display: flex; justify-content: flex-end; padding: 10px 24px 0; }
.read-tools-right { display: flex; gap: 8px; }
.read-tools-right button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
}
.read-tools-right button:hover { color: var(--text); border-color: #ccc; }

.read-main { width: 100%; max-width: 680px; margin: 0 auto; padding: 28px 20px 70px; flex: 1; }
.read-title { font-size: 24px; font-weight: 700; text-align: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.read-content { padding-top: 30px; font-size: 19px; line-height: 1.95; letter-spacing: .3px; word-break: break-word; }

.read-nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 40px 0 10px;
}
.nav-btn {
  padding: 9px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 15px;
  color: var(--text-2);
}
.nav-btn:hover { border-color: #ccc; color: var(--text); }
.nav-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav-btn.primary:hover { background: #333; color: #fff; }
.nav-btn.disabled { opacity: .35; pointer-events: none; }

/* ========== 夜间模式 ========== */
body.dark { --bg: #1c1c1e; --text: #cfcdc9; --text-2: #9a988f; --text-3: #6d6b66; --line: #333; --accent: #e8e6e1; --hover: #8fb0f0; background: var(--bg); }
body.dark .home-search { background: #26262a; border-color: #3a3a3e; }
body.dark .home-search button { color: #1c1c1e; }
body.dark .topbar { background: rgba(28,28,30,.95); }
body.dark .read-tools-right button { background: #26262a; }
body.dark .btn-start:hover, body.dark .nav-btn.primary:hover { background: #fff; color: #1c1c1e; }

/* ========== 响应式 ========== */
@media (max-width: 600px) {
  .home-logo h1 { font-size: 34px; }
  .home-search button span { display: none; }
  .home-search button { padding: 0 20px; }
  .topbar { flex-wrap: wrap; }
  .book-head { flex-direction: column; }
  .chapter-list { columns: 1; }
  .read-content { font-size: 18px; }
}
