:root {
    color-scheme: light;
    --ink: #18181b;
    --muted: #71717a;
    --line: #e4e4e7;
    --soft: #f7f7f8;
    --panel: #ffffff;
    --accent: #2563eb;
    --accent-soft: #eff6ff;
    --danger: #b42318;
    --success: #16794d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.hero { background: #fff; border-bottom: 1px solid var(--line); }
.hero::after { display: none; }
.nav {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
}
.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ink);
    border-radius: 7px;
    font-size: 13px;
}
.nav-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav-link:hover { color: var(--ink); }

.hero-content {
    padding: 72px 0;
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 80px;
    align-items: end;
}
.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
}
h1 {
    margin: 0 0 22px;
    max-width: 680px;
    font-size: clamp(44px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -.055em;
    font-weight: 760;
}
h1 span { color: var(--ink); }
.intro { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.contest-card {
    padding: 24px;
    display: grid;
    gap: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.contest-card strong { font-size: 18px; font-weight: 650; }
.contest-card > span, .contest-card small { color: var(--muted); }
.live-dot { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.live-dot i {
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 7px;
    background: #22a06b;
    border-radius: 50%;
}

.upload-section, .ranking-section { padding: 76px 0; }
.section-heading {
    margin-bottom: 28px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }
.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    color: var(--success);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 14px;
}
.alert.error { color: var(--danger); background: #fff5f4; border-color: #fecaca; }

.upload-form {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}
label > span { display: block; margin-bottom: 8px; color: #52525b; font-size: 13px; font-weight: 600; }
input, select, button { font: inherit; }
input[type="text"], select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 7px;
    outline: none;
}
input[type="text"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.wide { grid-column: 1 / -1; }
.file-drop {
    min-height: 128px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    border: 1px dashed #c7c7cc;
    border-radius: 9px;
    transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.has-file { background: var(--accent-soft); border-color: #93b4f4; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop b { margin-bottom: 6px; color: var(--ink); font-size: 15px; }
.file-drop span { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.submit-button {
    height: 48px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 7px;
    font-weight: 650;
    cursor: pointer;
}
.submit-button:hover { background: #1d4ed8; }
.submit-button span { font-size: 18px; }

.result-card {
    margin-top: 20px;
    padding: 28px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.score-block span { display: block; color: var(--muted); font-size: 12px; }
.score-block strong { display: block; margin-top: 5px; color: var(--ink); font-size: 48px; line-height: 1; letter-spacing: -.04em; }
.result-card dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.result-card dl div { padding-left: 14px; border-left: 1px solid var(--line); }
.result-card dt { color: var(--muted); font-size: 11px; }
.result-card dd { margin: 5px 0 0; font-size: 20px; font-weight: 650; }
.result-card p { grid-column: 1 / -1; margin: 0; padding-top: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

.rules-strip { background: var(--soft); border-block: 1px solid var(--line); }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.rule-grid > div { padding: 24px 28px; display: grid; gap: 4px; border-right: 1px solid var(--line); }
.rule-grid > div:last-child { border-right: 0; }
.rule-grid b { color: #a1a1aa; font-family: ui-monospace, monospace; font-size: 10px; }
.rule-grid span { color: var(--muted); font-size: 12px; }
.rule-grid strong { font-size: 16px; font-weight: 650; }

.ranking-section { padding-bottom: 100px; }
.ranking-head form { display: flex; align-items: center; gap: 10px; }
.ranking-head form label { color: var(--muted); font-size: 12px; }
.ranking-head select { width: 220px; height: 40px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
th { padding: 13px 16px; color: var(--muted); background: #fafafa; text-align: left; font-size: 11px; font-weight: 600; }
td { padding: 17px 16px; border-top: 1px solid var(--line); font-size: 13px; }
tbody tr:hover { background: #fcfcfd; }
.rank { width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted); background: var(--soft); border-radius: 6px; font-size: 11px; font-weight: 650; }
.rank-1 { color: #1d4ed8; background: var(--accent-soft); }
.callsign { display: block; font-size: 15px; letter-spacing: .02em; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.category-tag { padding: 5px 8px; color: #52525b; background: var(--soft); border-radius: 5px; font-size: 11px; white-space: nowrap; }
.score { color: var(--ink); font-size: 16px; }
.empty { padding: 54px; color: var(--muted); text-align: center; }

footer { padding: 28px 0; color: var(--muted); background: #fff; border-top: 1px solid var(--line); }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
footer span { color: var(--ink); font-weight: 650; font-size: 13px; }
footer p { margin: 0; font-size: 11px; }

@media (max-width: 760px) {
    .wrap { width: min(100% - 28px, 1080px); }
    .hero-content { padding: 52px 0; grid-template-columns: 1fr; gap: 30px; }
    h1 { font-size: 45px; }
    .contest-card { max-width: 420px; }
    .upload-section, .ranking-section { padding: 58px 0; }
    .section-heading, .ranking-head { align-items: flex-start; flex-direction: column; }
    .upload-form { padding: 20px; grid-template-columns: 1fr; }
    .upload-form > * { grid-column: 1; }
    .result-card { grid-template-columns: 1fr; }
    .result-card dl { grid-template-columns: 1fr 1fr; }
    .rule-grid { grid-template-columns: 1fr; }
    .rule-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .rule-grid > div:last-child { border-bottom: 0; }
    footer .wrap { align-items: flex-start; flex-direction: column; }
}
