/* ============================================
   Parenting the Useless Self — Styles
   Mobile-first, warm, readable
   ============================================ */

:root {
  --color-bg: #FFFBF5;
  --color-surface: #FFFFFF;
  --color-warm: #E8734A;
  --color-warm-light: #FFF0EB;
  --color-warm-dark: #C9553A;
  --color-text: #2D2A26;
  --color-text-secondary: #6B6560;
  --color-text-light: #9B9590;
  --color-border: #E8E2DC;
  --color-border-light: #F2EDE8;
  --color-accent: #4A90A4;
  --color-like: #E25555;
  --color-gold: #D4A026;
  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-tc: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: var(--font-cn);
  --max-width: 720px;
  --header-height: 60px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
}

[data-lang="zh-hant"] { --font-body: var(--font-tc); }
[data-lang="en"] { --font-body: var(--font-en); }

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-warm); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-warm-dark); }

img { max-width: 100%; display: block; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-height);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text) !important;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-text);
  border-bottom-color: var(--color-warm);
}

.font-sizer {
  display: flex;
  gap: 2px;
}

.font-btn {
  border: none;
  background: var(--color-border-light);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-en);
}

.font-btn:first-child { border-radius: 6px 0 0 6px; }
.font-btn:last-child { border-radius: 0 6px 6px 0; }
.font-btn:hover { background: var(--color-border); color: var(--color-text); }

.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--color-border-light);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.lang-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lang-btn:hover:not(.active) { color: var(--color-text); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ---- Main Content ---- */
#app {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ---- Page: Home ---- */
.hero {
  text-align: center;
  padding: 64px 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 480px;
}

.hero-spacer {
  height: 48px;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 2;
}

/* Home sections */
.home-section {
  padding: 64px 0;
  border-top: 1px solid var(--color-border-light);
}

.home-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.home-section-desc {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 2;
  margin-bottom: 32px;
}

.home-divider {
  width: 32px;
  height: 1px;
  background: var(--color-border);
  margin-bottom: 32px;
}

/* Home: Book section */
.home-book-name {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--color-warm);
}

.home-book-desc {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 2;
  margin-bottom: 16px;
}

.home-book-cover {
  width: 240px;
  border-radius: var(--radius);
  margin-top: 32px;
  box-shadow: var(--shadow-hover);
}

/* Home: Closing section */
.home-closing {
  text-align: center;
  padding: 80px 0;
}

.home-closing-line {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 2;
  margin-bottom: 24px;
}

.home-closing-line:first-child {
  font-size: 1.15rem;
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: 32px;
}

.home-closing-line:last-child {
  margin-bottom: 0;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border-light);
}

.section-more {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-warm);
  background: var(--color-warm-light);
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.card-meta .likes {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-light);
  cursor: pointer;
  transition: color 0.2s;
}

.card-meta .likes:hover,
.card-meta .likes.liked {
  color: var(--color-like);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  text-align: center;
}

.btn-warm {
  background: var(--color-warm);
  color: white;
}

.btn-warm:hover {
  background: var(--color-warm-dark);
  color: white;
}

.btn-outline {
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-warm);
  color: var(--color-warm);
}

/* ---- Book Page ---- */
.book-header {
  text-align: center;
  padding: 32px 0;
}

.book-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.kindle-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #FFF8F0;
  border: 1.5px solid #FF9900;
  border-radius: var(--radius);
  margin-bottom: 24px;
  color: var(--color-text);
  transition: all 0.2s;
}

.kindle-banner:hover {
  background: #FFF0E0;
  color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.15);
}

.kindle-icon { font-size: 1.3rem; }

.kindle-text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.kindle-arrow {
  font-size: 1.1rem;
  color: #FF9900;
  font-weight: 700;
}

.book-header .book-subtitle {
  font-size: 1.1rem;
  color: var(--color-text);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 8px;
  font-style: italic;
}

.book-header p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.chapter-list {
  list-style: none;
}

/* Top-level items (preface, epilogue, afterwords outside parts) */
.toc-top-item {
  border-bottom: 1px solid var(--color-border-light);
}

.toc-top-item a {
  display: block;
  padding: 16px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  transition: all 0.2s;
}

.toc-top-item a:hover { color: var(--color-warm); padding-left: 8px; }

/* Part (highest hierarchy) */
.toc-part {
  margin-top: 40px;
}

.toc-part-header {
  display: block;
  background: var(--color-warm);
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 16px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition: background 0.2s;
}

.toc-part-header:hover { background: var(--color-warm-dark); color: white; }

.toc-part-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 0;
  margin-bottom: 8px;
}

/* Section (mid hierarchy, inside a part) */
.toc-section {
  margin: 12px 0 4px;
  padding: 0 20px;
}

.toc-section-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--color-border-light);
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  transition: color 0.2s;
}

.toc-section-title:hover { color: var(--color-warm); }

/* Chapter (inside a section, indented) */
.toc-chapter {
  border-bottom: 1px solid var(--color-border-light);
  margin: 0 20px;
}

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

.toc-chapter a {
  display: block;
  padding: 14px 0 14px 12px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
  transition: all 0.2s;
}

.toc-chapter a:hover { color: var(--color-warm); padding-left: 20px; }

/* ---- Article / Book Reader ---- */
.article-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.article-header .meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.article-body {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--color-text);
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

.article-body p { margin-bottom: 20px; }

.article-body blockquote {
  border-left: 3px solid var(--color-warm);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--color-warm-light);
  border-radius: 0 8px 8px 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-body li { margin-bottom: 8px; }

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
  gap: 12px;
}

.chapter-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

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

/* ---- Interactions: Likes & Comments ---- */
.interactions {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--color-border-light);
}

.like-section {
  text-align: center;
  margin-bottom: 40px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-body);
  color: var(--color-text-secondary);
}

.like-btn:hover, .like-btn.liked {
  border-color: var(--color-like);
  color: var(--color-like);
  background: #FFF0F0;
}

.like-btn .heart { font-size: 1.2rem; transition: transform 0.3s; }
.like-btn:hover .heart, .like-btn.liked .heart { transform: scale(1.2); }
.like-btn.liked .heart { animation: heartPop 0.4s ease; }

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1.2); }
}

.like-count {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 8px;
}

/* Tip bar — compact, one-line */
.tip-bar {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 32px;
}

.tip-bar-text {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.tip-bar-amounts {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.tip-amount {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  background: transparent;
}

.tip-amount:hover {
  border-color: var(--color-warm);
  color: var(--color-warm);
  background: var(--color-warm-light);
}

.tip-custom {
  border-style: dashed;
}

/* Book ending */
.book-end-section {
  text-align: center;
  padding: 40px 24px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #F8F4EF, #FFF8F0);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.book-end-section h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--color-text);
}

.book-end-section p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 480px;
  margin: 0 auto;
}

/* Comments */
.comments-section h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.comment-form {
  margin-bottom: 32px;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-warm);
}

.comment-form .form-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

.comment-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.comment-form input:focus {
  outline: none;
  border-color: var(--color-warm);
}

.comment-list {
  list-style: none;
}

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

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.comment-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.comment-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.comment-item-header .comment-author {
  margin-right: 12px;
}

.report-btn {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.4;
}

.report-btn:hover {
  opacity: 1;
  color: var(--color-like);
  background: #FFF0F0;
}

.captcha-row {
  align-items: center;
}

.captcha-question {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.captcha-input {
  width: 80px !important;
  flex: none !important;
  text-align: center;
}

.comment-error {
  font-size: 0.8rem;
  color: var(--color-like);
  flex: 1;
}

/* ---- Videos ---- */
.video-grid {
  display: grid;
  gap: 20px;
}

.video-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--color-text-light);
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info {
  padding: 16px;
}

.video-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.video-info p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* ---- About ---- */
.about-page { padding: 32px 0; }

.about-page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.about-page .bio {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--color-text-secondary);
}

.about-page .bio p { margin-bottom: 20px; }

/* ---- Support Page ---- */
.support-page {
  text-align: center;
  padding: 48px 0;
}

.support-page h1 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.support-page .subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.support-options {
  display: grid;
  gap: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.support-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.support-card h3 { margin-bottom: 8px; }
.support-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.wechat-qr-img {
  max-width: 240px;
  margin: 0 auto;
  border-radius: 8px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
}

.footer-support {
  margin-bottom: 20px;
}

.footer-support p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.footer-social {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.footer-social-name {
  font-weight: 600;
  color: var(--color-text);
}

.footer-divider {
  margin: 0 12px;
  color: var(--color-border);
}

@media (max-width: 768px) {
  .footer-social .footer-divider { display: none; }
  .footer-social { display: flex; flex-direction: column; gap: 4px; }
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* ---- Untranslated notice ---- */
.untranslated-notice {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: var(--color-border-light);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

/* ---- Search ---- */
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: all 0.2s;
}

.search-toggle:hover {
  color: var(--color-text);
  background: var(--color-border-light);
}

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  width: 90%;
  max-width: 560px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
}

.search-input-row svg {
  flex-shrink: 0;
  color: var(--color-text-light);
}

.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text);
}

.search-close {
  background: var(--color-border-light);
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-en);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.search-results {
  overflow-y: auto;
  padding: 8px 0;
}

.search-result {
  display: block;
  padding: 12px 20px;
  transition: background 0.15s;
  color: var(--color-text);
  text-decoration: none;
}

.search-result:hover {
  background: var(--color-warm-light);
  color: var(--color-text);
}

.search-result-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-warm);
  background: var(--color-warm-light);
  padding: 1px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-result-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2px;
}

.search-result-snippet {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.search-result mark {
  background: #FFECD0;
  color: var(--color-text);
  padding: 0 2px;
  border-radius: 2px;
}

.search-empty, .search-loading {
  text-align: center;
  padding: 32px 20px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* ---- Loading ---- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.loading::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin: 16px auto 0;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-warm);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 16px 20px;
    gap: 4px;
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow);
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: none;
  }

  .hero { padding: 48px 0 32px; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-spacer { height: 48px; }
  .home-section { padding: 48px 0; }
  .home-closing { padding: 56px 0; }

  .article-header h1 { font-size: 1.5rem; }
  .book-header h1 { font-size: 1.6rem; }

  .tip-section { padding: 24px 16px; }

  .chapter-nav { flex-direction: column; }
  .chapter-nav a { text-align: center; }

  .card { padding: 20px; }
}

@media (min-width: 769px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  #app { padding: 48px 20px; }
  .hero { padding: 64px 0 56px; }
}
