/* Easy 托管: warm paper, serif headings, one terracotta accent */
:root {
  color-scheme: light;
  --bg: #faf9f5;
  --card: #ffffff;
  --sunk: #f4f2ec;
  --border: #e8e6dc;
  --hair: #efede6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --ink-3: #87867f;
  --accent: #d97757;
  --accent-hover: #c6613f;
  --accent-ink: #ffffff;
  --accent-wash: rgba(217, 119, 87, 0.12);
  --good: #3f7a3f;
  --good-wash: rgba(90, 140, 90, 0.14);
  --bad: #b5443a;
  --bad-wash: rgba(191, 77, 67, 0.12);
  --warn: #8a5a00;
  --warn-wash: rgba(201, 133, 0, 0.14);
  --axis: #c9c6bb;
  --shadow: 0 1px 2px rgba(20, 20, 19, 0.06);
  --shadow-pop: 0 8px 28px rgba(20, 20, 19, 0.12);
  --shadow-hover: 0 10px 28px -12px rgba(20, 20, 19, 0.22), 0 2px 6px rgba(20, 20, 19, 0.05);
  --accent-glow: 0 6px 16px -6px rgba(217, 119, 87, 0.55);
  --serif: "Iowan Old Style", "Source Serif 4", "Source Serif Pro", Georgia, "Songti SC", "Noto Serif SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --r: 14px;
  --r-sm: 9px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-fast: 150ms;
  --t: 220ms;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #262624; --card: #30302e; --sunk: #2b2b29; --border: #3e3e3a; --hair: #383835;
    --ink: #f0eee6; --ink-2: #c2c0b6; --ink-3: #8f8d85;
    --accent-hover: #e08a6c; --accent-wash: rgba(217, 119, 87, 0.18);
    --good: #7fb87f; --good-wash: rgba(127, 184, 127, 0.14);
    --bad: #e07a70; --bad-wash: rgba(224, 122, 112, 0.14);
    --warn: #e6b450; --warn-wash: rgba(230, 170, 60, 0.16);
    --axis: #4a4a46;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 12px 30px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262624; --card: #30302e; --sunk: #2b2b29; --border: #3e3e3a; --hair: #383835;
  --ink: #f0eee6; --ink-2: #c2c0b6; --ink-3: #8f8d85;
  --accent-hover: #e08a6c; --accent-wash: rgba(217, 119, 87, 0.18);
  --good: #7fb87f; --good-wash: rgba(127, 184, 127, 0.14);
  --bad: #e07a70; --bad-wash: rgba(224, 122, 112, 0.14);
  --warn: #e6b450; --warn-wash: rgba(230, 170, 60, 0.16);
  --axis: #4a4a46;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 30px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: block; }

/* layout */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 10px; }
.identity { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.page { max-width: 1120px; margin: 0 auto; padding: 30px 28px 72px; display: grid; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--ink-2); }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sub { font-size: 13px; color: var(--ink-2); }
.grid { display: grid; gap: 18px; }
.grid.tiles { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }
.admin { display: grid; gap: 18px; }
.admin .section-head { margin-bottom: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px 24px; min-width: 0; transition: box-shadow var(--t) var(--ease-out), border-color var(--t) ease-out, transform var(--t) var(--ease-out); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card > .muted + .btn, .card > .muted + .inline-form { margin-top: 14px; }

/* tiles */
.tile-label { font-size: 13px; color: var(--ink-2); }
.tile-value { font-size: 30px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.tile-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card); padding: 8px 15px; cursor: pointer; line-height: 1.3; white-space: nowrap; text-decoration: none; min-height: 38px; transition: background-color var(--t-fast) ease-out, border-color var(--t-fast) ease-out, color var(--t-fast) ease-out, opacity var(--t-fast) ease-out, box-shadow var(--t) var(--ease-out), transform var(--t) var(--ease-out); }
.btn:hover { background: var(--sunk); }
.btn:active:not(:disabled) { transform: scale(0.97); transition-duration: 80ms; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--accent-glow); }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-wash); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.sm { padding: 4px 11px; font-size: 13px; min-height: 30px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.copied { background: var(--good-wash); border-color: transparent; color: var(--good); animation: pop 260ms var(--ease-back); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); transition: background-color var(--t-fast) ease-out, color var(--t-fast) ease-out; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.link { border: 0; background: none; padding: 0 2px; color: var(--accent); cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn:focus-visible, .icon-btn:focus-visible, .link:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > span:first-child { font-size: 13px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); }
.input { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--card); padding: 9px 12px; outline: none; transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out; }
.input::placeholder { color: var(--ink-3); }
.input:hover:not(:focus):not(:disabled) { border-color: var(--axis); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.input:disabled { opacity: 0.6; }
input.input.mono { font-size: 13px; letter-spacing: 0.01em; }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.create-row, .inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 220px; }
.inline-form .grow { flex-basis: 160px; }
.create-row + .callout { margin-top: 14px; }

.callout { border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; background: var(--accent-wash); color: var(--ink); }
.secret { display: flex; gap: 8px; align-items: center; margin-top: 14px; background: var(--sunk); border: 1px dashed var(--border); border-radius: var(--r-sm); padding: 10px 12px; animation: rise-in 300ms var(--ease-out); }
.secret code { flex: 1; overflow-wrap: anywhere; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; line-height: 1.6; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { background: var(--good-wash); color: var(--good); }
.badge.err { background: var(--bad-wash); color: var(--bad); }
.badge.warn { background: var(--warn-wash); color: var(--warn); }
.badge.live::before { animation: pulse 1.2s ease-in-out infinite; }
.badge.plain::before { display: none; }
.chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 11px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--hair); }
.chips li .btn { min-height: 24px; padding: 1px 9px; font-size: 12px; border-radius: 99px; }
.chips .empty-chip { padding: 3px 11px; color: var(--ink-3); font-size: 13px; }

/* nodes */
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.node { display: grid; gap: 16px; align-content: start; animation: rise-in 360ms var(--ease-out) backwards; }
.node:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--axis); }
.node-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.node-head h3 { font-size: 18px; overflow-wrap: anywhere; }
.node-meta { margin-top: 3px; font: 12px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.node-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 14px; border-radius: var(--r-sm); background: var(--sunk); }
.node-status > div { display: grid; gap: 4px; min-width: 0; }
.node-status dt { font-size: 12px; color: var(--ink-3); }
.node-status dd { margin: 0; font-size: 14px; }
.node-status .badge.plain { padding-left: 0; background: none; color: var(--ink-3); }
.node-note { font-size: 14px; color: var(--ink-2); padding: 14px; border-radius: var(--r-sm); background: var(--sunk); }
.node-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.node-actions:empty { display: none; }
.empty { grid-column: 1 / -1; padding: 44px 16px; text-align: center; color: var(--ink-3); border: 1px dashed var(--border); border-radius: var(--r); }
.empty b { display: block; font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--ink-2); margin-bottom: 4px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr:hover td { background: var(--sunk); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; animation: fade-in 320ms ease-out; }
.auth-box { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-box > * { animation: rise-in 520ms var(--ease-out) backwards; }
.auth-box > :nth-child(2) { animation-delay: 50ms; }
.auth-box > :nth-child(3) { animation-delay: 100ms; }
.auth-box > :nth-child(n+4) { animation-delay: 150ms; }
.auth-box .brand { justify-content: center; font-size: 22px; }
.auth-box h1 { text-align: center; font-size: 34px; }
.auth-box .lead { text-align: center; color: var(--ink-2); margin-top: -12px; }
.auth-box .form { padding: 24px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--ink-2); }

/* dialog */
dialog { border: 1px solid var(--border); border-radius: var(--r); background: var(--card); color: var(--ink); padding: 24px; width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(20, 20, 19, 0.35); backdrop-filter: blur(2px); }
dialog[open] { animation: dialog-in 300ms var(--ease-out); }
dialog[open]::backdrop { animation: fade-in 260ms ease-out; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: -4px -8px 18px 0; }
.dialog-head .sub { margin-top: 2px; overflow-wrap: anywhere; }
.flow-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunk); font-size: 14px; color: var(--ink-2); }
.steps { list-style: none; counter-reset: step; margin: 20px 0 0; padding: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: step; position: relative; padding-left: 38px; display: grid; gap: 6px; justify-items: start; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--accent-wash); color: var(--accent); }
.steps > li > p { font-size: 13px; color: var(--ink-2); }
.steps > li > .btn { margin-top: 4px; }
.steps .form { width: 100%; margin-top: 4px; }
.steps .form .btn { justify-self: start; }
.dialog-foot { display: flex; justify-content: flex-end; margin-top: 22px; }
.dialog-foot:has(> [hidden]:only-child) { display: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; width: max-content; max-width: calc(100vw - 32px); text-align: center; background: var(--ink); color: var(--bg); padding: 9px 18px; border-radius: 20px; font-size: 14px; box-shadow: var(--shadow-pop); z-index: 50; animation: toast-in 380ms var(--ease-back); }

/* motion */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.9); } }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: 0.4; } }
.app { animation: fade-in 320ms ease-out; }
.page > * { animation: rise-in 520ms var(--ease-out) backwards; }
.page > :nth-child(2) { animation-delay: 55ms; }
.page > :nth-child(3) { animation-delay: 110ms; }
.page > :nth-child(n+4) { animation-delay: 165ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

@media (max-width: 860px) {
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; }
  .topbar .brand span { display: none; }
  .page { padding: 22px 16px 56px; gap: 18px; }
  h1 { font-size: 25px; }
  .grid.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 24px; }
  .tile-note { display: none; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .create-row > .btn { width: 100%; }
}
