:root {
  color-scheme: light;
  font-family: "Work Sans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  color: #203c37;
  background: #f5f7f5;
  --ink: #193c35;
  --muted: #596e67;
  --line: #d9e3dd;
  --soft: #f4f7f4;
  --primary: #146b54;
  --primary-dark: #0e513f;
  --mint: #dfefe6;
  --radius: 16px;
  --shadow: 0 3px 14px rgb(22 59 44 / 4%);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
:focus-visible { outline: 3px solid #51a68d; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 3px; }
svg { vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.35; }
h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); letter-spacing: -.045em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
h3 { font-size: 1.06rem; }

.appbar {display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px max(5vw,20px); border-bottom:1px solid var(--line); background:white;}
.brand {display:flex; align-items:center; gap:10px; font-size:1.05rem; font-weight:700;}
.brand-mark {display:inline-grid; place-items:center; width:34px; height:34px; color:white; background:#155d49; border-radius:9px;}
.brand-mark svg {width:23px;height:23px;}
.toolbar,.actions,.panel-head,.page-head,.paper-head,.sheet-meta,.gate {display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.page-head,.panel-head,.paper-head {justify-content:space-between;}
.person-picker {display:flex;align-items:center;gap:7px;font-size:.875rem;color:var(--muted);}
.account {position:relative;}
.account>summary {font-size:.9rem;cursor:pointer;}
.account-menu {position:absolute;right:0;z-index:2;top:calc(100% + 12px);padding:6px;white-space:nowrap;border:1px solid var(--line);background:white;border-radius:8px;box-shadow:0 8px 24px #18392b15;display:grid;}
.content {max-width:1060px; margin:0 auto; padding:clamp(28px,5vw,64px) 24px 64px;}
.page-head {margin-bottom:24px;}
.page-head h1 {font-size:clamp(1.6rem,3.2vw,2.25rem);font-weight:640;}
.paper {background:white;border:1px solid var(--line);border-radius:14px;padding:clamp(20px,4vw,44px);box-shadow:0 4px 20px #1b392d05;}
.paper-head {padding-bottom:14px;border-bottom:1px solid var(--line);margin-bottom:16px;}
.paper-head h2 {font-size:1.15rem;}
.sheet-meta {color:var(--muted);font-size:.9rem;}
.sheet-meta .btn {margin-left:auto;}
.paper>section,.paper>.muted,.paper>details,.paper>.gate {margin-top:22px;}
.panel-head {margin-bottom:14px;}
.panel-head h2,.evaluation h2 {font-size:1.12rem;}
.paper h3 {font-size:.96rem;}
.figures {display:flex;gap:clamp(20px,6vw,72px);flex-wrap:wrap;margin:16px 0 22px;}
.figures dt {color:var(--muted);font-size:.875rem;}
.figures dd {margin:2px 0 0;color:var(--primary-dark);font-size:1.65rem;font-weight:640;line-height:1.25;}
.comment {margin:6px 0 12px;white-space:pre-wrap;}
details summary {cursor:pointer;}
.paper details>summary {color:var(--muted);font-size:.88rem;}
details>form {margin-top:12px;}
form>.actions, form>.panel-head, #adjust>.btn {margin-top:16px;}
.activity {border-top:1px solid var(--line);padding-top:14px;}
.gate {justify-content:space-between;}
.content>.notice {margin-bottom:16px;}
.dialog .panel,dialog .panel {margin-top:20px;}
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
th { padding: 11px 12px; background: var(--soft); color: #51675e; font-weight: 580; font-size: .86rem; white-space: nowrap; }
td { overflow-wrap:anywhere; padding: 15px 12px; border-bottom: 1px solid #e5ece6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcf9; }
.metric-grid .numeric { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-grid .row-action { width: 1%; white-space: nowrap; }
.metric-grid .row-action .btn { padding-inline: 8px; }
.metric-grid .metric-name { min-width: 6.5rem; }
.metric-grid .metric-text { white-space: pre-wrap; min-width: 9rem; }
.metric-grid td > input, .metric-grid td > textarea { display: block; width: 100%; }
.metric-grid .goal-row td:first-child { width: 24%; min-width: 10rem; }
.metric-grid td > textarea { min-width: 12rem; min-height: 3.4rem; }
.metric-grid .numeric input { width: 5.5rem; }
.metric-grid .adjustment { background: var(--soft); }
.more-adjustment { display: none; border: 0; border-radius: 4px; background: transparent; color: var(--primary); font-size: 1rem; }
.adjustment:last-child .more-adjustment { display: inline-block; }
.more-adjustment:hover { background: var(--mint); }
.metric-grid tfoot th, .metric-grid tfoot td { background: var(--soft); border-top: 1px solid var(--line); padding-block: 10px; }
.penalty-line { margin: 12px 0 18px; font-size: .92rem; color: #b42318; }
#goals > .form-grid:not(:empty) { margin-bottom: 18px; }
.badge {
  display: inline-flex; align-items: center; vertical-align: middle; white-space: nowrap; border-radius: 999px;
  padding: 3px 10px; background: #eff2f0; color: #52625c; font-size: .81rem; font-weight: 600;
}
.badge.good { background: #e0f2e8; color: #206446; }
.badge.warn { background: #fff0cb; color: #795016; }
.badge.info { background: #e5eff6; color: #365c74; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  padding: 7px 14px; border: 1px solid #c9d8ce; border-radius: 8px; font-size: .9rem; font-weight: 560;
  line-height: 1.45; text-decoration: none; color: var(--ink); background: #fff; transition: background .15s, border-color .15s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: #f0f6f2; border-color: #a4c3b3; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.quiet { color: var(--primary); background: transparent; border-color: transparent; }
.btn.quiet:hover { background: var(--mint); }
.btn.danger { color: #8e3d33; border-color: #e8c6be; background: #fff9f7; }
.grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.form-grid .wide, .form-grid .full { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; font-size: .9rem; font-weight: 560; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  min-width: 0; max-width: 100%; min-height: 40px; padding: 8px 11px;
  background-color: #fff; border: 1px solid #c8d6cd; border-radius: 8px; font-size: .94rem; line-height: 1.5;
}
.field :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) { width: 100%; font-weight: 450; }
select {
  appearance: none; padding-right: 32px; background-repeat: no-repeat;
  background-position: right 12px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%23556c60' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: #73837b; }
.item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.item:first-child { padding-top: 0; }
.item:last-child { border-bottom: 0; }
.muted { color: var(--muted); font-size: .91rem; }
.empty { padding: 30px 16px; border: 1px dashed #cbd9cf; border-radius: 10px; text-align: center; color: var(--muted); background: #fafcf9; }
.notice { padding: 12px 16px; border: 1px solid #c8dece; border-radius: 10px; background: #eef6ee; color: #335c43; }
.notice.error, [role="alert"].error { color: #833d30; background: #fff2ec; border-color: #edc9bc; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tabs button {
  padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .93rem;
}
.tabs button.active, .tabs button[aria-selected="true"] { border-color: var(--primary); color: var(--primary); font-weight: 650; }
.audit { padding-left: 14px; border-left: 2px solid #bdd5c4; color: var(--muted); font-size: .9rem; }
.score { color: var(--primary); font-weight: 680; font-variant-numeric: tabular-nums; }
.login {
  width: min(480px, calc(100% - 32px)); margin: max(8vh, 28px) auto; padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 14px 60px rgb(25 61 42 / 8%);
}
.login > * + * { margin-top: 16px; }
dialog, .dialog { width: min(680px, calc(100% - 32px)); max-height: 88dvh; overflow: auto; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 20px 70px rgb(19 48 39 / 18%); color: var(--ink); }
dialog::backdrop { background: rgb(10 32 27 / 38%); }

@media (max-width: 600px) {
  .appbar {padding:10px 14px;flex-wrap:wrap;}
  .appbar .toolbar {gap:8px;}
  .person-picker span {display:none;}
  .content {padding:26px 12px 44px;}
  .page-head {margin-bottom:15px;}
  .paper {padding:18px 14px;}
  .grid,.form-grid {grid-template-columns:minmax(0,1fr);}
  .figures {gap:20px;}
  td,th {padding-inline:8px;}
  .table-wrap table {min-width:420px;}
}
