/* =========================================================
   多彩狮山 — 视觉样式
   仅调整外观：留白、圆角、配色、字体与 hover 细节
   ========================================================= */

:root {
  /* 底色与文字 */
  --bg: #f4f2ec;
  --bg-soft: #faf8f3;
  --paper: #fffdfa;
  --paper-solid: #ffffff;
  --ink: #232019;
  --ink-soft: #45403a;
  --muted: #756f65;
  --muted-soft: #948d81;
  --line: #e7e2d8;
  --line-strong: #d9d3c6;
  --tint: #f8f6f0;

  /* 主色 */
  --green: #0a6e4f;
  --green-deep: #08543d;
  --green-soft: #e7f2ec;
  --gold: #d8a73c;
  --gold-soft: rgba(216, 167, 60, 0.14);
  --warn: #96630f;
  --danger: #a13c37;

  /* 圆角 */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(42, 35, 22, 0.05);
  --shadow-md: 0 2px 4px rgba(42, 35, 22, 0.04), 0 18px 36px -28px rgba(42, 35, 22, 0.32);
  --shadow-lg: 0 24px 60px -40px rgba(42, 35, 22, 0.45);

  /* 字体 */
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", system-ui, "Segoe UI", sans-serif;
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  background:
    radial-gradient(1150px 460px at 8% -8%, rgba(10, 110, 79, 0.11), transparent 62%),
    radial-gradient(950px 400px at 102% -4%, rgba(216, 167, 60, 0.1), transparent 60%),
    radial-gradient(720px 360px at 86% 30%, rgba(216, 167, 60, 0.05), transparent 60%),
    radial-gradient(1300px 640px at 50% 116%, rgba(10, 110, 79, 0.08), transparent 64%),
    repeating-linear-gradient(115deg, rgba(35, 32, 25, 0.013) 0 1px, transparent 1px 9px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(20, 101, 79, 0.16); }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

:where(a, button, summary):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 55%, white);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- 顶栏（华农绿官网风格） ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 11px 32px;
  background: linear-gradient(100deg, #0a5c44 0%, #0e6b52 56%, #0d6349 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 10px 30px -22px rgba(8, 84, 61, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
}

.brand::after {
  content: "勤读力耕 · 立己达人";
  margin-left: 6px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32em;
  white-space: nowrap;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.brand:hover .mark {
  transform: scale(1.04);
  box-shadow: 0 0 0 3px rgba(216, 167, 60, 0.25), 0 8px 20px -8px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.nav a, .nav button, .menu summary {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav a[aria-current="page"], .subnav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.nav a:hover, .nav button:hover, .menu summary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav form { display: flex; margin: 0; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }

.menu div {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 2px;
}

.menu a { border-radius: var(--radius-xs); }
.menu a:hover { background: var(--tint); }

.dot {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  animation: pulse 2.8s ease infinite;
}

.nav-toggle { display: none; }

/* ---------- 提示条 ---------- */

.unread-banner, .flash {
  display: block;
  width: min(1040px, calc(100% - 48px));
  margin: 16px auto 0;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.unread-banner {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 14%, white);
  transition: background 0.18s ease;
}

.unread-banner:hover { background: color-mix(in srgb, var(--green-soft) 82%, var(--green)); }

.flash {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: rise 0.35s ease both;
}

.flash-bad {
  color: var(--danger);
  border-color: #efd9d5;
  background: #fdf4f2;
}

.flash.out { opacity: 0; transform: translateY(-6px); transition: 0.35s ease; }

/* ---------- 布局 ---------- */

main { animation: settle 0.4s ease both; }

.wrap { width: min(1040px, calc(100% - 48px)); margin: 32px auto 80px; }

.narrow {
  width: min(680px, calc(100% - 48px));
  padding: clamp(24px, 3.4vw, 38px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.narrow h2 { margin-top: 30px; }

h1, h2 { font-weight: 600; letter-spacing: 0.01em; }

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.4;
  margin: 0 0 20px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h2 { font-size: 17px; margin: 0 0 10px; }

.filters, .head-row, .row-actions, .split {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filters { margin-bottom: 16px; }
.head-row { justify-content: space-between; margin-bottom: 18px; }
.head-row h1 { margin: 0; }
.grow { flex: 1; }

/* ---------- 筛选与标签 ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }

.chip {
  padding: 7px 15px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 14px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.chip.on, .chip:hover {
  color: var(--green-deep);
  background: var(--paper);
  border-color: color-mix(in srgb, var(--green) 34%, white);
}

.chip.on {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 45%, white);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--green) 40%, transparent);
}

.chip:hover { transform: translateY(-1px); }

.pill, .state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill {
  background: color-mix(in srgb, var(--c, var(--green)) 12%, white);
  color: var(--c, var(--green));
}

.state {
  background: #f1eee6;
  color: #6d675d;
}

.pill[data-b="学科竞赛"], .tile[data-b="学科竞赛"], .chip[data-b="学科竞赛"] { --c: #1c6b55; }
.pill[data-b="讲座沙龙"], .tile[data-b="讲座沙龙"], .chip[data-b="讲座沙龙"] { --c: #b45f36; }
.pill[data-b="科研招募"], .tile[data-b="科研招募"], .chip[data-b="科研招募"] { --c: #33587f; }
.pill[data-b="文体活动"], .tile[data-b="文体活动"], .chip[data-b="文体活动"] { --c: #97731e; }
.pill[data-b="校园招聘"], .tile[data-b="校园招聘"], .chip[data-b="校园招聘"] { --c: #6a4f8c; }
.pill[data-b="通知"], .tile[data-b="通知"], .chip[data-b="通知"] { --c: #15756b; }
.pill[data-b="新闻"], .tile[data-b="新闻"], .chip[data-b="新闻"] { --c: #9c4a2c; }

.chip[data-b].on {
  color: var(--c);
  border-color: color-mix(in srgb, var(--c) 26%, white);
  background: color-mix(in srgb, var(--c) 8%, white);
}

.count, .sub, .who, .views, .source, .reason, .foot { color: var(--muted); }

.count {
  margin: 10px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.count .ics {
  color: var(--green);
  margin-left: 10px;
  border-bottom: 1px dashed color-mix(in srgb, var(--green) 55%, white);
}

.count .ics:hover { color: var(--green-deep); }

/* ---------- 详情页工具条 / 我的提醒 ---------- */

.tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 6px;
}

.tools form { display: inline-flex; margin: 0; }

.reminds {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.reminds li {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-solid);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.reminds li:hover {
  border-color: color-mix(in srgb, var(--green) 35%, white);
  box-shadow: var(--shadow-sm);
}

.remind-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.remind-body a { font-weight: 500; color: var(--ink); }
.remind-body a:hover { color: var(--green); }
.remind-body span { font-size: 12.5px; color: var(--muted); }
.reminds form { margin: 0; }

.views { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.views::before { content: "浏览 "; }

/* ---------- 列表 ---------- */

.list {
  margin-top: 10px;
  padding: 2px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px 18px;
  align-items: center;
  padding: 18px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.item:last-child { border-bottom: 0; }
.item:hover {
  background: linear-gradient(90deg, rgba(10, 110, 79, 0.05), transparent 46%);
}

.item.plain { grid-template-columns: minmax(0, 1fr) auto; }

.item.unread {
  background: linear-gradient(90deg, rgba(20, 101, 79, 0.055), transparent 46%);
}

.item.unread .state {
  background: var(--green-soft);
  color: var(--green);
}

.tile {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--c, var(--green)) 16%, white),
    color-mix(in srgb, var(--c, var(--green)) 7%, white)
  );
  box-shadow: inset 0 0 0 1px rgba(35, 32, 25, 0.05);
  transition: box-shadow 0.3s ease;
}

.item:hover .tile {
  box-shadow: 0 10px 20px -14px rgba(35, 32, 25, 0.5),
    inset 0 0 0 1px rgba(35, 32, 25, 0.05);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(35, 32, 25, 0.07);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.item:hover .tile img { transform: scale(1.05); }

/* 无图活动：居中绿叶图标占位 */
.tile:not(:has(img)) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile:not(:has(img))::after {
  content: "";
  width: 26px;
  height: 26px;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 3C11 3 4 10 4 19c9 0 16-7 16-16Z' fill='%230a6e4f'/%3E%3Cpath d='M20 3c0 6-3.5 11.5-9.5 14.5' stroke='%23fff' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.body { min-width: 0; }

.meta, .tagline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.item-title {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}

.item:hover .item-title { color: var(--green); }

.sub, .tagline { margin: 5px 0 0; font-size: 13px; }

.sub a { color: var(--green); }
.sub a:hover { text-decoration: underline; }

.tagline span {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.who {
  font-size: 13px;
  white-space: nowrap;
  align-self: center;
}

/* ---------- 按钮 ---------- */

.btn, .sheet-table button, .row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  background: linear-gradient(180deg, #0f7a5c, #0b5f47);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(8, 84, 61, 0.7);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover, .sheet-table button:hover, .row-actions button:hover {
  background: linear-gradient(180deg, #0c6a50, #08543d);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -14px rgba(8, 84, 61, 0.8);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn.ghost, .sheet-table button, .row-actions button, .row-actions a {
  background: var(--paper-solid);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
}

.btn.ghost:hover, .sheet-table button:hover, .row-actions button:hover,
.row-actions a:hover {
  background: var(--tint);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.row-actions a { padding: 6px 12px; }

.danger { color: var(--danger) !important; }

.btn.ghost.danger:hover, .row-actions .danger:hover {
  background: #fdf1ef;
  border-color: #eccdc8;
}

/* ---------- 表单 ---------- */

label, .stack { display: flex; flex-direction: column; gap: 7px; }
label { font-size: 14px; color: var(--ink-soft); }
.stack { gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; }

legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-solid);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

::placeholder { color: var(--muted-soft); }

textarea { resize: vertical; min-height: 104px; line-height: 1.7; }

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(20, 101, 79, 0.11);
}

.filters input, .filters select, .head-row input {
  width: auto;
  min-width: 128px;
  background: var(--paper);
}

.split > label { flex: 1; min-width: 180px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.check span {
  display: inline-flex;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-solid);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.check span:hover { border-color: var(--line-strong); }

.check input:checked + span {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 55%, white);
  background: var(--green-soft);
}

.check input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(20, 101, 79, 0.11);
}

.errors {
  margin: 0 0 16px;
  padding: 12px 16px 12px 32px;
  border: 1px solid #f0d9d5;
  border-radius: var(--radius-sm);
  background: #fdf3f1;
  color: var(--danger);
  font-size: 14px;
}

.errors li + li { margin-top: 4px; }

.reason { color: var(--warn); }

/* ---------- 帖子详情 ---------- */

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 3.6vw, 40px);
  box-shadow: var(--shadow-md);
}

.sheet h1 {
  font-size: clamp(28px, 3vw, 35px);
  line-height: 1.3;
  margin: 12px 0 4px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 22px 0;
}

.facts div { padding-top: 10px; border-top: 1px solid var(--line); }

.facts dt {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.facts dd { margin: 4px 0 0; font-size: 15px; font-weight: 500; }

.facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }

.prose {
  margin: 24px 0 0;
  white-space: pre-wrap;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.gallery img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-md);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery a:hover img {
  transform: scale(1.02);
  box-shadow: 0 14px 28px -20px rgba(35, 32, 25, 0.6);
}

.gallery.compact img { height: 110px; }

.shot {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.source { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sheet .source {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.source a { color: var(--green); }
.source a:hover { text-decoration: underline; }

.sheet .row-actions { margin-top: 26px; }

.comments { margin-top: 38px; padding-top: 24px; border-top: 1px dashed var(--line-strong); }
.comments h2 { margin-bottom: 4px; }

.comments article {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.comments header {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.comments p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.comments .stack { margin-top: 22px; }

.inline { display: flex; gap: 8px; align-items: center; }
.inline input { width: 220px; }

/* ---------- 分页与表格 ---------- */

.pager {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 22px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pager a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.pager a:hover {
  border-color: var(--line-strong);
  background: var(--paper-solid);
  transform: translateY(-1px);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sheet-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.sheet-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}

.sheet-table tbody tr:first-child td { border-top: 0; }

.sheet-table tbody tr:hover td {
  background: var(--tint);
}

.sheet-table tr.is-pending td { background: #fdf7ee; }
.sheet-table tr.is-pending:hover td { background: #fbf1e2; }

.sheet-table a { color: var(--ink); font-weight: 500; }
.sheet-table a:hover { color: var(--green); }

/* 板块管理：操作列是 td，不能用 flex 打乱表格布局 */
.sheet-table td.row-actions {
  display: table-cell;
  white-space: nowrap;
}

.sheet-table td.row-actions > a,
.sheet-table td.row-actions > form {
  display: inline-flex;
  vertical-align: middle;
  margin: 2px 6px 2px 0;
}

/* ---------- 管理后台 ---------- */

.admin {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.subnav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  transition: background 0.18s ease, color 0.18s ease;
}

.subnav a:hover { background: var(--tint); color: var(--ink); }

.subnav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 500;
  box-shadow: none;
}

.admin > div {
  min-width: 0;
  padding: clamp(20px, 2.6vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.admin h1 { font-size: clamp(22px, 2.2vw, 26px); }
.admin .head-row { margin-bottom: 20px; }
.admin .filters { margin-bottom: 20px; }
.admin .row-actions { margin-top: 20px; }

.head-row > a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-solid);
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.head-row > a:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--tint);
}

/* 后台表单的提交按钮不占满整行 */
.admin .stack > .btn {
  align-self: flex-start;
  min-width: 120px;
}

.raw {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.raw h2 { margin-bottom: 10px; }

.raw pre {
  max-height: 300px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ---------- 空状态与错误页 ---------- */

.empty {
  color: var(--muted);
  padding: 36px 0;
  text-align: center;
}

.code {
  margin: 0;
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--green);
  opacity: 0.9;
}

.miss h1 { margin: 6px 0 22px; }

.foot {
  margin-top: 40px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 34px 16px 28px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(100deg, #0a5c44 0%, #0e6b52 56%, #0d6349 100%);
  border-top: 3px solid var(--gold);
}

.foot::before {
  content: "勤读力耕 · 立己达人";
  display: block;
  margin-bottom: 12px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.42em;
}

.foot-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  opacity: 0.95;
}

.foot-name {
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- 轮播 ---------- */

.carousel {
  position: relative;
  height: 340px;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--gold);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  background:
    radial-gradient(560px 240px at 50% 42%, rgba(232, 192, 104, 0.1), transparent 65%),
    linear-gradient(160deg, #0c523d 0%, #0e6b52 58%, #0a5c44 100%);
}

.slide.on { opacity: 1; pointer-events: auto; }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 36px rgba(4, 26, 19, 0.5));
}

.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 34px 24px 18px;
  color: #fff;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: linear-gradient(transparent, rgba(8, 56, 41, 0.85));
  overflow-wrap: anywhere;
}

.cap::before {
  content: "";
  width: 3px;
  height: 22px;
  margin-right: 4px;
  border-radius: 2px;
  background: var(--gold);
}

.car-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.car-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.car-btn.prev { left: 14px; }
.car-btn.next { right: 14px; }

.car-btn.prev::before, .car-btn.next::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.car-btn.prev::before { transform: rotate(-135deg); margin-left: 15px; }
.car-btn.next::before { transform: rotate(45deg); margin-right: 15px; }

.table-scroll, .admin > div { max-width: 100%; }

/* ---------- 图片查看 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(28, 25, 21, 0.84);
  animation: fade 0.2s ease;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1000px, 100%);
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* ---------- 动效 ---------- */

@keyframes settle {
  from { transform: translateY(6px); }
  to { transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease;
  }

  .nav-toggle:hover { background: rgba(255, 255, 255, 0.12); }

  .nav-toggle::before {
    content: "";
    width: 18px;
    height: 1.5px;
    background: #fff;
    box-shadow: 0 6px 0 #fff, 0 -6px 0 #fff;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
  }

  .nav.open { display: flex; animation: settle 0.25s ease; }
  .nav a, .nav button, .nav summary {
    text-align: left;
    color: var(--muted);
  }
  .nav a:hover, .nav button:hover, .menu summary:hover {
    color: var(--ink);
    background: var(--tint);
  }
  .nav a[aria-current="page"] {
    color: var(--green-deep);
    background: var(--green-soft);
  }
  .nav form { display: flex; }
  .nav form button { text-align: left; }
  .menu div { position: static; box-shadow: none; border: 0; padding: 0 0 0 10px; }

  .item, .item.plain { grid-template-columns: 56px minmax(0, 1fr); }
  .item.plain { grid-template-columns: 1fr; }
  .who, .row-actions { grid-column: 2; }
  .tile { width: 56px; height: 56px; }

  .facts, .admin { grid-template-columns: 1fr; }
  .subnav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
  .subnav a { white-space: nowrap; }

  .sheet h1 { font-size: 26px; }
  .cap { font-size: 19px; }
  .carousel { height: 220px; }

  .filters { align-items: stretch; }
  .filters input, .filters select, .grow, .split > label {
    width: 100%;
    min-width: 0;
  }

  .admin > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subnav { -webkit-overflow-scrolling: touch; }
  .sheet-table { min-width: 640px; }

  .top { padding-left: 18px; padding-right: 18px; }
  .brand::after { display: none; }
  .wrap, .narrow, .unread-banner, .flash { width: calc(100% - 28px); }
  .wrap { margin-top: 24px; margin-bottom: 64px; }
  .list { padding: 2px 14px; }
  .item { padding: 16px 4px; gap: 14px; }
  .sheet, .narrow, .admin > div { padding: 22px 18px; }
}

/* 平板宽度下，后台筛选器保持横排，不逐行占满 */
@media (min-width: 641px) and (max-width: 1080px) {
  .admin .filters input,
  .admin .filters select {
    width: auto;
    min-width: 132px;
  }

  .admin .filters .btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 细节打磨 ---------- */

/* 轮播指示点 */
.car-dots {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.car-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.car-dot:hover { background: rgba(255, 255, 255, 0.75); }
.car-dot.on { width: 22px; background: var(--gold); }

/* 分页 */
.pager a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pager a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.6px solid currentColor;
  border-left: 1.6px solid currentColor;
}

.pager-prev::before { transform: rotate(-45deg); }
.pager-next::before { transform: rotate(135deg); margin-right: -3px; }

.pager span {
  padding: 7px 15px;
  border: 1px solid color-mix(in srgb, var(--green) 22%, white);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 500;
}

/* 详情字段图标 */
.facts dt::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 12px;
  margin-right: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 55%, white));
  vertical-align: -2px;
}

/* 评论区卡片化 */
.comments article {
  padding: 16px 18px;
  margin-top: 10px;
  background: color-mix(in srgb, var(--green-soft) 42%, var(--paper-solid));
  border: 1px solid color-mix(in srgb, var(--green) 10%, white);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.comments article:hover {
  border-color: color-mix(in srgb, var(--green) 24%, white);
  box-shadow: var(--shadow-sm);
}

.comments header span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
}

/* 下拉箭头 */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23756f65' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* 灯箱关闭按钮 */
.light-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(28, 25, 21, 0.55);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.light-close::before { content: "\00d7"; }
.light-close:hover { background: rgba(28, 25, 21, 0.85); transform: scale(1.06); }

/* 移动端导航遮罩 */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(20, 17, 12, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
}

.nav-backdrop[hidden] { display: none; }

/* 作者/来源小圆点 */
.who { display: inline-flex; align-items: center; gap: 7px; }
.who::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 55%, white);
}

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--green) 32%, white) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--green) 30%, white);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--green) 48%, white);
  background-clip: content-box;
}
*::-webkit-scrollbar-track { background: transparent; }

/* 筛选按钮与输入框等高 */
.filters .btn { padding-top: 11px; padding-bottom: 11px; }

@media (max-width: 1080px) {
  .car-dots { right: 12px; bottom: 12px; }
}

/* ---------- 质感打磨 · 第二轮 ---------- */

/* 轮播：顶部压暗 + 标题文字层次 */
.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 42, 31, 0.32), transparent 30%);
}

.cap {
  padding: 34px 76px 18px 24px;
  line-height: 1.45;
  text-shadow: 0 1px 10px rgba(5, 30, 22, 0.5);
}

.cap .pill { box-shadow: 0 1px 8px rgba(5, 30, 22, 0.35); }

/* 板块菜单下拉指示 */
.menu summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 2px 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.menu[open] summary::after { transform: rotate(225deg) translateY(-3px); }

/* 空状态：绿叶图标 */
.empty::before {
  content: "";
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 3C11 3 4 10 4 19c9 0 16-7 16-16Z' fill='%230a6e4f' opacity='.85'/%3E%3Cpath d='M20 3c0 6-3.5 11.5-9.5 14.5' stroke='%23fff' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 26px no-repeat;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 12%, white);
}

/* 错误页 */
.miss { text-align: center; }

.miss .code {
  display: inline-block;
  padding: 4px 34px;
  border-radius: 999px;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 14%, white);
}

.miss h1 { margin: 16px 0 24px; }
.miss h1::after { margin-left: auto; margin-right: auto; }

/* 窄卡片页（登录/注册/个人中心/发帖） */
.narrow {
  background:
    radial-gradient(460px 220px at 100% 0%, rgba(216, 167, 60, 0.09), transparent 62%),
    radial-gradient(420px 220px at 0% 100%, rgba(10, 110, 79, 0.05), transparent 60%),
    var(--paper);
}

.narrow > h1::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 25%, transparent));
}

.narrow h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 14px;
  margin-right: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 55%, white));
  vertical-align: -2px;
}

legend [data-tag-count] {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  vertical-align: middle;
}

/* 后台：内容面板金色顶边 + 表头底色 + 侧栏选中标记 */
.admin > div { border-top: 3px solid var(--gold); }

.sheet-table th { background: var(--bg-soft); }

@media (min-width: 1081px) {
  .subnav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); }
}

/* 消息列表排版 */
.item.plain .body h2 { margin: 4px 0 3px; font-size: 16.5px; }
.item.plain .body > p:not(.reason) { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.item.plain .body > a:not(.item-title) { color: var(--green); font-size: 13.5px; }
.item.plain .body > a:not(.item-title):hover { text-decoration: underline; }

/* 移动端触控热区 */
@media (max-width: 1080px) {
  .nav a, .nav button, .menu summary { padding: 12px 14px; }
  .chip { padding: 9px 16px; }
  .check span { padding: 9px 15px; }
  .pager a { padding: 10px 15px; }
  .btn:not(.ghost) { min-height: 44px; }
  .car-btn { width: 44px; height: 44px; }
  .car-dot { width: 10px; height: 10px; }
  .car-dots { gap: 9px; }
  .cap { padding: 26px 60px 16px 16px; font-size: 17px; }
  .cap::before { height: 18px; }
  .empty { padding: 30px 12px; }
  .nav-toggle { width: 44px; height: 44px; }
  .count .ics { display: inline-block; padding: 6px 2px; }
}

/* ---------- 质感打磨 · 第三轮 ---------- */

/* 详情页工具按钮图标（日历 / 海报 / 提醒铃铛） */
.tools a[href$="calendar.ics"]::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='1.5' y='2.5' width='13' height='12' rx='2' stroke='%230a6e4f' stroke-width='1.4'/%3E%3Cpath d='M1.5 6h13M5 1v3M11 1v3' stroke='%230a6e4f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tools a[href$="poster.png"]::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='1.5' y='2.5' width='13' height='11' rx='2' stroke='%230a6e4f' stroke-width='1.4'/%3E%3Ccircle cx='11.2' cy='5.6' r='1.7' stroke='%230a6e4f' stroke-width='1.2'/%3E%3Cpath d='M1.5 12.8l4.2-4.2 2.6 2.6 2.4-2.4 3.8 3.8' stroke='%230a6e4f' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tools form button::before,
.tools a[href^="/login"]::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M8 1.8a4 4 0 0 0-4 4c0 3-1.2 4.2-1.6 4.6-.3.3-.1.8.3.8h10.6c.4 0 .6-.5.3-.8-.4-.4-1.6-1.6-1.6-4.6a4 4 0 0 0-4-4Z' stroke='%230a6e4f' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M6.6 13.2a1.6 1.6 0 0 0 2.8 0' stroke='%230a6e4f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 文件上传控件 */
input[type="file"] {
  padding: 8px 10px;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg-soft);
  border-style: dashed;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  background: var(--paper-solid);
  color: var(--ink-soft);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  margin-right: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

input[type="file"]::file-selector-button:hover {
  border-color: color-mix(in srgb, var(--green) 40%, white);
  background: var(--green-soft);
  color: var(--green);
}

/* 消息列表"标为已读"按钮（原为浏览器默认样式） */
.item.plain > form button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--paper-solid);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.item.plain > form button:hover {
  border-color: color-mix(in srgb, var(--green) 40%, white);
  background: var(--green-soft);
  color: var(--green);
}

/* 内容页标题金色装饰线（与登录/个人中心页一致） */
.wrap:not(.sheet) > h1::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 25%, transparent));
}

/* 正文内链接样式 */
.prose a {
  color: var(--green);
  border-bottom: 1px dashed color-mix(in srgb, var(--green) 45%, white);
}

.prose a:hover { color: var(--green-deep); border-bottom-style: solid; }