:root {
  --text: #1f2328;
  --muted: #6b7280;
  --accent: #2f6df6;
  --accent-soft: rgba(47, 109, 246, 0.1);
  --card: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.75 system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #f5f6f8;
}

#bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, #eef2f7, #e6ebf5) center / cover no-repeat;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(248, 250, 252, 0.82));
  backdrop-filter: blur(1.5px);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 8px;
}

.site-header .brand {
  font-weight: 650;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0.2px;
}

.site-header .brand:hover { text-decoration: none; opacity: 0.75; }

.site-header nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  padding: 52px 0 34px;
  text-align: center;
}

/* 留言板标题区 */
.gb-hero {
  padding: 54px 0 30px;
  text-align: center;
}

.gb-hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: 6px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
}

.gb-hero p {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: 1px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.5px;
}

.hero .hero-rule {
  width: 48px;
  height: 2px;
  margin: 22px auto 0;
  background: var(--text);
  opacity: 0.15;
}

/* ---------- post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }

.post-card {
  display: block;
  padding: 26px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--text);
}

.post-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1);
}

.post-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.45;
  font-weight: 650;
}

.post-card .excerpt {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .meta {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- pager ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 60px;
  font-size: 14px;
  color: var(--muted);
}

.pager button {
  font: inherit;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- article ---------- */
.article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  margin-bottom: 26px;
}

.article-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 700;
}

.article-meta {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.markdown { font-size: 16px; }
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.45; margin: 1.6em 0 0.7em; }
.markdown h1 { font-size: 26px; }
.markdown h2 { font-size: 22px; }
.markdown h3 { font-size: 18px; }
.markdown p { margin: 0 0 1.1em; }
.markdown img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 1.2em auto; }
.markdown blockquote {
  margin: 1.2em 0;
  padding: 8px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: #374151;
  border-radius: 0 8px 8px 0;
}
.markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 5px;
}
.markdown pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
}
.markdown pre code { background: none; padding: 0; color: inherit; }
.markdown table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 15px; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown th { background: rgba(15, 23, 42, 0.03); }
.markdown hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- comments ---------- */
.comments {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px 34px;
  margin-bottom: 60px;
}

.comments h3 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 650;
}

.comments h3 span { color: var(--muted); font-weight: 400; font-size: 14px; }

.comment { padding: 16px 0; border-top: 1px solid var(--border); }
.comment:first-of-type { border-top: none; }

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.comment-head .name { color: var(--text); font-weight: 600; font-size: 14px; }

.badge-admin {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-mod {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

.badge-pending {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff4e5;
  color: #b45309;
}

.comment-body { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.comment-body img { max-width: 100%; border-radius: 10px; margin-top: 8px; display: block; }

.comment-actions { margin-top: 8px; font-size: 13px; }
.comment-actions button {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.comment-actions button:hover { color: var(--accent); }

.replies {
  margin-top: 14px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: #dc2626; }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 8px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; }
.form-row .field { flex: 1; margin-bottom: 0; }

.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.error { color: #dc2626; font-size: 14px; }
.ok { color: #15803d; font-size: 14px; }

.thumb {
  margin-top: 10px;
  max-width: 220px;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--border);
}

/* ---------- admin ---------- */
.admin-shell { padding: 40px 0 70px; }

.login-card {
  max-width: 380px;
  margin: 60px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 32px;
}

.login-card h2 { margin: 0 0 6px; font-size: 20px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.dash {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.dash-head h2 { margin: 0; font-size: 17px; }

.tabs { display: flex; gap: 4px; }

.tab {
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { background: rgba(15, 23, 42, 0.04); }
.tab.active { background: var(--text); color: #fff; }

.panel { padding: 26px 24px 32px; display: none; }
.panel.active { display: block; }

.admin-list { display: flex; flex-direction: column; gap: 10px; }

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.admin-item .grow { flex: 1; min-width: 0; }
.admin-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.admin-item .ops { display: flex; gap: 6px; flex-shrink: 0; }

.comment-quote {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 8px;
}

.split { display: flex; gap: 20px; }
.split > * { flex: 1; min-width: 0; }

.preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 200px;
  background: #fff;
  overflow: auto;
}

.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
}

@media (max-width: 720px) {
  .article { padding: 26px 20px; }
  .comments { padding: 22px 18px; }
  .split { flex-direction: column; }
  .hero { padding: 34px 0 24px; }
  .dash-head { align-items: flex-start; }
  .admin-item { flex-direction: column; align-items: flex-start; }
}

/* ---------- 页脚备案信息 ---------- */
.site-footer {
  padding: 6px 22px 38px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}
