/* ============================================================
   诗松 · 前台样式（宣纸墨韵风 · 精修版）
   全部视觉由 CSS 实现，无外部资源依赖
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #2b2620;
  --ink-light: #645c4e;
  --paper: #f5f0e6;
  --paper-card: #fdfaf3;
  --paper-deep: #ece4d3;
  --seal: #a63d2f;
  --seal-dark: #8c3226;
  --seal-soft: #c87365;
  --line: #ddd3bf;
  --line-soft: #e9e1d0;
  --green: #4a6741;
  --shadow-sm: 0 2px 8px rgba(74, 62, 44, .06);
  --shadow-md: 0 10px 28px rgba(74, 62, 44, .12);
  /* 标题用衬线（大字号下宋体渲染清晰），正文/界面用雅黑（小字号锐利）；SimSun(GB18030) 兜底扩展A区，ExtB 字体兜底扩展B/C区 */
  --font-title: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", "SimSun-ExtB", "MingLiU-ExtB", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "SimSun", "SimSun-ExtB", "MingLiU-ExtB", "Helvetica Neue", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "FZKai-Z03S", "SimSun", "SimSun-ExtB", "MingLiU-ExtB", serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15.5px;
  background-color: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* 宣纸纹理：细横纹 + 淡晕 */
  background-image:
    repeating-linear-gradient(0deg, rgba(160, 140, 100, .028) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(255, 252, 244, .9), transparent),
    radial-gradient(ellipse 70% 50% at 100% 110%, rgba(196, 178, 143, .14), transparent),
    radial-gradient(ellipse 70% 50% at 0% 110%, rgba(196, 178, 143, .10), transparent);
  color: var(--ink);
  line-height: 1.85;
}

::selection { background: rgba(166, 61, 47, .18); }

a { color: inherit; text-decoration: none; }
.muted { color: var(--ink-light); font-size: .9em; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.main { min-height: 62vh; padding-top: 28px; }

/* ---------- header ---------- */
.site-header {
  background: rgba(253, 250, 243, .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; gap: 36px; height: 66px; }
.brand {
  font-family: var(--font-title);
  font-size: 30px; font-weight: 700; letter-spacing: 2px;
  display: flex; align-items: center; gap: 10px;
}
.brand span { color: var(--seal); }
.brand::before {
  content: "诗松"; /* 印章 */
  writing-mode: vertical-rl;
  font-size: 11px; letter-spacing: 2px; line-height: 1;
  color: #f6ead9; background: linear-gradient(160deg, var(--seal), var(--seal-dark));
  padding: 6px 4px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  padding: 7px 16px; border-radius: 8px; font-size: 15px; letter-spacing: 1px;
  position: relative; transition: .18s;
}
.nav a:hover { color: var(--seal); background: rgba(166, 61, 47, .06); }
.nav a.active {
  color: var(--seal); background: rgba(166, 61, 47, .08); font-weight: 600;
}
.nav a.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 2px; width: 18px; height: 3px; border-radius: 2px; background: var(--seal);
}
.header-right { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--paper-card);
  padding: 7px 18px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px;
  letter-spacing: 1px; transition: .18s; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--seal-soft); color: var(--seal); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(160deg, var(--seal), var(--seal-dark));
  border-color: var(--seal-dark); color: #fdf6ec; box-shadow: 0 3px 10px rgba(140, 50, 38, .28);
}
.btn-primary:hover {
  background: linear-gradient(160deg, var(--seal-dark), #74291e);
  color: #fff; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(140, 50, 38, .34);
}
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: rgba(166, 61, 47, .07); box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 3px 11px; font-size: 13px; border-radius: 6px; }
.btn-danger { color: var(--seal-dark); }

/* ---------- flash ---------- */
.flash { margin: 14px 0; padding: 11px 18px; border-radius: 8px; font-size: 14px; }
.flash-error { background: #fbeae7; color: var(--seal-dark); border: 1px solid #ecc8c1; }
.flash-ok { background: #eaf2e6; color: var(--green); border: 1px solid #cdddc5; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 0 30px; position: relative; }
.hero h1 {
  font-family: var(--font-kai);
  font-size: 46px; font-weight: 600; letter-spacing: 10px; color: var(--ink);
  position: relative; display: inline-block; padding: 0 26px;
}
/* 标题两侧墨点装饰 */
.hero h1::before, .hero h1::after {
  content: "❝"; color: rgba(166, 61, 47, .28); font-size: 30px;
  position: absolute; top: -8px;
}
.hero h1::before { left: -22px; }
.hero h1::after { content: "❞"; right: -22px; top: auto; bottom: -14px; }
.hero p { margin: 16px 0 28px; color: var(--ink-light); letter-spacing: 2.5px; }
/* 印章 */
.hero-seal {
  position: absolute; right: 8%; top: 56px;
  width: 52px; height: 52px; border-radius: 5px;
  background: linear-gradient(160deg, var(--seal), var(--seal-dark));
  color: #f8ecd9; font-family: var(--font-kai);
  writing-mode: vertical-rl; font-size: 17px; letter-spacing: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4), inset 0 0 0 3px rgba(140,50,38,.5), var(--shadow-sm);
  transform: rotate(3deg); opacity: .9;
  user-select: none; pointer-events: none;
}
.search-bar { display: flex; max-width: 540px; margin: 0 auto; }
.search-bar input {
  flex: 1; border: 2px solid var(--ink); border-right: 0;
  border-radius: 10px 0 0 10px; padding: 13px 18px;
  font: inherit; background: var(--paper-card); letter-spacing: 1px;
}
.search-bar input:focus { outline: none; border-color: var(--seal); }
.search-bar input::placeholder { color: #b3a992; }
.search-bar button {
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 0 30px; border-radius: 0 10px 10px 0; cursor: pointer; font: inherit;
  letter-spacing: 3px; transition: .18s;
}
.search-bar button:hover { background: var(--seal); border-color: var(--seal); }

/* ---------- stat chips ---------- */
.stat-strip { display: flex; justify-content: center; gap: 12px; padding: 10px 0 28px; flex-wrap: wrap; }
.stat-chip {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 18px; font-size: 14px; color: var(--ink-light);
  transition: .18s; box-shadow: var(--shadow-sm);
}
.stat-chip:hover { border-color: var(--seal-soft); color: var(--seal); transform: translateY(-1px); }
.stat-chip b { color: var(--seal); font-size: 18px; margin: 0 6px; font-family: var(--font-title); }

/* ---------- sections ---------- */
.section { margin: 40px 0; }
.section-title {
  font-family: var(--font-title);
  font-size: 23px; letter-spacing: 5px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px;
}
.section-title::before {
  content: ""; width: 5px; height: 24px; border-radius: 3px;
  background: linear-gradient(180deg, var(--seal), var(--seal-dark));
}
.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.page-head { padding: 28px 0 12px; }
.page-head h1 {
  font-family: var(--font-title); letter-spacing: 4px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px;
}
.page-head h1::before {
  content: ""; width: 5px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg, var(--seal), var(--seal-dark));
}

/* ---------- poem grid ---------- */
.poem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.poem-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  transition: .22s; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.poem-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--seal), var(--seal-soft), transparent 70%);
  opacity: 0; transition: .22s;
}
.poem-card:hover {
  border-color: var(--seal-soft); transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.poem-card:hover::before { opacity: 1; }
.poem-card-body {
  white-space: pre-line; font-family: var(--font-kai);
  font-size: 16.5px; color: #3d362c; flex: 1;
}
.poem-card-meta {
  display: flex; align-items: baseline; gap: 10px;
  border-top: 1px dashed var(--line); padding-top: 12px;
  font-size: 13.5px; color: var(--ink-light);
}
.poem-card-meta b { font-family: var(--font-title); font-size: 15.5px; color: var(--ink); letter-spacing: 1px; }
.views { margin-left: auto; font-size: 12.5px; }

/* ---------- poem list rows ---------- */
.poem-list {
  list-style: none; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.poem-list li { display: flex; align-items: baseline; gap: 12px; padding: 13px 20px; border-bottom: 1px dashed var(--line-soft); transition: .15s; }
.poem-list li:last-child { border-bottom: 0; }
.poem-list li:hover { background: rgba(166, 61, 47, .035); }
.poem-list a:hover { color: var(--seal); }
.tag {
  display: inline-block; font-size: 12.5px; padding: 1px 10px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-light); border: 1px solid var(--line); cursor: default;
}
.tag-ok { background: #eaf2e6; color: var(--green); border-color: #cdddc5; }
.tag-wait { background: #fdf3e2; color: #a0722a; border-color: #ecd9b5; }
/* 学段徽标（课标归类） */
.tag-edu {
  background: #f3ece0; color: var(--seal-dark); border-color: #e0cfb3;
  font-weight: 600; letter-spacing: 1px;
}
button.tag { cursor: pointer; font: inherit; font-size: 12px; }

/* ---------- 学段入口（首页） ---------- */
.edu-strip { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 6px 0 10px; }
.edu-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 118px; padding: 14px 20px 11px; border-radius: 12px;
  background: var(--paper-card); border: 1px solid var(--line); border-top: 3px solid var(--line);
  box-shadow: var(--shadow-sm); transition: .2s;
}
.edu-chip b { font-family: var(--font-title); font-size: 18px; letter-spacing: 2px; }
.edu-chip span { font-size: 12px; color: var(--ink-light); }
.edu-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.edu-幼儿 { border-top-color: #4a6741; } .edu-幼儿 b { color: #4a6741; }
.edu-小学 { border-top-color: #2b7a78; } .edu-小学 b { color: #2b7a78; }
.edu-初中 { border-top-color: #a0722a; } .edu-初中 b { color: #a0722a; }
.edu-高中 { border-top-color: var(--seal); } .edu-高中 b { color: var(--seal); }
.edu-extra { border-top-color: #9a9284; } .edu-extra b { color: #6e675b; }

/* ---------- poets ---------- */
.poet-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.poet-chip {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 22px; display: flex; flex-direction: column; min-width: 140px;
  transition: .18s; box-shadow: var(--shadow-sm);
}
.poet-chip:hover { border-color: var(--seal-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.poet-chip b { font-size: 17px; letter-spacing: 1px; }
.poet-chip span { font-size: 13px; color: var(--ink-light); }

.poet-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.poet-card {
  display: flex; gap: 16px; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 10px; padding: 20px;
  transition: .18s; box-shadow: var(--shadow-sm);
}
.poet-card:hover { border-color: var(--seal-soft); box-shadow: var(--shadow-md); }
.poet-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(150deg, var(--seal), var(--seal-dark));
  color: #f8ecd9; display: flex; align-items: center; justify-content: center;
  font-size: 15px; letter-spacing: 1px; flex-shrink: 0; font-family: var(--font-body); font-weight: 600;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.3);
}
.poet-avatar.lg { width: 88px; height: 88px; font-size: 22px; }
.poet-info b { font-size: 18px; margin-right: 8px; letter-spacing: 1px; }
.poet-intro { font-size: 13.5px; color: var(--ink-light); margin-top: 6px; }

/* ---------- poet detail (side card + works) ---------- */
.poet-page {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px;
  align-items: start; margin-top: 26px;
}
.poet-side { position: sticky; top: 20px; }
.poet-side-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 22px; text-align: center; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--seal);
}
.poet-side-card .poet-avatar.lg { margin: 0 auto 14px; }
.poet-side-name {
  font-family: var(--font-title); font-size: 26px; letter-spacing: 4px; margin-bottom: 10px;
}
.poet-side-bio {
  font-size: 13.5px; line-height: 1.85; color: var(--ink-light);
  text-align: justify; margin: 16px 0 0; max-height: 240px; overflow-y: auto;
}
.poet-side-stats {
  margin: 18px 0; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
  display: flex; flex-direction: column;
}
.poet-side-stats b { font-size: 22px; font-family: var(--font-title); color: var(--seal); }
.poet-side-stats span { font-size: 13px; color: var(--ink-light); letter-spacing: 2px; }
.btn-block { display: block; text-align: center; }
.works-count {
  font-family: inherit; font-size: 13.5px; letter-spacing: 1px; color: var(--ink-light);
  font-weight: normal; margin-left: 4px;
}
.work-list { display: flex; flex-direction: column; gap: 10px; }
.work-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 18px; transition: .18s; box-shadow: var(--shadow-sm); color: var(--ink);
}
.work-item:hover { border-color: var(--seal-soft); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.work-index {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(158,60,40,.07); color: var(--seal); font-size: 13.5px; font-weight: 600;
}
.work-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.work-title { font-size: 15.5px; letter-spacing: 1px; }
.work-item:hover .work-title { color: var(--seal); }
.work-preview {
  font-size: 13.5px; color: #6f675a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.work-meta {
  flex-shrink: 0; text-align: right; font-size: 12.5px; color: var(--ink-light);
  display: flex; flex-direction: column; gap: 3px;
}
.work-meta i { font-style: normal; color: #8d8577; }
@media (max-width: 900px) {
  .poet-page { grid-template-columns: minmax(0, 1fr); }
  .poet-side { position: static; }
}

/* ---------- poem rows ---------- */
.poem-rows { display: flex; flex-direction: column; gap: 12px; }
.poem-row {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 10px; padding: 17px 22px; transition: .18s; box-shadow: var(--shadow-sm);
}
.poem-row:hover { border-color: var(--seal-soft); box-shadow: var(--shadow-md); }
.poem-row-body { white-space: pre-line; font-family: var(--font-kai); font-size: 16px; color: #3d362c; }
.poem-row-meta { display: flex; gap: 14px; align-items: baseline; margin-top: 10px; font-size: 13.5px; color: var(--ink-light); }
.poem-row-meta a b { font-size: 15px; color: var(--ink); letter-spacing: 1px; }
.poem-row-meta a:hover { color: var(--seal); }

/* ---------- filter bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 24px; }
.filter-bar input, .filter-bar select {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px;
  font: inherit; background: var(--paper-card); transition: .15s;
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--seal-soft); }

/* ---------- feedback ---------- */
.feedback-box {
  max-width: 720px; margin: 10px 0 30px; padding: 24px 26px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 10px rgba(60,40,20,.05);
}
.feedback-ref {
  padding: 10px 14px; margin-bottom: 16px; font-size: 14px;
  background: rgba(158,60,40,.06); border-left: 3px solid var(--seal); border-radius: 6px;
}
.feedback-types { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.feedback-type {
  padding: 7px 18px; border: 1px solid var(--line); border-radius: 20px;
  cursor: pointer; font-size: 14.5px; user-select: none; transition: .15s; background: #fff;
}
.feedback-type input { display: none; }
.feedback-type.checked {
  background: linear-gradient(150deg, var(--seal), var(--seal-dark));
  color: #f8ecd9; border-color: transparent;
}
.feedback-box textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical; background: #fff;
}
.feedback-box textarea:focus { outline: none; border-color: var(--seal-soft); }
.feedback-contact {
  display: block; width: 100%; box-sizing: border-box; margin-top: 12px;
  padding: 10px 14px; font: inherit; border: 1px solid var(--line); border-radius: 8px;
}
.feedback-contact:focus { outline: none; border-color: var(--seal-soft); }
.feedback-box .btn { margin-top: 14px; }
.fb-handle-form { display: flex; gap: 6px; align-items: center; }
.fb-handle-form input { border: 1px solid #444; border-radius: 6px; padding: 4px 8px; font-size: 12px; }

/* ---------- notes ---------- */
.note-block { border-left: 3px solid var(--seal-soft); }
.note-privacy { font-size: 12px; letter-spacing: 1px; font-weight: normal; }
.note-block textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit;
  line-height: 1.8; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf7; resize: vertical;
}
.note-block textarea:focus { outline: none; border-color: var(--seal-soft); }
.note-actions { margin-top: 10px; display: flex; gap: 10px; }
.note-delete-form { margin-top: 10px; display: flex; gap: 12px; align-items: center; font-size: 12.5px; }
.note-item .note-preview {
  font-size: 13.5px; color: var(--ink-light); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- poem detail ---------- */
.poem-detail {
  max-width: 780px; margin: 30px auto 0;
  background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 48px 56px; position: relative;
  box-shadow: var(--shadow-md);
}
/* 双线画框 */
.poem-detail::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid var(--line-soft); border-radius: 8px; pointer-events: none;
}
.poem-title {
  text-align: center; font-family: var(--font-title);
  font-size: 32px; letter-spacing: 7px; font-weight: 600;
}
.poem-author { text-align: center; color: var(--ink-light); margin: 14px 0 34px; letter-spacing: 2px; }
.poem-author a:hover { color: var(--seal); }
.poem-content {
  white-space: pre-line; text-align: center;
  font-family: var(--font-kai);
  font-size: 20px; line-height: 2.5; letter-spacing: 3px; color: #3c352b;
}
.poem-actions { text-align: center; margin: 30px 0 8px; }
.poem-block { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--line); }
.poem-block h3 {
  font-size: 15px; color: var(--seal); letter-spacing: 4px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.poem-block h3::before {
  content: ""; width: 22px; height: 1px; background: var(--seal-soft);
}
.poem-block p { font-size: 15px; color: #4a4336; white-space: pre-line; line-height: 1.95; }
.mini-list { list-style: none; }
.mini-list li { padding: 4px 0; }
.mini-list a:hover { color: var(--seal); }

/* ---------- comments ---------- */
.comment-form { margin: 12px 0 20px; }
.comment-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 15px; font: inherit; background: var(--paper-card); resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--seal-soft); }
.comment-list { list-style: none; }
.comment-item { padding: 13px 0; border-bottom: 1px dashed var(--line-soft); }
.comment-item:last-child { border-bottom: 0; }
.comment-head { display: flex; gap: 12px; font-size: 14px; margin-bottom: 4px; }
.comment-head b { color: var(--seal); }

/* ---------- auth card ---------- */
.auth-card {
  max-width: 410px; margin: 52px auto;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 40px 44px; box-shadow: var(--shadow-md);
}
.auth-card h1 { text-align: center; letter-spacing: 7px; margin-bottom: 24px; font-family: var(--font-title); }
.auth-card label { display: block; font-size: 14px; margin-bottom: 16px; }
.auth-card input {
  width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; font: inherit; background: #fff; transition: .15s;
}
.auth-card input:focus { outline: none; border-color: var(--seal-soft); }
.auth-card .btn-block { margin-top: 8px; padding: 12px; }
.auth-card p { text-align: center; margin-top: 18px; }

/* ---------- me page ---------- */
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.fav-item {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 15px 19px; margin-bottom: 12px; transition: .18s; box-shadow: var(--shadow-sm);
}
.fav-item:hover { border-color: var(--seal-soft); box-shadow: var(--shadow-md); }
.fav-item a { color: var(--ink); }
.fav-item a:hover { color: var(--seal); }
.fav-item p { font-size: 14px; margin: 6px 0; }
.fav-item .btn { margin-top: 6px; }

/* ---------- empty + pager ---------- */
.empty { text-align: center; color: var(--ink-light); padding: 48px 0; letter-spacing: 2px; }
.pager { margin: 28px 0; text-align: center; }
.pager ul { display: inline-flex; gap: 6px; list-style: none; flex-wrap: wrap; justify-content: center; }
.pager li a, .pager li span {
  display: inline-block; min-width: 36px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-card); font-size: 14px; transition: .15s;
}
.pager li a:hover { border-color: var(--seal-soft); color: var(--seal); }
.pager .active span { background: linear-gradient(160deg, var(--seal), var(--seal-dark)); border-color: var(--seal-dark); color: #fff; }

/* ---------- footer ---------- */
.site-footer {
  background: linear-gradient(180deg, #322c25, #26211b);
  color: #cfc6b4; text-align: center; padding: 34px 0; margin-top: 70px;
  font-size: 14px; letter-spacing: 1px;
  border-top: 3px solid var(--seal);
  position: relative;
}
.site-footer p { margin: 4px 0; }
.site-footer .muted { color: #847c6d; font-size: 12.5px; }

/* ============================================================
   响应式 / 移动端适配
   ============================================================ */

/* --- 触屏设备：取消 hover 位移与点击高亮，避免状态残留 --- */
@media (hover: none), (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .btn, .nav a, .pager li a, .pager li span, .stat-chip, .edu-chip,
  .poem-card, .poet-card, .poet-chip, .work-item, .fav-item,
  .poem-row, .poem-list li a { touch-action: manipulation; }
  .btn:hover, .poem-card:hover, .poet-card:hover, .poet-chip:hover,
  .stat-chip:hover, .edu-chip:hover, .work-item:hover, .fav-item:hover,
  .poem-row:hover { transform: none; }
}

/* --- 平板：卡片两列 --- */
@media (max-width: 1024px) {
  .container { padding: 0 18px; }
  .poem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

/* --- 竖屏平板 / 大屏手机 --- */
@media (max-width: 860px) {
  .poem-grid { grid-template-columns: minmax(0, 1fr); }
  .poet-cards, .me-grid { grid-template-columns: minmax(0, 1fr); }
  .me-grid { gap: 6px; }
  .poet-page { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 18px; }
  .poet-side { position: static; }
  .brand::before { display: none; }
  .hero-seal { display: none; }
}

/* --- 手机 --- */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  .main { padding-top: 14px; min-height: 58vh; }

  /* 输入控件统一 16px：iOS Safari 对字号 <16px 的输入框会自动放大整页 */
  input, select, textarea { font-size: 16px !important; }

  /* ---------- 顶栏：两行（上行品牌 + 账号，下行等宽导航） ---------- */
  .header-inner { flex-wrap: wrap; height: auto; gap: 0; padding: 7px 0 0; }
  .brand { order: 1; font-size: 23px; letter-spacing: 1px; }
  .brand::before { display: none; }
  .header-right { order: 2; margin-left: auto; gap: 4px; }
  .header-right .btn { padding: 5px 11px; font-size: 13.5px; min-height: 34px; }
  .nav {
    order: 3; flex: 0 0 100%; width: 100%; gap: 0;
    margin-top: 6px; border-top: 1px solid var(--line-soft);
  }
  .nav a {
    flex: 1 1 0; text-align: center; padding: 11px 4px;
    border-radius: 0; font-size: 15px; letter-spacing: .5px;
  }
  .nav a:hover, .nav a.active { background: transparent; }
  .nav a.active::after { bottom: 0; width: 26px; }

  /* ---------- 触控目标：主按钮 ≥42px ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 9px 16px;
  }
  .btn-block { display: flex; }
  .btn-sm { min-height: 34px; padding: 5px 12px; }

  /* ---------- 首页 hero ---------- */
  .hero { padding: 26px 0 14px; }
  .hero h1 { font-size: 27px; letter-spacing: 5px; padding: 0 6px; }
  .hero h1::before, .hero h1::after { display: none; }
  .hero p { font-size: 13.5px; letter-spacing: .5px; margin: 12px 0 20px; line-height: 1.95; }
  .search-bar { max-width: 100%; }
  .search-bar input { padding: 12px 14px; border-width: 1.5px; border-radius: 9px 0 0 9px; }
  .search-bar button { padding: 0 18px; letter-spacing: 1px; border-width: 1.5px; }

  /* ---------- 学段 / 朝代跳转 ---------- */
  .edu-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 2px 0 8px; }
  .edu-chip { min-width: 0; padding: 11px 4px 8px; }
  .edu-chip b { font-size: 16px; letter-spacing: 1px; }
  .edu-chip span { font-size: 11.5px; }
  .stat-strip { gap: 7px; padding: 6px 0 18px; }
  .stat-chip { padding: 5px 12px; font-size: 12.5px; }
  .stat-chip b { font-size: 16px; margin: 0 4px; }

  /* ---------- 区块 / 标题 ---------- */
  .section { margin: 26px 0; }
  .section-title { font-size: 19px; letter-spacing: 3px; margin-bottom: 14px; gap: 10px; }
  .section-title::before { height: 20px; width: 4px; }
  .page-head { padding: 16px 0 8px; }
  .page-head h1 { font-size: 22px; letter-spacing: 3px; margin-bottom: 10px; }
  .page-head h1::before { height: 22px; }

  /* ---------- 诗词卡片 / 列表 ---------- */
  .poem-card { padding: 16px; gap: 10px; }
  .poem-card-body { font-size: 16px; }
  .poem-card-meta { flex-wrap: wrap; gap: 3px 8px; padding-top: 10px; font-size: 12.5px; }
  .poem-card-meta b { font-size: 15px; }
  .views { margin-left: 0; font-size: 12px; }
  .poem-list li { flex-wrap: wrap; align-items: flex-start; gap: 3px 8px; padding: 12px 14px; }
  .poem-list li .muted { font-size: 12.5px; }

  /* ---------- 筛选栏：竖向堆叠，避免挤成一条 ---------- */
  .filter-bar { gap: 8px; margin: 10px 0 18px; }
  .filter-bar input { flex: 1 1 100%; width: 100%; }
  .filter-bar select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filter-bar .btn { flex: 1 1 calc(50% - 4px); }

  /* ---------- 诗词库列表行 ---------- */
  .poem-row { padding: 14px 15px; }
  .poem-row-body { font-size: 16px; line-height: 2; }
  .poem-row-meta { flex-wrap: wrap; gap: 4px 10px; margin-top: 9px; font-size: 12.5px; }
  .poem-row-meta a b { font-size: 14.5px; }

  /* ---------- 诗词详情 ---------- */
  .poem-detail { margin: 16px auto 0; padding: 26px 18px 22px; border-radius: 10px; }
  .poem-detail::before { inset: 6px; border-radius: 6px; }
  .poem-title { font-size: 23px; letter-spacing: 4px; }
  .poem-author { font-size: 13.5px; margin: 10px 0 20px; line-height: 2; }
  .poem-content { font-size: 18px; line-height: 2.15; letter-spacing: 1.5px; word-break: break-word; }
  .poem-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0 6px; }
  .poem-actions form { display: flex; }
  .poem-block { margin-top: 22px; padding-top: 16px; }
  .poem-block h3 { font-size: 14.5px; letter-spacing: 2px; gap: 8px; }
  .poem-block p { font-size: 14.5px; line-height: 1.9; }
  .mini-list li { padding: 6px 0; }

  /* ---------- 诗人 ---------- */
  .poet-cards { gap: 12px; }
  .poet-card { padding: 15px; gap: 12px; }
  .poet-avatar { width: 46px; height: 46px; font-size: 14px; }
  .poet-avatar.lg { width: 72px; height: 72px; font-size: 20px; }
  .poet-info b { font-size: 16.5px; }
  .poet-intro { font-size: 13px; }
  .poet-side-card { padding: 22px 18px; }
  .poet-side-name { font-size: 22px; letter-spacing: 3px; }
  .poet-side-bio { max-height: none; overflow: visible; font-size: 13px; text-align: left; }
  .poet-side-stats { flex-direction: row; justify-content: center; align-items: baseline; gap: 8px; margin: 14px 0; }
  .poet-side-stats b { font-size: 20px; }

  /* ---------- 作品列表 ---------- */
  .work-item { padding: 11px 13px; gap: 11px; }
  .work-index { width: 28px; height: 28px; font-size: 12.5px; }
  .work-title { font-size: 15px; }
  .work-preview { font-size: 13px; }
  .work-meta { font-size: 11.5px; }
  .work-meta i { display: none; }

  /* ---------- 笔记 / 评论 ---------- */
  .note-actions { flex-direction: column; }
  .note-actions .btn { width: 100%; }
  .note-delete-form { flex-wrap: wrap; gap: 8px; }
  .comment-list { font-size: 14.5px; }
  .comment-head { flex-wrap: wrap; gap: 4px 10px; }

  /* ---------- 反馈 ---------- */
  .feedback-box { padding: 18px 15px; margin: 8px 0 22px; }
  .feedback-types { gap: 8px; }
  .feedback-type { flex: 1 1 30%; text-align: center; padding: 9px 6px; }

  /* ---------- 登录 / 注册 ---------- */
  .auth-card { max-width: 100%; margin: 18px auto; padding: 26px 20px; }
  .auth-card h1 { font-size: 21px; letter-spacing: 5px; }

  /* ---------- 个人中心 ---------- */
  .fav-item { padding: 13px 15px; }

  /* ---------- 分页 ---------- */
  .pager { margin: 20px 0; }
  .pager li a, .pager li span {
    min-width: 40px; min-height: 40px; padding: 4px 9px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* ---------- 页脚（含 iPhone 底部安全区） ---------- */
  .site-footer { margin-top: 40px; padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
  .site-footer .muted { font-size: 12px; line-height: 1.95; }
}

/* --- 小屏手机（≤400px） --- */
@media (max-width: 400px) {
  .container { padding: 0 12px; }
  .brand { font-size: 21px; }
  .hero h1 { font-size: 24px; letter-spacing: 3px; }
  .hero p { font-size: 12.5px; }
  .edu-strip { grid-template-columns: repeat(2, 1fr); }
  .poem-title { font-size: 20px; letter-spacing: 3px; }
  .poem-content { font-size: 16.5px; letter-spacing: 1px; line-height: 2.1; }
  .filter-bar select { flex: 1 1 100%; }
  .stat-chip { font-size: 12px; padding: 5px 10px; }
  .nav a { font-size: 14px; }
}
