/* ==========================================================================
   比赛成绩查询 + A4 证书系统
   移动优先；断点 768px / 1024px
   ========================================================================== */

:root {
    --brand: #1f3a68;
    --brand-strong: #16294a;
    --brand-soft: #e8eef8;
    --gold: #c8a15a;
    --gold-soft: #f6edd9;
    --teal: #1d8a8f;
    --ink: #1a2436;
    --text: #33405a;
    --muted: #6b7891;
    --line: #e2e8f2;
    --surface: #ffffff;
    --bg: #f4f7fb;
    --danger: #b4433f;
    --success: #1f7a55;
    --warning: #9a6b1e;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(16, 32, 64, .06);
    --shadow-soft: 0 2px 8px rgba(16, 32, 64, .05);
    --maxw: 1080px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    /* 全站整体放大到 120%（打印时复位） */
    zoom: 1.2;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fd 0%, #f2f5fb 42%, #f7f9fd 100%);
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.35;
    font-weight: 700;
}

p {
    margin: 0 0 10px;
}

a {
    color: var(--brand);
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 18px;
}

.muted {
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 卡片 ---------- */

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

/* ---------- 按钮 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn svg {
    flex: 0 0 auto;
}

.btn-primary {
    background: linear-gradient(120deg, #1f3a68, #2a5588);
    color: #fff;
    box-shadow: 0 6px 14px rgba(31, 58, 104, .18);
}

.btn-primary:hover {
    background: #183153;
}

.btn-outline {
    background: #fff;
    color: var(--brand);
    border-color: #c9d6ea;
}

.btn-outline:hover {
    background: var(--brand-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: #f4f7fc;
    color: var(--brand);
}

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

.btn-danger:hover {
    background: #9c3632;
}

.btn-danger-ghost {
    background: #fff;
    color: var(--danger);
    border-color: #eccfce;
}

.btn-danger-ghost:hover {
    background: #fdf3f2;
}

.btn-sm {
    padding: 8px 13px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
}

.btn-block-mobile {
    width: 100%;
}

/* ---------- 表单 ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.label-hint {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d6dfec;
    border-radius: 10px;
    background: #fbfcff;
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

input[type="file"] {
    padding: 9px 11px;
    background: #f8fafd;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 84px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #7f9cc4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 58, 104, .1);
}

.field-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.form-grid-tight {
    gap: 12px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ---------- 提示条 ---------- */

.alert {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 13.5px;
    line-height: 1.65;
}

.alert strong {
    display: block;
    margin-bottom: 3px;
}

.alert-success {
    background: #edf8f1;
    border-color: #cfe9d9;
    color: #1d6a49;
}

.alert-error {
    background: #fdf0ef;
    border-color: #f2d3d1;
    color: #a33c38;
}

.alert-warning {
    background: #fdf6e7;
    border-color: #f0e0bc;
    color: var(--warning);
}

.alert-info {
    background: #eef4fc;
    border-color: #d7e4f5;
    color: #2a4e7d;
}

/* ---------- 前台头部 ---------- */

.site-header {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(118deg, #1c355f 0%, #26497e 52%, #1b6d74 100%);
    padding: 14px 0 16px;
}

.site-header::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 161, 90, .22), rgba(200, 161, 90, 0) 68%);
    pointer-events: none;
}

.site-header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    z-index: 1;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .12);
    color: #ffe3ac;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.site-brand-text strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-brand-text small {
    font-size: 10.5px;
    letter-spacing: .16em;
    color: rgba(255, 255, 255, .7);
    white-space: nowrap;
}

.site-nav a {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: rgba(255, 255, 255, .88);
    font-size: 12.5px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

/* ---------- 前台主体 ---------- */

.public-main {
    padding-top: 24px;
    padding-bottom: 48px;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 2px 22px;
}

.eyebrow {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .26em;
    color: var(--teal);
    text-transform: uppercase;
}

.hero h1 {
    margin: 8px 0 8px;
    font-size: 26px;
    letter-spacing: .02em;
    color: var(--brand);
}

.hero-desc {
    margin: 0;
    max-width: 54ch;
    font-size: 13.5px;
    color: var(--muted);
}

.hero-badge {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 1px solid #d9e3f2;
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    color: var(--brand);
    font-size: 12.5px;
    letter-spacing: .12em;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
}

.hero-badge .dot {
    color: var(--gold);
}

.query-card {
    padding: 18px;
}

.query-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.query-hint {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
    text-align: center;
}

/* ---------- 结果 ---------- */

.results {
    margin-top: 26px;
    scroll-margin-top: 18px;
}

.results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 14px;
    margin-bottom: 14px;
    padding: 0 2px;
}

.results-head h2 {
    margin: 0;
    font-size: 18px;
    color: var(--brand);
}

.results-head p {
    margin: 0;
    font-size: 13px;
}

.result-event {
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
}

.result-event-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fcfdff, #f5f8fd);
}

.result-event-title {
    min-width: 0;
}

.result-event-title h3 {
    margin: 0 0 3px;
    font-size: 15.5px;
    color: var(--ink);
    line-height: 1.45;
}

.result-event-title p {
    margin: 0;
    font-size: 12.5px;
}

.pill {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-table th {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: left;
}

.result-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f8;
    vertical-align: middle;
}

.result-table tbody tr:last-child td {
    border-bottom: 0;
}

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

.cell-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- 名次徽标（柔和金银铜） ---------- */

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 10px;
    border: 1px solid #e0e7f2;
    border-radius: 999px;
    background: #eef2f8;
    color: #4a5a75;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.rank-badge.rank-1 {
    background: #faf1dc;
    border-color: #efdfb9;
    color: #8d6a24;
}

.rank-badge.rank-2 {
    background: #f0f3f6;
    border-color: #dde4ea;
    color: #5b6b7e;
}

.rank-badge.rank-3 {
    background: #f8ece4;
    border-color: #ecd6c6;
    color: #8c5a3c;
}

/* ---------- 空状态 ---------- */

.empty-state {
    margin-top: 22px;
    padding: 40px 22px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
}

.empty-state h2,
.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--brand);
}

.empty-state p {
    margin: 0 auto;
    max-width: 46ch;
    font-size: 13.5px;
}

.empty-state .btn {
    margin-top: 16px;
}

.empty-state-compact {
    margin: 0;
    padding: 34px 20px;
    border: 0;
    box-shadow: none;
}

.empty-tips {
    display: grid;
    gap: 6px;
    max-width: 440px;
    margin: 18px auto 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--muted);
}

.empty-tips li {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafd;
    text-align: left;
}

/* ---------- 查询说明 ---------- */

.guide-card {
    margin-top: 22px;
}

.guide-card h2 {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--brand);
}

.guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.guide-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.guide-step {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--teal);
}

.guide-item h3 {
    margin: 6px 0 5px;
    font-size: 14px;
}

.guide-item p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--muted);
}

/* ---------- 前台页脚 ---------- */

.site-footer {
    padding: 20px 0 28px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .6);
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 18px;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- 后台框架 ---------- */

.admin-body {
    /* 全站 120% 缩放，高度按缩放折算，避免多出滚动条 */
    min-height: calc(100vh / 1.2);
    background: #f3f6fb;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 1px 0 rgba(16, 32, 64, .03);
}

.admin-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 10px 18px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand);
    text-decoration: none;
}

.admin-brand .brand-mark {
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
}

.admin-brand-text {
    font-size: 13.5px;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.admin-nav-link {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.admin-nav-link:hover {
    background: #f2f6fc;
    color: var(--brand);
}

.admin-nav-link.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}

.admin-logout {
    margin: 0 0 0 auto;
}

.admin-main {
    padding-top: 24px;
    padding-bottom: 44px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--brand);
}

.page-head p {
    margin: 0;
    font-size: 13px;
}

.admin-footer {
    padding: 18px 0 30px;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- 统计卡 ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 18px;
    border-left: 3px solid var(--gold);
}

.stat-label {
    font-size: 11.5px;
    letter-spacing: .14em;
    color: var(--muted);
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--brand);
}

.stat-note {
    font-size: 12px;
    color: var(--muted);
}

/* ---------- 数据表格 ---------- */

.table-card {
    margin-bottom: 22px;
    padding: 0;
    overflow: hidden;
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    margin: 0;
    font-size: 16px;
    color: var(--ink);
}

.card-head .muted {
    font-size: 12.5px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 18px;
    border-bottom: 1px solid #eef2f8;
    vertical-align: top;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.cell-title {
    font-weight: 600;
    color: var(--ink);
    line-height: 1.5;
}

.cell-sub {
    margin-top: 2px;
    font-size: 11.5px;
    word-break: break-all;
}

/* ---------- 导入预览 ---------- */

.preview-summary {
    margin-bottom: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcff;
}

.summary-label {
    font-size: 11px;
    letter-spacing: .1em;
    color: var(--muted);
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
}

.preview-form .form-grid {
    margin-bottom: 4px;
}

.upload-form .field {
    margin-bottom: 12px;
}

/* ---------- 设置页 ---------- */

.form-card h2 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--brand);
}

.form-card > p.muted {
    margin: 0 0 14px;
    font-size: 13px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.settings-grid .form-card .field {
    margin-bottom: 12px;
}

/* 微信分享卡片：设置表单 + 卡片预览 */
.share-clear-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.share-wxcard {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    max-width: 420px;
}

.share-wxcard-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
}

.share-wxcard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.share-wxcard-txt {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-wxcard-txt strong {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    word-break: break-all;
}

.share-wxcard-txt em {
    font-style: normal;
    font-size: 12.5px;
    color: #8b939c;
    line-height: 1.45;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-wxcard-txt i {
    font-style: normal;
    font-size: 11.5px;
    color: #b0b6bd;
}

.share-current {
    font-size: 12.5px;
    word-break: break-all;
}

.share-link-field {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
}

.share-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-link-row input {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    color: #4b5563;
}

.share-bust-form {
    margin-top: 10px;
}

.bg-preview {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #fbfcff;
    font-size: 12px;
    text-align: center;
}

.bg-preview img {
    max-height: 260px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.bg-preview-empty {
    padding: 26px 16px;
    color: var(--muted);
    font-size: 12.5px;
}

.pill-muted {
    background: #f1f4f9;
    color: var(--muted);
}

.event-bg-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.event-bg-item {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.event-bg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.event-bg-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.event-bg-title strong {
    font-size: 13.5px;
    color: var(--ink);
    line-height: 1.4;
}

.event-bg-title span {
    font-size: 11.5px;
}

.event-bg-thumb {
    width: 34px;
    height: 48px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

/* ---------- 证书底图大图预览 ---------- */

.bg-preview-btn,
.event-bg-thumb-btn {
    display: inline-flex;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: zoom-in;
    transition: box-shadow .15s ease, transform .15s ease;
}

.bg-preview-btn:hover,
.bg-preview-btn:focus-visible,
.event-bg-thumb-btn:hover,
.event-bg-thumb-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 138, 143, .22);
    transform: translateY(-1px);
}

/* 缩略图上的二维码位置标记 */
.bg-preview-btn,
.event-bg-thumb-btn {
    position: relative;
}

.event-bg-qr-marker {
    position: absolute;
    aspect-ratio: 1 / 1;
    border: 1.5px solid rgba(37, 99, 235, .95);
    border-radius: 2px;
    background: rgba(37, 99, 235, .22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .65) inset;
    pointer-events: none;
}

.cert-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px 22px;
    background: rgba(10, 18, 32, .74);
    backdrop-filter: blur(4px);
    animation: certLightboxIn .18s ease-out;
}

.cert-lightbox[hidden] {
    display: none;
}

.cert-lightbox img {
    display: block;
    max-width: min(90vw, 700px);
    max-height: 84vh;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.cert-lightbox-figure {
    position: relative;
    display: inline-block;
    line-height: 0;
}

/* 大图预览上的二维码位置框 */
.cert-lightbox-qr {
    position: absolute;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(37, 99, 235, .95);
    border-radius: 4px;
    background: rgba(37, 99, 235, .16);
    pointer-events: none;
}

.cert-lightbox-qr[hidden] {
    display: none;
}

.cert-lightbox-qr em {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: #1d4ed8;
    font-style: normal;
    font-size: 11px;
    line-height: 1.4;
}

.cert-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease;
}

.cert-lightbox-close:hover,
.cert-lightbox-close:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .26);
}

body.lightbox-open {
    overflow: hidden;
}

@keyframes certLightboxIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.event-bg-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.event-bg-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
}

.event-bg-form input[type="file"] {
    flex: 1 1 160px;
    width: auto;
    padding: 7px 9px;
    font-size: 12.5px;
}

.qr-pos-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
}

.qr-pos-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.qr-pos-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}

.qr-pos-field input[type="number"] {
    width: 74px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    text-align: center;
}

.qr-pos-field input[type="number"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.qr-pos-hint {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* ---------- 登录页 ---------- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh / 1.2);
    padding: 26px 18px;
    background:
        radial-gradient(circle at 12% 18%, rgba(31, 58, 104, .1), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(200, 161, 90, .14), transparent 46%),
        linear-gradient(135deg, #eef3fb, #f7f4ec);
}

.login-wrap {
    width: 100%;
    max-width: 400px;
}

.login-card {
    padding: 30px 26px;
}

.login-head {
    margin-bottom: 18px;
    text-align: center;
}

.login-head .brand-mark {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-color: transparent;
    background: var(--brand-soft);
    color: var(--brand);
}

.login-head h1 {
    margin: 0 0 3px;
    font-size: 20px;
    color: var(--brand);
}

.login-head p {
    margin: 0;
    font-size: 12.5px;
}

.login-form .field {
    margin-bottom: 14px;
}

.login-foot {
    margin: 18px 0 0;
    font-size: 13px;
    text-align: center;
}

.login-foot a {
    color: var(--muted);
    text-decoration: none;
}

.login-foot a:hover {
    color: var(--brand);
}

/* ==========================================================================
   证书页（A4 竖向 210×297mm，比例 1:1.4）
   ========================================================================== */

.cert-doc {
    min-height: calc(100vh / 1.2);
    margin: 0;
    overflow-x: hidden;
    background: #e9eef5;
}

.cert-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 18px;
}

.cert-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

/* 同一查询有多张证书时的左右翻页 */
.cert-pager {
    display: flex;
    align-items: center;
    gap: 2px;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 0 auto 16px;
    padding: 5px 7px;
    border: 1px solid rgba(31, 63, 120, .10);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 26px rgba(23, 52, 102, .10), 0 1px 2px rgba(23, 52, 102, .04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cert-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--brand);
    background: transparent;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.cert-pager-btn:hover {
    background: var(--brand);
    color: #fff;
}

.cert-pager-btn:active {
    transform: scale(.94);
}

.cert-pager-btn.is-disabled {
    color: #c3cddd;
    pointer-events: none;
}

.cert-pager-count {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 64px;
    padding: 0 8px;
    line-height: 1.15;
    text-align: center;
}

.cert-pager-count strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .01em;
}

.cert-pager-count small {
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .04em;
}

/* 手机端（窄屏或触屏设备）显示“保存证书到手机”，电脑端显示“打印 / 另存为 PDF” */
.cert-save-btn {
    display: none;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
    .cert-save-btn {
        display: inline-flex;
    }

    .cert-print-btn {
        display: none;
    }
}

/* 保存证书图片的浮层 */
.cert-save-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 20, 36, .72);
    /* 抵消全站 120% 缩放，保证浮层铺满屏幕 */
    zoom: 0.83334;
}

.cert-save-modal[hidden] {
    display: none;
}

.cert-save-panel {
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
    text-align: center;
}

.cert-save-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.cert-save-tip {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--muted);
}

.cert-save-img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

.cert-save-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

.cert-save-open {
    overflow: hidden;
}

.cert-toolbar .muted {
    font-size: 12px;
}

.cert-viewport {
    overflow: hidden;
    padding: 4px 12px 44px;
}

.cert-stage {
    position: relative;
    width: 210mm;
    height: 297mm;
    margin: 0 auto;
}

.cert-page {
    position: absolute;
    inset: 0;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    background: #fffdf8;
    color: #1f2a44;
    box-shadow: 0 14px 38px rgba(16, 24, 40, .18);
    transform-origin: top left;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.cert-page.has-bg {
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.cert-frame {
    position: absolute;
    inset: 9mm;
    border: 1px solid rgba(31, 58, 104, .5);
    pointer-events: none;
}

.cert-frame::after {
    content: "";
    position: absolute;
    inset: 2.2mm;
    border: 1px solid rgba(200, 161, 90, .55);
}

.cert-corner {
    position: absolute;
    width: 20mm;
    height: 20mm;
    pointer-events: none;
}

.cert-corner::before,
.cert-corner::after {
    content: "";
    position: absolute;
    background: rgba(200, 161, 90, .85);
}

.cert-corner::before {
    width: 20mm;
    height: 1px;
}

.cert-corner::after {
    width: 1px;
    height: 20mm;
}

.cert-corner.tl {
    top: 5.5mm;
    left: 5.5mm;
}

.cert-corner.tl::before {
    top: 0;
    left: 0;
}

.cert-corner.tl::after {
    top: 0;
    left: 0;
}

.cert-corner.tr {
    top: 5.5mm;
    right: 5.5mm;
}

.cert-corner.tr::before {
    top: 0;
    right: 0;
}

.cert-corner.tr::after {
    top: 0;
    right: 0;
}

.cert-corner.bl {
    bottom: 5.5mm;
    left: 5.5mm;
}

.cert-corner.bl::before {
    bottom: 0;
    left: 0;
}

.cert-corner.bl::after {
    bottom: 0;
    left: 0;
}

.cert-corner.br {
    bottom: 5.5mm;
    right: 5.5mm;
}

.cert-corner.br::before {
    bottom: 0;
    right: 0;
}

.cert-corner.br::after {
    bottom: 0;
    right: 0;
}

.cert-heading {
    position: absolute;
    top: 12.5%;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
}

.cert-heading-cn {
    display: block;
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: .48em;
    text-indent: .48em;
    color: #b08a45;
}

.cert-heading-en {
    display: block;
    margin-top: 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 10px;
    letter-spacing: .34em;
    text-indent: .34em;
    color: #9a8a68;
}

.cert-heading::after {
    content: "";
    display: block;
    width: 52mm;
    height: 1px;
    margin: 13px auto 0;
    background: linear-gradient(90deg, transparent, rgba(200, 161, 90, .9), transparent);
}

.cert-name {
    position: absolute;
    left: 50%;
    width: 82%;
    transform: translate(-50%, -50%);
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .14em;
    text-align: center;
    color: #16233d;
    word-break: break-word;
}

.cert-body {
    position: absolute;
    left: 50%;
    width: 70%;
    transform: translateX(-50%);
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    line-height: 2;
    letter-spacing: .08em;
    text-align: center;
    color: #3a3f52;
    word-break: break-word;
}

.cert-fields {
    position: absolute;
    z-index: 2;
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    color: #1c1c1c;
    line-height: 1;
}

.cert-field {
    position: absolute;
    left: 0;
    right: 0;
    transform: translateY(-100%) translateY(-2px);
    text-align: center;
    white-space: nowrap;
    letter-spacing: .06em;
    font-weight: 700;
}

/* 团体赛：运动员一行可能放不下「领队 + 教练 + 全部队员」，允许折成两行 */
.cert-field-members {
    white-space: normal;
    letter-spacing: 0;
    word-break: break-all;
}

.cert-page.has-bg .cert-name,
.cert-page.has-bg .cert-body {
    text-shadow: 0 1px 2px rgba(255, 255, 255, .65), 0 0 12px rgba(255, 255, 255, .35);
}

.cert-meta {
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 7%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    font-size: 12px;
    letter-spacing: .08em;
    color: #6f674f;
}

/* ---------- 证书编码 + 二维码 ---------- */

.cert-code-block {
    position: absolute;
    z-index: 3;
    line-height: 1.2;
    text-align: center;
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
    color: #1c1c1c;
}

.cert-qr {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: #fff;
}

.cert-qr svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.cert-code-text {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: nowrap;
}

.cert-code-text span {
    font-size: 8px;
    letter-spacing: .1em;
    color: #5c5750;
}

.cert-code-text strong {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ---------- 打印 ---------- */

@media print {
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        zoom: 1 !important;
    }

    .no-print,
    .cert-toolbar {
        display: none !important;
    }

    .cert-doc {
        overflow: visible;
    }

    .cert-viewport {
        overflow: visible;
        padding: 0 !important;
    }

    .cert-stage {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
    }

    .cert-page {
        position: relative !important;
        transform: none !important;
        width: 210mm !important;
        height: 297mm !important;
        box-shadow: none !important;
        page-break-after: avoid;
    }

    .cert-page.has-bg {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ==========================================================================
   断点
   ========================================================================== */

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .site-header {
        padding: 16px 0 18px;
    }

    .site-brand-text strong {
        font-size: 18px;
    }

    .site-brand-text small {
        font-size: 11px;
    }

    .public-main {
        padding-top: 30px;
        padding-bottom: 56px;
    }

    .hero {
        padding: 18px 4px 28px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero-badge {
        display: inline-flex;
    }

    .query-card {
        padding: 22px;
    }

    .query-form {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .field-submit {
        align-self: end;
        justify-self: stretch;
    }

    .btn-block-mobile {
        width: 100%;
    }

    .result-event-head {
        padding: 18px 22px;
    }

    .result-table th,
    .result-table td {
        padding-left: 22px;
        padding-right: 22px;
    }

    .guide-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

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

    .card {
        padding: 22px;
    }

    .table-card,
    .result-event {
        padding: 0;
    }

    .admin-main {
        padding-top: 30px;
    }

    .admin-header-inner {
        padding: 12px 24px;
    }

    .admin-brand-text {
        font-size: 14.5px;
    }

    .cert-toolbar {
        padding: 16px 24px;
    }

    .cert-viewport {
        padding: 6px 18px 48px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 28px;
    }

    .query-form {
        grid-template-columns: 1.05fr 1.1fr 1.2fr auto;
        align-items: end;
    }

    .field-submit {
        justify-self: end;
    }

    .btn-block-mobile {
        width: auto;
    }

    .admin-header-inner {
        padding: 14px 28px;
    }

    .page-head h1 {
        font-size: 24px;
    }
}

/* 表格在移动端转为卡片 */
@media (max-width: 767px) {
    .admin-header-inner {
        gap: 8px 12px;
    }

    .admin-nav {
        order: 3;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid #eef2f8;
    }

    .admin-logout {
        margin-left: auto;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        padding: 10px 16px;
        border-bottom: 1px solid #eef2f8;
    }

    .responsive-table tr:last-child {
        border-bottom: 0;
    }

    .responsive-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 6px 0;
        border: 0;
        text-align: right;
    }

    .responsive-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 11.5px;
        font-weight: 600;
        text-align: left;
    }

    .responsive-table td.cell-action {
        justify-content: flex-end;
        padding-top: 10px;
    }

    .responsive-table td.cell-action::before {
        content: none;
    }

    .result-table th {
        display: none;
    }

    .result-table td {
        padding: 6px 0;
    }

    .result-event .responsive-table tr {
        padding: 10px 18px;
        border-bottom: 1px dashed #e7edf6;
    }

    .result-event .responsive-table tr:last-child {
        border-bottom: 0;
    }

    .cert-toolbar {
        padding: 12px 14px;
    }

    .cert-toolbar-meta {
        width: 100%;
        justify-content: space-between;
    }

    .cert-toolbar .btn {
        flex: 1 1 auto;
    }
}

/* ==========================================================================
   查询首页改版：深色舞台 + 悬浮查询卡
   ========================================================================== */

.query-body {
    background: #eef2f8;
}

/* ---------- 首屏舞台 ---------- */

.qx-hero {
    position: relative;
    overflow: hidden;
    padding: 14px 0 68px;
    color: #fff;
    background:
        radial-gradient(120% 95% at 100% 0%, rgba(200, 161, 90, .30), rgba(200, 161, 90, 0) 56%),
        radial-gradient(95% 85% at 0% 100%, rgba(29, 138, 143, .42), rgba(29, 138, 143, 0) 60%),
        linear-gradient(135deg, #12233f 0%, #1f3a68 56%, #163f56 100%);
}

.qx-hero::before {
    content: "";
    position: absolute;
    top: -55%;
    right: -8%;
    width: 460px;
    height: 760px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0));
    transform: rotate(22deg);
    pointer-events: none;
}

.qx-hero::after {
    content: "";
    position: absolute;
    left: -170px;
    bottom: -280px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 0 0 64px rgba(255, 255, 255, .045), 0 0 0 138px rgba(255, 255, 255, .028);
    pointer-events: none;
}

.qx-hero-inner {
    position: relative;
    z-index: 1;
}

.qx-hero-art {
    display: none;
    position: absolute;
    top: 50%;
    right: 9%;
    width: 250px;
    height: 250px;
    color: #ffe3ac;
    opacity: .16;
    transform: translateY(-58%) rotate(12deg);
    pointer-events: none;
}

.qx-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qx-topbar .brand-mark-logo {
    padding: 0;
    overflow: hidden;
    border-color: rgba(255, 255, 255, .9);
    background: #fff;
    box-shadow: 0 4px 12px rgba(8, 20, 40, .18);
}

.brand-mark-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qx-topbar-tag {
    display: none;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .82);
    font-size: 11.5px;
    letter-spacing: .12em;
    white-space: nowrap;
}

.qx-hero-copy {
    padding: 16px 0 0;
    max-width: 660px;
}

.qx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #f0d9a8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .26em;
}

.qx-eyebrow::before {
    content: "";
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #c8a15a;
}

.qx-hero h1 {
    margin: 12px 0 10px;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .02em;
}

.qx-hero h1 span {
    margin: 0 4px;
    color: #e0bd7c;
    font-weight: 400;
}

.qx-lede {
    margin: 0;
    max-width: 48ch;
    color: rgba(255, 255, 255, .72);
    font-size: 13.5px;
    line-height: 1.75;
}

.qx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.qx-chips li {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    color: rgba(255, 255, 255, .84);
    font-size: 11.5px;
}

/* ---------- 悬浮查询卡 ---------- */

.qx-main {
    position: relative;
    z-index: 2;
    margin-top: -56px;
    padding-bottom: 44px;
}

.qx-search {
    position: relative;
    padding: 22px 18px 18px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 44px rgba(16, 32, 64, .15), 0 2px 6px rgba(16, 32, 64, .05);
}

.qx-search::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, #c8a15a, #e6c98d 45%, #1d8a8f);
}

.qx-search-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.qx-search-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 19px;
    letter-spacing: .01em;
}

.qx-search-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.qx-search-flag {
    display: none;
    flex: 0 0 auto;
    padding: 5px 12px;
    border: 1px solid #f0e2c6;
    border-radius: 999px;
    background: #fbf3e3;
    color: #a87c33;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    white-space: nowrap;
}

.qx-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.qx-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.qx-field label {
    color: #41506b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.qx-optional {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f1f4f9;
    color: #93a1b8;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

.qx-field input,
.qx-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dde4ef;
    border-radius: 11px;
    background: #f7f9fd;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.qx-field input::placeholder {
    color: #9aa8bf;
}

.qx-field input:focus,
.qx-field select:focus {
    outline: none;
    border-color: #1d8a8f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29, 138, 143, .14);
}

/* ---------- 赛事下拉：自定义弹层（JS 增强，无 JS 时回退原生 select） ---------- */

.qx-select {
    position: relative;
}

.qx-select-trigger,
.qx-select-panel {
    display: none;
}

.qx-select-trigger {
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dde4ef;
    border-radius: 11px;
    background: #f7f9fd;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.qx-select-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.qx-select-date {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e9f0fa;
    color: #64748f;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.qx-select-date:empty {
    display: none;
}

.qx-select-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5ecf7;
    color: #4a628c;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

.qx-select.is-open .qx-select-arrow {
    background: #fbefd7;
    color: #a87c33;
    transform: rotate(180deg);
}

.qx-select.is-open .qx-select-trigger,
.qx-select-trigger:focus-visible {
    outline: none;
    border-color: #1d8a8f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29, 138, 143, .14);
}

/* JS 增强后：原生 select 只负责提交，界面用自定义触发器 */
.qx-select.is-enhanced .qx-select-trigger {
    display: flex;
}

.qx-field .qx-select.is-enhanced .qx-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.qx-select.is-enhanced .qx-select-panel {
    display: none;
}

.qx-select.is-open .qx-select-panel {
    display: block;
}

.qx-select-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 304px;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e3ebf6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(16, 32, 64, .16), 0 2px 6px rgba(16, 32, 64, .06);
    animation: qxSelectIn .16s ease-out;
}

.qx-select-panel[hidden] {
    display: none;
}

/* 年份筛选条：吸附在赛事弹层顶部 */
.qx-select-years {
    position: sticky;
    top: -6px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: -6px -6px 4px;
    padding: 9px 10px 8px;
    border-bottom: 1px solid #edf2f9;
    background: #fff;
}

.qx-select-years-label {
    margin-right: 2px;
    color: #8492a8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
}

.qx-year-chip {
    padding: 5px 12px;
    border: 1px solid #e1e9f4;
    border-radius: 999px;
    background: #f7f9fd;
    color: #51617a;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.qx-year-chip:hover,
.qx-year-chip:focus-visible {
    outline: none;
    border-color: #d3dfee;
    background: #eef4fb;
}

.qx-year-chip[aria-pressed="true"] {
    border-color: #1d8a8f;
    background: #1d8a8f;
    color: #fff;
    box-shadow: 0 4px 10px rgba(29, 138, 143, .22);
}

/* 下方空间不足时向上展开 */
.qx-select.is-up .qx-select-panel {
    top: auto;
    bottom: calc(100% + 8px);
    transform-origin: bottom center;
}

/* 宽屏时弹层更宽，右边缘与触发器对齐 */
@media (min-width: 768px) {
    .qx-select-panel {
        left: auto;
        right: 0;
        width: max(100%, 320px);
    }
}

@keyframes qxSelectIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.qx-select-panel::-webkit-scrollbar {
    width: 6px;
}

.qx-select-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cfdaea;
}

.qx-select-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease;
}

.qx-select-option + .qx-select-option {
    margin-top: 2px;
}

/* 年份筛选后隐藏不在该年份的赛事 */
.qx-select-option[hidden] {
    display: none;
}

.qx-select-option:hover,
.qx-select-option:focus-visible {
    outline: none;
    background: #f3f7fd;
}

.qx-select-option[aria-selected="true"] {
    background: linear-gradient(120deg, #fbf3e3, #f8efdc);
}

.qx-select-option[aria-selected="true"]:hover,
.qx-select-option[aria-selected="true"]:focus-visible {
    background: #f8ecd4;
}

.qx-select-option-check {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid #d9e2ef;
    border-radius: 50%;
    background: #fff;
    color: transparent;
}

.qx-select-option[aria-selected="true"] .qx-select-option-check {
    border-color: #c8a15a;
    background: #c8a15a;
    color: #fff;
}

.qx-select-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.qx-select-option-title {
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
}

.qx-select-option[aria-selected="true"] .qx-select-option-title {
    color: #8a6425;
}

.qx-select-option-date {
    color: #8492a8;
    font-size: 11px;
    letter-spacing: .04em;
}

.qx-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(120deg, #d9b674, #c0994f);
    color: #23293c;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(178, 140, 72, .30);
    transition: filter .15s ease, box-shadow .15s ease, transform .12s ease;
}

.qx-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 12px 26px rgba(178, 140, 72, .36);
}

.qx-submit:active {
    transform: translateY(1px);
}

.qx-footnote {
    margin: 14px 0 0;
    color: #8492a8;
    font-size: 11.5px;
    line-height: 1.7;
    text-align: center;
}

/* ---------- 三步说明 ---------- */

.qx-guide {
    margin-top: 26px;
    padding: 22px 18px;
    border: 1px solid #e6ecf6;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.qx-guide-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 17px;
}

.qx-guide-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.qx-steps {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.qx-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #e9eff8;
    border-radius: 12px;
    background: #f7f9fd;
}

.qx-step-no {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #f0e2c6;
    border-radius: 9px;
    background: #fbf3e3;
    color: #b98b3f;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .06em;
}

.qx-steps h3 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 14px;
}

.qx-steps p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.65;
}

/* ---------- 结果区（查询后） ---------- */

.qx-main .results {
    margin-top: 28px;
}

.qx-main .results-head h2 {
    font-size: 19px;
}

.qx-main .result-event {
    border-color: #e6ecf6;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(16, 32, 64, .07);
}

.qx-main .result-event-head {
    position: relative;
    padding-left: 22px;
    background: linear-gradient(180deg, #fbfcff, #f4f7fc);
}

.qx-main .result-event-head::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #c8a15a, #1d8a8f);
}

.qx-main .empty-state {
    margin-top: 26px;
    border-radius: 16px;
}

.qx-main .empty-tips li {
    background: #f7f9fd;
}

@media (min-width: 768px) {
    .qx-hero {
        padding: 18px 0 108px;
    }

    .qx-hero-copy {
        padding-top: 40px;
    }

    .qx-hero h1 {
        font-size: 46px;
    }

    .qx-lede {
        font-size: 15px;
    }

    .qx-topbar-tag,
    .qx-search-flag {
        display: inline-flex;
    }

    .qx-hero-art {
        display: block;
    }

    .qx-main {
        margin-top: -72px;
        padding-bottom: 56px;
    }

    .qx-search {
        padding: 26px 30px 22px;
        border-radius: 20px;
    }

    .qx-search-head h2 {
        font-size: 21px;
    }

    .qx-form {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: end;
    }

    .qx-submit {
        grid-column: 1 / -1;
        width: auto;
        padding: 14px 30px;
        white-space: nowrap;
    }

    .qx-footnote {
        text-align: left;
    }

    .qx-guide {
        padding: 26px 28px;
    }

    .qx-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .qx-field-event {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .qx-form {
        grid-template-columns: 1.05fr 1.05fr .9fr auto;
        gap: 18px;
    }

    .qx-submit {
        grid-column: auto;
        align-self: end;
    }
}

/* 移动端结果行：组别 + 名次一行，单位第二行，按钮整行 */
@media (max-width: 767px) {
    .qx-select-panel {
        max-height: 46vh;
    }

    .qx-select-option {
        padding: 12px;
    }

    .qx-select-option-title {
        font-size: 14px;
    }

    .qx-main .result-event .responsive-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2px 12px;
        padding: 14px 16px;
    }

    .qx-main .result-event .responsive-table td {
        display: block;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .qx-main .result-event .responsive-table td::before {
        content: none;
    }

    .qx-main .result-event .responsive-table td:nth-child(1) {
        grid-column: 1;
        color: var(--ink);
        font-size: 14.5px;
        font-weight: 700;
    }

    .qx-main .result-event .responsive-table td:nth-child(2) {
        grid-column: 2;
        align-self: center;
        justify-self: end;
    }

    .qx-main .result-event .responsive-table td:nth-child(3) {
        grid-column: 1;
        color: var(--muted);
        font-size: 12px;
    }

    .qx-main .result-event .responsive-table td:nth-child(4) {
        grid-column: 1 / -1;
        margin-top: 10px;
        justify-content: stretch;
    }

    .qx-main .result-event .responsive-table td:nth-child(4) .btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ---------- 数据统计页 ---------- */

.stats-range {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.stats-range a {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

.stats-range a.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.stats-legend {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
}

.stats-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: middle;
}

.stats-legend .legend-pv {
    background: var(--brand);
}

.stats-legend .legend-query {
    background: var(--gold);
}

.stats-legend .legend-download {
    background: #2f9e6f;
}

.stats-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 190px;
    padding: 14px 4px 0;
    overflow-x: auto;
}

.stats-col {
    flex: 1 0 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.stats-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
}

.stats-bar {
    display: block;
    width: 6px;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
}

.bar-pv {
    background: var(--brand);
}

.bar-query {
    background: var(--gold);
}

.bar-download {
    background: #2f9e6f;
}

.stats-day {
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
}

.admin-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.admin-split-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.tag {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.6;
    background: var(--brand-soft);
    color: var(--brand);
    vertical-align: 1px;
}

.tag-u {
    background: var(--gold-soft);
    color: #8a6a2f;
}

.rank-cell {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    width: 2em;
}

.award-personal {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.award-personal strong {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--brand);
}

.award-personal .ap-unit {
    font-size: 13px;
    color: var(--muted);
}

@media (min-width: 1024px) {
    .stat-grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .admin-split {
        grid-template-columns: 1fr 1fr;
    }

    .admin-split-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
