:root {
    color-scheme: light;
    --page: #f5f7fb;
    --surface: #fff;
    --text: #18253c;
    --muted: #54657d;
    --border: #dce4ef;
    --accent: #254bc0;
    --accent-dark: #1b3893;
    --accent-light: #e9efff;
    --error: #a52b36;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover, .link-button:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid #6788f2;
    outline-offset: 3px;
}

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
    max-width: 1120px;
    min-height: 68px;
    padding: 12px 24px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.brand { color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -0.025em; }
.header-inner nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 0.875rem; }
.header-inner nav a, .link-button { text-decoration: none; color: var(--muted); }
.link-button { padding: 0; font: inherit; border: 0; background: transparent; cursor: pointer; }

.layout { max-width: 840px; margin: auto; padding: 56px 24px 72px; }
.layout.compact { max-width: 510px; }
.layout.wide { max-width: 1120px; }
.page-heading { margin-bottom: 24px; }
h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 4.5vw, 2.55rem); line-height: 1.25; letter-spacing: -0.025em; }
h2, .heading-label { margin: 0; font-size: 1.125rem; font-weight: 700; }
p { margin: 0; }
.page-heading p, .muted { color: var(--muted); }
.panel {
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(31 58 107 / 4%);
}
.type-selector {
    display: flex;
    gap: 5px;
    width: fit-content;
    padding: 4px;
    margin-bottom: 24px;
    border-radius: 10px;
    background: var(--page);
}
.type-selector a {
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.925rem;
    font-weight: 650;
    text-decoration: none;
}
.type-selector a[aria-current] { background: var(--accent-light); color: var(--accent-dark); }
.stack { display: grid; gap: 20px; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 600; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { padding: 0; margin: 0 0 8px; font-weight: 650; }
legend .muted { font-size: 0.875rem; font-weight: 400; }
fieldset .field { font-size: 0.875rem; color: var(--muted); }
input:not([type="hidden"]), textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #bbc9dc;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
}
textarea { resize: vertical; line-height: 1.55; }
input[aria-invalid], textarea[aria-invalid] { border-color: var(--error); }
.error { color: var(--error); font-size: 0.875rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.actions p { font-size: 0.875rem; overflow-wrap: anywhere; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--accent-dark); color: white; }
.notice { margin: 0 0 18px; padding: 12px 15px; background: var(--accent-light); border-radius: 8px; color: var(--accent-dark); }
.result { display: grid; justify-items: start; gap: 10px; }
.result .button { margin-top: 8px; }
.result-icon { background: var(--accent-light); color: var(--accent); border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; }
.reference { font-family: ui-monospace, monospace; font-size: 0.9em; }
.table-panel { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.pager { margin-top: 16px; display: flex; gap: 16px; }
.back { display: inline-block; margin-bottom: 12px; }
.details { display: grid; gap: 8px; margin: 0; }
.details div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 8px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.user-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-gap { margin-top: 18px; }
.reply + .reply { border-top: 1px solid var(--border); padding-top: 16px; }
@media (max-width: 580px) {
    .header-inner { padding-inline: 16px; }
    .layout { padding: 34px 16px 48px; }
    .grid-two { grid-template-columns: 1fr; }
    .details div { grid-template-columns: 1fr; gap: 0; }
}
