:root {
  --background: #f4f6f2;
  --paper: #fff;
  --ink: #192822;
  --muted: #53645b;
  --line: #dfe6de;
  --line-soft: #e9eee7;
  --primary: #1b563f;
  --primary-dark: #144330;
  --mint: #b5efca;
  --mint-wash: #e9f4eb;
  --dark: #142d25;
  --danger: #a62e29;
  --shadow: 0 1px 2px #132c1a08;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font: 14px/1.55 var(--sans); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #339468; outline-offset: 3px; }
.symbol-bank { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.boot { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f5f8f4; border-color: #a9baaf; }
.btn:disabled { cursor: not-allowed; color: #64746a; background: #f0f3ef; opacity: .75; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: #a62e29; border-color: #a62e29; color: white; }
.btn.danger:hover { background: #88211c; }
.btn.small { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--mint-wash); color: var(--ink); }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.12; font-size: 20px; font-weight: 760; }
.brand small { display: block; margin-top: 4px; color: #52685d; font: 9px/1 var(--mono); letter-spacing: .17em; }
.dark-panel { background: var(--dark); color: #f4fbf5; }
.overline { display: flex; align-items: center; gap: 9px; font: 11px/1.4 var(--mono); letter-spacing: .12em; font-weight: 700; }
.overline > span, .private-status > span, .visual-index > span { width: 7px; height: 7px; flex: none; border-radius: 100%; background: #61af84; }

.login-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(390px, .86fr) minmax(0, 1fr); }
.login-panel { display: grid; grid-template-rows: auto 1fr auto; padding: clamp(26px, 5vw, 76px); background: #fafbf8; }
.login-content { width: 100%; max-width: 370px; justify-self: center; align-self: center; padding: 44px 0; }
.login-content .overline { color: var(--primary); }
.login-content h1 { font-size: clamp(35px, 5vw, 53px); letter-spacing: -.055em; line-height: 1.15; margin: 17px 0 13px; }
.login-content > p { color: var(--muted); font-size: 15px; margin-bottom: 30px; }
.login-content form { display: grid; gap: 15px; }
.login-content form > .btn { width: 100%; min-height: 45px; }
.login-caption { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.login-caption .icon { width: 15px; height: 15px; }
.login-art { min-width: 0; overflow: hidden; padding: clamp(24px, 5vw, 68px); display: grid; align-content: center; justify-items: center; }
.visual-index { justify-self: start; display: flex; align-items: center; gap: 8px; color: #c4dacf; font: 11px/1 var(--mono); letter-spacing: .14em; }
.login-route { width: 100%; max-width: 530px; margin: 17px auto; }
.login-art-copy { justify-self: start; }
.login-art-copy strong { font-size: clamp(21px, 2.4vw, 32px); font-weight: 720; }
.login-art-copy p { margin-top: 8px; color: #b6cec1; }

.workspace { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background: #fafbf8;
  border-right: 1px solid var(--line);
}
.sidebar .brand { margin: 3px 12px 43px; }
.nav-heading { margin: 0 11px 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.nav { display: grid; gap: 4px; }
.nav > a, .logout { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 9px 11px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 650; }
.nav > a:hover, .logout:hover { background: #f0f3ee; color: var(--ink); }
.nav > a[aria-current] { background: var(--mint-wash); border-color: #dceadd; color: #1c523b; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.private-status { display: flex; align-items: center; gap: 8px; padding: 0 11px 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.logout { background: none; width: 100%; text-align: left; }
.workspace-main { min-width: 0; }
.topbar { min-height: 64px; padding: 12px clamp(20px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fafbf8; color: var(--muted); font-size: 13px; }
.topbar strong { color: var(--ink); font-weight: 700; }
.top-divider { padding: 0 7px; color: #748078; }
.top-private { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.top-private .icon { width: 14px; height: 14px; }
.page { max-width: 1320px; margin: auto; padding: 30px clamp(20px, 4vw, 52px) 0; }
.hero { position: relative; min-height: 211px; overflow: hidden; isolation: isolate; display: grid; align-items: center; border-radius: 13px; padding: 26px clamp(22px, 4vw, 37px); }
.hero-content { position: relative; z-index: 1; }
.hero .overline { color: #b9ddc9; }
.hero h1 { font-size: clamp(28px, 4vw, 45px); font-weight: 730; letter-spacing: -.055em; line-height: 1.18; margin: 10px 0 7px; }
.hero p { color: #c2d7cd; }
.hero-button { background: var(--mint); border-color: var(--mint); color: var(--dark); margin-top: 19px; }
.hero-button:hover { background: #cef4dc; border-color: #cef4dc; }
.hero-route { position: absolute; right: 0; top: 0; width: min(49%, 490px); height: 100%; object-fit: contain; opacity: .9; mask-image: linear-gradient(to right, transparent, black 15%); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 16px 0 25px; }
.stat, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.stat { padding: 15px 17px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.stat-label .icon { width: 16px; height: 16px; color: var(--primary); }
.stat-value { margin: 6px 0 2px; font-size: 30px; font-weight: 730; font-variant-numeric: tabular-nums; line-height: 1.08; letter-spacing: -.04em; }
.stat-detail { color: var(--muted); font-size: 12px; }
.panel { margin-bottom: 19px; scroll-margin-top: 18px; }
.panel-header { padding: 18px 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.section-index { color: var(--primary); font: 10px/1.2 var(--mono); letter-spacing: .10em; font-weight: 700; margin-bottom: 5px; }
.panel-header h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.panel-header p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.loading-copy { padding: 27px 20px; color: var(--muted); }
.empty { padding: 20px; display: flex; align-items: center; gap: 13px; }
.empty-icon { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid #dceadd; display: grid; place-items: center; background: var(--mint-wash); color: var(--primary); }
.empty-icon .icon { width: 22px; height: 22px; }
.empty strong { font-weight: 690; }
.empty p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.workspace-foot { display: flex; gap: 9px; padding: 2px 0 25px; color: var(--muted); font-size: 12px; }

.row { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(120px, .9fr) minmax(170px, 1.25fr) auto; gap: 12px; align-items: center; }
.row:last-child { border-bottom: none; }
.row.link-row { grid-template-columns: minmax(100px, 1.12fr) minmax(100px, .8fr) minmax(130px, 1fr) auto; }
.row-name { display: block; color: var(--ink); font-weight: 720; overflow-wrap: anywhere; }
.row-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.tag { width: fit-content; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 2px 7px; background: #eef2ee; color: #475c50; font-size: 11px; font-weight: 700; }
.tag.good { background: #e6f4e9; color: #1b5a3e; }
.tag.bad { background: #f9ecea; color: #8c2c26; }
.tag.warn { background: #fbf0db; color: #754d19; }
.row-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 5px; }
.row-actions .btn { min-height: 34px; padding: 5px 9px; font-size: 12px; }
.row-actions .icon { width: 15px; height: 15px; }

.state-error { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #faeeea; color: var(--danger); border: 1px solid #ebcfc8; border-radius: 8px; margin-bottom: 14px; padding: 8px 10px; }
.form-error { padding: 8px 10px; border: 1px solid #ebcfc8; border-radius: 7px; background: #faeeea; color: var(--danger); font-size: 13px; }
dialog { width: min(530px, calc(100% - 28px)); max-height: calc(100dvh - 30px); padding: 0; border: 1px solid #cbd8ce; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 18px 70px #10221a4a; }
dialog::backdrop { background: #101e19a6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 19px; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { font-size: 20px; line-height: 1.2; }
#dialog-body { padding: 18px 19px 20px; }
#dialog-body form { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 670; }
.field > input, .field > select, .share-url { width: 100%; min-width: 0; min-height: 40px; border: 1px solid #cbd6cc; border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--ink); font-weight: 450; }
.field > input::placeholder { color: #68776d; }
.field > input:disabled { background: #edf1ee; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.endpoint { grid-template-columns: minmax(0, 2.2fr) minmax(78px, 1fr); }
.quick-paste { border: 1px solid var(--line); border-radius: 7px; background: #f6f8f5; padding: 8px 10px; }
.quick-paste > summary { color: var(--primary); font-size: 13px; font-weight: 700; cursor: pointer; }
.quick-paste-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin: 8px 0 5px; }
.quick-paste-controls > .btn { min-height: 40px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.dialog-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.local-note { padding: 7px 9px; margin-top: 8px; background: #eef4ef; border-radius: 6px; color: #345a45; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.node-picks { display: grid; gap: 7px; margin: 0; padding: 9px 10px 11px; border: 1px solid var(--line); border-radius: 7px; max-height: 200px; overflow: auto; }
.node-picks > legend { padding: 0 4px; font-size: 13px; font-weight: 670; }
.node-picks > label { padding: 3px 0; overflow-wrap: anywhere; }
.node-picks .row-meta { margin-left: auto; margin-top: 0; }
.share-item { display: grid; gap: 5px; margin: 12px 0; }
.share-item > label { font-weight: 650; font-size: 13px; }
.share-input { display: flex; gap: 7px; }
.share-url { font: 12px/1.4 var(--mono); background: #f6f8f5; }
.dialog-divider { border: 0; border-top: 1px solid var(--line-soft); margin: 17px 0 13px; }
.dialog-confirm p { margin-bottom: 15px; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: calc(100% - 36px); padding: 11px 14px; border-radius: 8px; background: var(--dark); color: #f8fdf8; box-shadow: 0 4px 20px #152e2140; overflow-wrap: anywhere; }
.toast.error { background: #8c2c26; }

@media (max-width: 1120px) {
  .row, .row.link-row { grid-template-columns: minmax(110px, 1fr) minmax(106px, 1fr) minmax(134px, 1fr); }
  .row-actions { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 13px 16px 10px; }
  .sidebar .brand { margin: 0; }
  .sidebar .brand img { width: 32px; height: 32px; }
  .nav-heading, .private-status { display: none; }
  .nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 5px; }
  .nav > a { flex: 1; justify-content: center; min-height: 37px; padding: 6px 4px; font-size: 13px; gap: 5px; white-space: nowrap; }
  .nav .icon { width: 15px; height: 15px; }
  .sidebar-foot { margin: 0; grid-column: 2; grid-row: 1; padding: 0; border: 0; }
  .logout { min-height: 34px; padding: 5px 7px; font-size: 12px; }
  .topbar { min-height: 45px; padding-inline: 16px; }
  .page { padding: 16px 16px 0; }
  .login-layout { grid-template-columns: 1fr; }
  .login-panel { min-height: 68dvh; padding: 23px; }
  .login-art { padding: 24px; grid-template-columns: 1fr .7fr; gap: 12px; align-items: center; justify-items: start; }
  .visual-index { display: none; }
  .login-route { grid-column: 2; grid-row: 1; margin: 0; }
  .login-art-copy { grid-column: 1; grid-row: 1; }
}
@media (max-width: 540px) {
  .hero { min-height: 193px; }
  .hero-route { width: 67%; opacity: .31; }
  .hero p { font-size: 13px; max-width: 260px; }
  .stats { gap: 6px; margin: 10px 0 16px; }
  .stat { padding: 10px 8px; border-radius: 8px; }
  .stat-label { font-size: 11px; gap: 4px; white-space: nowrap; }
  .stat-label .icon { width: 12px; height: 12px; }
  .stat-value { font-size: 24px; }
  .stat-detail { font-size: 10px; }
  .panel-header, .empty, .row { padding-left: 13px; padding-right: 13px; }
  .panel-header { align-items: flex-start; }
  .panel-header h2 { font-size: 18px; }
  .panel-header p { font-size: 12px; }
  .panel-header .btn { font-size: 12px; gap: 4px; padding-inline: 8px; }
  .panel-header .btn .icon { width: 15px; height: 15px; }
  .row, .row.link-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-actions { justify-content: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
.clipboard-fallback { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
