/* 基础样式 */
:root {
  --bg-color: #f8f5f0;
  --text-color: #2c2c2c;
  --accent-color: #8b7355;
  --hover-color: #a0896c;
  --border-color: #d4c5b2;
  --shadow-color: rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.8;
  min-height: 100vh;
}

/* 容器 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 首页样式 */
.site-header {
  text-align: center;
  padding: 60px 20px 40px;
}

.site-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 6px;
}

.site-header .back-link {
  margin-top: 16px;
  font-size: 0.85rem;
}

.site-header .back-link a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

.site-header .back-link a:hover {
  color: var(--hover-color);
}

/* 首页英雄区 */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  background: linear-gradient(180deg, #f0ebe4 0%, var(--bg-color) 100%);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 16px;
  letter-spacing: 4px;
}

.hero .hook {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 20px;
  font-weight: 500;
  letter-spacing: 1px;
}

.hero .back-link {
  margin-top: 24px;
  font-size: 0.85rem;
}

.hero .back-link a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

.hero .back-link a:hover {
  color: var(--hover-color);
}

.hero .hook-sub {
  font-size: 0.95rem;
  color: var(--accent-color);
  line-height: 2;
  letter-spacing: 1px;
  max-width: 500px;
  margin: 0 auto;
}

/* 入口页 - 双按钮 */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}

.landing-title {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 6px;
  margin-bottom: 48px;
}

.landing-buttons {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 180px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.landing-btn .btn-title {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 3px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.landing-btn .btn-desc {
  font-size: 0.8rem;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

/* 正文按钮 - 暖色 */
.btn-main {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,115,85,0.25);
}

.btn-main .btn-title {
  color: #fff;
}

.btn-main .btn-desc {
  color: rgba(255,255,255,0.75);
}

.btn-main:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(139,115,85,0.35);
}

/* 前传按钮 - 默认暖色边框，hover变暗 */
.btn-prequel {
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  background: transparent;
}

.btn-prequel .btn-title {
  color: var(--accent-color);
}

.btn-prequel .btn-desc {
  color: var(--accent-color);
  opacity: 0.7;
}

.btn-prequel:hover {
  background: #141419;
  border-color: #141419;
  color: #c8c8c8;
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.btn-prequel:hover .btn-title {
  color: #c8c8c8;
}

.btn-prequel:hover .btn-desc {
  color: #7a8a9c;
  opacity: 1;
}

/* 外传按钮 - 烟灰紫 */
.btn-side {
  border: 2px solid #7c6a7a;
  color: #7c6a7a;
  background: transparent;
}

.btn-side .btn-title {
  color: #7c6a7a;
}

.btn-side .btn-desc {
  color: #7c6a7a;
  opacity: 0.7;
}

.btn-side:hover {
  background: #7c6a7a;
  border-color: #7c6a7a;
  color: #f3f0ef;
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(124, 106, 122, 0.25);
}

.btn-side:hover .btn-title {
  color: #f3f0ef;
}

.btn-side:hover .btn-desc {
  color: rgba(243, 240, 239, 0.75);
  opacity: 1;
}

@media (max-width: 600px) {
  .landing-buttons {
    flex-direction: column;
    gap: 20px;
  }
  
  .landing-btn {
    width: 240px;
    height: 140px;
  }
  
  .landing-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
  }
}

/* 双栏布局 */
.bookshelf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.book-col {
  min-width: 0;
}

.book-col .section-head {
  text-align: center;
  padding: 40px 0 30px;
  position: relative;
}

.book-col .section-head::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--border-color);
  margin: 0 auto 24px;
}

.book-col .section-head h2 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 4px;
}

.book-col .section-head .hook {
  font-size: 0.9rem;
  color: var(--accent-color);
  margin-top: 10px;
  line-height: 1.8;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .bookshelf {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .site-header h1 {
    font-size: 1.5rem;
  }
}

/* 章节列表 */
.chapter-list {
  list-style: none;
  padding: 0;
}

.chapter-list li {
  margin-bottom: 12px;
}

.chapter-list a {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.chapter-list a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-color);
  background: var(--accent-color);
  color: white;
}

.chapter-list .chapter-num {
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-right: 16px;
  min-width: 50px;
}

.chapter-list a:hover .chapter-num {
  color: rgba(255,255,255,0.8);
}

.chapter-list .chapter-title {
  font-size: 1.05rem;
  font-weight: 500;
}

/* 章节页面样式 */
.chapter-header {
  text-align: center;
  padding: 40px 0 30px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 40px;
}

.chapter-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 3px;
}

.chapter-content {
  font-size: 1.1rem;
  line-height: 2;
  text-align: justify;
}

.chapter-content p {
  text-indent: 2em;
  margin-bottom: 1.5em;
}

/* 导航 */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
}

.nav a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--hover-color);
}

.nav .home-link {
  font-weight: 500;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 40px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  color: var(--accent-color);
  font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .chapter-header h1 {
    font-size: 1.4rem;
  }
  
  .chapter-content {
    font-size: 1rem;
  }
  
  .container {
    padding: 20px 16px;
  }
}

/* 外传入口卡片 */
.side-story-entry {
  margin-bottom: 32px;
}

.side-story-entry a {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f3f0ef 0%, #ebe6e5 100%);
  border-radius: 10px;
  text-decoration: none;
  color: #3a2e38;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(124, 106, 122, 0.1);
  border-left: 3px solid #7c6a7a;
}

.side-story-entry a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 106, 122, 0.18);
}

.side-story-tag {
  background: #7c6a7a;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 2px;
  margin-right: 18px;
  white-space: nowrap;
}

.side-story-info {
  flex: 1;
}

.side-story-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.side-story-desc {
  font-size: 0.85rem;
  color: #7c6a7a;
  opacity: 0.8;
}

.side-story-arrow {
  font-size: 1.2rem;
  color: #7c6a7a;
  margin-left: 12px;
  transition: transform 0.3s ease;
}

.side-story-entry a:hover .side-story-arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .side-story-entry a {
    padding: 16px 18px;
  }
  .side-story-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    margin-right: 12px;
  }
  .side-story-title {
    font-size: 1rem;
  }
  .side-story-desc {
    font-size: 0.8rem;
  }
}

/* 字体大小控制 */
.font-size-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.font-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--accent-color);
  width: 44px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  user-select: none;
}

.font-btn:first-child {
  font-size: 0.85rem;
  font-weight: 600;
}

.font-btn:last-child {
  font-size: 1.3rem;
  font-weight: 700;
}

.font-btn:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.font-size-display {
  font-size: 0.85rem;
  color: var(--accent-color);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}



