:root {
  --bg: #f6f3ee;
  --ink: #1d1a16;
  --muted: #5c564c;
  --accent: #0f6b5c;
  --accent-2: #c45c26;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(29, 26, 22, 0.12);
  --danger: #a12622;
  --ok: #0f6b5c;
  --shadow: 0 10px 30px rgba(29, 26, 22, 0.08);
  --radius: 14px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 107, 92, 0.16), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(196, 92, 38, 0.14), transparent 55%),
    linear-gradient(180deg, #f8f5f0 0%, #efe8df 100%);
  min-height: 100vh;
}

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

.container { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(246, 243, 238, 0.82);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 1rem;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em;
}
.brand-zh {
  margin-left: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.05;
  color: var(--ink);
}
.nav { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.nav a { color: var(--muted); }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; padding: 0;
}

main.container { padding: 1.5rem 0 3rem; }

.hero, .panel, .card-list article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  margin: 0.35rem 0 0.5rem;
  font-weight: 600;
}
.hero > .brand-mark + h1 { color: var(--accent); }
.hero p { color: var(--muted); margin-top: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.65rem 1rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:hover { filter: brightness(1.05); text-decoration: none; }

.flash, .alert {
  padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem;
}
.flash { background: rgba(15, 107, 92, 0.12); color: var(--ok); }
.alert { background: rgba(161, 38, 34, 0.1); color: var(--danger); }

.form { display: grid; gap: 0.9rem; max-width: 480px; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; }
.form input, .form textarea, .form select {
  width: 100%; padding: 0.7rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font: inherit;
}
.form textarea { min-height: 140px; resize: vertical; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.meta { color: var(--muted); font-size: 0.92rem; }
.site-footer {
  border-top: 1px solid var(--line); padding: 1.2rem 0 2rem; color: var(--muted);
}
.site-footer .container { display: flex; gap: 1rem; flex-wrap: wrap; }
.comment { margin-left: calc(var(--depth, 0) * 1.2rem); }
.comment-item {
  border-left: 2px solid var(--line);
  padding-left: 0.75rem;
  margin-top: 0.75rem;
}
.comment-depth-0 { margin-left: 0; }
.comment-depth-1 { margin-left: 1rem; }
.comment-depth-2 { margin-left: 2rem; }
.comment-depth-3 { margin-left: 3rem; }
.comment-depth-4 { margin-left: 4rem; }
.comment-depth-5 { margin-left: 5rem; }
.comment-depth-6 { margin-left: 6rem; }
.comment-depth-7 { margin-left: 7rem; }
.deleted-comment { font-style: italic; }
.comment-form textarea, .reply-box textarea {
  width: 100%; min-height: 5rem; padding: 0.65rem;
  border-radius: 10px; border: 1px solid var(--line);
  font: inherit;
}
.vote-controls { display: inline-flex; gap: 0.4rem; align-items: center; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 0.6rem; text-align: left; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.4rem; text-align: left; vertical-align: top; }
.data-table code { font-size: 0.82rem; word-break: break-all; }
nav.row a.active { font-weight: 700; text-decoration: underline; }
.report-box, .inline-report { margin-top: 0.5rem; }

/* 长标题/无空格外文在窄屏换行，避免横向溢出 */
.panel h1, .panel h2, .panel h3,
.hero h1, article h1, article h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.panel h1 a, .panel h2 a, .panel h3 a,
article h1 a, article h2 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-body {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.post-body img,
.post-body video {
  max-width: 100%;
  height: auto;
}
.post-body a {
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 720px) {
  .comment { margin-left: calc(var(--depth, 0) * 0.6rem); }
  .comment-depth-1 { margin-left: 0.5rem; }
  .comment-depth-2 { margin-left: 0.9rem; }
  .comment-depth-3,
  .comment-depth-4,
  .comment-depth-5,
  .comment-depth-6,
  .comment-depth-7 { margin-left: 1.2rem; }
  .panel > .row { align-items: flex-start; }
  .header-inner { align-items: flex-start; flex-wrap: wrap; }
  .brand { font-size: 1.2rem; max-width: 100%; overflow-wrap: anywhere; }
}
