/* ============================================================
 * Duwen 读文书库 · 纸页书房（浅色阅读版）
 * ------------------------------------------------------------
 * 0. 设计令牌（核心变量全量重映射，插件页自动继承）
 * 1. 基础与核心组件覆盖
 * 2. 顶栏 / 导航 / 用户区
 * 3. 首页门厅
 * 4. 编辑推荐 / 三道书门 / 书友动态 / 专题 / 圈子
 * 5. 侧栏 / 页脚 / 底栏
 * 6. 列表行
 * 7. 插件页浅色适配（booklist / baike / bookshelf）
 * 8. 响应式与动效
 * ============================================================ */

/* ========== 0. 设计令牌 ========== */
:root {
  --bg: #F7F4EC;
  --bg-2: #F1EDE2;
  --card: #FFFDF8;
  --soft: #F3EFE4;
  --soft-2: #ECE6D8;
  --bd: rgba(30, 42, 36, .12);
  --bd-2: rgba(30, 42, 36, .22);
  --tx: #1E2A24;
  --tx-2: #4E6256;
  --tx-3: #5E7267;
  --ac: #5CAD81;
  --ac-2: #3E8F66;
  --ac-soft: rgba(92, 173, 129, .12);
  --ac-text: #2F6E50;
  --gold: #C9A24E;
  --gold-2: #A97F2A;
  --gold-soft: rgba(201, 162, 78, .14);
  --gold-text: #8C6A1F;
  --ok: #2D7D46;
  --ok-soft: #E6F2E9;
  --warn: #B7791F;
  --warn-soft: #FBF1DF;
  --err: #C0392B;
  --err-soft: #FBEDEA;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(30, 42, 36, .06), 0 8px 24px rgba(30, 42, 36, .10);
  --shadow-lg: 0 12px 36px rgba(30, 42, 36, .16);
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  --dw-brand-on: #08100C;
}

/* ========== 1. 基础与核心组件覆盖 ========== */
html { background: var(--bg); }
body.dw-body {
  background:
    radial-gradient(900px 480px at 8% -6%, rgba(92, 173, 129, .10), transparent 62%),
    radial-gradient(760px 420px at 98% 8%, rgba(201, 162, 78, .10), transparent 66%),
    var(--bg);
  background-attachment: fixed;
  color: var(--tx);
  font-family: var(--sans);
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--dw-brand-on); }

a { color: var(--ac-text); }
a:hover { color: var(--ac-2); }

.dw-body .card {
  background: var(--card);
  border-color: var(--bd);
  box-shadow: var(--shadow);
}

.dw-body .card-head h3,
.dw-body .card-head h2 { color: var(--tx); }

.dw-body .btn {
  background: var(--ac);
  color: var(--dw-brand-on);
  border-radius: var(--radius-s);
}
.dw-body .btn:hover { background: var(--ac-2); color: var(--dw-brand-on); }
.dw-body .btn-ghost { background: var(--soft); color: var(--tx); border-color: var(--bd); }
.dw-body .btn-ghost:hover { background: var(--soft-2); border-color: var(--bd-2); color: var(--tx); }

.dw-body .alert-error { background: var(--err-soft); border-color: var(--err); color: #8C2F26; }
.dw-body .alert-success { background: var(--ok-soft); border-color: var(--ok); color: #1F5B40; }

.dw-body .empty-box,
.dw-body .muted { color: var(--tx-3); }

.dw-body .pagination a,
.dw-body .pager a,
.dw-body .pager-btn {
  background: var(--card);
  border-color: var(--bd);
  color: var(--tx-2);
}
.dw-body .pagination a:hover,
.dw-body .pager a:hover { border-color: var(--ac); color: var(--tx); }

.dw-body .modal-box {
  background: var(--card);
  border: 1px solid var(--bd);
  box-shadow: var(--shadow-lg);
}
.dw-body .modal-head,
.dw-body .modal-foot { border-color: var(--bd); }

.dw-body .toast { background: var(--card); color: var(--tx); border: 1px solid var(--bd); }

/* ========== 2. 顶栏 / 导航 / 用户区 ========== */
.dw-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 241, .90);
  border-bottom: 1px solid var(--bd);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.dw-topbar-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dw-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--tx);
  text-decoration: none;
  letter-spacing: .01em;
}
.dw-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #5CAD81, #2E5B49);
  color: #08100C;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.dw-brand:hover { color: var(--ac-text); }

.dw-topbar .main-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.dw-topbar .nav-link {
  color: var(--tx-2);
  font-size: 14px;
  padding: 8px 11px;
  border-radius: var(--radius-s);
  text-decoration: none;
  white-space: nowrap;
}
.dw-topbar .nav-link:hover,
.dw-topbar .nav-drop:hover > .nav-link {
  background: var(--soft);
  color: var(--tx);
}

.dw-topbar .drop-menu {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.dw-topbar .drop-menu a,
.dw-topbar .drop-menu button {
  color: var(--tx-2);
  border-radius: var(--radius-s);
  font-size: 13.5px;
}
.dw-topbar .drop-menu a:hover,
.dw-topbar .drop-menu button:hover {
  background: var(--soft);
  color: var(--tx);
}
.dw-topbar .drop-group-title { color: var(--tx-3); }
.dw-topbar .nav-apps-all { color: var(--gold-text); border-top-color: var(--bd); }

.dw-topbar .header-right { display: flex; align-items: center; gap: 8px; flex: none; }
.dw-topbar .icon-btn { color: var(--tx-2); border-radius: var(--radius-s); }
.dw-topbar .icon-btn:hover { background: var(--soft); color: var(--tx); }

.dw-write {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ac);
  color: var(--dw-brand-on);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.dw-write:hover { background: var(--ac-2); color: var(--dw-brand-on); }

.dw-login {
  color: var(--tx-2);
  font-size: 13.5px;
  padding: 7px 10px;
  text-decoration: none;
}
.dw-login:hover { color: var(--tx); }

.dw-cta {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--gold-text);
  color: var(--gold-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.dw-cta:hover { background: var(--gold); color: var(--dw-brand-on); }

.dw-topbar-in.is-scrolled {
  box-shadow: 0 8px 24px rgba(30, 42, 36, .08);
}

/* ========== 3. 首页门厅 ========== */
.dw-main { position: relative; z-index: 1; }
.dw-main-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 72px;
}

.dw-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 44px 40px;
  border: 1px solid var(--bd);
  border-radius: 20px;
  background:
    radial-gradient(760px 380px at 14% -10%, rgba(92, 173, 129, .16), transparent 64%),
    radial-gradient(560px 340px at 96% 108%, rgba(201, 162, 78, .14), transparent 62%),
    linear-gradient(135deg, #FBF9F2 0%, #F4EFE3 62%, #F8F5ED 100%);
  box-shadow: var(--shadow);
}
.dw-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.dw-hero-glow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dw-hero-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .20;
  will-change: transform, opacity;
}
.dw-hero-glow span:nth-child(1) {
  width: 340px;
  height: 340px;
  left: -100px;
  top: -120px;
  background: rgba(92, 173, 129, .32);
}
.dw-hero-glow span:nth-child(2) {
  width: 280px;
  height: 280px;
  right: -80px;
  bottom: -120px;
  background: rgba(201, 162, 78, .20);
}
.dw-hero-in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 270px;
  gap: 44px;
  align-items: center;
  min-width: 0;
}
.dw-hero-copy,
.dw-hero-book,
.dw-hero-book-meta { min-width: 0; max-width: 100%; }

.dw-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.dw-hero-title {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--tx);
}
.dw-hero-desc {
  max-width: 640px;
  margin: 0;
  color: var(--tx-2);
  font-size: 16px;
  line-height: 1.8;
}
.dw-hero-entity {
  max-width: 620px;
  margin: 12px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--gold-soft);
  color: var(--tx-3);
  font-size: 12.5px;
  line-height: 1.75;
}

.dw-hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 600px;
  margin-top: 20px;
  padding: 7px 7px 7px 14px;
  border: 1px solid var(--bd-2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  transition: border-color .18s, box-shadow .18s;
}
.dw-hero-search:focus-within {
  border-color: var(--ac);
  box-shadow: 0 0 0 4px var(--ac-soft);
}
.dw-hero-search-ic { display: inline-flex; color: var(--tx-3); flex: none; }
.dw-hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tx);
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
/* 只保留整个搜索框的 focus-within 外环；输入框自身不再出现第二条内边框/焦点阴影 */
.dw-hero-search input:focus,
.dw-hero-search input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
}
.dw-hero-search input::placeholder { color: var(--tx-3); }
.dw-hero-search button {
  flex: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 18px;
  background: var(--ac);
  color: var(--dw-brand-on);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dw-hero-search button:hover { background: var(--ac-2); }

.dw-hero-scopes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.dw-hero-scopes a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  color: var(--tx-3);
  font-size: 12px;
  text-decoration: none;
  transition: color .18s, background .18s, border-color .18s;
}
.dw-hero-scopes a:hover { color: var(--tx); background: var(--soft); border-color: var(--bd-2); }

.dw-hero-stats {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 26px;
  border: 1px solid var(--bd);
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  overflow: hidden;
}
.dw-hero-stat { position: relative; padding: 12px 22px; text-align: center; }
.dw-hero-stat + .dw-hero-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--bd);
}
.dw-hero-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
  color: var(--tx);
}
.dw-hero-stat span {
  display: block;
  margin-top: 4px;
  color: var(--tx-3);
  font-size: 11px;
  letter-spacing: .06em;
}

.dw-hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.dw-btn-primary { background: var(--ac); color: var(--dw-brand-on); }
.dw-btn-primary:hover { background: var(--ac-2); color: var(--dw-brand-on); }
.dw-btn-ghost { background: transparent; color: var(--tx); border-color: var(--bd-2); }
.dw-btn-ghost:hover { background: var(--soft); border-color: var(--ac); color: var(--tx); }
.dw-btn-sm { padding: 8px 14px; font-size: 13px; }
.dw-btn-block { width: 100%; }
.dw-btn:active { transform: scale(.985); }

/* 今日一书 */
.dw-hero-book { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.dw-hero-stack { position: relative; width: 164px; height: 220px; }
.dw-stack-sheet {
  position: absolute;
  inset: 0;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--soft);
}
.dw-stack-sheet.is-s1 { transform: rotate(6deg) translate(10px, 6px); opacity: .62; }
.dw-stack-sheet.is-s2 { transform: rotate(-5deg) translate(-8px, 10px); opacity: .40; }
.dw-hero-cover {
  position: absolute;
  inset: 0;
  display: block;
  border: 1px solid var(--bd-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.dw-hero-cover:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 18px 44px rgba(30, 42, 36, .22); }
.dw-hero-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.dw-cover-first {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, .92);
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 700;
}
.dw-hero-cover.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: var(--soft);
  color: var(--tx-3);
  box-shadow: none;
  transform: none;
}
.dw-hero-book-kicker {
  display: block;
  color: var(--gold-text);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
}
.dw-hero-book-title {
  display: block;
  max-width: 240px;
  margin-top: 5px;
  color: var(--tx);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.dw-hero-book-title:hover { color: var(--ac-text); }
.dw-hero-book-author { display: block; margin-top: 3px; color: var(--tx-3); font-size: 12.5px; }
.dw-hero-book-meta { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dw-hero-quote {
  max-width: 230px;
  margin: 4px 0 0;
  color: var(--tx-2);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.75;
}

/* home_hero_after 插件内容（会员风采等）：与门厅、下方书库主体各留出呼吸间距 */
.dw-hero-after { margin-top: 18px; }
.dw-hero-after > .card,
.dw-hero-after > section { margin-bottom: 0; }

/* 会员风采独立区块（布局管理）：门厅之下、编辑推荐之前；卡片自带 margin-bottom 需清零 */
.dw-member-wall-block { margin-top: 0; }
.dw-member-wall-block .mwc-card { margin-bottom: 0; }

/* ========== 4. 书库主体 ========== */
.dw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin-top: 26px;
  min-width: 0;
}
.dw-grid.is-three { grid-template-columns: 200px minmax(0, 1fr) 320px; }
.dw-grid-main { min-width: 0; }
.dw-grid-main .dw-hero { margin-bottom: 16px; }
.dw-grid-left { min-width: 0; }
.dw-grid-side { min-width: 0; }

.dw-spotlight, .dw-gates-sec, .dw-latest, .dw-topics, .dw-forums { margin-top: 26px; }
.dw-spotlight:first-child, .dw-gates-sec:first-child { margin-top: 0; }
.dw-extra-blocks > * + * { margin-top: 20px; }

.dw-spotlight-head,
.dw-sec-head,
.dw-panel-head,
.dw-forums-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dw-spotlight-heading h2,
.dw-sec-head h2,
.dw-panel-heading h2,
.dw-forums-head h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--tx);
}
.dw-sec-head p,
.dw-forums-head p {
  margin: 6px 0 0;
  color: var(--tx-3);
  font-size: 12.5px;
  line-height: 1.6;
}
.dw-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  color: var(--tx-3);
  font-size: 12.5px;
  text-decoration: none;
}
.dw-more:hover { color: var(--ac-text); }

/* 01 编辑推荐：booklist 首页块只换容器与表面 */
.dw-spotlight .bl-rec {
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dw-spotlight .bl-rec .card-head { display: none; }
.dw-spotlight .bl-rec-body { padding: 0; gap: 18px; }
.dw-spotlight .bl-rec-big { background: var(--soft); border-color: var(--bd); border-radius: 12px; }
.dw-spotlight .bl-rec-item { background: var(--soft); border-color: var(--bd); border-radius: 10px; }
.dw-spotlight .bl-rec-item:hover { border-color: var(--ac); }
.dw-spotlight .bl-rec-big-cover img,
.dw-spotlight .bl-rec-cfirst { border-radius: 8px; box-shadow: 0 10px 22px rgba(30, 42, 36, .16); }
/* 无封面首字彩块：插件用低饱和浅色底 + 白字，浅色主题下改为墨色字保证可读 */
.dw-spotlight .bl-rec-cfirst { color: #1E2A24 !important; text-shadow: none; }
.dw-spotlight .bl-rec-title { font-family: var(--serif); font-size: 18px; }
.dw-spotlight .bl-rec-title:hover { color: var(--ac-text); }
.dw-spotlight .bl-rec-go { padding: 8px 14px; font-size: 12.5px; }

.dw-spotlight-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 42px 20px;
  border: 1px dashed var(--bd-2);
  border-radius: 18px;
  background: var(--soft);
  text-align: center;
}
.dw-spotlight-empty-ic { color: var(--gold-text); }
.dw-spotlight-empty p { margin: 0; color: var(--tx-3); font-size: 13px; line-height: 1.7; }

/* 02 三道书门 */
.dw-gates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dw-gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--card);
  color: var(--tx);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.dw-gate:hover { border-color: var(--ac); transform: translateY(-3px); box-shadow: var(--shadow); }
.dw-gate-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--ac-soft);
  color: var(--ac-text);
}
.dw-gate:nth-child(2) .dw-gate-ic { background: var(--gold-soft); color: var(--gold-text); }
.dw-gate:nth-child(3) .dw-gate-ic { background: var(--soft); color: var(--tx-2); }
.dw-gate-title { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.4; }
.dw-gate-desc { color: var(--tx-3); font-size: 12.5px; line-height: 1.6; }
.dw-gate-go { position: absolute; top: 18px; right: 16px; left: auto; color: var(--tx-3); }
.dw-gate:hover .dw-gate-go { color: var(--ac-text); }

/* 专题书架 */
.dw-topics {
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dw-topics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dw-topic {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--soft);
  color: var(--tx);
  text-decoration: none;
  transition: border-color .18s, transform .18s;
}
.dw-topic:hover { border-color: var(--ac); transform: translateY(-2px); }
.dw-topic strong { font-family: var(--serif); font-size: 15px; }
.dw-topic-desc { color: var(--tx-3); font-size: 12px; line-height: 1.5; }
.dw-topic em {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  color: var(--tx-3);
  font-size: 11.5px;
  font-style: normal;
}

/* 03 书友正在聊 */
.dw-latest {
  padding: 22px;
  border: 1px solid var(--bd);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dw-list { display: flex; flex-direction: column; }
.dw-empty { padding: 26px 0; text-align: center; color: var(--tx-3); font-size: 13px; }

/* 04 圈子 */
.dw-forums-head { margin-bottom: 12px; }
.dw-cat {
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dw-cat-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dw-cat-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}
.dw-cat-icon { display: inline-flex; color: var(--gold-text); }
.dw-cat-desc { color: var(--tx-3); font-size: 12px; }
.dw-cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dw-forum-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--soft);
  color: var(--tx);
  text-decoration: none;
  transition: border-color .18s, background .18s, transform .18s;
}
.dw-forum-cell:hover { border-color: var(--ac); background: var(--soft-2); transform: translateY(-2px); }
.dw-forum-ic { display: inline-flex; flex: none; color: var(--tx-2); }
.dw-forum-ic img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.dw-forum-main { min-width: 0; flex: 1; }
.dw-forum-name {
  display: block;
  overflow: hidden;
  color: var(--tx);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-forum-desc {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--tx-3);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-forum-count { flex: none; text-align: right; }
.dw-forum-count strong { display: block; font-family: var(--mono); font-size: 13px; color: var(--tx-2); }
.dw-forum-count span { color: var(--tx-3); font-size: 10.5px; }
.dw-forum-cell.is-locked { opacity: .72; }
.dw-forums-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--bd-2);
  border-radius: 12px;
  color: var(--tx-3);
  font-size: 12.5px;
  text-decoration: none;
}
.dw-forums-more:hover { border-color: var(--ac); color: var(--tx); }
.dw-forums-more span { color: var(--tx-3); }

/* ========== 5. 侧栏 / 页脚 / 底栏 ========== */
.dw-side-slot { min-width: 0; }
.dw-side-slot + .dw-side-slot { margin-top: 14px; }
.dw-side {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.dw-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.dw-side-head h3 {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--tx);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}
.dw-online-nums { color: var(--tx-3); font-family: var(--sans); font-size: 10.5px; font-weight: 400; }

.dw-hot-list { margin: 0; padding: 0; list-style: none; }
.dw-hot-list li {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--bd);
}
.dw-hot-list li:last-child { border-bottom: 0; }
.dw-hot-rank {
  flex: none;
  width: 18px;
  color: var(--tx-3);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}
.dw-hot-rank.is-top { color: var(--gold-text); font-weight: 700; }
.dw-hot-link {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--tx-2);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.dw-hot-link:hover { color: var(--ac-text); }

.dw-online-avatars { display: flex; flex-wrap: wrap; gap: 7px; }
.dw-online-avatars a { display: inline-flex; }
.dw-online-avatars img { width: 30px; height: 30px; border-radius: 50%; }
.dw-online-empty { margin: 0; color: var(--tx-3); font-size: 12px; }

.dw-newest { margin: 0 0 12px; color: var(--tx-2); font-size: 13px; line-height: 1.6; }
.dw-newest a { color: var(--ac-text); }
.dw-side-actions { display: flex; flex-direction: column; gap: 8px; }

.dw-friend-links { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.dw-friend-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  color: var(--tx-3);
  font-size: 11.5px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.dw-friend-link:hover { border-color: var(--ac); color: var(--tx); }

.dw-pwa-tip { margin: 0 0 12px; color: var(--tx-3); font-size: 12px; line-height: 1.6; }

.dw-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-soft);
}

.dw-footer {
  margin-top: 56px;
  border-top: 1px solid var(--bd);
  background: var(--bg-2);
}
.dw-footer-wrap { max-width: 1280px; margin: 0 auto; padding: 40px 24px 28px; }
.dw-footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.dw-footer-brand { max-width: 320px; }
.dw-footer-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #5CAD81, #2E5B49);
  color: #08100C;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}
.dw-footer-name { margin: 10px 0 6px; font-family: var(--serif); font-size: 18px; color: var(--tx); }
.dw-footer-desc { margin: 0; color: var(--tx-3); font-size: 12.5px; line-height: 1.7; }
.dw-footer-cols { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 28px; }
.dw-footer-col { display: flex; flex-direction: column; gap: 7px; }
.dw-footer-col-title {
  margin-bottom: 3px;
  color: var(--tx-3);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dw-footer-col a { color: var(--tx-2); font-size: 12.5px; text-decoration: none; }
.dw-footer-col a:hover { color: var(--ac-text); }
.dw-footer-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--bd);
  color: var(--tx-3);
  font-size: 11.5px;
}
.dw-footer-bottom a { color: var(--tx-3); }
.dw-footer-bottom a:hover { color: var(--tx-2); }

.bottom-nav { background: rgba(250, 248, 241, .96); border-top: 1px solid var(--bd); }
.bn-item { color: var(--tx-3); }
.bn-item.is-active { color: var(--ac-text); }
.bn-post { background: var(--ac); color: var(--dw-brand-on); }
.bn-post:hover { background: var(--ac-2); }
.bn-dot { background: var(--err); color: #fff; }

.blockquote,
.dw-body blockquote { border-left-color: var(--gold); background: var(--soft); color: var(--tx-2); }

/* ========== 6. 列表行 ========== */
.dw-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 12px;
  border-bottom: 1px solid var(--bd);
  border-radius: 10px;
  transition: background .18s ease;
}
.dw-row:last-child { border-bottom: 0; }
.dw-row:hover { background: var(--soft); }
.dw-row-idx {
  align-self: start;
  padding-top: 2px;
  color: var(--gold-text);
  font-family: var(--mono);
  font-size: 11px;
}
.dw-row-ava { flex: none; }
.dw-row-ava img,
.dw-row-ava .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.dw-row-main { min-width: 0; }
.dw-row-title { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.dw-row-flags { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-right: 6px; vertical-align: 1px; }
.dw-flag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  color: var(--tx-3);
  font-size: 10px;
  font-weight: 500;
}
.dw-flag-ess { border-color: var(--gold-text); color: var(--gold-text); }
.dw-flag-rec { border-color: var(--ac-text); color: var(--ac-text); }
.dw-flag-cat { border-color: var(--bd-2); color: var(--tx-2); }
.dw-row-link { color: var(--tx); text-decoration: none; }
.dw-row-link:hover { color: var(--ac-text); }
.dw-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  color: var(--tx-3);
  font-size: 11.5px;
}
.dw-row-meta a { color: var(--tx-3); text-decoration: none; }
.dw-row-meta a:hover { color: var(--tx-2); }
.dw-row-author { color: var(--tx-2) !important; }
.dw-dot { color: var(--tx-3); opacity: .7; }
.dw-row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.dw-chip {
  padding: 2px 7px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  color: var(--tx-3);
  font-size: 10.5px;
  text-decoration: none;
}
.dw-chip:hover { border-color: var(--ac); color: var(--tx-2); }
.dw-row-side { display: flex; align-items: center; gap: 10px; flex: none; }
.dw-nums { display: flex; gap: 12px; }
.dw-num { text-align: center; }
.dw-num strong { display: block; color: var(--tx-2); font-family: var(--mono); font-size: 12.5px; }
.dw-num span { color: var(--tx-3); font-size: 9.5px; }
.dw-row-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--bd);
  border-radius: 50%;
  color: var(--tx-3);
  text-decoration: none;
}
.dw-row-go:hover { border-color: var(--ac-text); color: var(--ac-text); }

/* ========== 7. 插件页浅色适配 ========== */
.dw-body .bl-page,
.dw-body .bk-page,
.dw-body .bs-page { color: var(--tx); }
.dw-body .bl-page .card,
.dw-body .bk-page .card,
.dw-body .bs-page .card { background: var(--card); border-color: var(--bd); }
.dw-body .bl-page h1,
.dw-body .bk-page h1,
.dw-body .bs-page h1 { color: var(--tx); font-family: var(--serif); }
.dw-body .bl-page h2,
.dw-body .bk-page h2,
.dw-body .bs-page h2 { color: var(--tx); }
.dw-body .bl-page .bl-hero,
.dw-body .bk-page .bk-hero,
.dw-body .bs-page .bs-plaza-hero {
  background: linear-gradient(135deg, var(--soft), var(--card)) !important;
  border-color: var(--bd) !important;
}
.dw-body .bl-page input,
.dw-body .bk-page input,
.dw-body .bs-page input,
.dw-body .bl-page select,
.dw-body .bk-page select,
.dw-body .bs-page select,
.dw-body .bl-page textarea,
.dw-body .bk-page textarea,
.dw-body .bs-page textarea {
  background: var(--soft);
  border-color: var(--bd);
  color: var(--tx);
}
.dw-body .bl-page input::placeholder,
.dw-body .bk-page input::placeholder,
.dw-body .bs-page input::placeholder { color: var(--tx-3); }
.dw-body .bl-page .bl-chip,
.dw-body .bk-page .bk-chip,
.dw-body .bs-page .bs-plaza-chip {
  border-color: var(--bd);
  background: var(--soft);
  color: var(--tx-3);
}
.dw-body .bl-page .bl-chip.is-on,
.dw-body .bk-page .bk-chip.on,
.dw-body .bs-page .bs-plaza-chip.is-on {
  border-color: var(--ac);
  background: var(--ac-soft);
  color: var(--ac-text);
}
.dw-body .bl-page .bl-tag,
.dw-body .bk-page .bk-badge { border-color: var(--bd-2); }

/* ========== 8. 响应式与动效 ========== */
@media (max-width: 1180px) {
  .dw-grid { grid-template-columns: minmax(0, 1fr) 292px; }
  .dw-grid.is-three { grid-template-columns: 176px minmax(0, 1fr) 292px; }
  .dw-hero-in { grid-template-columns: minmax(0, 1fr) 236px; gap: 30px; }
  .dw-hero { padding: 36px; }
}

@media (max-width: 1024px) {
  .dw-grid.is-three { grid-template-columns: minmax(0, 1fr) 292px; }
  .dw-grid-left { display: none; }
  .dw-hero-stack { width: 142px; height: 190px; }
  .dw-footer-cols { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  .dw-grid { grid-template-columns: minmax(0, 1fr); }
  .dw-grid-side { display: block; }
  .dw-hero-in { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .dw-hero-book { flex-direction: row; justify-content: flex-start; text-align: left; }
  .dw-hero-book-meta { align-items: flex-start; }
  .dw-hero-quote { max-width: none; }
  .dw-hero-stack { width: 110px; height: 148px; }
  .dw-gates { grid-template-columns: 1fr; }
  .dw-topics-grid { grid-template-columns: 1fr; }
  .dw-cat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .dw-topbar-in { position: relative; padding: 0 14px; height: 58px; gap: 10px; justify-content: space-between; }
  .dw-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 17px;
  }
  .dw-brand .brand-mark { width: 29px; height: 29px; font-size: 16px; }
  .dw-topbar .main-nav { top: 58px; }
  .dw-topbar .header-right { margin-left: 0; }
  /* 顶栏药丸搜索已移除；手机端保留右侧放大镜作为唯一搜索入口 */
  .dw-topbar .head-search-btn { display: inline-flex; }
  .dw-write { display: none; }
  .dw-main-wrap { padding: 16px 14px 76px; }
  .dw-hero { padding: 24px 18px; border-radius: 16px; }
  .dw-hero-title { font-size: 30px; }
  .dw-hero-desc { font-size: 14px; }
  .dw-hero-entity { font-size: 12px; }
  .dw-hero-search { margin-top: 16px; }
  .dw-hero-search button { padding: 8px 13px; }
  .dw-hero-stat { padding: 10px 14px; }
  .dw-hero-stat strong { font-size: 20px; }
  .dw-hero-ctas { margin-top: 16px; }
  .dw-spotlight, .dw-gates-sec, .dw-latest, .dw-topics, .dw-forums { margin-top: 22px; }
  .dw-spotlight .bl-rec { padding: 14px; }
  .dw-spotlight .bl-rec-body { flex-direction: column; }
  .dw-spotlight .bl-rec-stage { flex: none; width: 100%; }
  .dw-spotlight .bl-rec-big { min-height: 180px; }
  .dw-spotlight .bl-rec-list { flex: none; width: 100%; }
  .dw-spotlight .bl-rec-list.is-scroll { height: auto !important; }
  .dw-spotlight .bl-rec-list.is-scroll .bl-rec-track { transform: none !important; }
  .dw-spotlight-heading h2, .dw-sec-head h2, .dw-panel-heading h2, .dw-forums-head h2 { font-size: 21px; }
  .dw-gate { padding: 16px; }
  .dw-gate-title { font-size: 16px; }
  .dw-latest, .dw-topics { padding: 16px; border-radius: 16px; }
  .dw-cat { padding: 14px; }
  .dw-row { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 13px 6px; }
  .dw-row-side { grid-column: 2; justify-content: flex-end; }
  .dw-row-ava img, .dw-row-ava .avatar { width: 34px; height: 34px; }
  .dw-row-title { font-size: 14.5px; }
  .dw-footer { margin-top: 40px; }
  .dw-footer-wrap { padding: 28px 14px 20px; }
  .dw-footer-cols { grid-template-columns: 1fr 1fr; gap: 18px; }
  .dw-footer-brand { max-width: none; }
  .dw-side { padding: 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  .dw-hero-glow span { animation: dw-glow 12s ease-in-out infinite alternate; }
  .dw-hero-glow span:nth-child(2) { animation-delay: -6s; }
  .dw-js .dw-reveal { opacity: 0; }
  .dw-js .dw-reveal.dw-in { animation: dw-rise .45s cubic-bezier(.2, .7, .3, 1) both; }
}

@keyframes dw-glow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .14; }
  to { transform: translate3d(22px, -14px, 0) scale(1.08); opacity: .24; }
}

@keyframes dw-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .dw-hero-cover,
  .dw-gate,
  .dw-forum-cell,
  .dw-topic { transform: none !important; }
}

/* ========== 9. 三道书门内部迷你内容（插件首页块） ========== */
.dw-gate-list { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 10px; }
.dw-gate-shelf {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: var(--tx);
}
.dw-gate-ava { display: inline-flex; flex: none; }
.dw-gate-ava img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.dw-gate-ava .avatar { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--soft-2); }
.dw-gate-shelf-main { min-width: 0; flex: 1; }
.dw-gate-shelf-name {
  display: block;
  overflow: hidden;
  color: var(--tx-2);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-gate-shelf-meta { display: block; margin-top: 1px; color: var(--tx-3); font-size: 10.5px; }
.dw-gate-mini { display: inline-flex; gap: 3px; flex: none; }
.dw-gate-mini img,
.dw-gate-mini i {
  display: block;
  width: 16px;
  height: 21px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid var(--bd);
  font-style: normal;
}
.dw-gate-mini i { color: rgba(255, 255, 255, .9); font-size: 9px; line-height: 19px; text-align: center; }
.dw-gate-entry { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.dw-gate-entry-cover { display: inline-flex; flex: none; }
.dw-gate-entry-cover img,
.dw-gate-entry-cover i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 29px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--bd);
  font-style: normal;
  color: rgba(255, 255, 255, .9);
  font-family: var(--serif);
  font-size: 11px;
}
.dw-gate-entry-main { min-width: 0; flex: 1; }
.dw-gate-entry-title {
  display: block;
  overflow: hidden;
  color: var(--tx-2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-gate-entry-meta { display: block; margin-top: 1px; color: var(--tx-3); font-size: 10.5px; }
.dw-gate-authors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.dw-gate-author { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.dw-gate-author-ava img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.dw-gate-author-ava .avatar { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--soft-2); }
.dw-gate-author-name {
  max-width: 52px;
  overflow: hidden;
  color: var(--tx-3);
  font-size: 10.5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-gate-author:hover .dw-gate-author-name { color: var(--ac-text); }
.dw-gate-foot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--gold-text);
  font-size: 11.5px;
  text-decoration: none;
}
.dw-gate-foot:hover { color: var(--gold-2); }

/* 侧栏「我的书架」 */
.dw-shelf-card .dw-btn-block { margin-top: 12px; }
.dw-shelf-list { display: flex; flex-direction: column; }
.dw-shelf-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
  text-decoration: none;
}
.dw-shelf-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dw-shelf-cover { display: inline-flex; flex: none; }
.dw-shelf-cover img,
.dw-shelf-cover i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--bd);
  font-style: normal;
  color: rgba(255, 255, 255, .9);
  font-family: var(--serif);
  font-size: 12px;
}
.dw-shelf-main { min-width: 0; flex: 1; }
.dw-shelf-title {
  display: block;
  overflow: hidden;
  color: var(--tx-2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-shelf-meta { display: block; margin-top: 2px; color: var(--tx-3); font-size: 10.5px; }
.dw-shelf-progress {
  display: block;
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-2);
}
.dw-shelf-progress i { display: block; height: 100%; border-radius: 999px; background: var(--ac); }
.dw-shelf-go { flex: none; color: var(--tx-3); }
.dw-shelf-row:hover .dw-shelf-title { color: var(--ac-text); }
.dw-shelf-row:hover .dw-shelf-go { color: var(--ac-text); }

@media (max-width: 720px) {
  .dw-gate-list { gap: 6px; }
  .dw-gate-authors { gap: 8px; }
}
