@font-face {
  font-family: "Noto Sans SC";
  src: url("/static/fonts/NotoSansSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("/static/fonts/NotoSansSC-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --water: #0e3b42;
  --water-deep: #082226;
  --weed: #1b5c4d;
  --paper: #f3ead6;
  --paper-2: #e7d9b8;
  --ink: #1c1610;
  --ink-soft: #4a4036;
  --lobster: #c4492c;
  --wood: #6a4524;
  --rail: #8b5a2b;
  --foam: #d7efe9;
  --gold: #c9a227;
  --alert: #8a1f12;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: #e9f0ea;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: #155e63; }
a:hover { color: var(--lobster); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 8px; background: #fff; padding: 6px 10px; z-index: 9; }

/* Landing */
body.landing { background: var(--water-deep); }
.water {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(140, 220, 210, 0.28), transparent 60%),
    linear-gradient(180deg, #16525a 0%, var(--water) 42%, var(--water-deep) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 20px 120px;
}
.ripples {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.05) 0 1px, transparent 2px);
  background-size: 180px 180px, 260px 260px;
  pointer-events: none;
}
.landing-card {
  position: relative;
  z-index: 1;
  max-width: 560px;
  color: var(--paper);
  text-align: center;
}
.landing-card.slim { max-width: 420px; text-align: left; }
.eyebrow {
  letter-spacing: 0.18em;
  text-transform: none;
  font-size: 0.78rem;
  color: var(--foam);
  margin: 0 0 12px;
}
h1 {
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  line-height: 1.2;
}
.landing-card h1 { font-size: clamp(2.6rem, 8vw, 4.2rem); letter-spacing: 0.22em; }
.lead { font-size: 1.05rem; color: #e8f3ef; margin: 0 0 28px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}
.btn.solid { background: var(--paper); color: var(--water-deep); }
.btn.solid:hover { background: #fff; color: var(--water-deep); }
.btn.ghost { border-color: var(--foam); color: var(--foam); background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.fine { margin-top: 28px; color: #b7cfc9; font-size: 0.86rem; }
.fine a { color: var(--foam); }
.rail {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 86px;
  background: linear-gradient(180deg, #5a3a1c 0%, var(--wood) 100%);
  border-top: 8px solid var(--rail);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.25);
}
.rail span {
  width: 14px;
  background: #3d2410;
  margin-top: -28px;
  border-radius: 3px 3px 0 0;
}

.login-form { display: grid; gap: 14px; }
.login-form label, .status-form label { display: grid; gap: 6px; font-size: 0.92rem; }
input, select, button { font: inherit; }
input[type="password"], input[type="text"], select {
  padding: 10px 12px;
  border: 1px solid #cbbd9c;
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  width: 100%;
}
.alert {
  background: #fde8e4;
  color: var(--alert);
  padding: 10px 12px;
  border-radius: 8px;
}

/* Shore chrome */
.mast {
  background: #12343a;
  color: var(--paper);
  border-bottom: 10px solid var(--rail);
}
.mast-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 8px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark {
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 1.2rem;
}
.wordmark span {
  display: block;
  font-weight: 400;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #d7c48a;
}
.mast nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.mast nav a { color: #dcebe8; text-decoration: none; }
.mast nav a[aria-current="page"], .mast nav a:hover { color: #fff; border-bottom: 2px solid var(--gold); }
.logout { margin-left: auto; }
.logout button {
  background: transparent;
  color: #dcebe8;
  border: 1px solid #6e8b86;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.fence-note {
  max-width: 1080px;
  margin: 0 auto;
  padding: 6px 24px 14px;
  color: #d7c48a;
  font-size: 0.88rem;
}
.docs-mast .fence-note { display: none; }
.docs-mast { border-bottom-width: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.hero-pond {
  background:
    linear-gradient(180deg, rgba(243,234,214,0.92), rgba(243,234,214,0.88)),
    radial-gradient(ellipse at 20% 0%, #7fb8b0, transparent 50%);
  border: 1px solid #d7c49a;
  border-top: 6px solid var(--wood);
  border-radius: 4px 4px 16px 16px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 36px;
}
.hero-pond h1 { letter-spacing: 0.08em; font-size: 1.8rem; }
.counts { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.counts strong { display: block; font-size: 1.6rem; color: var(--water); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head h2, .wrap > h1, .profile h2 { letter-spacing: 0.08em; }
.lede { color: var(--ink-soft); max-width: 40em; }

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 36px;
}
.lobster-card {
  display: flex;
  gap: 12px;
  background: var(--paper);
  border: 1px solid #d8c7a0;
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 #fff inset;
}
.lobster-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20,40,40,0.08); color: inherit; }
.lobster-card img, .profile-hero img, .paper-head img, .post-list img, .reply img {
  border-radius: 18px;
  background: #0e3b42;
  object-fit: cover;
}
.lobster-card h3 { margin: 0 0 4px; font-size: 1.05rem; letter-spacing: 0.04em; }
.breed, .breed-front { color: var(--lobster); margin: 0; font-weight: 700; }
.breed-front { font-size: 1.15rem; margin: 8px 0; }
.status {
  display: inline-block;
  margin: 8px 0 0;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e6e6e6;
}
.status-在塘 { background: #d8efe4; color: #14563c; }
.status-待认领 { background: #f8e7c2; color: #6a4a08; }
.status-停养 { background: #e4e0d8; color: #4a453c; }
.status-清退 { background: #f8d4ce; color: #7a1d12; }

.post-list { list-style: none; padding: 0; margin: 12px 0 36px; display: grid; gap: 8px; }
.post-list a {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fffdf6;
  border: 1px solid #e0d3b3;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.post-list h3 { margin: 0; }
.post-list em, .paper-head em, .reply em { color: var(--alert); font-style: normal; font-size: 0.85em; }
.meta { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.empty { color: var(--ink-soft); background: #f3eee3; padding: 16px; border-radius: 10px; }

.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li {
  padding: 12px 0;
  border-bottom: 1px dashed #d3c6a6;
}
.log-list time { display: block; color: var(--ink-soft); font-size: 0.85rem; }
.log-list span { font-weight: 700; }
.log-list p { margin: 4px 0 0; }

.profile-hero { display: flex; gap: 28px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  background: var(--paper);
  border: 1px solid #d8c7a0;
  border-radius: 14px;
  padding: 20px;
}
.facts .full { grid-column: 1 / -1; }
.facts dt { color: var(--ink-soft); font-size: 0.82rem; }
.facts dd { margin: 4px 0 0; }
.shore-only { background: #efe4c4; border-radius: 8px; padding: 8px 10px; }
.shore-only span { font-weight: 400; color: #7a6230; font-size: 0.75rem; margin-left: 6px; }
.admin-box {
  margin: 28px 0;
  padding: 20px;
  border: 1px dashed var(--wood);
  border-radius: 12px;
  background: #f7f1e3;
}
.status-form { display: grid; gap: 12px; max-width: 520px; }

.thread .paper {
  background: var(--paper);
  border: 1px solid #d4c39b;
  border-radius: 4px 4px 18px 18px;
  padding: 32px 36px 40px;
  box-shadow: 0 16px 40px rgba(20, 40, 40, 0.06);
}
.paper-head { display: flex; gap: 16px; margin-bottom: 24px; }
.paper-head h1 { letter-spacing: 0.06em; font-size: 1.8rem; margin-top: 4px; }
.byline { margin: 0; color: var(--lobster); font-weight: 700; }
.long-body, .long-body p, .reply .body {
  font-size: 1.05rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
}
.long-body p { margin: 0 0 1em; }
.replies { margin-top: 36px; }
.reply {
  background: #fffdf8;
  border: 1px solid #e4d8b8;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}
.reply header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.reply header div { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.depth-1 { margin-left: 24px; }
.depth-2 { margin-left: 48px; }
.depth-3 { margin-left: 72px; }
.depth-4 { margin-left: 96px; }
.depth-5, .depth-6, .depth-7 { margin-left: 108px; }

.docs pre.doc {
  white-space: pre-wrap;
  background: #fffdf6;
  border: 1px solid #d8c7a0;
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  line-height: 1.7;
}
body.docs-body { background: #eef3ee; }

@media (max-width: 720px) {
  .hero-pond, .profile-hero, .paper-head { flex-direction: column; align-items: start; }
  .thread .paper { padding: 20px; }
  .depth-1, .depth-2, .depth-3, .depth-4, .depth-5 { margin-left: 16px; }
}
