:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #172b43;
  background: #f3f6fa;
  --navy: #12263f;
  --navy-soft: #203a55;
  --teal: #096557;
  --teal-hover: #074f45;
  --teal-soft: #e6f4ef;
  --muted: #526379;
  --line: #dce4ed;
  --white: #fff;
  --alert: #9c3b28;
  --alert-soft: #fff2e8;
  --shadow: 0 10px 32px rgba(18, 38, 63, .075);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .64; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #238b7d;
  outline-offset: 3px;
}
a { color: var(--teal); }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-block-start: 0; }
h1, h2, h3 { line-height: 1.32; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.035em; margin-bottom: .45rem; }
h2 { font-size: 1.18rem; margin-bottom: .4rem; }
h3 { font-size: 1.02rem; margin-bottom: .35rem; }
p { line-height: 1.65; margin-bottom: .7rem; }
[hidden] { display: none !important; }

.skip-link { position: absolute; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-160%); background: white; padding: .6rem; border-radius: .4rem; }
.skip-link:focus { transform: none; }
.loading-screen { min-height: 95vh; display: grid; place-content: center; justify-items: center; gap: 1em; }
.noscript { position: absolute; inset: auto 2rem 2rem; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; border-radius: .68rem; color: #e9faf2; background: #146b61; font-weight: 800; font-size: .87rem; letter-spacing: .07em; }
.brand-name { font-size: 1rem; }
.brand-context { padding-inline-start: .85rem; margin-inline-start: .1rem; border-inline-start: 1px solid var(--line); color: var(--muted); font-size: .83rem; font-weight: 550; letter-spacing: 0; }
.topbar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; padding: .65rem clamp(1rem, 3vw, 2rem); background: var(--white); border-bottom: 1px solid var(--line); }
.top-actions, .user, .actions, .toolbar, .row-between, .subtle-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.top-actions { justify-content: flex-end; }
.user { gap: .55rem; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: #e9eef6; color: var(--navy); font-size: .8rem; font-weight: 800; }
.user-info { line-height: 1.35; }
.user-info b, .user-info small { display: block; }
.user-info b { font-size: .87rem; }
.user-info small { color: var(--muted); font-size: .78rem; }
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: calc(100vh - 4.25rem); }
.side { background: var(--navy); color: #dbe6f2; padding: 1.5rem .9rem; }
.side-content { position: sticky; top: 5.6rem; }
.nav-header { color: #a9bbcf; font-size: .8rem; padding: .15rem .65rem .6rem; margin: 0; }
.nav-link { display: flex; align-items: center; gap: .68rem; margin-bottom: .35rem; width: 100%; padding: .72rem .65rem; text-align: left; border: 0; border-radius: .5rem; background: transparent; color: #e4edf7; font-size: .9rem; }
.nav-link:hover { background: var(--navy-soft); }
.nav-link[aria-current="page"] { background: #29435a; color: white; font-weight: 700; box-shadow: inset 3px 0 #75d0b4; }
.nav-icon { display: grid; place-items: center; inline-size: 1.3rem; block-size: 1.28rem; flex-shrink: 0; line-height: 1; font-size: 1.18rem; }
.side-foot { border-top: 1px solid #34516b; margin: 1.45rem .65rem 0; padding-top: 1rem; color: #beccdd; font-size: .79rem; line-height: 1.65; }
.content { max-width: 93rem; width: 100%; padding: clamp(1.1rem, 3.3vw, 2.65rem); margin-inline: auto; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.32rem; }
.page-head p { margin-bottom: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .65rem; color: var(--muted); font-size: .88rem; }
.row-between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: .83rem; }
.code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.btn, .text-btn { min-height: 2.65rem; border-radius: .55rem; border: 1px solid transparent; padding: .5rem .85rem; font-weight: 650; font-size: .88rem; line-height: 1.5; white-space: nowrap; }
.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--teal-hover); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: #c8d4e1; }
.btn-secondary:hover:not(:disabled) { background: #eff4f9; }
.text-btn { min-height: auto; padding: 0; background: transparent; border: 0; color: var(--teal); text-decoration: underline; text-underline-offset: .22em; white-space: normal; text-align: start; }
.btn-danger { color: var(--alert); background: var(--white); border-color: #e8c0b6; }
.btn-danger:hover:not(:disabled) { background: var(--alert-soft); }
.btn-compact { min-height: 2.2rem; padding: .33rem .6rem; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.metric { background: white; padding: 1.05rem 1.15rem; border: 1px solid var(--line); border-radius: .7rem; }
.metric-label { color: var(--muted); margin-bottom: .45rem; font-size: .88rem; }
.metric-value { font-size: 2rem; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.metric-design { width: .66rem; height: .66rem; border-radius: 50%; background: #537b9a; margin-left: auto; }
.metric-design.review { background: #a87424; }
.metric-design.complete { background: #187766; }
.card { background: white; border: 1px solid var(--line); border-radius: .75rem; margin-bottom: 1rem; padding: 1.12rem; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card-header { padding-bottom: .95rem; }
.card-header p { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
.table th, .table td { padding: .78rem .68rem; border-bottom: 1px solid #e7edf4; vertical-align: top; }
.table thead { background: #f1f5f9; color: #425875; }
.table th { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background-color: #f8fafc; }
.table td:first-child { min-width: 9rem; }
.table .site-cell { min-width: 7rem; white-space: nowrap; }
.table .empty-cell { text-align: center; padding: 2.3rem .75rem; }
.empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 1rem; padding: .24rem .59rem; line-height: 1.3; font-size: .8rem; font-weight: 650; background: #eef2f7; color: #425570; width: fit-content; }
.badge.submitted { background: #f9f0dc; color: #76541b; }
.badge.approved, .badge.locked { background: var(--teal-soft); color: #125f52; }
.badge.returned { background: var(--alert-soft); color: #923c27; }
.notice { padding: .75rem .9rem; border-radius: .5rem; background: #eaf2fb; color: #284962; border: 1px solid #cddff2; margin-bottom: .95rem; font-size: .88rem; line-height: 1.6; overflow-wrap: anywhere; }
.notice.success { background: var(--teal-soft); color: #15594d; border-color: #bdddd2; }
.notice.error { background: #fff3ec; color: #8a351f; border-color: #efc7ad; }
.notice ul { margin: .45rem 0 0; padding-left: 1.2rem; }
.section-nav { display: flex; flex-wrap: wrap; gap: .38rem; border-bottom: 1px solid var(--line); margin: 0 0 1.12rem; padding-bottom: .5rem; }
.section-jumps { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .65rem .8rem; margin-bottom: .9rem; background: #f2f7fa; border-radius: .45rem; }
.tab { border: 1px solid transparent; padding: .54rem .72rem; min-height: 2.62rem; background: transparent; border-radius: .42rem; color: #425875; font-size: .86rem; font-weight: 650; }
.tab:hover { background: #e5edf5; }
.tab[aria-current="true"] { color: var(--teal); background: var(--teal-soft); border: 1px solid #c0e1d5; }
.timepoints { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; margin-bottom: 1rem; }
.timepoints .tab { background: white; border: 1px solid var(--line); }
.timepoints .tab[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: white; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15.2rem, 100%), 1fr)); gap: .9rem 1rem; margin-bottom: .8rem; }
.field { display: grid; align-content: start; gap: .28rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field-label, label { font-weight: 630; font-size: .89rem; color: #273e55; }
.required { color: #a3482c; }
.field-hint { font-size: .78rem; line-height: 1.45; color: var(--muted); }
input, select, textarea { min-height: 2.65rem; border: 1px solid #b9c8d6; border-radius: .47rem; padding: .48rem .62rem; color: #152c43; background-color: white; min-width: 0; width: 100%; }
input[type="checkbox"], input[type="radio"] { min-height: 0; min-width: 1rem; width: 1rem; height: 1rem; vertical-align: middle; accent-color: var(--teal); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #516981 50%), linear-gradient(135deg, #516981 50%, transparent 50%); background-position: calc(100% - 16px) center, calc(100% - 12px) center; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 1.7rem; }
select[multiple] { background-image: none; min-height: 6rem; }
textarea { min-height: 4.7rem; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background-color: #f2f5f8; color: #526379; }
[aria-invalid="true"] { border: 1px solid #b7593d; }
.search-field { width: min(100%, 18rem); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.attachment-actions .form-actions { border-top: 0; padding-top: 0; }
.check-field { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.check-options { display: flex; flex-wrap: wrap; gap: .65rem 1rem; margin-bottom: .25rem; }
.check-options label { padding: .2rem .4rem .2rem 0; }
.record-picker { max-width: 18rem; }
.form-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .9rem; scroll-margin-top: 5.2rem; }
.form-section:focus-visible { outline: 2px solid #238b7d; outline-offset: .25rem; }
.form-section > legend { float: left; width: 100%; margin-bottom: .65rem; font-weight: 700; }
.form-section > .field-grid { clear: both; }
.form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.icp-footer { text-align: center; padding: 1rem 0 .2rem; font-size: .82rem; }
.login-panel:has(.icp-footer) { grid-template-rows: 1fr auto; }

.login { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.login-brand { background: var(--navy); color: white; padding: clamp(1.5rem, 6vw, 6.5rem); display: flex; flex-direction: column; justify-content: center; gap: clamp(2rem, 7vw, 5rem); }
.login-brand .brand-mark { background: #1e786b; }
.login-brand h1 { max-width: 15em; font-size: clamp(2.2rem, 5vw, 4.25rem); line-height: 1.13; margin-bottom: .9rem; }
.login-brand p { color: #c6d8ea; margin: 0; max-width: 30rem; }
.login-panel { display: grid; place-items: center; padding: clamp(1.2rem, 6vw, 6rem); }
.login-card { background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 1rem; padding: clamp(1.2rem, 3vw, 2rem); width: min(100%, 28rem); }
.login-card h2 { font-size: 1.55rem; }
.login-card .field { margin: .95rem 0; }
.login-card .btn { width: 100%; margin-top: .48rem; }
.login-card .login-note { color: var(--muted); font-size: .82rem; margin: 1rem 0 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 11.25rem minmax(0, 1fr); }
  .side { padding-inline: .65rem; }
}
@media (max-width: 750px) {
  .shell { display: block; }
  .side { padding: .38rem .7rem; }
  .side nav { display: flex; flex-wrap: wrap; gap: .18rem; }
  .nav-link { width: auto; margin-bottom: 0; min-height: 2.5rem; padding: .48rem .62rem; }
  .nav-link[aria-current="page"] { box-shadow: inset 0 -2px #75d0b4; }
  .side-foot, .nav-header, .brand-context { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .login { grid-template-columns: 1fr; min-height: 100svh; grid-template-rows: auto 1fr; }
  .login-brand { gap: 1.25rem; }
  .login-brand h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); }
  .topbar { position: static; }
}
@media (max-width: 385px) {
  .avatar { display: none; }
  .topbar { padding-inline: .8rem; }
  .top-actions { gap: .35rem; }
}
