:root {
    color-scheme: light;
    font: 15px/1.55 "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
    --ink: #142442;
    --muted: #516580;
    --blue: #1559cf;
    --line: #dbe6f6;
    --wash: #f4f8ff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; color: var(--ink); background: var(--wash); }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.48rem); line-height: 1.2; }
h2 { font-size: 1.18rem; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button, .button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #cddcf2;
    border-radius: .57rem;
    padding: .43rem .7rem;
    min-height: 2.38rem;
    background: white;
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
}
button:hover, .button:hover { background: #edf5ff; }
.primary { border-color: var(--blue); color: white; background: var(--blue); }
.primary:hover { background: #0e48b2; }
input, select, textarea { min-height: 2.38rem; max-width: 100%; padding: .4rem .55rem; border: 1px solid #cbdaf0; border-radius: .53rem; background: #fff; }
textarea { resize: vertical; }
input[type="number"] { width: 5rem; }
input[type="checkbox"] { min-height: 0; margin: 0; accent-color: var(--blue); }
:focus-visible { outline: 3px solid #3777db; outline-offset: 2px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip:focus { position: fixed; top: .6rem; left: .6rem; z-index: 5; padding: .55rem 1rem; background: white; }

.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: 14rem;
    padding: 1.4rem 1.05rem;
    background: #fff;
    border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.13rem; font-weight: 800; }
.brand-mark { display: grid; flex: none; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .73rem; background: #e6efff; }
.brand-mark img { display: block; width: 60%; height: 60%; object-fit: contain; }
.sidebar nav { display: grid; gap: .34rem; margin-top: 1.75rem; }
.sidebar nav a { padding: .58rem .78rem; border-radius: .56rem; color: #344966; font-weight: 600; }
.sidebar nav a:first-child, .sidebar nav a:hover { color: #164da8; background: #eaf2ff; }
.sidebar-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding: .75rem .25rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.quiet { border-color: transparent; color: #244c89; }
.admin-main { margin-left: 14rem; padding: clamp(1.3rem, 3.8vw, 3.2rem); }
.page-header { padding: 1.35rem 1.6rem; margin-bottom: 1.15rem; border: 1px solid #d6e5fa; border-radius: 1.2rem; background: radial-gradient(ellipse at 85% 10%, #dceaff, transparent 65%), #fff; }
.page-header p, .panel-heading p { margin-top: .35rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.15rem; }
.stats > div, .panel, .secret-panel { border-radius: .9rem; border: 1px solid var(--line); background: #fff; }
.stats > div { min-width: 0; padding: .85rem 1.05rem; }
.stats dt { color: var(--muted); }
.stats dd { font-size: 1.85rem; font-weight: 780; font-variant-numeric: tabular-nums; }
.panel, .secret-panel { padding: 1.1rem; margin-bottom: 1rem; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: .95rem; }
.inline, .row-actions { display: flex; gap: .38rem; align-items: center; }
.row-actions { flex-wrap: wrap; }
.row-details > summary { padding: .36rem .4rem; color: #244c89; font-weight: 600; }
.row-details > div { padding: .4rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 37rem; text-align: left; }
th, td { padding: .61rem .62rem; border-bottom: 1px solid #e5edf8; white-space: nowrap; }
thead th { color: #354c6a; background: #f3f7fd; }
tbody tr:last-child > * { border-bottom: none; }
tbody tr:hover { background: #fbfdff; }
.empty { text-align: center; color: var(--muted); padding: 1.15rem; }
.tag { display: inline-flex; padding: .18rem .5rem; border-radius: 2rem; background: #f0f3f9; color: #4a5e7a; font-weight: 600; }
.tag.active { color: #106556; background: #e3f7f0; }
.tag.pending { color: #7c4c13; background: #fff3d9; }
.tag.disabled { color: #a3474e; background: #ffecef; }
.notice-editor { display: grid; gap: .58rem; max-width: 54rem; }
.notice-editor label:not(.check), .login-card label { display: grid; gap: .25rem; color: #344966; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: .33rem; padding-right: .5rem; }
.notice-list { margin-top: 1rem; border-top: 1px solid var(--line); }
.notice-list details { border-bottom: 1px solid var(--line); padding: .65rem 0; }
.notice-list summary span { margin-left: .6rem; color: var(--muted); }
.notice-list details .notice-editor { padding-top: .65rem; }
.messages, .error { padding: .65rem .8rem; margin-bottom: 1rem; border-radius: .65rem; background: #e5f3ff; color: #224d88; }
.error { background: #fff0ef; color: #9b303b; }
.secret-panel { border-color: #a9c8fb; }
.secret-panel p { color: var(--muted); margin-block: .22rem .55rem; }
.secret-panel textarea { display: block; width: min(28rem, 100%); font-family: ui-monospace, Consolas, monospace; }

.login-page { display: grid; min-height: 100svh; align-items: center; justify-items: center; padding: 1rem; background: radial-gradient(ellipse at 50% 25%, #fff, #e1eeff); }
.login-card { width: min(100%, 27rem); padding: clamp(1.25rem, 5vw, 2.4rem); background: white; border: 1px solid #d3e3fa; border-radius: 1.2rem; box-shadow: 0 22px 50px #244d9417; }
.login-card h1 { margin: 1.35rem 0 1rem; font-size: 1.8rem; }
.login-card form { display: grid; gap: .77rem; }
.login-card form .primary { margin-top: .2rem; }

@media (max-width: 55rem) {
    .sidebar { position: static; width: 100%; padding: .8rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar nav { display: flex; flex-wrap: wrap; margin-top: .55rem; }
    .sidebar nav a { padding: .42rem .52rem; }
    .sidebar-footer { padding-top: .4rem; margin-top: .34rem; }
    .admin-main { margin-left: 0; padding: .9rem; }
}
@media (max-width: 34rem) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .panel { padding: .82rem; }
    .panel-heading > .inline { flex-wrap: wrap; }
}
