/* ============================================================
   奈斯兔AI城 · NiceTo AI City
   纸城 Paper City — shared design system
   ============================================================ */

@font-face {
  font-family: 'NiceTo Serif';
  src: url('/assets/fonts/NotoSerifSC-subset.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NiceTo Sans';
  src: url('/assets/fonts/NotoSansSC-subset.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F4EFE4;
  --paper-card: #FBF8F1;
  --paper-2: #EDE6D8;
  --paper-3: #E4DAC8;
  --ink: #23211C;
  --ink-2: #554F45;
  --ink-3: #857C6C;
  --line: #D8CEBC;
  --line-strong: #BFB39D;
  --seal: #B2502C;
  --seal-ink: #8E3E22;
  --seal-soft: #F2DED2;
  --teal: #274743;
  --teal-2: #3B5E58;
  --teal-soft: #DCE6E1;
  --gold: #B58A32;
  --ok: #4C7A5B;
  --ok-soft: #E0EBE2;
  --warn: #9A7424;
  --warn-soft: #F3E8CC;
  --danger: #9C3F2C;
  --danger-soft: #F2DDD7;

  --serif: 'NiceTo Serif', 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: 'NiceTo Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --shadow-sm: 0 4px 14px rgba(61, 50, 32, 0.06);
  --shadow: 0 14px 38px rgba(61, 50, 32, 0.10);
  --shadow-lg: 0 30px 80px rgba(48, 38, 22, 0.16);
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --nav-h: 72px;
  --wrap: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(83, 64, 35, 0.055) 0.7px, transparent 0.7px),
    radial-gradient(rgba(83, 64, 35, 0.03) 0.7px, transparent 0.7px);
  background-size: 5px 5px, 11px 11px;
  background-position: 0 0, 3px 4px;
}

::selection { background: var(--seal); color: var(--paper-card); }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
}
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper-card);
  border-radius: var(--r-sm);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--wrap), calc(100% - 64px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .wrap { width: min(var(--wrap), calc(100% - 40px)); }
}

.serif { font-family: var(--serif); }
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: -0.01em;
  font-variant-ligatures: none;
}
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-nav::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(178, 80, 44, 0.22), transparent);
  pointer-events: none;
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(60, 40, 20, 0.12));
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-mark { transform: rotate(-5deg) translateY(-1px); }
.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-word strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-word span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 3px;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px;
  background: var(--seal);
  border-radius: 2px;
}
.nav-links .nav-mobile-only { display: none; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.nav-mobile-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: var(--r-sm);
}
.nav-mobile-toggle span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-mobile-toggle span::before,
.nav-mobile-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px; height: 1.5px;
  background: var(--ink);
}
.nav-mobile-toggle span::before { top: -5px; }
.nav-mobile-toggle span::after { top: 5px; }

@media (max-width: 1040px) {
  .nav-links a { padding: 0 8px; font-size: 13.5px; }
  .nav-inner { gap: 18px; }
}
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 18px;
    background: var(--paper-card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { height: 44px; padding: 0 12px; font-size: 15px; }
  .nav-links .nav-mobile-only { display: flex; }
  .nav-links a[aria-current="page"]::after { left: 12px; right: auto; width: 20px; bottom: 6px; }
  .nav-mobile-toggle { display: inline-flex; margin-left: auto; }
  .nav-actions .nav-hide-sm { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  --btn-bg: var(--teal);
  --btn-fg: var(--paper-card);
  --btn-bd: var(--teal);
}
.btn-primary:hover { --btn-bg: var(--teal-2); --btn-bd: var(--teal-2); }
.btn-seal {
  --btn-bg: var(--seal);
  --btn-fg: #FFF7F0;
  --btn-bd: var(--seal);
}
.btn-seal:hover { --btn-bg: var(--seal-ink); --btn-bd: var(--seal-ink); }
.btn-outline { --btn-bg: transparent; }
.btn-outline:hover { --btn-bg: var(--paper-2); }
.btn-ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink-2);
}
.btn-ghost:hover { --btn-bg: var(--paper-2); color: var(--ink); box-shadow: none; }
.btn-soft {
  --btn-bg: var(--paper-2);
  --btn-bd: var(--paper-2);
  --btn-fg: var(--ink);
}
.btn-soft:hover { --btn-bg: var(--paper-3); --btn-bd: var(--paper-3); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; }
.btn-danger {
  --btn-bg: transparent;
  --btn-fg: var(--danger);
  --btn-bd: rgba(156, 63, 44, 0.35);
}
.btn-danger:hover { --btn-bg: var(--danger-soft); }
.btn-block { width: 100%; }
.btn .i { width: 16px; height: 16px; flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- tags / badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.tag-outline { background: transparent; border-color: var(--line); }
.tag-teal { background: var(--teal-soft); color: var(--teal); }
.tag-seal { background: var(--seal-soft); color: var(--seal-ink); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.badge-open::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(76, 122, 91, 0.15); }
.badge-paused::before { background: var(--warn); }
.badge-offline::before { background: var(--ink-3); }
.badge-down::before { background: var(--danger); }
.badge-guide::before { background: var(--teal); }

.cert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px 0 7px;
  color: var(--seal-ink);
  background: transparent;
  border: 1px solid rgba(178, 80, 44, 0.35);
  border-radius: var(--r-xs);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.cert svg { width: 12px; height: 12px; }

/* ---------- surfaces ---------- */
.panel {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}
.panel-flat { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}
.panel-head h3 { font-size: 19px; }
.panel-head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.panel-body { padding: 20px 22px 22px; }
.hairline { height: 1px; background: var(--line); }

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-title h2 { font-size: clamp(26px, 2.6vw, 36px); }
.section-title p { margin: 8px 0 0; color: var(--ink-3); font-size: 14px; max-width: 52ch; }
.section-title .section-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-hint { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: #FFFDF8;
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
}
.input { height: 44px; }
.textarea { min-height: 116px; resize: vertical; }
.select {
  height: 44px;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23554F45' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.input::placeholder, .textarea::placeholder { color: #A79E8E; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(39, 71, 67, 0.10);
  background: #FFFEFB;
}
.input-sm { height: 36px; font-size: 13px; padding: 6px 10px; }
.textarea-sm { min-height: 80px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--teal); }
.radio-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  transition: background 0.2s ease;
  position: relative;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
.switch input:checked + .track { background: var(--teal); border-color: var(--teal); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--teal); outline-offset: 2px; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 3px;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--paper-card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(50,40,25,0.10);
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper-card); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 640px;
}
table.data th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #F7F2E8;
  white-space: nowrap;
}
table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(216, 206, 188, 0.65);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(237, 230, 216, 0.42); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* ---------- empty states ---------- */
.empty {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  background: rgba(251, 248, 241, 0.55);
}
.empty img { width: 76px; margin: 0 auto 10px; opacity: 0.9; }
.empty strong { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- drawer / modal ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(34, 29, 22, 0.38);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: var(--paper-card);
  border-left: 1px solid var(--line);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.32s cubic-bezier(.2,.8,.2,1);
  box-shadow: -24px 0 60px rgba(40, 30, 18, 0.16);
}
.drawer.is-on { transform: translateX(0); }
.drawer-lg { width: min(760px, 100%); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-head h3 { font-size: 21px; }
.drawer-head .sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  background: var(--paper-card);
}
@media (max-width: 560px) {
  .drawer { width: 100%; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 18px; padding-right: 18px; }
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(34, 29, 22, 0.4);
}
.modal-wrap.is-on { display: flex; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.24s cubic-bezier(.2,.8,.2,1);
}
.modal-lg { width: min(880px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h3 { font-size: 21px; }
.modal-body { padding: 18px 24px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ---------- toast ---------- */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper-card);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.24s ease;
  max-width: min(560px, calc(100vw - 40px));
}
.toast.ok::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8CC49A; flex: none; }
.toast.err::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #E59A84; flex: none; }
.toast.info::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #D9C68E; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot-open { background: var(--ok); box-shadow: 0 0 0 3px rgba(76, 122, 91, 0.14); }
.dot-paused { background: var(--warn); }
.dot-offline { background: var(--ink-3); }
.dot-down { background: var(--danger); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  border: 1px solid var(--line);
  flex: none;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(216, 206, 188, 0.55); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-3); flex: none; }
.kv dd { margin: 0; color: var(--ink); text-align: right; }

.copy-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #2B2A25;
  color: #E8DECB;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-x: auto;
}
.copy-line button {
  margin-left: auto;
  border: 1px solid rgba(232, 222, 203, 0.25);
  background: transparent;
  color: #E8DECB;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11px;
  flex: none;
}
.copy-line button:hover { background: rgba(232, 222, 203, 0.12); }

.note {
  padding: 12px 14px;
  background: var(--paper-2);
  border-left: 2px solid var(--teal);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.7;
}
.note-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note-danger { border-left-color: var(--danger); background: var(--danger-soft); }

.price { font-family: var(--mono); font-size: 12.5px; color: var(--seal-ink); white-space: nowrap; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(85, 79, 69, 0.25);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, #F4EDE0 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-xs);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding: 56px 0 44px;
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; color: var(--ink-3); max-width: 34ch; margin: 0; }
.footer-col h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.footer-col a, .footer-col span {
  display: block;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 4px 0;
}
.footer-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-3);
}
.footer-bottom .mono { font-size: 10.5px; }
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 40px; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- utility ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.strong { font-weight: 600; }
.serif-num { font-family: var(--serif); font-variant-numeric: lining-nums; }

.inline-link { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.guide-msg.is-user .inline-link, .chat-msg.is-user .inline-link { color: var(--paper-card); }
