:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #d6dde6;
    --text: #18212f;
    --muted: #667085;
    --primary: #1f4b7f;
    --primary-dark: #17395f;
    --accent: #dbe7f3;
    --success: #e7f6ec;
    --success-text: #1f6b3b;
    --error: #fdecec;
    --error-text: #a33a3a;
    --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #0f1720;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
}

.brand {
    display: inline-block;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.top-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.page-main {
    padding: 28px 0 40px;
}

.site-footer {
    background: #111927;
    color: rgba(255, 255, 255, 0.74);
    margin-top: 40px;
}

.hero-panel,
.section-card,
.entry-card,
.record-card,
.question-bank-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 38px;
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.hero-panel h1,
.section-heading h1 {
    margin: 12px 0;
    font-size: 34px;
    line-height: 1.25;
}

.hero-panel p,
.section-heading p,
.content-block p,
.entry-card p,
.record-card p,
.question-bank-card p {
    color: var(--muted);
}

.stats-row,
.summary-grid,
.entry-grid {
    display: grid;
    gap: 16px;
}

.stats-row {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 26px;
}

.stat-card,
.summary-item {
    padding: 18px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.stat-card strong,
.summary-item strong {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
}

.entry-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.entry-card {
    padding: 24px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.entry-card:hover {
    transform: translateY(-3px);
    border-color: #b9c8d8;
}

.entry-card h2,
.question-bank-card h2,
.record-card h2,
.content-block h2 {
    margin-top: 0;
}

.section-card {
    padding: 28px;
    margin-bottom: 24px;
}

.narrow-card {
    width: min(820px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.split-heading,
.action-row,
.card-head,
.record-card,
.exam-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field span {
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #c8d2df;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.field textarea {
    resize: vertical;
}

.field-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 34px;
}

.field-checkbox input {
    width: auto;
}

.full-span {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.compact-actions {
    align-self: end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: #c9d3df;
}

.alert,
.empty-state {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success);
    color: var(--success-text);
    border-color: #b8dfc5;
}

.alert-error {
    background: var(--error);
    color: var(--error-text);
    border-color: #f1c1c1;
}

.inline-form {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.grow-field {
    flex: 1;
}

.list-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.record-card,
.question-bank-card {
    padding: 22px;
}

.record-side {
    min-width: 130px;
    text-align: right;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
}

.tag,
.meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--primary-dark);
    border: 1px solid #cdd8e4;
    font-size: 13px;
    font-weight: 700;
}

.tag-dark {
    background: #1c2c40;
    color: #fff;
    border-color: #1c2c40;
}

.exam-panel {
    padding: 22px;
}

.exam-meta {
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.question-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    background: #fff;
}

.question-head {
    margin-bottom: 20px;
}

.content-block {
    padding: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 16px;
}

.image-wrap {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #eef2f7;
    margin-bottom: 16px;
}

.preview-image {
    max-width: 420px;
}

.score-form {
    margin-top: 18px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f8fafc;
    color: #334155;
}

.action-links {
    white-space: nowrap;
}

.action-links a {
    color: var(--primary);
    margin-right: 12px;
    font-weight: 700;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
}

.config-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.config-summary .stat-card {
    text-align: center;
}

.config-summary .stat-card span {
    color: var(--muted);
    font-size: 14px;
}

.station-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.station-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-soft);
}

.station-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.station-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-required {
    background: #e7f6ec;
    color: #1f6b3b;
    border-color: #b8dfc5;
}

.tag-draw {
    background: #fef3e2;
    color: #8a5a00;
    border-color: #f0d8a8;
}

.config-form .add-row {
    margin-top: 20px;
    padding: 18px;
    background: var(--panel-soft);
    border: 1px dashed var(--line);
    border-radius: 14px;
}

.config-form .add-row h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.add-row-fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.add-row-fields .field {
    min-width: 160px;
}

.input-sm {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #c8d2df;
    border-radius: 10px;
    font: inherit;
}

.input-md {
    width: 200px;
    padding: 8px 10px;
    border: 1px solid #c8d2df;
    border-radius: 10px;
    font: inherit;
}

.belong-stations {
    color: var(--muted);
    font-size: 14px;
}

.station-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.empty-hint {
    color: var(--muted);
    font-style: italic;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-item:hover {
    border-color: #b9c8d8;
    background: #eef2f7;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-item .tag {
    padding: 2px 8px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .input-md {
        width: 100%;
    }

    .header-inner,
    .footer-inner,
    .split-heading,
    .record-card,
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel h1,
    .section-heading h1 {
        font-size: 28px;
    }

    .record-side {
        text-align: left;
    }
}
