:root {
    --io-ink: #18222b;
    --io-muted: #62717c;
    --io-faint: #8b98a1;
    --io-surface: #f4f7f8;
    --io-panel: #ffffff;
    --io-line: #d9e0e4;
    --io-line-strong: #bdc8ce;
    --io-accent: #147c83;
    --io-accent-dark: #0c5960;
    --io-accent-soft: #dceff0;
    --io-warm: #e05a47;
    --io-positive: #18826d;
    --io-shadow: 0 12px 30px rgba(21, 38, 49, .08);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { color: var(--io-ink); background: #e8eef0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid #147c83; outline-offset: 2px; }

.io-app {
    min-height: 100vh;
    background-color: var(--io-surface);
    background-image: linear-gradient(rgba(46, 78, 91, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(46, 78, 91, .035) 1px, transparent 1px);
    background-size: 28px 28px;
}

.io-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 12px 22px;
    color: #f8fbfc;
    background: #14252d;
    border-bottom: 3px solid var(--io-accent);
}

.io-header::after {
    position: absolute;
    right: 0;
    bottom: -3px;
    width: 22%;
    height: 3px;
    content: "";
    background: var(--io-warm);
}

.io-brand { display: flex; align-items: center; min-width: 0; gap: 14px; }
.io-brand-mark { position: relative; display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; }
.io-brand-mark::before { position: absolute; width: 28px; height: 28px; content: ""; border: 1px solid #79d0d3; transform: rotate(45deg); }
.io-brand-mark i { position: absolute; width: 7px; height: 7px; background: #79d0d3; border: 1px solid #14252d; border-radius: 50%; }
.io-brand-mark i:nth-child(1) { top: 0; left: 13px; }
.io-brand-mark i:nth-child(2) { right: 0; bottom: 2px; background: #ef806d; }
.io-brand-mark i:nth-child(3) { bottom: 2px; left: 0; background: #e6ad4a; }
.io-brand p { margin: 0 0 4px; color: #88a2ad; font: 700 9px/1.1 "SFMono-Regular", Consolas, monospace; letter-spacing: 1px; }
.io-brand h1 { margin: 0; overflow: hidden; color: white; font-size: 24px; line-height: 1; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.io-header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.io-view-switch { display: flex; padding: 3px; background: #0b1b22; border: 1px solid #35515d; border-radius: 4px; }
.io-view-switch button { min-height: 32px; padding: 7px 12px; color: #9fb1b9; background: transparent; border: 0; border-radius: 2px; font-size: 12px; }
.io-view-switch button.active { color: #102229; background: #8bd0d3; font-weight: 700; }
.io-language { display: grid; width: 38px; height: 38px; padding: 0; color: white; background: transparent; border: 1px solid #52707d; border-radius: 4px; place-items: center; font-weight: 700; }
.io-language:hover { color: #102229; background: #e6ad4a; border-color: #e6ad4a; }

.io-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 140px)) minmax(260px, 1fr);
    min-height: 76px;
    background: var(--io-panel);
    border-bottom: 1px solid var(--io-line);
}
.io-summary > div { display: flex; flex-direction: column; justify-content: center; padding: 13px 20px; border-right: 1px solid var(--io-line); }
.io-summary span { margin-bottom: 5px; color: var(--io-muted); font-size: 11px; text-transform: uppercase; }
.io-summary strong { color: var(--io-ink); font: 700 22px/1 "SFMono-Regular", Consolas, monospace; }
.io-summary div:nth-child(4) strong { color: #8557b6; }
.io-summary p { align-self: center; max-width: 640px; margin: 0; padding: 12px 22px; color: var(--io-muted); font-size: 13px; line-height: 1.45; }

.io-workspace {
    display: grid;
    grid-template-columns: 252px minmax(440px, 1fr) 330px;
    width: 100%;
    min-height: 760px;
    height: calc(100vh - 152px);
    background: var(--io-panel);
}

.io-sidebar { position: relative; z-index: 5; min-width: 0; overflow: auto; background: #f8fafb; border-right: 1px solid var(--io-line); transition: width .2s, min-width .2s; }
.io-sidebar-head, .io-inspector-head { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 16px; border-bottom: 1px solid var(--io-line); }
.io-label { display: block; margin-bottom: 5px; color: var(--io-faint); font: 700 8px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .9px; }
.io-sidebar h2, .io-inspector h2 { margin: 0; font-size: 19px; line-height: 1; }
.io-icon-button { display: grid; width: 32px; height: 32px; padding: 0; color: #53656f; background: white; border: 1px solid var(--io-line-strong); border-radius: 3px; place-items: center; font-size: 18px; line-height: 1; }
.io-icon-button:hover { color: white; background: var(--io-accent); border-color: var(--io-accent); }

.io-search { position: relative; display: block; margin: 14px; }
.io-search input { width: 100%; height: 38px; padding: 8px 32px 8px 34px; color: var(--io-ink); background: white; border: 1px solid var(--io-line-strong); border-radius: 3px; font-size: 12px; }
.io-search input::placeholder { color: #919ca3; }
.io-search-icon { position: absolute; top: 12px; left: 12px; width: 12px; height: 12px; border: 2px solid #6c7b83; border-radius: 50%; }
.io-search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; content: ""; background: #6c7b83; transform: rotate(45deg); }
.io-search kbd { position: absolute; top: 9px; right: 8px; padding: 3px 5px; color: #77858d; background: #eef2f4; border: 1px solid #d6dee2; border-radius: 2px; font: 10px/1 monospace; }

.io-filter-section { padding: 0 14px 14px; border-bottom: 1px solid var(--io-line); }
.io-filter-section header { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 9px; }
.io-filter-section h3, .io-relationship-list h3 { margin: 0; color: #40515b; font-size: 11px; text-transform: uppercase; }
.io-filter-section header button { padding: 2px; color: var(--io-accent); background: transparent; border: 0; font-size: 10px; font-weight: 700; }
.io-filter-list { display: grid; gap: 5px; }
.io-standard-choice { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; min-height: 34px; padding: 7px 8px; gap: 8px; color: #53636c; text-align: left; background: white; border: 1px solid #d7e0e3; border-radius: 3px; }
.io-standard-choice i { width: 8px; height: 8px; background: var(--filter-color); border-radius: 50%; }
.io-standard-choice span { font-size: 12px; font-weight: 700; }
.io-standard-choice small { color: #8b989f; font: 9px/1 monospace; }
.io-standard-choice.active { color: #10252e; background: #e1f0f1; border-color: #74b4b8; box-shadow: inset 3px 0 0 var(--filter-color); }
.io-filter-item { display: grid; grid-template-columns: 18px 10px minmax(0, 1fr) auto; align-items: center; min-height: 28px; gap: 7px; color: #4d5d66; font-size: 12px; cursor: pointer; }
.io-filter-item input { width: 15px; height: 15px; margin: 0; accent-color: var(--io-accent); }
.io-filter-item i { width: 8px; height: 8px; background: var(--filter-color); border-radius: 50%; }
.io-filter-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-filter-item small { color: #93a0a7; font: 9px/1 "SFMono-Regular", Consolas, monospace; }
.io-filter-list-types { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
.io-filter-list-types .io-filter-item { grid-template-columns: 18px 8px minmax(0, 1fr); }
.io-filter-list-types .io-filter-item small { display: none; }
.io-app.source-mode .io-filter-list-types { grid-template-columns: 1fr; }
.io-app.source-mode .io-filter-list-types .io-filter-item { grid-template-columns: 18px 10px minmax(0, 1fr) auto; }
.io-app.source-mode .io-filter-list-types .io-filter-item small { display: block; }

.io-relationship-list { padding: 16px 14px 22px; }
.io-relationship-list h3 { margin-bottom: 10px; }
.io-relation-stat { display: grid; grid-template-columns: minmax(0, 1fr) 60px 24px; align-items: center; min-height: 25px; gap: 8px; color: #5d6c74; font-size: 11px; }
.io-relation-stat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-relation-bar { height: 3px; background: #e1e7e9; }
.io-relation-bar i { display: block; width: var(--bar-width); height: 100%; background: var(--io-accent); }
.io-relation-stat b { color: #7b8991; font: 9px/1 monospace; text-align: right; }

.io-graph-panel { display: grid; grid-template-rows: 58px minmax(0, 1fr) auto; min-width: 0; overflow: hidden; background: #edf2f3; }
.io-graph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--io-line); }
.io-graph-toolbar > div:first-child { min-width: 0; }
.io-graph-toolbar strong { font-size: 13px; }
.io-graph-toolbar small { display: block; margin: 4px 0 0 16px; overflow: hidden; color: var(--io-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.io-status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--io-positive); border: 2px solid #c6e9e1; border-radius: 50%; }
.io-toolbar-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.io-text-button { min-height: 32px; padding: 6px 9px; color: #53656f; background: white; border: 1px solid var(--io-line-strong); border-radius: 3px; font-size: 11px; }
.io-text-button[aria-pressed="true"] { color: #0a575d; background: var(--io-accent-soft); border-color: #83bfc3; }

.io-graph-stage { position: relative; min-height: 0; overflow: hidden; background-color: #edf2f3; background-image: radial-gradient(#b9c7cc 1px, transparent 1px); background-size: 18px 18px; }
.io-graph-stage svg { display: block; width: 100%; height: 100%; cursor: grab; }
.io-graph-stage svg:active { cursor: grabbing; }
.io-link.selected { stroke: #1a2c35; stroke-opacity: .9; }
.io-link.mapping.selected { stroke: #7542aa; }
.io-node { user-select: none; -webkit-user-select: none; transition: opacity .2s; }
.io-node:focus, .io-node:focus-visible { outline: none; }
.io-node:focus-visible .io-node-circle { stroke: #0891b2; stroke-width: 3px; }
.io-node.selected .io-node-circle { stroke: #10252e; stroke-width: 4px; }
.io-node.related .io-node-circle { stroke-width: 2.5px; }
.io-node.dimmed { opacity: .12; }
.io-node.search-match .io-node-circle { stroke: #e05a47; stroke-width: 4px; }
.io-node text { opacity: 0; fill: #25343c; stroke: none; font-size: 9px; font-weight: 500; pointer-events: none; transition: opacity .18s; }
.io-app.source-mode .io-node text { font-size: 9px; font-weight: 500; }
.io-node.label-visible text { opacity: 1; }
.io-link-label { opacity: 0; fill: #667780; stroke: #edf2f3; stroke-width: 3px; paint-order: stroke; font: 400 8px/1 "SFMono-Regular", Consolas, monospace; pointer-events: none; }
.io-link-label.label-visible { opacity: 1; }
.io-link-label.mapping { fill: #684285; }
.io-link { transition: opacity .2s; }
.io-link.dimmed { opacity: .08; }
.io-link-label.dimmed { opacity: 0; }
.io-link-label.selected { opacity: 1; fill: #4d286d; font-weight: 400; }
.io-graph-help { position: absolute; right: 14px; bottom: 12px; padding: 6px 8px; color: #61727b; background: rgba(255,255,255,.88); border: 1px solid #d2dcdf; font: 8px/1.2 "SFMono-Regular", Consolas, monospace; pointer-events: none; }
.io-tooltip { position: absolute; z-index: 12; max-width: 220px; padding: 8px 10px; color: white; background: rgba(20,37,45,.96); border-left: 3px solid #79d0d3; box-shadow: 0 8px 18px rgba(20,37,45,.18); pointer-events: none; }
.io-tooltip[hidden] { display: none; }
.io-tooltip strong, .io-tooltip span { display: block; }
.io-tooltip strong { font-size: 11px; }
.io-tooltip span { margin-top: 4px; color: #aac0c9; font-size: 9px; }
.io-empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; padding: 30px; color: #61727b; background: rgba(237,242,243,.94); text-align: center; }
.io-empty[hidden] { display: none; }
.io-empty strong { margin-bottom: 7px; color: var(--io-ink); font-size: 17px; }
.io-empty span { font-size: 12px; }
.io-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; min-height: 36px; padding: 8px 14px; background: white; border-top: 1px solid var(--io-line); }
.io-legend > strong { display: inline-flex; align-items: center; padding-right: 12px; color: #354750; border-right: 1px solid #d8e0e3; font: 700 9px/1.2 "SFMono-Regular", Consolas, monospace; text-transform: uppercase; }
.io-legend span { display: inline-flex; align-items: center; gap: 5px; color: #65757d; font-size: 9px; }
.io-legend i { width: 7px; height: 7px; background: var(--legend-color); border-radius: 50%; }
.io-legend .mapping i { width: 14px; height: 0; background: transparent; border-top: 2px dashed #8557b6; border-radius: 0; }

.io-inspector { position: relative; z-index: 6; min-width: 0; overflow: auto; background: white; border-left: 1px solid var(--io-line); box-shadow: -8px 0 22px rgba(24, 42, 52, .04); }
.io-governance-badge { padding: 4px 7px; color: #116c5b; background: #e1f2ed; border: 1px solid #a8d4c8; border-radius: 3px; font: 700 9px/1 monospace; text-transform: uppercase; }
.io-node-identity { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--io-line); }
.io-node-symbol { display: grid; width: 44px; height: 44px; color: white; background: var(--node-color, var(--io-accent)); border-radius: 4px; place-items: center; font: 700 12px/1 monospace; }
.io-node-identity small { display: block; margin-bottom: 4px; color: var(--node-color, var(--io-accent)); font: 700 9px/1 monospace; text-transform: uppercase; }
.io-node-identity h3 { margin: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.1; }
.io-node-identity p { margin: 4px 0 0; color: var(--io-muted); font-size: 12px; }
.io-definition { margin: 0; padding: 14px 16px; color: #56666f; border-bottom: 1px solid var(--io-line); font-size: 12px; line-height: 1.5; }
.io-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #f5f8f9; border-bottom: 1px solid var(--io-line); }
.io-tabs button { min-width: 0; padding: 10px 5px; color: #718089; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 10px; }
.io-tabs button.active { color: var(--io-accent-dark); background: white; border-bottom-color: var(--io-accent); font-weight: 700; }
.io-tab-panel { padding: 4px 16px 18px; }
.io-tab-panel[hidden] { display: none; }
.io-property-grid { margin: 0; }
.io-property-grid > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #e6ebed; }
.io-property-grid dt { color: #7b8991; font-size: 10px; }
.io-property-grid dd { margin: 0; color: #30414a; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.io-property-grid code { color: #0e6870; font: 9px/1.4 "SFMono-Regular", Consolas, monospace; }
.io-property-grid .io-confidence { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; }
.io-confidence i { height: 4px; background: #e2e9eb; }
.io-confidence i::before { display: block; width: var(--confidence); height: 100%; content: ""; background: var(--io-positive); }
.io-edge-list, .io-mapping-list { display: grid; gap: 7px; padding-top: 12px; }
.io-edge-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 8px; padding: 9px; background: #f5f8f9; border: 1px solid #dce4e7; border-radius: 3px; }
.io-edge-item > i { width: 7px; height: 7px; margin-top: 3px; background: var(--edge-color); border-radius: 50%; }
.io-edge-item strong, .io-edge-item span, .io-edge-item small { display: block; }
.io-edge-item strong { overflow: hidden; color: #3e4e57; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.io-edge-item span { margin: 4px 0; color: #0e7077; font: 9px/1.2 monospace; }
.io-edge-item small { color: #849198; font-size: 9px; }
.io-mapping-item { padding: 10px; background: #f8f5fa; border: 1px solid #e1d7e8; border-left: 3px solid #8557b6; }
.io-mapping-item header { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.io-mapping-item strong { overflow: hidden; color: #483453; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.io-mapping-item b { color: #74469a; font: 700 9px/1 monospace; }
.io-mapping-item p { margin: 6px 0; color: #75647c; font-size: 9px; }
.io-mapping-item footer { display: flex; justify-content: space-between; color: #8c7b93; font: 8px/1 monospace; }
.io-no-data { padding: 22px 8px; color: #8a979e; font-size: 11px; text-align: center; }
.io-inspector-footer { display: flex; align-items: center; justify-content: space-between; margin: 0 16px 16px; padding: 10px 0; color: #6b7b83; border-top: 1px solid var(--io-line); font-size: 9px; }
.io-inspector-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.io-inspector-footer i { width: 7px; height: 7px; background: var(--io-positive); border-radius: 50%; }
.io-inspector-footer code { color: #7d8b92; font-size: 8px; }

.io-app.filters-collapsed .io-workspace { grid-template-columns: 0 minmax(440px, 1fr) 330px; }
.io-app.filters-collapsed .io-sidebar { width: 0; min-width: 0; overflow: hidden; border: 0; }
.io-app.filters-collapsed .io-graph-panel::before { position: absolute; z-index: 10; top: 174px; left: 7px; content: "FILTERS"; padding: 7px 9px; color: white; background: var(--io-accent); font-size: 10px; pointer-events: none; writing-mode: vertical-rl; }

@media (max-width: 1180px) {
    .io-workspace { grid-template-columns: 222px minmax(400px, 1fr) 300px; }
    .io-summary { grid-template-columns: repeat(4, minmax(80px, 120px)) minmax(220px, 1fr); }
    .io-summary > div { padding-inline: 14px; }
    .io-app.filters-collapsed .io-workspace { grid-template-columns: 0 minmax(400px, 1fr) 300px; }
}

@media (max-width: 960px) {
    .io-workspace { grid-template-columns: 218px minmax(440px, 1fr); overflow-x: auto; }
    .io-inspector { position: absolute; top: 152px; right: 0; width: 320px; height: calc(100vh - 152px); transform: translateX(calc(100% - 5px)); transition: transform .2s; }
    .io-inspector::before { position: absolute; top: 110px; left: -29px; width: 30px; padding: 9px 6px; content: "INFO"; color: white; background: #14252d; font: 8px/1 monospace; writing-mode: vertical-rl; cursor: pointer; }
    .io-inspector.open { transform: translateX(0); }
    .io-summary { grid-template-columns: repeat(4, 1fr); }
    .io-summary p { display: none; }
    .io-app.filters-collapsed .io-workspace { grid-template-columns: 0 minmax(440px, 1fr); }
}

@media (max-width: 680px) {
    .io-header { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px; }
    .io-brand h1 { font-size: 20px; white-space: normal; }
    .io-header-actions { width: 100%; justify-content: space-between; }
    .io-view-switch { flex: 1; }
    .io-view-switch button { flex: 1; padding-inline: 7px; }
    .io-summary { grid-template-columns: repeat(2, 1fr); }
    .io-summary > div { min-height: 64px; border-bottom: 1px solid var(--io-line); }
    .io-workspace { display: block; height: auto; min-height: 0; overflow: visible; }
    .io-sidebar { max-height: none; border-right: 0; border-bottom: 1px solid var(--io-line); }
    .io-filter-list-types { grid-template-columns: repeat(2, 1fr); }
    .io-graph-panel { grid-template-rows: auto 560px auto; min-height: 620px; }
    .io-graph-toolbar { align-items: flex-start; flex-direction: column; }
    .io-toolbar-actions { align-self: flex-end; }
    .io-inspector { position: relative; top: auto; right: auto; width: 100%; height: auto; max-height: none; border-top: 1px solid var(--io-line); border-left: 0; transform: none; }
    .io-inspector::before { display: none; }
    .io-app.filters-collapsed .io-workspace { display: block; }
    .io-app.filters-collapsed .io-sidebar { display: none; }
    .io-app.filters-collapsed .io-graph-panel::before { top: auto; bottom: 12px; writing-mode: horizontal-tb; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}