:root {
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #202c26;
  background: #f5f7f5;
  font-synthesis: none;
  --ink: #202c26;
  --muted: #586660;
  --line: #e2e9e4;
  --green: #267052;
  --soft: #e9f4ec;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.45rem; padding: .46rem .88rem; white-space: nowrap; border: 1px solid #dbe4de;
  border-radius: .56rem; color: var(--ink); background: #fff; text-decoration: none; font-size: .875rem; cursor: pointer;
}
button:hover:not(:disabled), .button:hover { background: #f2f7f3; border-color: #bdd2c5; }
button:disabled { opacity: .5; cursor: default; }
input:not([type=checkbox]), select, textarea {
  min-width: 0; min-height: 2.45rem; padding: .49rem .7rem; border-radius: .48rem;
  border: 1px solid #dbe4de; background: #fff; color: var(--ink); font-size: .875rem;
}
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--green); height: 1rem; width: 1rem; }
input::placeholder, textarea::placeholder { color: #63746b; }
input:focus, select:focus, textarea:focus { outline: 2px solid #68a886; border-color: transparent; outline-offset: 1px; }
select {
  appearance: none; padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, #50635a 50%), linear-gradient(135deg, #50635a 50%, transparent 50%);
  background-position: calc(100% - 14px) 53%, calc(100% - 10px) 53%; background-size: 4px 4px;
  background-repeat: no-repeat;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 2.3vw, 2.45rem); letter-spacing: -.045em; line-height: 1.26; }
h2 { font-size: 1.1rem; line-height: 1.4; }
h3 { font-size: 1rem; }
small { display: block; font-size: .8rem; color: var(--muted); }
a { color: var(--green); }
.loading { padding: 2rem; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar {
  background: #132c24; color: #dcece1; display: flex; flex-direction: column;
  padding: 1.5rem .9rem .9rem; min-height: 100vh; height: 100vh; position: sticky; top: 0; overflow: auto;
}
.sidebar button { border: 0; background: transparent; color: inherit; justify-content: flex-start; }
.sidebar button:hover:not(:disabled) { background: #224538; }
.sidebar .brand { font-size: 1.22rem; font-weight: 740; letter-spacing: .05em; line-height: 1.2; gap: .7rem; align-self: flex-start; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.42rem; height: 2.42rem;
  border-radius: .68rem; background: #9be2ad; color: #163328; font-weight: 850; font-size: 1.4rem;
}
.brand-accent { color: #9be2ad; }
.brand small, .sidebar-foot small { color: #adcaB9; font-weight: 430; letter-spacing: 0; margin-top: .23rem; }
.nav-caption { margin: 2.25rem .86rem .55rem; font-size: .78rem; color: #a5c0b0; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav button { min-height: 2.7rem; font-size: .93rem; gap: .65rem; }
.sidebar .current { background: #285641; color: #f0fff2; font-weight: 700; }
.nav-icon { width: 1rem; font-size: 1.02rem; color: #a9e7bb; text-align: center; }
.side-tree { display: grid; gap: .1rem; }
.side-tree button { min-height: 2.1rem; font-size: .86rem; }
.side-tree .selected { background: #224538; color: #bef5cb; }
.side-tree .depth-1, .category-list .depth-1 { padding-left: 1rem; }
.side-tree .depth-2, .category-list .depth-2 { padding-left: 1.75rem; }
.side-tree .depth-3, .category-list .depth-3 { padding-left: 2.5rem; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: 1rem .55rem .2rem; font-size: .89rem; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; width: 2.1rem; height: 2.1rem; background: #2b5948; }
.topbar {
  height: 4.1rem; border-bottom: 1px solid var(--line); background: #fff; display: flex;
  align-items: center; justify-content: space-between; padding: 0 clamp(1.1rem, 3vw, 3rem); color: var(--muted); font-size: .88rem;
}
.topbar span { margin: 0 .65rem; color: #75877c; }
.topbar strong { color: var(--ink); }
.workspace { max-width: 1600px; margin: auto; padding: 2.1rem clamp(1.1rem, 3vw, 3rem) 2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-head p { color: var(--muted); margin-top: .55rem; font-size: .93rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.primary { background: #246548; color: #fff; border-color: #246548; font-weight: 650; }
.primary:hover:not(:disabled) { background: #194e38; border-color: #194e38; }
.ai-button { background: #eff7ed; color: #225b40; border-color: #dcebdc; font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .93rem; margin-bottom: 1.15rem; }
.stats > div, .panel { background: #fff; border: 1px solid var(--line); border-radius: .75rem; min-width: 0; }
.stats > div { display: grid; gap: .61rem; padding: 1rem 1.18rem; border-top: 3px solid #a8d5b3; }
.stats > div:last-child { border-top-color: #bacfc5; }
.stats span { color: var(--muted); font-size: .875rem; }
.stats b { font-size: 1.78rem; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.panel-head, .section-head { display: flex; align-items: center; justify-content: space-between; min-height: 3.2rem; gap: .75rem; }
.panel-head { padding: .7rem 1.15rem; }
h2 span { font-size: .78rem; color: var(--muted); font-weight: 500; margin-left: .25rem; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: .53rem; padding: 0 1.15rem .85rem; }
.panel.padded .filters { padding: 0 0 .85rem; }
.search { position: relative; display: block; flex: 1 1 13rem; max-width: 23rem; }
.search span { position: absolute; inset: .45rem auto auto .68rem; color: var(--muted); font-size: 1.18rem; line-height: 1; }
.search input { width: 100%; padding-left: 2rem; }
.filters select { max-width: 13rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .87rem; }
th, td { padding: .78rem .72rem; border-bottom: 1px solid #ebefec; }
th { font-weight: 650; color: #4a5c51; background: #f2f6f3; border-top: 1px solid #eaf0ec; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 1.15rem; }
th:last-child, td:last-child { padding-right: 1.15rem; }
td small { margin-top: .25rem; }
tbody tr:hover { background: #f8fbf9; }
td strong { font-weight: 680; }
.category-cell { color: #506158; min-width: 8rem; }
.code { font-family: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace; font-weight: 650; letter-spacing: -.015em; }
.link { min-height: auto; padding: 0; color: #246548; border: 0; background: transparent; }
.link:hover:not(:disabled) { text-decoration: underline; background: transparent; }
.status { display: inline-block; border-radius: 1rem; padding: .23rem .54rem; white-space: nowrap; font-size: .8rem; }
.enabled { background: #e4f3e9; color: #225d3e; }
.disabled { background: #eef0ef; color: #505e57; }
.table-foot { min-height: 3.4rem; display: flex; justify-content: space-between; align-items: center; padding: .45rem 1.15rem; color: var(--muted); font-size: .85rem; }
.table-foot button { min-height: 1.9rem; width: 2rem; padding: .2rem; }
.page-index { margin: 0 .7rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.negative { color: #9b392e; }
.split { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); gap: .9rem; align-items: start; }
.category-list { padding-bottom: .75rem; }
.category-list > button { border: 0; width: 100%; justify-content: start; }
.category-list > .selected { background: var(--soft); color: var(--green); }
.padded { padding: 1.14rem; margin-bottom: .9rem; }
.padded > h2 { margin-bottom: 1rem; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
label:not(.check,.search,.upload,.upload-inline) { display: grid; gap: .32rem; color: #46594e; font-size: .87rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .72rem; margin-bottom: .85rem; }
.param-grid, .expanded, .audit { padding: .72rem; border: 1px solid var(--line); border-radius: .56rem; margin-bottom: .65rem; }
.param-grid strong { display: block; margin-bottom: .6rem; }
.check-row, .line { display: flex; align-items: center; gap: .55rem .85rem; flex-wrap: wrap; margin: .55rem 0; }
.check { display: inline-flex; align-items: center; gap: .3rem; color: #43584c; white-space: nowrap; font-size: .86rem; }
.upload { display: grid; justify-items: start; gap: .48rem; border: 1px dashed #a9c8b5; border-radius: .6rem; padding: 1.1rem; background: #f7fbf8; }
.upload input { padding: 0; }
.upload-inline { position: relative; overflow: hidden; }
.upload-inline input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-inline:focus-within { outline: 2px solid #68a886; }
.attachment-list { padding-left: 1.2rem; }
.attachment-list li { margin-bottom: .4rem; }
.attachment-list img { display: block; width: min(100%, 190px); max-height: 140px; object-fit: contain; object-position: left; margin: .5rem 0; }
.veil { position: fixed; inset: 0; z-index: 10; display: flex; justify-content: flex-end; background: #10241d66; }
.drawer {
  width: min(680px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column;
  box-shadow: -12px 0 38px #10241d27; min-width: 0;
}
.drawer header, .drawer footer { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 1.3rem; }
.drawer footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.drawer-body { flex: 1; overflow: auto; padding: 1rem 1.2rem; }
.icon { min-height: 1.8rem; width: 1.8rem; padding: 0; font-size: 1.17rem; }
.tabs { display: flex; overflow: auto; border-bottom: 1px solid var(--line); padding: 0 .65rem; }
.tabs button { border: 0; border-radius: 0; border-bottom: 2px solid transparent; }
.tabs .active { border-color: var(--green); color: var(--green); font-weight: 670; }
.alert { color: #843a33; background: #fcf0ed; border: 1px solid #f4cfc4; padding: .65rem .8rem; border-radius: .48rem; margin-bottom: .75rem; white-space: pre-line; font-size: .9rem; }
.drawer > .alert { margin: .7rem 1.2rem 0; }
.alert .icon { float: right; min-height: 1.45rem; }
.candidate { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .1rem; border-bottom: 1px solid var(--line); }
.expanded { display: grid; gap: .4rem; }
.audit summary { cursor: pointer; }
.audit span { color: var(--muted); font-size: .82rem; }
.audit pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f1f6f2; padding: .6rem; }
.ai-veil { z-index: 20; }
.ai-drawer { width: min(425px, 100%); }
.ai-mode { margin-bottom: .75rem; color: var(--green); font-weight: 680; }
.ai-result { margin-top: 1rem; }
.ai-drawer form button { margin-top: .65rem; }
.toast { position: fixed; z-index: 30; bottom: 1.05rem; right: 1.05rem; background: #163c2d; color: #fff; border-radius: .55rem; padding: .7rem .95rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(ellipse at top left, #2d5b48, #142e26 55%); }
.login-card { width: min(100%, 420px); background: #fff; padding: 2.2rem; border-radius: 1rem; box-shadow: 0 18px 72px #12231d66; }
.login-brand { display: flex; align-items: center; gap: .6rem; color: #265d43; font-size: 1.3rem; font-weight: 760; margin-bottom: 1.5rem; }
.login-card h1 { font-size: 1.85rem; }
.login-card p { margin: .5rem 0 1.3rem; color: var(--muted); }
.login-card label { margin-bottom: .85rem; }
.login-card .primary { width: 100%; margin-top: .25rem; }
@media (max-width: 950px) {
  .shell { grid-template-columns: 175px minmax(0, 1fr); }
  table { min-width: 770px; }
  .sidebar { padding-inline: .55rem; }
}
@media (max-width: 640px) {
  .shell { display: block; }
  .sidebar { min-height: 0; height: auto; position: static; padding: .52rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav button { min-height: 2rem; padding-inline: .5rem; font-size: .84rem; }
  .sidebar .brand { padding: .2rem .52rem; }
  .sidebar .nav-caption, .side-tree, .sidebar-foot { display: none; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .workspace { padding-top: 1.05rem; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .split { grid-template-columns: 1fr; }
  .category-list { max-height: 14rem; overflow: auto; }
}
