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

:root {
  --bg: #f6f3ec;
  --card: #fffdf8;
  --ink: #2b2a26;
  --ink-light: #6b675e;
  --accent: #b08d3e;
  --accent-deep: #8a6d2f;
  --border: #e5dfd2;
  --shadow: 0 2px 12px rgba(60, 50, 30, .07);
  --serif: Georgia, 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ============ 头部 ============ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand { text-decoration: none; display: flex; align-items: baseline; gap: 14px; }

.brand-mark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 4px;
}

.brand-sub { font-size: 13px; color: var(--ink-light); }

/* ============ 书架视图 ============ */
.shelf-head { padding: 48px 0 28px; }

.shelf-head h1 {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.shelf-head p { color: var(--ink-light); font-size: 15px; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 56px;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.book-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(60, 50, 30, .13); }

.book-cover {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  position: relative;
}

.book-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.25));
}

.book-cover .cover-title {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  color: #fff;
  font-size: 22px;
  letter-spacing: 6px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.book-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }

.book-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }

.book-author { font-size: 13px; color: var(--ink-light); margin-bottom: 10px; }

.book-intro {
  font-size: 14px;
  color: var(--ink-light);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 12px;
  color: var(--accent-deep);
  background: rgba(176, 141, 62, .1);
  padding: 2px 10px;
  border-radius: 999px;
}

.quote-count { font-size: 13px; color: var(--ink-light); white-space: nowrap; }

/* ============ 书籍详情 ============ */
.book-hero {
  color: #fff;
  padding: 52px 0 44px;
  position: relative;
}

.book-hero .hero-inner { position: relative; z-index: 1; }

.back-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  transition: color .2s;
}

.back-link:hover { color: #fff; }

.hero-emoji { font-size: 44px; margin-bottom: 8px; }

.book-hero h1 {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.hero-original { font-size: 14px; opacity: .8; font-style: italic; margin-bottom: 14px; }

.hero-intro {
  max-width: 760px;
  font-size: 15px;
  opacity: .92;
  margin-bottom: 18px;
}

.hero-tags .tag { background: rgba(255,255,255,.18); color: #fff; }

/* 标签页 */
.tabs { display: flex; gap: 10px; padding: 26px 0 0; }

.tab {
  padding: 7px 22px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--ink-light);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.tab:hover { color: var(--accent-deep); border-color: var(--accent); }

.tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* 过滤框 */
.filter-bar { padding: 14px 0 8px; }

.filter-bar input {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-family: var(--sans);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.filter-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176, 141, 62, .15); }

.filter-empty { text-align: center; color: var(--ink-light); padding: 40px 0 60px; }

/* 金句卡片 */
.quote-list { padding: 12px 0 64px; display: flex; flex-direction: column; gap: 28px; }

.quote-list[hidden] { display: none; }

.quote-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 36px;
  box-shadow: var(--shadow);
}

.quote-card .q-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

.q-index {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 1px;
}

.q-theme {
  font-size: 12px;
  color: var(--accent-deep);
  background: rgba(176, 141, 62, .12);
  padding: 2px 12px;
  border-radius: 999px;
}

.q-text {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.7;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.q-source { font-size: 13px; color: var(--ink-light); margin-bottom: 22px; }

.q-section { border-top: 1px dashed var(--border); padding-top: 18px; margin-top: 4px; }

.q-section h3 {
  font-size: 14px;
  color: var(--accent-deep);
  letter-spacing: 3px;
  margin-bottom: 8px;
  font-weight: 600;
}

.q-section p { font-size: 15px; color: #3d3a33; }

.example-item { display: flex; gap: 12px; margin-top: 14px; }

.example-item:first-of-type { margin-top: 8px; }

.example-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  background: rgba(176, 141, 62, .1);
  border: 1px solid rgba(176, 141, 62, .25);
  border-radius: 6px;
  padding: 2px 10px;
  height: fit-content;
  margin-top: 3px;
  white-space: nowrap;
}

.example-item p { font-size: 15px; color: #3d3a33; }

/* 方法论板块 */
#model-list { gap: 24px; }

.section-head { padding: 12px 0 0; }

.section-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.section-head p { font-size: 14px; color: var(--ink-light); }

.model-badge { background: rgba(61, 90, 128, .1); color: #3d5a80; }

.m-name {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.m-en { font-size: 13px; color: var(--ink-light); font-style: italic; }

.m-points { list-style: none; }

.m-points li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: #3d3a33;
  margin-bottom: 6px;
}

.m-points li:last-child { margin-bottom: 0; }

.m-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ============ 底部 ============ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 22px 0;
  color: var(--ink-light);
  font-size: 13px;
  background: var(--card);
}

.site-footer code {
  background: rgba(176, 141, 62, .12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .brand-sub { display: none; }
  .shelf-head { padding-top: 32px; }
  .shelf-head h1 { font-size: 24px; }
  .book-hero { padding: 36px 0 32px; }
  .book-hero h1 { font-size: 26px; }
  .quote-card { padding: 24px 20px; }
  .tabs { padding-top: 20px; gap: 8px; }
  .tab { padding: 6px 16px; font-size: 13px; }
  .q-text { font-size: 19px; }
  .m-name { font-size: 19px; }
  .section-head h2 { font-size: 20px; }
}
