:root {
  color-scheme: light;
  --paper: #fff;
  --bg: #f2f5f7;
  --ink: #193036;
  --muted: #53656d;
  --line: #d9e2e6;
  --accent: #006a61;
  --accent-dark: #00534c;
  --accent-pale: #e7f4ef;
  --dark: #113d41;
  --warn: #82410a;
  --warn-bg: #fff4e6;
  --error: #a22e26;
  --radius: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.62; }
p, h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); letter-spacing: -.025em; line-height: 1.22; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }
small { display: block; font-size: .8125rem; }
strong, output, td.score-cell { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #118f7e; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  min-height: 44px;
  border-radius: 8px;
  padding: .48rem .9rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
}
button:hover { border-color: #8daeaa; background: #f7fbfa; }
button:disabled { opacity: .53; cursor: default; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.text-button { border-color: transparent; color: var(--accent); padding-inline: .45rem; }
button.text-button:hover { background: var(--accent-pale); }
label { display: grid; gap: 6px; font-size: .875rem; font-weight: 600; }
input, select, textarea {
  display: block; width: 100%; min-width: 0; min-height: 44px;
  border: 1px solid #cbd9df; border-radius: 8px; padding: .6rem .75rem;
  background: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 400;
}
select { appearance: none; padding-right: 2.1rem; background:
    linear-gradient(45deg, transparent 50%, #53656d 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, #53656d 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat var(--paper); }
textarea { resize: vertical; }
input[type=checkbox] { width: 19px; height: 19px; min-height: auto; accent-color: var(--accent); }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.full { grid-column: 1 / -1; }
.frame { max-width: 1220px; margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2rem); }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header:empty { display: none; }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .85rem; font-weight: 800; line-height: 1.2; }
.brand-symbol { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.brand small { font-weight: 500; margin-top: .2rem; }
.identity { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; font-size: .875rem; }
.identity .badge { white-space: nowrap; }
.nav-strip { border-top: 1px solid var(--line); }
.nav { display: flex; gap: 5px; overflow-x: auto; }
.nav button { border: none; border-radius: 0; background: transparent; padding: .72rem .85rem .6rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.nav button[aria-current=page] { border-color: var(--accent); color: var(--accent); }
#main { outline: 0; }
.page { padding-top: 1.85rem; padding-bottom: 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.35rem; }
.page-head p { margin-top: .4rem; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; gap: .7rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.card-title small { font-weight: 500; }
.empty, .loading { color: var(--muted); padding: 1.15rem; text-align: center; }
.notice { margin-block: .8rem; padding: .65rem .85rem; background: var(--accent-pale); border-radius: 8px; color: #075950; font-size: .875rem; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.notice.error { background: #fff0ee; color: var(--error); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; background: #edf1f3; color: #415357; font-size: .8125rem; font-weight: 650; }
.badge.good { background: var(--accent-pale); color: #075950; }
.badge.draft { background: var(--warn-bg); color: var(--warn); }
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 1.1rem; background: #eaf0f2; }
.auth-panel { display: grid; grid-template-columns: 1fr 1fr; width: min(850px, 100%); border-radius: 18px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 15px 50px #17383d14; }
.auth-intro { background: var(--dark); color: #fff; padding: clamp(1.6rem, 4.2vw, 3.75rem); display: flex; flex-direction: column; gap: 1.65rem; justify-content: center; }
.auth-intro .brand-symbol { background: #d3f1e3; color: var(--dark); width: 42px; height: 42px; }
.auth-intro p { color: #c8dedb; font-size: .95rem; }
.auth-form { padding: clamp(1.5rem, 4vw, 3.2rem); display: grid; gap: .95rem; align-content: center; }
.auth-form h2 { font-size: 1.4rem; }
.auth-form button { width: 100%; }
.auth-form .notice { margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  border: 1px solid var(--line); background: var(--paper); border-radius: 11px; padding: .8rem 1rem;
}
.kpi span { color: var(--muted); font-size: .875rem; }
.kpi strong { font-size: clamp(1.2rem, 3.3vw, 1.72rem); line-height: 1.2; word-break: break-word; }
.kpi.emphasis { background: var(--dark); color: #fff; border-color: var(--dark); }
.kpi.emphasis span, .kpi.emphasis small { color: #d1e3df; }
.table-container { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { text-align: left; padding: .65rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f1f5f6; white-space: nowrap; color: #3b5357; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td.score-cell, td.date { white-space: nowrap; }
td.project-title { min-width: 155px; overflow-wrap: anywhere; }
.filters { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: .7rem; margin-bottom: 1rem; }
.filters.single { grid-template-columns: minmax(0, 250px) auto; justify-content: start; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem; border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .75rem; font-size: .875rem; color: var(--muted); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; align-items: start; }
.form-layout > .live-result { position: sticky; top: 14px; }
.score-panel { background: var(--dark); color: #fff; border: 0; }
.score-panel small { color: #d1e3df; }
.score-panel output, .score-panel .hero-score { display: block; font-size: 3rem; font-weight: 800; line-height: 1.3; margin: .2rem 0; }
.score-panel .unit { font-size: .9rem; font-weight: 500; margin-left: .35rem; }
progress { display: block; width: 100%; height: 7px; margin: .55rem 0; accent-color: #9ed9b1; }
.metric { padding: 1rem 0; border-top: 1px solid var(--line); }
.metric:first-of-type { border-top: 0; padding-top: 0; }
.metric .card-title { margin-bottom: .65rem; }
.metric-result { color: var(--accent); font-size: .875rem; margin-top: .65rem; font-weight: 650; }
.deadline { background: #f1f5f6; color: var(--ink); padding: .55rem .7rem; border-radius: 8px; margin-bottom: .55rem; font-size: .875rem; }
details { margin-top: .8rem; }
details > summary { cursor: pointer; color: #275859; font-weight: 650; font-size: .875rem; }
details .grid-two { margin-top: .7rem; }
details p { margin: .6rem 0; font-size: .875rem; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; padding-top: 1rem; }
.live-mobile { display: none; }
.detail-header-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; margin-top: .8rem; overflow-wrap: anywhere; }
.detail-headline { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; overflow-wrap: anywhere; }
.detail-headline .big { font-size: 1.9rem; font-weight: 800; }
.detail-list { display: grid; gap: .55rem; }
.detail-row { padding: .65rem .85rem; background: #f2f6f6; border-radius: 8px; overflow-wrap: anywhere; }
.detail-row > div { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.detail-row small { margin-top: .2rem; }
@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-layout > .live-result { position: static; }
  .live-mobile {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    position: sticky; bottom: 0; z-index: 2; margin-top: .65rem;
    padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom, 0px));
    background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -4px 18px #17383d15;
  }
}
@media (max-width: 640px) {
  .auth-panel { grid-template-columns: 1fr; }
  .auth-intro { gap: .7rem; }
  .auth-form { gap: .8rem; }
  .header-inner { min-height: 60px; }
  .brand { gap: .5rem; font-size: .95rem; }
  .brand small { display: none; }
  .brand-symbol { width: 31px; height: 31px; }
  .identity .name { display: none; }
  .identity .badge { font-weight: 500; padding-inline: .35rem; }
  .page { padding-top: 1.25rem; }
  .card { padding: 1rem; }
  .grid-two, .detail-header-fields { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .kpi { padding: .7rem .75rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  input[type=date] { max-width: 100%; }
  .form-actions { justify-content: stretch; }
  .form-actions button { flex: 1; }
}
@media print {
  .site-header, .actions, .nav-strip, .live-mobile, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .detail-row { break-inside: avoid; }
  .page { padding: 0; }
}
.detail-list { padding: 0; list-style: none; margin: 0; }
