/* ===== IMC 2026 报名系统（手机/电脑自适应） ===== */
* { box-sizing: border-box; }

:root {
    --primary: #2b4acb;
    --primary-dark: #1e3799;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #dfe3ec;
    --error: #c0392b;
    --error-bg: #fdecea;
    --radius: 12px;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 55, 153, .25);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .5px; }
.lang-switch a {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    font-size: .95rem;
    padding: 2px 4px;
}
.lang-switch a.active { color: #fff; font-weight: 700; text-decoration: underline; }
.lang-switch span { color: rgba(255, 255, 255, .5); }

/* ---------- Title & type cards ---------- */
.page-title {
    text-align: center;
    font-size: 1.45rem;
    margin: 28px 0 18px;
}

.type-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.type-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    position: relative;
    min-height: 92px;
}
.type-card.active {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(43, 74, 203, .15);
}
a.type-card,
a.type-card:link,
a.type-card:visited,
a.type-card:hover,
a.type-card:active { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
a.type-card * { text-decoration: none; }
a.type-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(43, 74, 203, .12); }
.type-card.disabled { opacity: .55; background: #fafbfe; }
.type-name { font-weight: 600; font-size: .95rem; }
.type-desc { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.type-due {
    margin-top: 8px;
    font-size: .72rem;
    font-weight: 600;
    color: #0077b6;
    background: #e6f4ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    padding: 4px 10px;
    display: inline-block;
}
.type-deadline {
    margin-top: 8px;
    font-size: .72rem;
    font-weight: 600;
    color: #c2410c;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 6px;
    padding: 4px 10px;
    display: inline-block;
}
.badge {
    display: inline-block;
    margin-top: 8px;
    font-size: .72rem;
    color: var(--primary-dark);
    background: #e8edff;
    border-radius: 999px;
    padding: 2px 10px;
}

/* ---------- Form card ---------- */
.form-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(31, 36, 48, .06);
}
.form-card h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--primary-dark); }
.required-hint { color: var(--muted); font-size: .85rem; margin: 0 0 18px; }

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px 18px;
    margin: 0 0 18px;
}
legend {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 0 8px;
    font-size: .95rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.grid-2 .field:last-child,
fieldset > .field:last-child { margin-bottom: 0; }

label { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.req { color: var(--error); }
.field-note { color: var(--muted); font-size: .8rem; margin-top: 5px; font-weight: 400; }

input, select {
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 74, 203, .15);
}
input.is-invalid, select.is-invalid { border-color: var(--error); }

/* 年龄组：只读（由 DOB 自动选择） */
.readonly-select {
    background: #f0f3fb;
    color: #374151;
    cursor: default;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: .92rem;
}
.alert-error {
    background: var(--error-bg);
    border: 1px solid #f5c6c0;
    color: var(--error);
}
.alert-error ul { margin: 8px 0 0; padding-left: 20px; }
.alert-success {
    background: #eafaf1;
    border: 1px solid #b8e8cf;
    color: #1e7d47;
}

/* ---------- Payment ---------- */
.payment-box { background: #fbfcff; }
.fee-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.fee-title { font-weight: 600; }
.fee-amount {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.pay-methods-title { font-weight: 600; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-size: .78rem;
    background: #eef1fa;
    border: 1px solid var(--border);
    color: #374151;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.fee-note { color: var(--muted); font-size: .85rem; margin: 12px 0 16px; }

.btn-primary {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #8b97c9; cursor: wait; }
.btn-loading { display: none; }
.is-submitting .btn-text { display: none; }
.is-submitting .btn-loading { display: inline; }

/* ---------- Result pages ---------- */
.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 36px 28px;
    margin: 32px 0;
    text-align: center;
    box-shadow: 0 2px 12px rgba(31, 36, 48, .06);
}
.result-icon { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.result-card h1 { font-size: 1.4rem; margin: 0 0 10px; }
.result-detail {
    display: inline-block;
    text-align: left;
    margin: 16px auto 0;
    background: #f7f9fe;
    border-radius: 10px;
    padding: 14px 22px;
    font-size: .95rem;
}
.result-detail div { margin: 4px 0; }
.result-detail strong { color: var(--primary-dark); }
.result-card .btn-primary { max-width: 320px; margin-top: 22px; }
.text-muted { color: var(--muted); }
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid #c7d0ee;
    border-top-color: var(--primary);
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    padding: 24px 0 32px;
}

/* ---------- 手机端 ---------- */
@media (max-width: 720px) {
    .page-title { font-size: 1.2rem; }
    .type-cards { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; gap: 0; }
    .form-card { padding: 16px 12px; }
    fieldset { padding: 12px; }
    .fee-row { flex-direction: column; }
    .fee-amount { font-size: 1.6rem; }
}
