/* ============================================
   Forty-nine Steeps — Shared Stylesheet
   未名：四十九泡
   All pages link to this file.
   Edit here once, changes apply everywhere.
   ============================================ */

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Color System (抹茶绿 + 茶汤琥珀) --- */
:root {
  --matcha: #7A8B62;
  --matcha-light: #A3B593;
  --amber: #C88E62;
  --amber-light: #E8C8A0;
  --tea-stain: #D4C5A9;
  --starry-night: #1A1F2E;
  --warm-white: #FAF8F5;
  --text-primary: #2C2416;
  --text-secondary: #5A524A;
  --border-light: #E8E0D0;
}

/* --- Base --- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Georgia', 'Noto Serif SC', serif;
  background: var(--warm-white);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
}

/* --- Layout --- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- Navigation --- */
nav {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 3rem;
}

nav a {
  color: var(--matcha);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

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

/* --- Typography --- */
h1 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--matcha);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

/* --- Chapter Content --- */
.chapter-content {
  max-width: 680px;
  margin: 0 auto;
}

.chapter-content p {
  margin-bottom: 2rem;
  text-align: justify;
}

.chapter-label {
  color: var(--matcha);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

/* --- Separator --- */
hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 3rem 0;
}

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid var(--tea-stain);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Tea Record (茶修录) --- */
blockquote.tea-record {
  border-left: 3px solid var(--amber);
  background: rgba(200, 142, 98, 0.05);
  padding: 1.5rem;
  border-radius: 0 4px 4px 0;
  font-style: normal;
  color: var(--text-primary);
}

/* --- System Prompt (pre) — 清新浅色调 --- */
pre {
  background: #F7FBF4;
  color: #5C6652;
  padding: 1.8rem 2rem;
  border-radius: 6px;
  border: 1px solid rgba(163, 181, 147, 0.25);
  border-left: 3px solid var(--matcha-light);
  box-shadow: 0 2px 10px rgba(122, 139, 98, 0.05);
  overflow-x: auto;
  margin: 2.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: 'Menlo', 'Consolas', monospace;
  white-space: pre-wrap;
}

/* --- Homepage: Hero --- */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero .cover {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(44, 36, 22, 0.15);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.3rem;
  color: var(--matcha);
  margin-bottom: 0.3rem;
}

.hero .tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

/* --- Homepage: Platform Links --- */
.platforms {
  text-align: center;
  margin: 3rem 0;
}

.platform-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  margin: 0.5rem;
  background: var(--matcha);
  color: var(--warm-white);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.platform-btn:hover {
  background: var(--text-primary);
}

/* --- Homepage: About --- */
.about {
  margin: 3rem 0;
}

.about p {
  margin-bottom: 1.5rem;
}

/* --- Homepage: Dedication --- */
.dedication {
  text-align: center;
  border: none;
  padding: 2rem 0;
  margin: 3rem 0;
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Homepage: Chapter List --- */
.chapter-list {
  margin-top: 2rem;
}

.chapter-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

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

.chapter-item a {
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.chapter-item a:hover {
  color: var(--matcha);
}

.chapter-item .ch-num {
  color: var(--matcha);
  font-size: 0.9rem;
  margin-right: 0.8rem;
}

.chapter-item .ch-title {
  font-size: 1.05rem;
}

/* --- Chapter Navigation (prev/next) --- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.chapter-nav a {
  color: var(--matcha);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.chapter-nav .placeholder {
  color: var(--border-light);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-light);
  margin-top: 4rem;
}

/* --- Bilingual Chapter Page --- */
.chapter-title-en {
  color: var(--matcha);
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.lang-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 0;
  border-bottom: 1px solid var(--border-light);
}

.lang-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-tab:hover {
  color: var(--matcha);
}

.lang-tab.active {
  color: var(--matcha);
  border-bottom-color: var(--matcha);
  font-weight: 600;
}

.lang-panel {
  display: none;
  animation: fadeIn 0.3s ease;
  padding-top: 1.5rem;
}

.lang-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--matcha);
  border: 1px solid var(--matcha-light);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

/* --- Platform Links --- */
.platform-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.platform-btn.rr {
  background: var(--matcha);
}

.platform-btn.sh {
  background: var(--amber);
}

.platform-btn.sh:hover {
  background: #b67d52;
}

/* --- Section Notes --- */
.section-note {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* --- Homepage: Chapter List (Bilingual) --- */
.chapter-item .ch-title-en {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.2rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .hero .cover {
    max-width: 200px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .platform-btn {
    display: block;
    margin: 0.5rem auto;
    width: 80%;
  }

  .chapter-nav {
    flex-direction: column;
    gap: 1rem;
  }
}
