:root {
    color-scheme: light dark;
    --surface: #f2f4f5;
    --surface-raised: #ffffff;
    --paper: #fffef9;
    --text: #17232e;
    --muted: #66727d;
    --line: #d7dde1;
    --accent: #9d252a;
    --accent-strong: #7d171d;
    --accent-soft: #f6e9e9;
    --gold: #b9922f;
    --gold-deep: #886a1d;
    --radius-card: 18px;
    --radius-control: 10px;
    --shadow: 0 20px 55px rgba(27, 45, 58, 0.10);
    --font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    --font-document: "STKaiti", "KaiTi", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--surface); }

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(157, 37, 42, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
        var(--surface);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0;
}

.school-brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.school-brand img { display: block; width: min(330px, 76vw); height: auto; mix-blend-mode: multiply; }

.query-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
    align-items: center;
    gap: 76px;
    width: min(1120px, calc(100% - 40px));
    min-height: calc(100dvh - 190px);
    margin: 0 auto;
    padding: 20px 0 72px;
}

.section-label {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .18em;
}

.query-intro h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(46px, 7vw, 86px);
    font-weight: 760;
    letter-spacing: -.06em;
    line-height: .98;
}

.intro-copy {
    max-width: 520px;
    margin: 28px 0 34px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.85;
}

.service-facts { margin: 0; border-top: 1px solid var(--line); }
.service-facts div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.service-facts dt { color: var(--muted); font-size: 13px; }
.service-facts dd { margin: 0; font-size: 14px; font-weight: 650; }

.query-panel {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.panel-heading { margin-bottom: 28px; }
.panel-heading h2 { margin: 0 0 6px; font-size: 24px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.query-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field span { font-size: 14px; font-weight: 680; }
.field input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #c8d0d6;
    border-radius: var(--radius-control);
    outline: none;
    background: var(--surface-raised);
    color: var(--text);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: #8b959e; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(157, 37, 42, .12); }

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-control);
    background: var(--accent);
    color: #fffaf7;
    font-weight: 720;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}
.primary-button:hover { background: var(--accent-strong); }
.primary-button:active { transform: translateY(1px) scale(.995); }
.primary-button:focus-visible { outline: 3px solid rgba(157, 37, 42, .25); outline-offset: 3px; }

.privacy-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.alert { margin: -8px 0 22px; padding: 13px 15px; border-radius: var(--radius-control); font-size: 13px; line-height: 1.65; }
.alert-error { border: 1px solid #e3b8ba; background: var(--accent-soft); color: #7b1d22; }
.alert-success { border: 1px solid #a9cfbd; background: #edf8f2; color: #245d42; }

.result-shell { width: min(900px, calc(100% - 32px)); margin: 22px auto 72px; }
.result-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.result-toolbar h1 { margin: 0 0 8px; font-size: 38px; letter-spacing: -.03em; }
.result-toolbar p:not(.section-label) { margin: 0; color: var(--muted); line-height: 1.6; }
.text-link { flex: 0 0 auto; padding-bottom: 3px; border-bottom: 1px solid currentColor; color: var(--accent); text-decoration: none; font-size: 14px; }

.notice-paper {
    position: relative;
    width: min(100%, 720px);
    aspect-ratio: 210 / 297;
    margin: 0 auto;
    overflow: hidden;
    background: var(--paper) url("/assets/images/notice-background.png") center / 100% 100% no-repeat;
    box-shadow: 0 28px 70px rgba(36, 44, 49, .16);
    color: #28241d;
    font-family: var(--font-document);
}

.notice-content { position: relative; z-index: 2; height: 100%; padding: 7.5% 9.5%; }
.notice-number { position: absolute; top: 5.4%; right: 7%; margin: 0; font-family: var(--font-sans); font-size: clamp(9px, 1.5vw, 13px); color: #6f675a; }
.notice-logo { display: block; width: 66%; height: auto; margin: 2% auto 1.5%; }
.notice-paper h2 { margin: 0 0 5%; text-align: center; font-size: clamp(23px, 4.3vw, 39px); letter-spacing: .08em; }
.notice-body { font-size: clamp(13px, 2.1vw, 19px); line-height: 2.05; }
.notice-body p { margin: 0 0 2.3%; }
.notice-body strong { font-weight: 800; }
.notice-identity { padding: 0 .12em; border-bottom: 1px solid #766d5f; font-family: var(--font-sans); font-size: .86em; letter-spacing: .03em; }
.report-line { margin-top: 3.5% !important; }
.notice-seal { position: absolute; right: 7.5%; bottom: 12.8%; z-index: 1; width: 22%; height: auto; opacity: .82; mix-blend-mode: multiply; transform: rotate(-3deg); }
.notice-signature { position: absolute; right: 9.5%; bottom: 17%; z-index: 3; text-align: center; font-size: clamp(12px, 2vw, 18px); line-height: 1.7; }
.notice-signature p { margin: 0; }
.notice-qr { position: absolute; left: 50%; bottom: 4.5%; width: 20%; transform: translateX(-50%); text-align: center; font-family: var(--font-sans); }
.notice-qr img { display: block; width: 100%; height: auto; border: 5px solid #fff; background: #fff; }
.notice-qr p { margin: 2px -50% 0; color: #655f54; font-size: clamp(8px, 1.25vw, 11px); line-height: 1.4; white-space: nowrap; }

.result-actions { display: grid; justify-items: center; gap: 12px; margin: 30px auto 0; }
.download-button { width: min(100%, 340px); }
.result-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.not-admitted-panel { padding: 38px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-raised); }
.not-admitted-panel h2 { margin-top: 0; }
.not-admitted-panel p { margin-bottom: 0; color: var(--muted); }

.site-footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; }

@media (max-width: 820px) {
    .site-header { width: min(100% - 28px, 620px); padding: 20px 0; }
    .query-layout { grid-template-columns: 1fr; gap: 32px; width: min(100% - 28px, 620px); min-height: auto; padding: 24px 0 52px; }
    .query-intro h1 { font-size: clamp(46px, 14vw, 70px); }
    .intro-copy { margin: 22px 0 26px; font-size: 15px; }
    .query-panel { padding: 24px 20px; }
    .result-toolbar { align-items: flex-start; }
}

@media (max-width: 520px) {
    .query-intro h1 { letter-spacing: -.07em; }
    .service-facts div { grid-template-columns: 82px 1fr; }
    .result-shell { width: 100%; margin-top: 8px; }
    .result-toolbar { padding: 0 16px; }
    .result-toolbar h1 { font-size: 32px; }
    .result-toolbar p:not(.section-label) { font-size: 13px; }
    .text-link { font-size: 12px; }
    .notice-paper { width: 100%; box-shadow: none; }
    .notice-content { padding-left: 9%; padding-right: 9%; }
    .notice-paper h2 { margin-bottom: 4%; font-size: clamp(18px, 5.2vw, 23px); }
    .notice-body { font-size: clamp(9px, 2.8vw, 13px); line-height: 1.85; }
    .notice-signature { font-size: clamp(9px, 2.8vw, 12px); }
    .result-actions { padding: 0 16px; }
    .site-footer { display: grid; width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #161b1f;
        --surface-raised: #20262b;
        --text: #edf0f2;
        --muted: #a9b2b9;
        --line: #3b454d;
        --accent: #d06b6e;
        --accent-strong: #bd575b;
        --accent-soft: #412528;
        --shadow: 0 22px 60px rgba(0, 0, 0, .26);
    }
    .field input { border-color: #4b565f; }
    .alert-error { border-color: #7d4548; color: #f0b7b9; }
    .notice-paper { color: #28241d; }
    .primary-button { color: #fffaf7; }
}

@media print {
    .site-header, .result-toolbar, .result-actions, .site-footer { display: none !important; }
    body, .result-shell { margin: 0; background: #fff; }
    .notice-paper { width: 210mm; height: 297mm; box-shadow: none; }
}
