:root {
  --paper: #f4ede0;
  --paper-2: #fbf7ef;
  --ink: #2c2620;
  --ink-soft: #5b4f42;
  --red: #9e2b25;
  --red-soft: #c0584f;
  --green: #5b7d6f;
  --gold: #b8893b;
  --line: #e2d8c6;
  --shadow: 0 8px 30px rgba(70, 50, 30, 0.10);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(184,137,59,.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(91,125,111,.10), transparent 55%),
    var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
mark { background: rgba(184,137,59,.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.serif { font-family: var(--serif); }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 28px;
  background: rgba(251, 247, 239, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--red); }
.nav .brand .seal {
  width: 34px; height: 34px; border-radius: 8px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-size: 18px; box-shadow: 0 4px 12px rgba(158,43,37,.35);
}
.nav .links { display: flex; gap: 6px; margin-left: 14px; flex: 1; }
.nav .links a {
  padding: 8px 14px; border-radius: 8px; color: var(--ink-soft); font-size: 15px; transition: .2s;
}
.nav .links a:hover, .nav .links a.active { background: rgba(158,43,37,.08); color: var(--red); }
.nav .right { display: flex; align-items: center; gap: 10px; }
.btn {
  border: none; cursor: pointer; font-family: inherit; font-size: 14px;
  padding: 9px 18px; border-radius: 10px; transition: .2s; font-weight: 600;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(158,43,37,.30); }
.btn-primary:hover { background: #87231e; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ===== 容器 ===== */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }
.section-title { font-family: var(--serif); font-size: 24px; color: var(--ink); margin: 30px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 5px; height: 22px; background: var(--red); border-radius: 3px; }
.muted { color: var(--ink-soft); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 54px 44px;
  background: linear-gradient(135deg, #2c2620 0%, #4a3626 60%, #6b4326 100%);
  color: #f3e9d8; box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(184,137,59,.35), transparent 70%);
}
.hero h1 { font-family: var(--serif); font-size: 40px; line-height: 1.3; letter-spacing: 2px; position: relative; }
.hero p { margin-top: 14px; color: #d8c7ac; font-size: 16px; max-width: 560px; position: relative; }
.hero .quote-card {
  position: relative; margin-top: 26px; display: inline-block;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 18px 24px; backdrop-filter: blur(4px); max-width: 560px;
}
.hero .quote-card .q-text { font-family: var(--serif); font-size: 20px; line-height: 1.7; color: #f6ecd9; }
.hero .quote-card .q-meta { margin-top: 10px; color: #c9b48f; font-size: 14px; }
.hero .refresh { margin-top: 14px; }
.hero .refresh button { background: rgba(255,255,255,.12); color: #f3e9d8; border: 1px solid rgba(255,255,255,.2); }

/* ===== 卡片网格 ===== */
.grid { display: grid; gap: 18px; }
.grid-poem { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow); transition: .22s; cursor: pointer; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(70,50,30,.16); border-color: rgba(158,43,37,.3); }
.card .kind { position: absolute; right: 14px; top: 14px; font-size: 12px; color: var(--gold); border: 1px solid var(--gold); padding: 1px 8px; border-radius: 20px; }
.card h3 { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.card .author { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.card .content { font-family: var(--serif); color: var(--ink-soft); font-size: 15px; line-height: 1.7; max-height: 5.1em; overflow: hidden; }
.card .quote { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--green); font-family: var(--serif); font-size: 14px; }

/* ===== 筛选栏 ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters input[type="text"] {
  flex: 1; min-width: 200px; padding: 11px 16px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: #fff; font-family: inherit;
}
.filters input:focus { outline: none; border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); cursor: pointer; transition: .18s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.active { background: var(--red); color: #fff; border-color: var(--red); }
.filter-group { margin-bottom: 12px; }
.filter-group .label { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }

/* ===== 分页 ===== */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; }
.pager button { min-width: 40px; }

/* ===== 详情页 ===== */
.detail { max-width: 760px; margin: 0 auto; }
.detail .title { font-family: var(--serif); font-size: 34px; text-align: center; color: var(--ink); margin: 10px 0 6px; }
.detail .meta { text-align: center; color: var(--red); font-size: 15px; margin-bottom: 24px; }
.detail .content-box {
  font-family: var(--serif); font-size: 21px; line-height: 2.2; text-align: center;
  color: var(--ink); background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 24px; box-shadow: var(--shadow); white-space: pre-wrap;
}
.accordion { margin-top: 22px; border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; cursor: pointer; font-family: var(--serif); font-size: 17px; color: var(--ink); }
.acc-head .arrow { transition: .25s; color: var(--gold); }
.acc-body { display: none; padding: 0 4px 18px; color: var(--ink-soft); line-height: 1.9; font-size: 15px; }
.acc-item.open .acc-body { display: block; }
.acc-item.open .arrow { transform: rotate(180deg); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0; justify-content: center; }

/* ===== 作者 ===== */
.author-card { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--red), var(--gold)); color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-size: 24px;
}
.author-card .name { font-family: var(--serif); font-size: 18px; }
.author-card .sub { color: var(--ink-soft); font-size: 13px; margin-top: 3px; }

/* ===== 登录模态 ===== */
.mask { position: fixed; inset: 0; background: rgba(40,30,20,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  width: 400px; max-width: 94%; background: var(--paper-2); border-radius: 18px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .close { position: absolute; right: 16px; top: 14px; font-size: 22px; color: var(--ink-soft); cursor: pointer; border: none; background: none; }
.modal h2 { font-family: var(--serif); color: var(--red); font-size: 22px; margin-bottom: 4px; }
.modal .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; background: #efe6d6; padding: 4px; border-radius: 12px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--ink-soft); transition: .2s; }
.tabs .tab.active { background: #fff; color: var(--red); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--red); }
.field.row { display: flex; gap: 10px; }
.field.row input { flex: 1; }
.field.row button { white-space: nowrap; }
.wechat-btn {
  width: 100%; margin-top: 4px; padding: 12px; border-radius: 10px; border: none; cursor: pointer;
  background: #07c160; color: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.wechat-btn:hover { background: #06ad56; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ===== 我的页 ===== */
.profile { display: flex; align-items: center; gap: 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.profile .avatar { width: 64px; height: 64px; font-size: 28px; }
.menu { margin-top: 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.menu a, .menu .item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 15px; }
.menu a:last-child, .menu .item:last-child { border-bottom: none; }
.menu a:hover, .menu .item:hover { background: rgba(158,43,37,.05); }
.menu .item .val { color: var(--red); }

/* ===== 空状态 / 加载 ===== */
.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; font-size: 15px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(91,75,60,.3); border-top-color: var(--red);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 页脚 ===== */
.footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 20px 40px; border-top: 1px solid var(--line); margin-top: 40px; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .nav { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .nav .links { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .hero { padding: 36px 22px; }
  .hero h1 { font-size: 30px; }
  .wrap { padding: 16px 14px 50px; }
  .grid-poem { grid-template-columns: 1fr; }
}
