:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  color: #16263a;
  background: #f4f7fb;
  --ink: #16263a;
  --muted: #53667c;
  --border: #dce5ef;
  --nav: #122640;
  --primary: #1758a7;
  --primary-hover: #104787;
  --surface: #fff;
  --wash: #f4f7fb;
  --soft-blue: #eaf3ff;
  --positive: #197451;
  --danger: #a33142;
  --radius: 13px;
  --shadow: 0 10px 28px rgba(25, 51, 83, .08);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid #5a92d3; outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.4vw, 2.3rem); letter-spacing: -.025em; line-height: 1.3; }
h2 { font-size: 1.15rem; line-height: 1.4; }
h3 { font-size: 1rem; line-height: 1.5; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.eyebrow { font-weight: 700; color: var(--primary); letter-spacing: .08em; font-size: .78rem; }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.skip-link { position: absolute; top: .5rem; left: .5rem; transform: translateY(-150%); z-index: 20; background: white; padding: .5rem; }
.skip-link:focus { transform: none; }
.boot { min-height: 100vh; display: grid; place-content: center; gap: 1rem; justify-items: center; color: var(--muted); }
.boot-logo, .brand-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #dcecff; color: #174c88; font-weight: 800; flex: 0 0 auto; }
.icon { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; vertical-align: middle; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.08rem; font-weight: 800; }
.brand-logo .icon { width: 22px; height: 22px; }
.brand small { color: #adc3df; display: block; margin-top: .18rem; font-weight: 500; font-size: .72rem; letter-spacing: .08em; }
.workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #fff; display: flex; flex-direction: column; gap: 2rem; padding: 1.55rem 1.05rem 1.1rem; position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { margin-inline: .28rem; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar .section-label { color: #adc3df; font-size: .74rem; letter-spacing: .1em; padding: 0 .75rem .45rem; }
.nav-button { display: flex; align-items: center; gap: .7rem; border: 0; padding: .8rem .75rem; background: transparent; color: #c3d4eb; border-radius: 9px; text-align: left; white-space: nowrap; }
.nav-button:hover { background: #203b5c; color: white; }
.nav-button[aria-current="page"] { background: #2a4a70; color: #fff; font-weight: 700; }
.sidebar-foot { margin-top: auto; color: #adc3df; font-size: .79rem; display: flex; gap: .55rem; align-items: center; padding-inline: .35rem; }
.workarea { min-width: 0; }
.topbar { min-height: 64px; padding: .75rem clamp(1rem, 3vw, 2rem); background: #fff; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar select { max-width: 230px; }
.account-area { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.account-area .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 185px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e9f2ff; color: var(--primary); font-weight: 800; flex: 0 0 auto; }
.page { max-width: 1600px; margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); display: grid; gap: 1.05rem; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.page-intro p { margin-top: .45rem; }
.stack { display: grid; gap: 1rem; min-width: 0; }
.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.between { justify-content: space-between; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .42rem; padding: .47rem .78rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 650; text-decoration: none; white-space: nowrap; }
.button:hover { background: #edf4fb; }
.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.primary:hover { background: var(--primary-hover); color: #fff; }
.quiet { background: transparent; border-color: transparent; }
.danger { color: var(--danger); }
.link-button { border: 0; background: transparent; padding: .1rem 0; color: var(--primary); text-align: left; font-weight: 700; line-height: 1.55; text-decoration: underline; text-underline-offset: .18em; white-space: normal; }
.link-button:hover { color: var(--primary-hover); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 6px rgba(27, 50, 75, .025); min-width: 0; }
.panel-body, .panel-head { padding: 1.05rem 1.15rem; }
.panel-head { border-bottom: 1px solid #e8eef6; }
.panel-head p { margin-top: .25rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .85rem; }
.stat { display: grid; grid-template-columns: 1fr auto; gap: .3rem .7rem; padding: .95rem 1.1rem; }
.stat strong { display: block; font-size: 1.65rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-mark { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: var(--primary); background: var(--soft-blue); }
.stat:nth-child(2) .stat-mark { color: #1a7657; background: #e5f5ee; }
.stat:nth-child(3) .stat-mark { color: #78571d; background: #f9f1df; }
.chip { display: inline-flex; align-items: center; min-height: 24px; gap: .28rem; border-radius: 999px; background: #edf2f7; color: #3b5069; padding: .15rem .53rem; font-weight: 650; font-size: .78rem; line-height: 1.4; }
.chip.blue { background: #e7f1ff; color: #154b89; }
.chip.green { background: #e3f5ec; color: #176748; }
.chip.orange { background: #fff1d9; color: #785618; }
.chip.red { background: #fce9ed; color: #942b40; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.result-head { display: grid; gap: .8rem; }
.result-head label { min-width: 0; }
.group-picker { max-width: 250px; }
.filter-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.search-field { position: relative; flex: 1 1 215px; min-width: 160px; max-width: 430px; }
.search-field .icon { position: absolute; left: .65rem; top: .66rem; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 2.35rem; }
.field { display: grid; gap: .4rem; min-width: 0; }
.field > span, .field > label { font-weight: 700; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 38px; padding: .45rem .62rem; background: #fff; color: var(--ink); border: 1px solid #cbd8e6; border-radius: 8px; }
input[type="checkbox"] { accent-color: var(--primary); width: 1rem; height: 1rem; }
textarea { resize: vertical; min-height: 92px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem 1rem; }
.span-two { grid-column: 1 / -1; }
.manual-project-rows:empty { display: none; }
fieldset { border: 1px solid var(--border); border-radius: 8px; min-width: 0; margin: 0; padding: .48rem .7rem .62rem; }
legend { color: var(--muted); font-size: .86rem; font-weight: 650; padding-inline: .3rem; }
.group-fields { padding: 0; border: 0; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th { background: #f7f9fc; color: #425770; font-size: .81rem; text-align: left; font-weight: 700; }
td, th { padding: .74rem .9rem; border-bottom: 1px solid #e9eff6; vertical-align: middle; }
td { line-height: 1.6; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faff; }
.project-cell { min-width: 210px; }
.project-cell button { text-decoration: none; }
.project-cell button:hover { text-decoration: underline; }
.project-cell p { margin-top: .18rem; font-size: .8rem; }
.table-meta { border-top: 1px solid #e8eef6; padding: .65rem 1.15rem; }
.two-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .74fr); gap: 1rem; align-items: start; }
.detail-card { min-width: 0; align-self: start; }
.detail-card h2, .detail-card a { overflow-wrap: anywhere; }
.detail-card .section-title { margin-bottom: .38rem; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem .75rem; }
.facts div { padding: .55rem .65rem; background: #f4f7fb; border-radius: 8px; min-width: 0; }
.facts dt { color: var(--muted); font-size: .78rem; }
.facts dd { margin: .18rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.line-list { display: grid; gap: .48rem; padding: 0; margin: 0; list-style: none; }
.line-list li { padding: .55rem 0; border-bottom: 1px solid #e9eff6; min-width: 0; overflow-wrap: anywhere; }
.line-list li:last-child { border-bottom: 0; }
.blank { text-align: center; padding: 2rem 1rem; display: grid; gap: .5rem; justify-items: center; }
.blank .blank-mark { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--soft-blue); margin-bottom: .15rem; }
.blank .blank-mark .icon { width: 23px; height: 23px; }
.blank p { max-width: 46ch; }
.callout { padding: .8rem .95rem; border-radius: 9px; border: 1px solid #cbdcf0; background: #eef6ff; color: #264b75; line-height: 1.6; overflow-wrap: anywhere; }
.callout.error { border-color: #edc7d0; background: #fff2f4; color: #862b3d; }
.callout.warning { border-color: #efdcac; background: #fff7e7; color: #715522; }
.connection-status { padding: .5rem clamp(1rem, 3vw, 2rem); background: #fff7e7; color: #715522; border-bottom: 1px solid #efdcac; }
.notice { display: none; position: fixed; bottom: 1.15rem; right: 1.15rem; max-width: min(430px, calc(100vw - 2.3rem)); z-index: 10; border-radius: 10px; background: #12304c; color: #fff; box-shadow: var(--shadow); padding: .8rem 1rem; line-height: 1.55; }
.notice.visible { display: block; }
.notice.error { background: #8e2f43; }
.graph-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: .8rem; }
.graph-view-switch { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.graph-project { background: #f5f9fe; border: 1px solid #d7e5f4; border-radius: 11px; padding: .9rem; }
.graph-project ul { margin-top: .4rem; }
.graph-diagram { margin: 0; overflow-x: auto; border: 1px solid #dce9f7; background: #f7faff; border-radius: 11px; padding: .65rem; }
.graph-diagram svg { width: 100%; min-width: 500px; display: block; }
.graph-diagram line { stroke: #94adca; stroke-width: 1.4; }
.graph-diagram line.company-edge { stroke: #28735d; stroke-width: 2.1; stroke-dasharray: 5 3; }
.graph-diagram text { font-size: 12px; font-weight: 600; fill: #274565; }
.graph-diagram rect { fill: #fff; stroke: #a9c4e2; }
.graph-diagram .project-node rect { fill: #225996; stroke: #225996; }
.graph-diagram .project-node text { fill: white; }
.graph-diagram a { cursor: pointer; }
.graph-diagram a:is(:hover, :focus-visible) .company-node rect { fill: var(--soft-blue); stroke: var(--primary); stroke-width: 2; }
.company-link { overflow-wrap: anywhere; }
.company-evidence summary { color: var(--primary); cursor: pointer; }
.company-evidence p { margin-top: .35rem; }
.company-distribution { padding: .75rem; border: 1px solid #e4edf7; border-radius: 9px; }
.company-distribution .chips { list-style: none; padding: 0; }
.company-distribution summary { color: var(--primary); cursor: pointer; }
.edge-card { display: grid; gap: .35rem; padding: .72rem .82rem; background: #f7f9fd; border: 1px solid #e4edf7; border-radius: 9px; }
.edge-card .edge-label { font-weight: 750; overflow-wrap: anywhere; }
.edge-card p { overflow-wrap: anywhere; }
.edge-card details summary { cursor: pointer; color: var(--primary); margin-top: .15rem; }
.edge-card details p { margin-top: .35rem; }
.account-card { max-width: 680px; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, .95fr) minmax(390px, 1.05fr); }
.auth-side { display: flex; min-height: 100%; flex-direction: column; position: relative; overflow: hidden; justify-content: space-between; padding: clamp(2rem, 6vw, 5rem); color: #fff; background: #122945; }
.auth-side::before, .auth-side::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid #507caf; width: 420px; height: 420px; right: -170px; bottom: -210px; pointer-events: none; }
.auth-side::after { width: 580px; height: 580px; right: -250px; bottom: -290px; opacity: .5; }
.auth-side .pitch { max-width: 440px; padding: 3rem 0; z-index: 1; }
.auth-side .pitch h1 { font-size: clamp(2rem, 4.8vw, 3.65rem); }
.auth-side .pitch p { color: #d5e4f6; margin-top: 1rem; font-size: 1.04rem; }
.auth-side .eyebrow { color: #b7d5fb; margin-bottom: .6rem; }
.auth-side .inline { color: #bed4f0; font-size: .86rem; }
.auth-main { display: grid; align-content: center; justify-items: center; padding: clamp(1rem, 4vw, 3rem); }
.auth-card { width: min(100%, 430px); padding: clamp(1.2rem, 3vw, 2rem); display: grid; gap: 1.1rem; box-shadow: var(--shadow); }
.auth-card header p { margin-top: .45rem; }
.auth-card .action-link { border: 0; background: none; padding: .3rem 0; color: var(--primary); text-decoration: underline; text-underline-offset: .2em; }
.auth-card .mfa-entry { word-break: break-all; }

@media (max-width: 1150px) {
  .workspace { grid-template-columns: 184px minmax(0,1fr); }
  .sidebar { padding-inline: .85rem; }
  .two-pane { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .workspace { display: flex; flex-direction: column; }
  .sidebar { position: sticky; z-index: 5; top: 0; width: 100%; height: auto; gap: .45rem; padding: .68rem .65rem .4rem; }
  .sidebar .brand { font-size: .98rem; }
  .sidebar .brand-logo { width: 30px; height: 30px; }
  .sidebar .brand-logo .icon { width: 17px; height: 17px; }
  .sidebar .brand small, .sidebar-foot, .sidebar .section-label { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-button { font-size: .85rem; padding: .52rem .54rem; gap: .28rem; }
  .nav-button .icon { width: 1rem; height: 1rem; }
  .topbar { min-height: 54px; gap: .55rem; padding: .45rem .7rem; }
  .topbar select { max-width: 46vw; }
  .account-area .email { display: none; }
  .page { padding: .85rem; }
  .page-intro { align-items: flex-start; flex-wrap: wrap; }
  .stats { gap: .45rem; }
  .stat { padding: .62rem; grid-template-columns: 1fr; gap: .28rem; }
  .stat strong { font-size: 1.15rem; }
  .stat-mark { display: none; }
  .stat .small { font-size: .73rem; }
  .panel-body, .panel-head { padding: .85rem; }
  #feed-results table, #feed-results tbody { display: block; }
  #feed-results thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  #feed-results tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; padding: .7rem .85rem; border-bottom: 1px solid var(--border); }
  #feed-results tr:last-child { border-bottom: 0; }
  #feed-results td { padding: 0; border: 0; }
  #feed-results .project-cell { min-width: 0; }
  #feed-results td:nth-child(even) { text-align: right; }
  #feed-results .chip { white-space: nowrap; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { gap: .6rem; padding: 1.2rem; }
  .auth-side .pitch { padding: .85rem 0 .45rem; }
  .auth-side .pitch h1 { font-size: 1.85rem; }
  .auth-side .pitch p, .auth-side .inline { display: none; }
  .auth-main { padding: .9rem; }
}
@media (max-width: 430px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid .span-two { grid-column: auto; }
  .group-picker { max-width: 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
