:root {
  color-scheme: light;
  --wine: #78253c;
  --deep: #421725;
  --ink: #28242a;
  --muted: #675f67;
  --surface: #fff;
  --canvas: #f8f5f4;
  --line: #e7ddde;
  --rose: #f8eef0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
.wrap { width: min(1450px, calc(100% - 72px)); margin: 0 auto; }
.masthead { background: linear-gradient(113deg, var(--deep), #712841); color: #fff; }
.masthead .wrap { padding: 20px 0 25px; }
.back-link { color: #f5dee6; font-size: .86rem; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: white; text-decoration: underline; }
.hero { padding-top: 13px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.18; letter-spacing: .055em; }
.hero h1 { font-size: clamp(1.35rem, 3.4vw, 2.8rem); letter-spacing: .025em; }
.company-logo { flex: none; object-fit: contain; }
.hero p { color: #f5dee6; margin-top: 8px; overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: minmax(235px, 285px) minmax(0, 1fr); gap: 22px; margin: 24px 0 40px; align-items: start; }
.right-column { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 20px #4a25390a; min-width: 0; }
.filters, .score-panel, .candidates { padding: 19px 21px; }
.filters { display: grid; gap: 14px; }
.panel-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
h2 { font-size: 1.21rem; line-height: 1.34; }
label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .86rem; font-weight: 600; }
input, select, button { font: inherit; }
input:not([type="checkbox"]), select {
  width: 100%; min-width: 0; min-height: 39px; border: 1px solid #d8ced1; border-radius: 6px;
  padding: 7px 8px; color: var(--ink); background: #fff; font-weight: 400;
}
input[type="checkbox"] { accent-color: var(--wine); width: 16px; height: 16px; margin: 0; }
input:disabled { background: #f6f3f4; }
:focus-visible { outline: 2px solid #a83b59; outline-offset: 2px; }
button { min-height: 34px; color: var(--wine); border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 5px 10px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--rose); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--wine); border-color: var(--wine); color: #fff; min-height: 40px; padding-inline: 15px; font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--deep); }
.text-button { border: 0; min-height: 28px; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { color: var(--muted); font-size: .86rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.range, .pair { display: grid; gap: 7px; align-items: end; }
.pair { grid-template-columns: 1fr 1fr; }
.range { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.range span, .quiet { color: var(--muted); font-size: .81rem; }
.tenure { border-top: 1px solid var(--line); padding-top: 5px; display: grid; gap: 8px; }
.tenure legend { padding-right: 8px; color: var(--ink); }
.category-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 7px; margin-top: 13px; }
.category-tabs button { padding: 7px 6px; min-height: 40px; font-weight: 600; color: var(--ink); }
.category-tabs button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: white; }
.classification-controls:not(:empty) { display: grid; gap: 11px 14px; margin-top: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.classification-controls .category-level { padding-top: 1px; }
.classification-controls .category-level legend { color: var(--ink); }
.classification-controls .category-level.secondary { grid-column: span 2; }
.classification-controls .full { grid-column: 1 / -1; }
.pool-caption { margin-top: 10px; line-height: 1.6; }
summary { cursor: pointer; color: var(--wine); font-weight: 600; }
#score-settings { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
#score-controls { padding-top: 12px; display: grid; gap: 12px; }
.score-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.score-group legend { color: var(--ink); padding: 0 6px; margin: 0; }
.metric-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(188px, 100%), 1fr)); gap: 7px; }
.metric { display: grid; align-content: start; gap: 7px; background: #fbf8f8; border-radius: 5px; padding: 7px; min-width: 0; }
.metric-name { display: flex; align-items: center; gap: 6px; color: var(--ink); overflow-wrap: anywhere; }
.metric label { font-size: .76rem; }
.metric input[type="number"] { min-height: 33px; padding: 4px 6px; }
.score-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.score-actions .primary { flex-shrink: 0; }
.result-heading { padding: 17px 19px 13px; align-items: end; }
.result-heading p { margin-top: 5px; }
.sort-label { display: flex; align-items: center; white-space: nowrap; }
.sort-label select { min-height: 34px; }
.error { margin: 0 19px 10px; padding: 10px; border-radius: 6px; background: #fff1f0; color: #98262e; }
.table-wrap { overflow-x: auto; min-height: 100px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .85rem; }
th { background: var(--rose); color: #632d42; font-weight: 600; text-align: left; white-space: nowrap; }
.score-sort { color: inherit; border: 0; background: transparent; min-height: 0; padding: 0; font-weight: inherit; }
.score-sort::after { content: '↕'; margin-inline-start: 4px; font-size: .8em; opacity: .65; }
th[aria-sort="ascending"] .score-sort::after { content: '↑'; opacity: 1; }
th[aria-sort="descending"] .score-sort::after { content: '↓'; opacity: 1; }
td, th { border-bottom: 1px solid var(--line); padding: 10px 9px; vertical-align: top; }
td:first-child, th:first-child { padding-left: 19px; }
td:last-child, th:last-child { padding-right: 19px; }
td:first-child { min-width: 156px; }
tr:hover td { background: #fefafb; }
.fund-name { color: var(--ink); font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.subtext { display: block; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-chip { display: inline-block; white-space: nowrap; padding: 2px 6px; border-radius: 4px; background: #f0eced; color: #5f555a; font-size: .76rem; }
.status-open { color: #22604a; background: #e9f3ed; }
.status-limited { color: #79561a; background: #fbf0db; }
.status-closed { color: #862a40; background: #fbe9ee; }
.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.row-actions button { min-height: 30px; font-size: .78rem; padding: 2px 6px; }
.row-actions button[aria-pressed="true"] { background: var(--rose); }
.empty { padding: 24px 18px; color: var(--muted); }
.pagination { padding: 12px 18px; display: flex; align-items: center; justify-content: end; gap: 10px; font-variant-numeric: tabular-nums; font-size: .84rem; }
.counter { background: var(--rose); color: var(--wine); border-radius: 14px; padding: 1px 7px; font-size: .79rem; }
#candidates { list-style: none; padding: 0; margin: 10px 0; }
#candidates li { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; gap: 8px; }
dialog { max-width: min(720px, calc(100% - 28px)); max-height: 88vh; width: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
dialog::backdrop { background: #2c1423a0; }
.close { float: right; font-size: 1.16rem; }
#detail-content h2 { margin-right: 40px; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin: 14px 0; }
.details-grid dt { color: var(--muted); font-size: .82rem; }
.details-grid dd { margin-top: 4px; overflow-wrap: anywhere; }
.detail-section { margin: 16px 0; }
.detail-section h3 { margin-bottom: 6px; font-size: 1rem; }
.detail-section ul { margin: 0; padding-left: 18px; }
.detail-link { color: var(--wine); }
@media (max-width: 980px) {
  .wrap { width: calc(100% - 36px); }
  .workspace { grid-template-columns: 224px minmax(0, 1fr); gap: 14px; }
  .filters, .score-panel, .candidates { padding: 14px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 24px); }
  .workspace { grid-template-columns: minmax(0, 1fr); margin-top: 13px; }
  .masthead .wrap { padding: 13px 0 18px; }
  .category-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .classification-controls:not(:empty) { grid-template-columns: 1fr; }
  .classification-controls .category-level.secondary { grid-column: auto; }
  input:not([type="checkbox"]), select { font-size: 16px; }
  .result-heading { padding: 13px 11px; }
  .sort-label { display: grid; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
    padding: 12px; border-top: 1px solid var(--line);
  }
  tbody tr:nth-child(odd) { background: #fcf9fa; }
  tbody td, tbody td:first-child, tbody td:last-child { padding: 0; min-width: 0; border: 0; }
  tbody td:first-child, tbody td:last-child { grid-column: 1 / -1; }
  tbody td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
  tbody td:first-child .fund-name { font-size: .95rem; }
  tbody td:first-child .subtext { margin-top: 2px; }
  .row-actions { justify-content: flex-end; }
  .row-actions button { min-height: 34px; padding-inline: 9px; }
  .score-actions { align-items: flex-start; flex-direction: column; }
}

.login-frame { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { display:grid; width:min(390px,100%); gap:16px; padding:26px; }
.login-brand { display:flex; align-items:center; gap:8px; }
.login-brand .company-logo { width:clamp(50px, 14vw, 68px); height:auto; aspect-ratio:1; }
.login-card h1 { font-size:clamp(1.15rem, 4.5vw, 1.5rem); line-height:1.35; letter-spacing:.015em; }
.login-card label { display:grid; gap:6px; }
.screen-session { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom:18px; font-size:14px; }
.screen-session a { color:inherit; }
.screen-session button { padding:5px 12px; }
.screen-data-status { margin:.4rem 0 0; font-size:14px; }
.screen-data-status:empty { display:none; }
.fund-link { display:block; padding:0; text-align:left; color:inherit; font:inherit; font-weight:700; border:0; background:none; }
.fund-link:hover { text-decoration:underline; }
.score-radar { display:block; width:min(100%,360px); margin:8px auto; overflow:visible; }
.score-radar text { fill:currentColor; font:600 14px system-ui,sans-serif; }
.radar-grid { stroke:#8c9298; stroke-opacity:.55; fill:none; }
.radar-value { fill:var(--wine); fill-opacity:.2; stroke:var(--wine); stroke-width:2; }
.radar-marker { fill:var(--wine); }
.metric-details { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.metric-details section { padding:12px; border:1px solid #bac9cb; border-radius:8px; }
.metric-details h4 { margin:0; }
.metric-details dl { margin-bottom:0; }
.metric-details dl div { display:flex; justify-content:space-between; gap:8px; padding:5px 0; }
.metric-details dd { margin:0; font-variant-numeric:tabular-nums; }
@media(max-width:650px) { .metric-details { grid-template-columns:1fr; } }
