/* =====================================================================
   导文 daowen · 首页重设计  index2.css（仅首页使用）
   文墨书卷 editorial 风格 — 暖纸底 + 墨色 + 朱砂印章点缀
   基于 demo2 原型 styles.css 裁剪首页部分，不加载 umTheme.css
   ===================================================================== */

:root {
  --bg: #f5efe3;
  --bg-deep: #efe6d4;
  --surface: #fdfaf3;
  --surface-2: #f7f1e5;
  --border: #e4d8c3;
  --border-strong: #d6c7ab;
  --text: #2b2420;
  --text-sub: #7a6f61;
  --text-faint: #a39785;
  --primary: #a83c2f;
  --primary-hover: #8e3126;
  --primary-soft: #f0ddd6;
  --gold: #b98a3c;

  --font-display: "Noto Serif SC", "Songti SC", "STZhongsong", "SimSun", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(43, 36, 32, .06);
  --shadow-md: 0 8px 24px rgba(43, 36, 32, .10);
  --shadow-lg: 0 24px 48px rgba(43, 36, 32, .16);
  --header-h: 64px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 500px at 50% -8%, rgba(168, 60, 47, .06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--primary-soft); color: var(--primary-hover); }

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

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }

/* ---------- 顶部导航壳 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 239, 227, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; height: var(--header-h); }
.logo { display: flex; align-items: center; flex-shrink: 0; margin-right: 28px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 6px; display: grid; align-items: center; justify-content: center;
  background: var(--primary); color: #fdfaf3; box-shadow: var(--shadow-sm); margin-right: 10px;
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
}
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.logo-text small { display: block; font-size: 10px; letter-spacing: 4px; color: var(--text-faint); font-weight: 400; }

.main-nav { display: flex; align-items: center; flex: 1; }
.main-nav a + a { margin-left: 6px; }
.main-nav a {
  position: relative; padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-sub); transition: color .2s var(--ease);
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--primary); font-weight: 600; }
.main-nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--primary); border-radius: 1px;
}
.main-nav a.ai-nav { color: var(--primary); font-weight: 600; }
.main-nav a.ai-nav:hover { color: var(--primary-hover); }
.nav-tag { font-size: 10px; color: var(--gold); margin-left: 3px; }

.header-search { position: relative; display: flex; align-items: center; margin-left: 16px; }
.header-search input {
  width: 200px; padding: 9px 14px 9px 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; color: var(--text); font-family: inherit;
  transition: border-color .2s var(--ease), width .3s var(--ease), box-shadow .2s var(--ease);
}
.header-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); width: 260px; }
.header-search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); line-height: 1; color: var(--text-faint); font-size: 16px; }

.header-auth { display: flex; align-items: center; margin-left: 16px; }
.header-auth > a + a { margin-left: 8px; }
.auth-login { font-size: 14px;background: var(--primary);color: #fdfaf3;border-radius: 999px;padding: 7px 16px;font-weight: 600; }
.auth-login:hover { color: var(--primary); }

@media (max-width: 480px) { .header-auth { margin-left: 10px; } }

/* ---------- 区块标题（印章式） ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.section-title { display: flex; align-items: center; }
.section-title .seal { margin-right: 14px; }
.section-title .seal {
  width: 40px; height: 40px; border-radius: 4px; display: grid; align-items: center; justify-content: center;
  background: var(--primary); color: #fdfaf3; font-family: var(--font-display);
  font-size: 20px; font-weight: 700; transform: rotate(-3deg); box-shadow: var(--shadow-sm);
}
.section-title h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.section-title .en { font-size: 12px; letter-spacing: 3px; color: var(--text-faint); text-transform: uppercase; }
.section-head .more { display: inline-flex; align-items: center; color: var(--text-sub); font-size: 14px; }
.section-head .more > * + * { margin-left: 4px; }
.section-head .more:hover { color: var(--primary); }

/* ---------- 书卡 ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;align-items: stretch; }
.book-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px; position: relative; transition: transform .24s var(--ease), box-shadow .24s var(--ease);
  display: flex; flex-direction: column;height: 100%; min-width: 0; /* 填满网格单元高度，并允许在网格内收缩，避免撑破容器 */
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.book-card .cover-wrap { position: relative; margin-bottom: 14px; }
/* 兼容老内核（华为/搜狗等）：用 padding 撑出 3:4 比例，替代 aspect-ratio */
.cover-wrap { display: block; position: relative; }
.cover-wrap::before { content: ""; display: block; padding-top: 133.33%; }
.cover-wrap > .cover,
.cover-wrap > a > .cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.book-card h3 {
  font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1.5;
  margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;min-height: 48px;
}
.book-card h3 a:hover { color: var(--primary); }
.book-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.book-card .date { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }

/* ---------- 封面（CSS 渐变 + 衬线题字 + 朱砂印章） ---------- */
.cover {
  position: relative; overflow: hidden; border-radius: 6px;
  background: linear-gradient(160deg, var(--from), var(--to));
  box-shadow: 0 10px 20px rgba(43, 36, 32, .22), inset 0 0 0 1px rgba(255,255,255,.08);
  display: flex; flex-direction: column; padding: 18px 16px;
  color: #f7f1e5;
}
.cover-grain { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cover-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.3);
  text-align:center;
}
.cover-author {
  margin-top: auto; font-size: 11px; letter-spacing: 1px; color: rgba(247,241,229,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover-rule { display: block; height: 1px; background: rgba(247,241,229,.55); margin: 10px 0; }
.cover-seal {
  position: absolute; bottom: 12px; right: 12px; width: 22px; height: 22px; border-radius: 3px;
  display: grid; align-items: center; justify-content: center; background: #a83c2f; color: #fff;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; transform: rotate(4deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-hover); font-size: 12px;
  white-space: nowrap;
}

/* ---------- 首页：搜索英雄区 ---------- */
.search-hero { padding: 64px 0 40px; position: relative; }
.search-hero-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.search-brand .eyebrow { font-size: 12px; letter-spacing: 5px; color: var(--primary); font-weight: 600; }
.search-brand h1 {
  font-family: var(--font-display); font-size: 44px; line-height: 1.3; font-weight: 700;
  margin: 14px 0 10px; letter-spacing: 1px;
}
.search-brand p { color: var(--text-sub); font-size: 15px; max-width: 560px; margin: 0 auto; }

.search-box { position: relative; margin: 34px auto 0; max-width: 720px; }
.search-input-wrap {
  display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 7px 7px 22px;
  box-shadow: var(--shadow-md); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-md); }
.search-input-wrap > .ic { color: var(--text-faint); font-size: 21px; flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; min-width: 0; border: none; background: transparent; font-size: 16px;
  padding: 12px 14px; font-family: inherit; color: var(--text);
}
.search-input-wrap input:focus { outline: none; }
.search-input-wrap input::placeholder { color: var(--text-faint); }
.search-btn {
  background: var(--primary); color: #fdfaf3; border-radius: 999px; padding: 12px 30px;
  font-size: 15px; font-weight: 600; flex-shrink: 0; transition: background .2s var(--ease);
}
.search-btn:hover { background: var(--primary-hover); }

/* 快捷搜索标签 */
.quick-tags { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin: 22px 0 8px; }
.quick-tags > * { margin: 4px; }
.qt-label { font-size: 13px; color: var(--text-faint); margin-right: 2px; }
.qt-chip {
  display: inline-flex; align-items: center; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--text-sub);
  transition: all .18s var(--ease);
}
.qt-chip .dot { margin-right: 7px; }
.qt-chip:hover { border-color: var(--primary); color: var(--primary); }
.qt-chip .dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }

/* 热门搜索 */
.hot-search { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hot-search > * { margin: 3px 9px; }
.hs-label { display: inline-flex; align-items: center; font-size: 13px; color: var(--text-sub); font-weight: 600; margin-right: 4px; }
.hs-label .ic { margin-right: 6px; }
.hs-item { display: inline-flex; align-items: baseline; font-size: 13px; color: var(--text-sub); }
.hs-item .rank { margin-right: 6px; }
.hs-item:hover { color: var(--primary); }
.hs-item .rank { font-family: var(--font-display); font-weight: 700; width: 14px; text-align: center; color: var(--text-faint); }
.hs-item:nth-of-type(1) .rank, .hs-item:nth-of-type(2) .rank, .hs-item:nth-of-type(3) .rank { color: var(--primary); }

/* 搜索历史 */
.search-history { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.search-history > * { margin: 4px; }
.sh-chip {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-sub);
  transition: all .18s var(--ease);
}
.sh-chip .ic { margin-right: 6px; }
.sh-chip:hover { border-color: var(--primary); color: var(--primary); }
.sh-clear { font-size: 12px; color: var(--text-faint); }
.sh-clear:hover { color: var(--primary); }

@media (max-width: 768px) {
  .search-hero { padding: 44px 0 28px; }
  .search-brand h1 { font-size: 32px; }
  .search-input-wrap { padding-left: 16px; }
  .search-btn { padding: 12px 20px; }
  .search-input-wrap input { font-size: 15px; padding: 10px 10px; }
}
@media (max-width: 480px) {
  .search-brand h1 { font-size: 26px; }
  .search-btn { padding: 11px 18px; font-size: 14px; }
}

/* ---------- 分类卡 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cat-card {
  position: relative; padding: 22px 18px; border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); transition: all .24s var(--ease);
  display: flex; flex-direction: column; min-height: 128px;align-items: center;
}
.cat-card > * + * { margin-top: 6px; }
.cat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cc);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card .cat-ic { width: 40px; height: 40px; border-radius: 8px; display: grid; align-items: center; justify-content: center; color: #fff; font-size: 20px; }
.cat-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.cat-card p { font-size: 12px; color: var(--text-faint); }

/* ---------- 榜单 ---------- */
.hot-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 32px; }
.hot-item { display: flex; align-items: center; padding: 10px 12px; border-radius: var(--radius-md); transition: background .2s var(--ease); }
.hot-item > * + * { margin-left: 14px; }
.hot-item:hover { background: var(--surface); }
.hot-rank {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px; display: grid; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-faint);
  background: var(--surface-2); border: 1px solid var(--border);
}
.hot-item:nth-child(1) .hot-rank, .hot-item:nth-child(2) .hot-rank, .hot-item:nth-child(3) .hot-rank {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.hot-item:nth-child(4) .hot-rank, .hot-item:nth-child(5) .hot-rank { background: var(--gold); color: #fff; border-color: var(--gold); }
.hot-item .hot-title { flex: 1; font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hot-item .hot-title a:hover { color: var(--primary); }
.hot-item .hot-meta { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }

/* ---------- 次级内容（演讲范文/开场白/演讲稿开头） ---------- */
.secondary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.secondary-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px;
}
.secondary-card h3 { display: flex; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.secondary-card h3 > * + * { margin-left: 8px; }
.secondary-card h3 .ic { color: var(--primary); font-size: 18px; }
.secondary-card li { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.secondary-card li:last-child { border-bottom: none; }
.secondary-card li a { display: block; font-size: 14px; line-height: 1.5; color: var(--text); }
.secondary-card li a:hover { color: var(--primary); }
.secondary-card .li-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--bg-deep); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 32px 0 24px; }
.footer-brand p { color: var(--text-sub); font-size: 13px; margin-top: 12px; max-width: 320px; }
.footer-col h4 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.footer-col a { display: block; padding: 4px 0; font-size: 13px; color: var(--text-sub); }
.footer-col a:hover { color: var(--primary); }
/* 宽列（内容频道）：链接双列排布，压缩页脚高度 */
.footer-col-wide { columns: 2; column-gap: 24px; }
.footer-col-wide h4 { column-span: all; }
.footer-col-wide a { break-inside: avoid; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; flex-wrap: wrap; }
.footer-bottom > * + * { margin-left: 8px; }
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--primary); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .6s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .19s; }
.d4 { animation-delay: .26s; } .d5 { animation-delay: .33s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hot-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-wide { grid-column: 1 / -1; }
}
/* 图标按钮（移动端搜索入口等，全站通用） */
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; align-items: center; justify-content: center;
  color: var(--text-sub); border: 1px solid var(--border); background: var(--surface);
  font-size: 16px; transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
/* 移动端搜索入口（桌面隐藏）：用双类名提高优先级，避免被上面的 .icon-btn 覆盖 */
.icon-btn.mobile-search { display: none; }

/* 移动端导航条（第二模块，桌面隐藏） */
.mobile-nav-strip { display: none; }

@media (max-width: 768px) {
  /* 模块一：顶栏 = logo + 搜索 + 登录 */
  .header-inner { height: 56px; }
  .logo { margin-right: auto; }
  .logo-text small { display: none; }
  .header-search, .main-nav { display: none; }
  .icon-btn.mobile-search { display: grid; }
  .auth-login {
    background: var(--primary); color: #fdfaf3; border-radius: 999px;
    padding: 7px 16px; font-weight: 600;
  }
  .auth-login:hover { color: #fdfaf3; background: var(--primary-hover); }
  /* 模块二：胶囊导航条，可横滑 */
  .mobile-nav-strip { display: block; background: var(--surface); border-bottom: 1px solid var(--border); }
  .mobile-nav-inner { display: flex; overflow-x: auto; padding: 10px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mobile-nav-inner::-webkit-scrollbar { display: none; }
  .mobile-nav-inner a { flex-shrink: 0; margin-right: 6px; padding: 6px 14px; font-size: 14px; color: var(--text-sub); border-radius: 999px; }
  .mobile-nav-inner a:last-child { margin-right: 0; }
  .mobile-nav-inner a.active { background: var(--primary); color: #fdfaf3; font-weight: 600; }
  /* 面包屑：移动端横滑不换行 */
  .breadcrumb { white-space: nowrap; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
  .breadcrumb::-webkit-scrollbar { display: none; }
  /* 书卡：移动端更紧凑（封面填满卡片，不留空白） */
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .book-card { padding: 10px; }
  .book-card .cover-wrap { margin-bottom: 10px; }
  .book-card .cover { padding: 16px 14px; }
  .book-card .cover-title { font-size: 15px; -webkit-line-clamp: 3; }
  .book-card .fav-btn { top: 8px; right: 8px; }
  .book-card h3 { font-size: 14px; min-height: 42px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secondary-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .book-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .book-card { padding: 12px; }
}
