:root {
    color-scheme: light;
    font-family: Inter, "Microsoft YaHei UI", "PingFang SC", sans-serif;
    color: #172c29;
    background: #f6f8f6;
    line-height: 1.6;
    --ink: #143d35;
    --action: #116050;
    --line: #d5ded9;
    --muted: #53675f;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--action); text-underline-offset: .2em; }
a:hover { color: #073b30; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid #267d9c;
    outline-offset: 3px;
}
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h1, h2 { color: var(--ink); line-height: 1.25; }
h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
h2 { font-size: 1.35rem; }
.shell { width: min(1056px, calc(100% - 3rem)); margin: 0 auto; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.top-bar, .site-nav, .brand, .section-heading, .service-link, .button {
    display: flex;
    align-items: center;
}
.top-bar { min-height: 72px; justify-content: space-between; gap: 1.4rem; }
.site-nav { gap: 1.4rem; font-size: .94rem; }
.site-nav a, .brand { text-decoration: none; }
.brand { gap: .7rem; color: var(--ink); font-weight: 700; font-size: 1.2rem; }
.brand-mark {
    width: 1.7rem;
    height: 1.7rem;
    border: 5px solid var(--action);
    border-right-width: 9px;
    border-top-width: 9px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 5px;
}
.nav-button {
    display: inline-block;
    padding: .42rem .92rem;
    color: var(--action);
    background: white;
    border: 1px solid #99ada3;
    border-radius: .35rem;
}
.nav-button:hover { background: #eef4ef; }
.main-content { padding-block: clamp(1.5rem, 5vw, 3.7rem) 5rem; }
.welcome {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.2rem);
    border-radius: .8rem;
    background: #174c41;
    color: #eff7f1;
}
.welcome::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 35%;
    height: 150%;
    top: -22%;
    right: -9%;
    border: 2rem double #548176;
    border-radius: 45%;
    transform: rotate(-30deg);
    opacity: .55;
}
.welcome h1 { font-size: clamp(2rem, 4vw, 3.4rem); color: white; }
.welcome p { max-width: 35rem; margin: .9rem 0 1.65rem; }
.button {
    width: fit-content;
    gap: 1.2rem;
    justify-content: center;
    min-height: 2.75rem;
    padding: .55rem 1.35rem;
    border: 0;
    border-radius: .35rem;
    font-weight: 650;
    text-decoration: none;
}
.light { color: #163d32; background: #e1f6d8; }
.light:hover { background: white; }
.primary { color: white; background: var(--action); }
.primary:hover { background: var(--ink); }
.section-heading { gap: 1rem; flex-wrap: wrap; margin: 2.4rem 0 1rem; }
.section-heading p, .hint, .field-help { color: var(--muted); font-size: .88rem; }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.service-link {
    justify-content: space-between;
    padding: 1.45rem 1.6rem;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: white;
    color: var(--ink);
    text-decoration: none;
}
.service-link:hover { border-color: var(--action); }
.service-link strong { font-size: 1.15rem; }
.service-link small { display: block; color: var(--muted); }
.link-arrow { font-size: 1.4rem; }
.page-heading { border-bottom: 1px solid var(--line); padding-bottom: 1.6rem; }
.page-heading p, .intro { color: var(--muted); margin-top: .65rem; }
.form-panel, table, .empty-state { background: white; border: 1px solid var(--line); }
.form-panel {
    width: min(100%, 32rem);
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 2.6rem);
    border-radius: .7rem;
}
.form-panel h1 { font-size: 1.8rem; }
.fields { display: grid; gap: 1.25rem; margin-top: 1.8rem; }
.fields label { display: block; margin-bottom: .32rem; font-weight: 600; }
.fields input:not([type=checkbox]):not([type=hidden]) {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #8da099;
    border-radius: .32rem;
    color: inherit;
    background: white;
}
.field-help { display: block; margin-top: .25rem; }
.fields .checkbox { display: flex; gap: .6rem; align-items: center; font-weight: 500; }
.checkbox input { width: 1.1rem; height: 1.1rem; accent-color: var(--action); }
.fields .button { width: 100%; }
.validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary-errors, .field-validation-error { color: #a32721; }
.validation-summary-errors ul { margin: 0; padding-left: 1.3rem; }
.fields .input-validation-error { border-color: #a32721 !important; }
.form-foot { margin-top: 1.3rem; }
.hint { border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: 1rem; }
.back-link { display: inline-block; margin-bottom: 1.4rem; }
.notice, .empty-state { padding: 1.15rem 1.3rem; border-radius: .4rem; }
.notice { margin-bottom: 1.5rem; background: #e2f3e2; border-left: 4px solid var(--action); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
thead { background: #eaf0eb; }
tbody th { overflow-wrap: anywhere; font-weight: 500; }
td:last-child, th:last-child { width: 9.5rem; }
.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 4; top: .5rem; left: .5rem; padding: .5rem; background: white; }
.case-panel, .case-feedback {
    margin: 1.3rem 0;
    padding: clamp(1.2rem, 3vw, 2rem);
    background: white;
    border: 1px solid var(--line);
    border-radius: .65rem;
}
.case-feedback { background: #fff7e9; border-left: 4px solid #aa742e; }
.case-feedback p { margin-top: .6rem; }
.case-heading, .case-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.case-heading { justify-content: space-between; }
.case-heading h1, .case-table th, .case-facts dd, .material-link { overflow-wrap: anywhere; }
.case-status { border-radius: 1rem; background: #e1f3e8; color: #174c41; padding: .25rem .9rem; }
.case-status[data-status="Correction"], .case-status[data-status="Rejected"] { background: #fff1d9; color: #764c17; }
.case-fields, .case-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1.8rem; }
.case-fields .full-field, .case-facts .full-field { grid-column: 1 / -1; }
.case-fields .button { width: fit-content; }
.case-fields textarea, .case-fields select, .case-filter input, .case-filter select {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #8da099;
    border-radius: .32rem;
    color: inherit;
    background: white;
    font: inherit;
}
.case-fields textarea { resize: vertical; }
.case-fields textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #267d9c; outline-offset: 3px; }
.case-fields input[readonly] { background: #f0f3f1; }
.case-facts { margin: 1.2rem 0 0; }
.case-facts dt, .history-meta { font-size: .9rem; color: var(--muted); }
.case-facts dd { margin: .2rem 0 0; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.case-filter { align-items: end; }
.case-filter label { display: block; margin-bottom: .25rem; }
.case-filter > div:first-child { flex: 1 1 14rem; }
.case-filter a { padding: .55rem 0; }
.case-table { overflow-x: auto; }
.case-history { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.case-history li { border-top: 1px solid var(--line); padding: 1rem 0; }
.case-history li:last-child { padding-bottom: 0; }
.case-history h3 { margin: 0; font-size: 1.05rem; }
.history-meta, .history-snapshot, .material-link { margin-top: .4rem; }
.material-link { display: block; width: fit-content; }
.history-snapshot summary, .archive-edit summary { cursor: pointer; color: var(--action); }
.archive-edit summary { font-weight: 650; }
.dashboard-refresh {
    color: var(--action);
    background: white;
    border: 1px solid #99ada3;
}
.dashboard-refresh:hover { background: #eef4ef; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.15rem;
    margin-top: 1.5rem;
}
.dashboard-card {
    grid-column: span 3;
    min-width: 0;
    padding: clamp(1.1rem, 2.5vw, 1.65rem);
    background: white;
    border: 1px solid var(--line);
    border-radius: .65rem;
}
.dashboard-visits { grid-column: span 2; }
.dashboard-repairs { grid-column: span 4; }
.dashboard-card header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; }
.dashboard-card header a, .dashboard-note { font-size: .85rem; }
.dashboard-key, .dashboard-states { display: grid; gap: .8rem; }
.dashboard-key {
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    padding: .9rem 1rem;
    margin: 1rem 0;
    background: #eff5f0;
    border-radius: .35rem;
}
.dashboard-states { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.dashboard-visits .dashboard-states { grid-template-columns: 1fr; }
.dashboard-repairs .dashboard-states { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-card dt, .dashboard-note { color: var(--muted); }
.dashboard-card dt { font-size: .86rem; }
.dashboard-card dd { margin: .1rem 0 0; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-key dd { font-size: 2rem; line-height: 1.15; }
.dashboard-states dd { font-size: 1.35rem; }
.dashboard-note { margin-top: .8rem; }
@media (max-width: 840px) {
    .dashboard-card { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    .shell { width: calc(100% - 2rem); }
    .top-bar { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .8rem; }
    .site-nav { gap: .8rem; }
    .services { grid-template-columns: 1fr; }
    .case-fields, .case-facts { grid-template-columns: 1fr; }
    .dashboard-states, .dashboard-repairs .dashboard-states { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
