:root {
  --bg: #f3efe6;
  --surface: #fffdf8;
  --text: #1c241c;
  --muted: #3e4a3e;
  --line: #ddd4c4;
  --mark: #8f2d2a;
  --ink: #1e3a32;
  --link: #6a3418;
  --header-h: 64px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  padding-bottom: 112px;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: none; }

a:hover { color: #3f2412; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.35; color: #172017; font-weight: 700; }

h1 { font-size: 30px; margin: 0 0 12px; }

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

p { margin: 0 0 14px; }

.wrap { width: min(920px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0;
  margin-right: 8px;
}

.desk-nav { flex: 1; min-width: 0; }

.desk-nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.desk-nav a {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: var(--header-h);
  height: var(--header-h);
  padding: 0 10px;
}

.desk-nav a[aria-current="page"] { color: var(--mark); }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}

.menu-open { display: none; }

.page { padding-top: calc(var(--header-h) + 22px); }

.ledger, .side-list, .note-list { list-style: none; margin: 0; padding: 0; }

.ledger li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.tag {
  display: inline-block;
  width: max-content;
  justify-self: start;
  background: var(--mark);
  color: #fff8f4;
  font-size: 13px;
  line-height: 1.4;
  padding: 2px 8px;
}

.ledger h2 { margin: 0 0 4px; font-size: 20px; }

.ledger h2 a { color: var(--text); }

.meta { color: var(--muted); font-size: 14px; }

.sheet {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin: 8px 0 16px;
}

.sheet th, .sheet td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.sheet th { background: #f7f1e4; font-weight: 700; }

.sheet-wrap { overflow-x: auto; }

.fields { margin: 0; padding: 0; }

.fields div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.fields dt { font-weight: 700; }

.fields dd { margin: 0; }

.faq details {
  background: var(--surface);
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}

.faq summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

.side-list a, .note-list a {
  display: block;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  min-height: 44px;
}

.site-footer {
  background: var(--surface);
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 22px 0 8px;
  margin-top: 28px;
}

.foot-brand { font-size: 18px; font-weight: 700; }

.foot-brand a { color: var(--text); }

.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.foot-nav a { color: #33382f; }

.site-cta {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(520px, 36vw);
  min-width: 400px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--ink);
  color: #f6f1e6;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(30, 40, 32, 0.18);
}

.site-cta:hover, .site-cta:focus-visible, .site-cta:active {
  color: #f6f1e6;
  background: #163029;
}

.site-cta::before, .site-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-cta::before {
  background: radial-gradient(90% 140% at 0% 100%, rgba(143, 90, 42, 0.95) 0%, transparent 62%);
  opacity: 0;
  animation: card-corner-stain 2.6s cubic-bezier(.2, .7, .3, 1) infinite;
}

.site-cta::after {
  box-shadow: inset 0 0 0 rgba(20, 16, 8, 0);
  animation: drawer-lip-press 2.6s cubic-bezier(.2, .7, .3, 1) infinite;
}

@keyframes card-corner-stain {
  0%, 50% { opacity: 0; }
  66% { opacity: 0.26; }
  84%, 100% { opacity: 0; }
}

@keyframes drawer-lip-press {
  0%, 58% { box-shadow: inset 0 0 0 rgba(20, 16, 8, 0); }
  72% { box-shadow: inset 0 14px 16px rgba(20, 16, 8, 0.24); }
  90%, 100% { box-shadow: inset 0 0 0 rgba(20, 16, 8, 0); }
}

.mobile-panel {
  display: none;
  position: fixed;
  z-index: 25;
  inset: var(--header-h) 0 0 0;
  background: var(--surface);
  overflow: auto;
  padding: 8px 16px 120px;
}

.mobile-panel.is-on { display: block; }

.mobile-panel a {
  display: block;
  color: var(--text);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}

.search-layer {
  display: none;
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(243, 239, 230, 0.98);
  padding: 88px 16px 120px;
}

.search-layer.is-on { display: block; }

.search-box, .search-hits { width: min(720px, 100%); margin: 0 auto; }

.search-box input {
  width: 100%;
  min-height: 52px;
  font-size: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.search-hits a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .site-cta::before, .site-cta::after { animation: none; }
  .site-cta::before { opacity: 0.2; }
  .site-cta::after { box-shadow: inset 0 12px 14px rgba(20, 16, 8, 0.2); }
}

@media (max-width: 991px) {
  .desk-nav { display: none; }
  .menu-open { display: inline-flex; align-items: center; justify-content: center; }
  .site-cta {
    left: 12px;
    right: 12px;
    width: auto;
    min-width: 0;
    transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767px) {
  :root { --header-h: 56px; }
  h1 { font-size: 24px; }
  .ledger li, .fields div { grid-template-columns: minmax(0, 1fr); }
}
