/* =========================================================
   朱砂 · Cinnabar Ledger — theme layer for Studio CRM
   Editorial ink-on-paper · rice-paper canvas · ink rail ·
   vermilion seal accent · serif display (Noto Serif SC)
   Loaded AFTER style.css; overrides tokens + targeted rules.
   ========================================================= */

:root {
  /* Paper & ink */
  --bg: #f3edde;
  --surface: #fbf7ec;
  --surface-2: #f4eedd;
  --surface-3: #ece4cf;
  --border: rgba(74, 60, 38, 0.18);
  --border-strong: rgba(74, 60, 38, 0.34);
  --text: #241f16;
  --text-2: #57503c;
  --text-3: #93876c;

  /* Cinnabar (vermilion seal) */
  --cinnabar: #c2401f;
  --cinnabar-deep: #9c3115;
  --cinnabar-soft: #f7e3d7;

  /* Celadon — AI / secondary accent */
  --celadon: #2e6e5f;
  --celadon-soft: #e2eee6;

  /* Primary = ink (buttons, links) */
  --primary: #262019;
  --primary-hover: #000000;
  --primary-active: #000000;
  --primary-fg: #f6efdd;
  --primary-soft: #eae2cc;
  --primary-200: #cfc4a6;
  --primary-ring: rgba(194, 64, 31, 0.30);

  --accent: var(--celadon);
  --accent-soft: var(--celadon-soft);

  /* Warm semantic palette */
  --success: #2f7d4f;
  --success-soft: #e3efdd;
  --warning: #a96a10;
  --warning-soft: #f7ecd4;
  --error: #b3261e;
  --error-soft: #f7e2dc;
  --info: #8a5a2b;
  --info-soft: #f2e8d8;

  /* Ink sidebar */
  --sidebar-bg: #211b12;
  --sidebar-border: rgba(246, 239, 221, 0.10);
  --sidebar-text: #b3a789;
  --sidebar-text-strong: #f6efdd;
  --sidebar-hover: rgba(246, 239, 221, 0.06);
  --sidebar-active: rgba(214, 86, 44, 0.16);

  /* Sharper, editorial radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 16px;

  /* Warm-tinted shadows */
  --shadow-xs: 0 1px 2px rgba(58, 44, 22, 0.06);
  --shadow-sm: 0 1px 4px rgba(58, 44, 22, 0.08);
  --shadow-md: 0 6px 18px rgba(58, 44, 22, 0.12);
  --shadow-lg: 0 16px 40px rgba(58, 44, 22, 0.18);
  --shadow-xl: 0 28px 64px rgba(58, 44, 22, 0.26);
  --shadow-card: 0 1px 2px rgba(58, 44, 22, 0.07);

  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;

  /* Mesh placeholders used by body background */
  --bg-mesh-a: rgba(194, 64, 31, 0.05);
  --bg-mesh-b: rgba(46, 110, 95, 0.04);
}

[data-theme="dark"] {
  --bg: #16120c;
  --surface: #201a11;
  --surface-2: #272015;
  --surface-3: #2f2718;
  --border: rgba(236, 227, 209, 0.15);
  --border-strong: rgba(236, 227, 209, 0.28);
  --text: #ece3d1;
  --text-2: #b8ac92;
  --text-3: #847a62;

  --cinnabar: #e06a44;
  --cinnabar-deep: #f08a64;
  --cinnabar-soft: rgba(224, 106, 68, 0.16);

  --primary: #ede4d0;
  --primary-hover: #ffffff;
  --primary-active: #ffffff;
  --primary-fg: #1c1712;
  --primary-soft: rgba(237, 228, 208, 0.12);
  --primary-200: rgba(237, 228, 208, 0.3);
  --primary-ring: rgba(224, 106, 68, 0.4);

  --accent: #5aa38f;
  --accent-soft: rgba(90, 163, 143, 0.14);

  --success: #6fb98a;
  --success-soft: rgba(111, 185, 138, 0.14);
  --warning: #e0a84e;
  --warning-soft: rgba(224, 168, 78, 0.14);
  --error: #e2685a;
  --error-soft: rgba(226, 104, 90, 0.15);
  --info: #c99a63;
  --info-soft: rgba(201, 154, 99, 0.14);

  --sidebar-bg: #14100a;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 28px 64px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120c;
    --surface: #201a11;
    --surface-2: #272015;
    --surface-3: #2f2718;
    --border: rgba(236, 227, 209, 0.15);
    --border-strong: rgba(236, 227, 209, 0.28);
    --text: #ece3d1;
    --text-2: #b8ac92;
    --text-3: #847a62;

    --cinnabar: #e06a44;
    --cinnabar-deep: #f08a64;
    --cinnabar-soft: rgba(224, 106, 68, 0.16);

    --primary: #ede4d0;
    --primary-hover: #ffffff;
    --primary-active: #ffffff;
    --primary-fg: #1c1712;
    --primary-soft: rgba(237, 228, 208, 0.12);
    --primary-200: rgba(237, 228, 208, 0.3);
    --primary-ring: rgba(224, 106, 68, 0.4);

    --accent: #5aa38f;
    --accent-soft: rgba(90, 163, 143, 0.14);

    --success: #6fb98a;
    --success-soft: rgba(111, 185, 138, 0.14);
    --warning: #e0a84e;
    --warning-soft: rgba(224, 168, 78, 0.14);
    --error: #e2685a;
    --error-soft: rgba(226, 104, 90, 0.15);
    --info: #c99a63;
    --info-soft: rgba(201, 154, 99, 0.14);

    --sidebar-bg: #14100a;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 28px 64px rgba(0, 0, 0, 0.7);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- Atmosphere: rice-paper grain + warm mesh ---------- */
body {
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--bg-mesh-a), transparent 60%),
    radial-gradient(900px 480px at -10% 100%, var(--bg-mesh-b), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: 0.35; }
@media (prefers-color-scheme: dark) {
  body::after { mix-blend-mode: screen; opacity: 0.35; }
}

::selection { background: var(--cinnabar); color: #f6efdd; }

/* ---------- Typography: serif display + mono micro-labels ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}
h1 { font-weight: 900; }
h2, h3 { font-weight: 700; }

.page-heading h1 { letter-spacing: 0.02em; }
.page-heading .sub, .sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-header h2, .card-header h3 { font-size: 1.05rem; }
.card-header h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  background: var(--cinnabar);
  transform: rotate(45deg) translateY(-1px);
}

.nav-section-label {
  font-family: var(--font-mono);
  color: rgba(214, 170, 120, 0.55);
}
.table th {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.count {
  font-family: var(--font-mono);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.01em;
}

/* ---------- Links: ink with cinnabar hover ---------- */
a { color: var(--text); }
a:hover { color: var(--cinnabar); }
.greeting-text { color: var(--cinnabar); font-family: var(--font-display); }

/* ---------- Sidebar: ink rail with seal stamp ---------- */
.sidebar {
  background:
    linear-gradient(180deg, rgba(194, 64, 31, 0.10), transparent 30%),
    var(--sidebar-bg);
  border-color: var(--sidebar-border);
}
.brand-dot {
  border-radius: 8px;
  background: var(--cinnabar);
  box-shadow: 0 4px 14px rgba(194, 64, 31, 0.45), inset 0 0 0 1.5px rgba(246, 239, 221, 0.35);
}
.brand-dot::after {
  content: "工";
  inset: 0;
  border: none;
  transform: none;
  display: grid;
  place-items: center;
  color: #f6efdd;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
}
.brand-name { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.06em; }
.brand-tag { font-family: var(--font-mono); color: rgba(214, 170, 120, 0.6); }

.sidebar-link { border-left: 2px solid transparent; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}
.sidebar-link.is-active {
  background: var(--sidebar-active);
  color: var(--cinnabar);
  border-left-color: var(--cinnabar);
  font-weight: 650;
}
.sidebar-link.is-active .sidebar-icon-wrap {
  background: transparent;
  color: var(--cinnabar);
}
.sidebar-icon-wrap { border-radius: var(--radius-sm); background: rgba(246, 239, 221, 0.06); }
.sidebar-logout { color: #d98a7a !important; }
.sidebar-logout:hover { background: rgba(226, 104, 90, 0.12) !important; color: #f0a294 !important; }

/* ---------- Buttons: ink blocks with cinnabar focus ---------- */
.btn { font-weight: 600; letter-spacing: 0.01em; }
.btn-primary {
  box-shadow: 0 4px 14px rgba(38, 32, 25, 0.28);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(38, 32, 25, 0.34); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-glow); }
.btn-danger { background: var(--error); }
.btn-stamp {
  background: var(--cinnabar);
  color: #f6efdd;
}
.btn-stamp:hover { background: var(--cinnabar-deep); }

/* ---------- Forms ---------- */
input, select, textarea {
  background: var(--surface);
}
.form-group label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--cinnabar) !important; box-shadow: 0 0 0 3px var(--primary-ring) !important; }

/* ---------- Cards ---------- */
.card, .detail-card, .customer-summary, .chart-card {
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.stat-card::after { background: var(--cinnabar); }
.quick-action-icon.is-orchid { background: var(--celadon-soft); color: var(--celadon); }

/* ---------- Flash: ink ledger slip ---------- */
.flash { border-left: 3px solid var(--cinnabar); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Login — split editorial stage
   ========================================================= */
body.login-page { padding: 0; }
body.login-page .main { width: 100%; max-width: none; }

.lx-stage {
  display: grid;
  grid-template-columns: minmax(340px, 5fr) 7fr;
  min-height: 100vh;
}

/* Ink panel */
.lx-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 40px;
  color: #f6efdd;
  background:
    radial-gradient(700px 420px at 20% 110%, rgba(194, 64, 31, 0.28), transparent 60%),
    linear-gradient(160deg, #2a2318, #17120b 65%);
}
.lx-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.07'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.lx-panel > * { position: relative; z-index: 1; }

/* Giant watermark character */
.lx-panel::before {
  content: "帳";
  position: absolute;
  right: -0.18em;
  bottom: -0.22em;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(220px, 30vw, 420px);
  line-height: 1;
  color: rgba(246, 239, 221, 0.05);
  z-index: 0;
}

.lx-seal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #f6efdd;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(246, 239, 221, 0.4), 0 10px 30px rgba(194, 64, 31, 0.45);
}

.lx-vertical {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 7.5vw, 96px);
  letter-spacing: 0.28em;
  line-height: 1;
  color: #f6efdd;
  margin: 0;
  user-select: none;
}
.lx-vertical em {
  font-style: normal;
  color: var(--cinnabar);
  text-shadow: 0 0 30px rgba(224, 106, 68, 0.4);
}

.lx-panel-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.lx-panel-foot p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(214, 170, 120, 0.65);
  max-width: 30ch;
  line-height: 1.9;
}
.lx-rule {
  width: 72px;
  height: 3px;
  background: var(--cinnabar);
  margin-bottom: 14px;
}

/* Paper side */
.lx-paper {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(194, 64, 31, 0.06), transparent 55%),
    var(--bg);
}
.lx-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 34px 30px;
  animation: lxRise 0.5s var(--ease) both;
}
@keyframes lxRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.lx-card-head { margin-bottom: 26px; }
.lx-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cinnabar);
  display: block;
  margin-bottom: 10px;
}
.lx-card-head h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}
.lx-card-head .hint { margin-top: 8px; color: var(--text-3); font-size: var(--text-sm); }

.lx-card .form-group label { color: var(--text-3); }
.lx-card input {
  min-height: 46px;
  border-radius: var(--radius-sm);
}
.lx-card .btn-primary {
  min-height: 48px;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  border-radius: var(--radius-sm);
}
.lx-alt {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.lx-alt a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.lx-alt a:hover { color: var(--cinnabar); }

.lx-stamp-corner {
  position: absolute;
  top: 26px;
  right: 30px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(194, 64, 31, 0.5);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: rgba(194, 64, 31, 0.75);
  font-size: 20px;
  transform: rotate(6deg);
  user-select: none;
}

@media (max-width: 880px) {
  .lx-stage { grid-template-columns: 1fr; }
  .lx-panel {
    min-height: 240px;
    padding: 30px 26px;
    gap: 20px;
  }
  .lx-vertical { writing-mode: horizontal-tb; font-size: clamp(40px, 11vw, 64px); letter-spacing: 0.14em; }
  .lx-panel::before { font-size: 220px; }
  .lx-paper { padding: 28px 18px 44px; }
  .lx-card { padding: 26px 22px 24px; }
  .lx-stamp-corner { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lx-card { animation: none; }
}

/* =========================================================
   公告系统（/blog 隐藏页 + 弹窗 + 公告按钮）
   ========================================================= */

/* ---------- 侧边栏公告按钮 ---------- */
.ann-open-btn { width: 100%; text-align: left; position: relative; }
.ann-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #f6efdd;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}
.ann-open-btn.is-active-state { color: var(--cinnabar); }

/* ---------- 公告弹窗 ---------- */
.an-overlay[hidden] { display: none !important; }
.an-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 17, 9, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.an-overlay.is-open { opacity: 1; }
.an-modal {
  width: min(520px, 100%);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.an-overlay.is-open .an-modal { transform: none; }

.an-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 2px solid var(--text);
  position: relative;
}
.an-header-text { flex: 1; }
.an-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cinnabar);
  margin-bottom: 4px;
}
.an-header h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: 0.06em;
}
.an-header-seal {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #f6efdd;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  border-radius: 8px;
  transform: rotate(6deg);
  box-shadow: inset 0 0 0 1.5px rgba(246, 239, 221, 0.4), 0 6px 16px rgba(194, 64, 31, 0.4);
  flex-shrink: 0;
}
.an-close { flex-shrink: 0; }
.an-hint {
  padding: 10px 22px;
  font-size: var(--text-xs);
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.an-body { overflow-y: auto; padding: 14px 22px 20px; display: flex; flex-direction: column; gap: 12px; }

.an-item {
  border: 1px solid var(--border);
  border-left: 3px solid var(--cinnabar);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px 16px;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.an-item.is-read { border-left-color: var(--border-strong); opacity: 0.72; }
.an-item.is-leaving { opacity: 0; transform: translateX(10px); }
.an-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.an-item-meta time { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); letter-spacing: 0.06em; }
.an-pin,
.an-state {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: 3px;
}
.an-pin { background: var(--cinnabar); color: #f6efdd; }
.an-state { background: var(--surface-3); color: var(--text-3); }
.an-item:not(.is-read) .an-state { background: var(--cinnabar-soft); color: var(--cinnabar); }
.an-item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.03em;
}
.an-item-body { margin-top: 6px; font-size: var(--text-sm); color: var(--text-2); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.an-ack-btn { margin-top: 10px; }

.an-empty { text-align: center; padding: 36px 0 28px; color: var(--text-3); }
.an-empty-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: var(--text-3);
}

/* ---------- /blog 隐藏公告页 ---------- */
body.blog-page .main { max-width: 880px; }
.bl-heading h1 { font-size: 2rem; }
.bl-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cinnabar);
  margin-bottom: 8px;
}
.bl-seal {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--cinnabar);
  color: #f6efdd;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  border-radius: 10px;
  transform: rotate(5deg);
  box-shadow: inset 0 0 0 2px rgba(246, 239, 221, 0.4), 0 10px 26px rgba(194, 64, 31, 0.4);
  user-select: none;
}

.bl-composer {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: var(--space-6);
}
.bl-composer-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-2);
  list-style: none;
  user-select: none;
}
.bl-composer-summary::-webkit-details-marker { display: none; }
.bl-composer-summary svg { color: var(--cinnabar); }
.bl-composer[open] .bl-composer-summary { border-bottom: 1px solid var(--border); color: var(--text); }
.bl-form { padding: 18px; }
.bl-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bl-pin-check { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-2); cursor: pointer; }

.bl-list { display: flex; flex-direction: column; gap: 16px; }
.bl-post {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cinnabar);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px 22px 16px;
}
.bl-post.is-pinned {
  border-color: var(--cinnabar);
  border-left-width: 3px;
  background:
    linear-gradient(135deg, rgba(194, 64, 31, 0.05), transparent 40%),
    var(--surface);
}
.bl-post-head { display: flex; flex-direction: column; gap: 6px; }
.bl-post-meta { display: flex; align-items: center; gap: 8px; }
.bl-time { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--text-3); }
.bl-pin-stamp {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--cinnabar);
  color: #f6efdd;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  transform: rotate(-6deg);
  font-family: var(--font-display);
}
.bl-post-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}
.bl-post-body {
  margin-top: 10px;
  color: var(--text-2);
  font-size: var(--text-base);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.bl-post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.bl-hidden-form { display: none; }
.bl-edit-form {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.bl-empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.bl-empty p { margin-top: 12px; }

@media (max-width: 640px) {
  .bl-seal { width: 44px; height: 44px; font-size: 22px; }
  .bl-form-foot { flex-direction: column-reverse; align-items: stretch; }
  .bl-form-foot .btn { width: 100%; }
  .an-modal { max-height: 86vh; }
}

/* =========================================================
   信件动画：发布端「折叠→盖章→寄出」+ 观看端「飞入→展开→盖章」
   ========================================================= */

/* ---------- 观看端：弹窗信件三阶段 ---------- */
.an-modal.phase-fly { animation: anFlyIn 0.55s var(--ease-spring) both; }
@keyframes anFlyIn {
  0%   { transform: translate(46vw, -36vh) rotate(14deg) scale(0.45); opacity: 0; }
  55%  { opacity: 1; }
  82%  { transform: translate(-6px, 4px) rotate(-1.5deg) scale(1.01); }
  100% { transform: none; opacity: 1; }
}
.an-modal.phase-fly .an-body,
.an-modal.phase-fly .an-hint { visibility: hidden; }

.an-modal.phase-unfold .an-body {
  transform-origin: top center;
  animation: anUnfold 0.44s var(--ease) both;
}
@keyframes anUnfold {
  0%   { transform: perspective(900px) rotateX(-88deg); opacity: 0.2; }
  60%  { opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* 展开后印章压落 + 纸面震动 */
.an-modal.phase-stamped { animation: anPaperShake 0.3s ease-out 0.16s both; }
@keyframes anPaperShake {
  0%, 100% { transform: none; }
  35%      { transform: translateY(2px) rotate(0.4deg); }
  65%      { transform: translateY(-1px) rotate(-0.3deg); }
}
.an-header-seal { will-change: transform; }
.an-modal.phase-stamped .an-header-seal {
  animation: anStampHit 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
@keyframes anStampHit {
  0%   { transform: translateY(-110px) scale(2.1) rotate(26deg); opacity: 0;
         box-shadow: inset 0 0 0 1.5px rgba(246,239,221,0.4); }
  45%  { opacity: 1; }
  72%  { transform: translateY(2px) scale(0.92) rotate(3deg);
         box-shadow: inset 0 0 0 2px rgba(246,239,221,0.5), 0 0 34px rgba(194,64,31,0.75), 0 10px 26px rgba(194,64,31,0.4); }
  100% { transform: rotate(6deg); opacity: 1; }
}

/* 公告条目逐条浮起（错峰） */
@media (prefers-reduced-motion: no-preference) {
  .an-body .an-item { animation: anItemRise 0.38s var(--ease) both; }
  .an-body .an-item:nth-child(1) { animation-delay: 0.95s; }
  .an-body .an-item:nth-child(2) { animation-delay: 1.05s; }
  .an-body .an-item:nth-child(n+3) { animation-delay: 1.15s; }
}
@keyframes anItemRise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 发布端：折叠 → 盖章 → 寄出 ---------- */
.bl-composer { position: relative; overflow: visible; }

.bl-seal-drop {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  margin: -52px 0 0 -52px;
  z-index: 5;
  place-items: center;
  pointer-events: none;
  background: var(--cinnabar);
  color: #f6efdd;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px rgba(246, 239, 221, 0.45);
}
.bl-composer.is-stamping .bl-seal-drop {
  display: grid;
  animation: blSealDrop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.28) both;
}
.bl-seal-drop::before {
  content: "";
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 64, 31, 0.32), transparent 62%);
  animation: blInkRing 0.5s ease-out both;
}
@keyframes blSealDrop {
  0%   { transform: translateY(-130px) scale(1.9) rotate(22deg); opacity: 0; }
  50%  { opacity: 1; }
  74%  { transform: translateY(3px) scale(0.9) rotate(-4deg); }
  100% { transform: rotate(-7deg); opacity: 1; }
}
@keyframes blInkRing {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}

.bl-composer.is-folding .bl-form {
  transform-origin: bottom center;
  animation: blFoldUp 0.5s var(--ease) both;
}
@keyframes blFoldUp {
  0%   { transform: perspective(900px) rotateX(0); }
  100% { transform: perspective(900px) rotateX(-94deg); opacity: 0.65; }
}
.bl-composer.is-folding .bl-form::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(58, 44, 22, 0.18));
  pointer-events: none;
}
.bl-form { position: relative; }

/* 盖完章寄出：整封信向右上飞离 */
.bl-composer.is-sending {
  animation: blSendAway 0.5s ease-in both;
}
@keyframes blSendAway {
  0%   { transform: none; opacity: 1; }
  30%  { transform: translate(3vw, -2vh) rotate(2deg); opacity: 1; }
  100% { transform: translate(70vw, -60vh) rotate(20deg) scale(0.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .an-modal.phase-fly,
  .an-modal.phase-unfold .an-body,
  .an-modal.phase-stamped,
  .an-modal.phase-stamped .an-header-seal,
  .bl-composer.is-stamping .bl-seal-drop,
  .bl-composer.is-folding .bl-form,
  .bl-composer.is-sending,
  .an-body .an-item { animation: none !important; }
  .an-modal.phase-fly .an-body,
  .an-modal.phase-fly .an-hint { visibility: visible; }
}
