:root {
  font-size: 16px;
  --text-size: .875rem;
  --small-text: .75rem;
  --section-size: 1rem;
  --sidebar-width: 15.5rem;
  --header-height: 3.5rem;
  --tabs-height: 2.5rem;
  --background: #f5f6f8;
  --surface: #fff;
  --text: #111827;
  --muted: #667085;
  --line: #e3e7ee;
  --control-line: #d8dee8;
  --primary: #4264f5;
  --primary-hover: #3154dc;
  --selected: #eaf1ff;
  --radius: .25rem;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font: var(--text-size)/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--background); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
input:focus-visible, select:focus-visible { outline: 2px solid #9fc1ff; outline-offset: 1px; }
[hidden] { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.small { width: .875rem; height: .875rem; }
.portal { --nav-width: var(--sidebar-width); display: grid; width: 100%; height: 100%; height: 100dvh; font-size: var(--text-size); grid-template-columns: var(--nav-width) minmax(0, 1fr); grid-template-rows: var(--header-height) minmax(0, 1fr); background: var(--background); }
.portal.is-collapsed { --nav-width: 3.5rem; }
.portal[data-font="large"] { --text-size: 1rem; --small-text: .8125rem; --section-size: 1.125rem; }
.portal[data-font="largest"] { --text-size: 1.125rem; --small-text: .875rem; --section-size: 1.25rem; }
.global-header { grid-column: 1 / -1; display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); border-bottom: 1px solid var(--line); background: var(--surface); z-index: 30; }
.brand { display: flex; align-items: center; gap: .5rem; padding: 0 .625rem; border-right: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.brand img { object-fit: contain; width: 1.875rem; height: 1.625rem; flex: 0 0 auto; }
.brand-name { font-size: .9375rem; letter-spacing: -.02em; font-weight: 650; color: #101828; }
.is-collapsed .brand { justify-content: center; padding: 0; }
.is-collapsed .brand-name { display: none; }
.global-tools { display: flex; justify-content: flex-end; align-items: center; gap: .375rem; padding: 0 .875rem; min-width: 0; }
.global-search { display: flex; align-items: center; gap: .5rem; width: 13.5rem; height: 2rem; border: 1px solid var(--control-line); border-radius: var(--radius); padding: 0 .625rem; margin: 0 .375rem 0 0; background: #fafbfd; color: var(--muted); }
.global-search input { width: 100%; min-width: 0; border: 0; background: transparent; outline: none; font-size: .875rem; }
.global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #eaf3ff; }
input::placeholder { color: #8790a1; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.125rem; height: 2.125rem; border-radius: var(--radius); flex: 0 0 auto; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.125rem; padding: 0 .375rem; white-space: nowrap; border-radius: var(--radius); font-size: .875rem; }
.icon-button:hover, .tool-button:hover, .icon-button[aria-expanded="true"], .tool-button[aria-expanded="true"] { background: #f0f3f7; }
.tool-divider { width: 1px; height: 1.25rem; background: var(--line); }
.notification-trigger { position: relative; margin-right: .125rem; }
.notification-badge { position: absolute; top: -.125rem; right: -.0625rem; background: #e32636; border: 1px solid #fff; border-radius: 1rem; font: 11px/1.0625rem Arial, sans-serif; height: 1.125rem; min-width: 1.125rem; color: #fff; padding: 0 .1875rem; }
.avatar { display: flex; align-items: center; justify-content: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: #eaf3ff; color: var(--primary); overflow: hidden; }
.avatar .icon { fill: currentColor; stroke-width: 1; margin-top: .25rem; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.navigation { flex: 1; min-height: 0; overflow: auto; padding: .5rem .375rem; scrollbar-width: thin; scrollbar-color: #dce2eb transparent; }
.nav-section { margin-bottom: .125rem; }
.nav-item { display: flex; align-items: center; width: 100%; gap: .875rem; min-height: 2.75rem; padding: .5rem .875rem; position: relative; border-radius: var(--radius); text-align: left; white-space: nowrap; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .chevron { width: .875rem; height: .875rem; transition: transform .15s; }
.nav-item[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.nav-item:hover, .nav-item.flyout-open { background: #f2f4f7; }
.nav-item.current, .nav-item.is-owner { color: var(--primary); }
.nav-item.current, .is-collapsed .nav-item.is-owner { background: var(--selected); }
.nav-item.current::before, .is-collapsed .nav-item.is-owner::before { content: ""; position: absolute; left: -.375rem; top: .375rem; bottom: .375rem; width: 3px; background: var(--primary); border-radius: 2px; }
.nav-children { padding: .125rem 0 .5rem; }
.nav-child { padding-left: 3rem; min-height: 2.5rem; }
.collapse-button { display: flex; align-items: center; flex: 0 0 3rem; gap: .875rem; width: 100%; border-top: 1px solid var(--line); padding: 0 1.25rem; text-align: left; white-space: nowrap; }
.collapse-button:hover { background: #f6f8fa; }
.is-collapsed .nav-item { padding: .5rem; justify-content: center; }
.is-collapsed .nav-item .label, .is-collapsed .nav-item .chevron, .is-collapsed .nav-children, .is-collapsed .collapse-button span { display: none; }
.is-collapsed .collapse-button { justify-content: center; padding: 0; }
.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: var(--tabs-height) minmax(0, 1fr); }
.workspace-tabs-row { display: flex; min-width: 0; border-bottom: 1px solid var(--line); background: var(--background); }
.workspace-tabs { display: flex; flex: 1; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.workspace-tabs::-webkit-scrollbar { display: none; }
.workspace-tab { display: flex; align-items: stretch; position: relative; border-right: 1px solid var(--line); flex: 0 0 auto; max-width: 16rem; }
.workspace-tab.active { background: #fff; color: var(--primary); }
.workspace-tab.active::after { content: ""; position: absolute; left: .75rem; right: .75rem; height: 2px; bottom: 0; background: var(--primary); }
.workspace-tab > [role="tab"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 1rem; min-width: 5rem; font-size: var(--text-size); }
.workspace-tab .close-tab { padding: 0 .5rem; color: #626d80; }
.workspace-tab .close-tab:hover { color: #d43a43; background: #f0f2f5; }
.workspace-tab:has(.close-tab) > [role="tab"] { padding-right: .375rem; }
.tabs-list-button { border-left: 1px solid var(--line); width: 2.75rem; height: 100%; border-radius: 0; }
.page-host { padding: 1rem; min-height: 0; min-width: 0; overflow: hidden; }
.page-panel { height: 100%; min-width: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid #dfe4ec; border-radius: .3125rem; padding: 1rem; scrollbar-width: thin; }
.floating-panel { position: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: .375rem; box-shadow: 0 6px 20px #1720331a; z-index: 60; padding: .375rem; overflow-y: auto; overscroll-behavior: contain; }
.nav-flyout { width: 12.5rem; max-height: calc(100dvh - 4rem); }
.flyout-title { padding: .5rem .625rem .625rem; font-weight: 600; }
.flyout-link, .popover-choice { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.5rem; border-radius: var(--radius); padding: .5rem .625rem; text-align: left; overflow-wrap: anywhere; }
.flyout-link:hover, .popover-choice:hover { background: var(--selected); color: var(--primary); }
.flyout-link.current, .popover-choice[aria-checked="true"] { background: var(--selected); color: var(--primary); }
.popover-choice .icon { margin-left: auto; width: 1rem; height: 1rem; }
.popover-choice:disabled { cursor: not-allowed; color: #a2a9b5; background: transparent; }
.action-count { margin-left: auto; padding-left: 1.5rem; font-size: var(--small-text); color: var(--muted); font-variant-numeric: tabular-nums; }
.popover-choice:disabled .action-count { color: inherit; }
.menu-separator { height: 1px; margin: .375rem 0; background: var(--line); }
.tool-popover { min-width: 11rem; max-width: min(24rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 4rem); }
.popover-heading { padding: .5rem .625rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.popover-note { padding: .5rem .625rem; color: var(--muted); font-size: var(--small-text); }
.notice-item { padding: .75rem .625rem; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border: 0; }
.notice-item time { display: block; margin-top: .25rem; font-size: var(--small-text); color: var(--muted); }
.toast { position: fixed; top: 3.75rem; left: 50%; transform: translateX(-50%); z-index: 90; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 20px #1720331a; padding: .625rem 1rem; border-radius: .375rem; max-width: min(32rem, 90vw); }
.help-dialog { width: min(30rem, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: .5rem; color: var(--text); background: #fff; box-shadow: 0 16px 50px #0002; font-size: var(--text-size); }
.help-dialog::backdrop { background: #17203345; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: var(--section-size); margin: 0; }
.dialog-body { padding: .75rem 1.25rem 1.25rem; }
.dialog-body li { margin: .5rem 0; }
.muted { color: var(--muted); }
@media (max-width: 1000px) { .global-tools { gap: .125rem; padding: 0 .5rem; } .global-search { width: 11rem; } }
@media (max-width: 760px) { .global-search { width: 8rem; } .help-button span { display: none; } .global-tools .tool-divider { display: none; } .user-button > span:not(.avatar) { display: none; } .portal:not(.is-collapsed) .global-search { display: none; } }
@media (max-width: 480px) { .global-search { display: none; } .global-tools { gap: 0; } .page-host { padding: .5rem; } .page-panel { padding: .75rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
