:root { --ink: #17342f; --muted: #63756f; --accent: #087b60; --line: #dce7e1; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); background: #172820 url('images/3.jpg') center / cover fixed no-repeat; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; line-height: 1.65; }
a { color: #08705b; text-underline-offset: 3px; }
a:hover { color: #064d3f; }
.site-nav { background: #153e34; padding: 17px 24px; }
.nav-inner { width: 100%; max-width: 1160px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.navbar-brand { font-weight: 700; letter-spacing: .03em; }
.navbar .nav-link { color: #e1eee7; padding: 8px 14px !important; }
.navbar .nav-link:hover { color: #c7efa7; }
.site-main { width: calc(100% - 48px); max-width: 1160px; margin: 32px auto; padding: 32px; border: 1px solid #ffffffb8; border-radius: 16px; background: rgba(255,255,255,.86); flex: 1; min-width: 0; box-shadow: 0 8px 32px #071b1826; }
h1, h2, h3, h4, h5 { color: var(--ink); line-height: 1.35; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.btn { border-radius: 8px; padding: 9px 17px; font-weight: 600; }
.btn-success, .btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-success:hover, .btn-primary:hover { background: #08654f; border-color: #08654f; }
.btn-outline-info { color: #08654f; border-color: #b0cfc1; }
.btn-outline-info:hover { background: #e8f5ed; color: #064d3f; border-color: #087b60; }
.form-group { margin-bottom: 16px; }
label { font-size: .93rem; margin-bottom: 7px; }
.form-control, .form-select { min-height: 43px; border: 1px solid #cddbd3; border-radius: 8px; padding: 8px 12px; }
.form-select { padding-right: 2.5rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #087b601c; }
textarea.form-control { min-height: 110px; }
.card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-body { padding: 22px; }
.card.shadow-sm { box-shadow: 0 3px 12px #153e3408 !important; }
.table { color: var(--ink); font-variant-numeric: tabular-nums; }
.table > thead { background: #edf5f0; }
.table td, .table th { padding: 12px 10px; white-space: nowrap; vertical-align: middle; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 18px 0; border-radius: 8px; }
.table-scroll .table { margin-bottom: 0; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); }
.table-hint { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.result-summary { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; color: var(--muted); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 45px 20px; background: #f5f8f5; border-radius: 12px; margin: 12px; color: var(--muted); }
.page-link { color: #08654f; }
.footer { text-align: center; padding: 22px 24px 30px; color: #e2eae5; font-size: .82rem; background: rgba(16,35,29,.88); }
.footer p { margin-bottom: 12px; }
.footer-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; }
.footer a { color: #e2eae5; }
.skip-link { position: absolute; left: 16px; top: -100px; background: white; padding: 8px; z-index: 2000; }
.skip-link:focus { top: 8px; }
.login-panel { max-width: 420px; margin: 25px auto; }
.login-panel h1 { margin-bottom: 12px; }
.login-panel .btn { width: 100%; }
.record-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.record-tools code { color: var(--accent); background: #edf5f0; padding: 5px 9px; border-radius: 6px; }
#chart { max-width: 900px; min-width: 0; }
#chart svg { width: 100%; max-width: 100%; display: block; }
.race-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.race-control { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.race-control label { margin: 0; white-space: nowrap; }
.race-control select { width: auto; min-width: 6.25rem; padding-right: 2.5rem; }
#simulationMode { min-width: 9.5rem; }
@media (max-width: 767px) {
    .site-nav { padding: 12px 14px; }
    .navbar-brand { font-size: 1rem; }
    .site-main { width: calc(100% - 24px); padding: 20px 14px; margin: 16px auto; border-radius: 12px; }
    .pagination { flex-wrap: wrap; gap: 4px; }
    .page-link { padding: 7px 9px; font-size: .85rem; }
    .d-flex.gap-2 { flex-wrap: wrap; }
    #main-content .form-row { flex-wrap: wrap; justify-content: flex-start; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    #main-content .form-row .input-group { margin-left: 0; max-width: 100%; }
    #chart-container { padding: 10px !important; }
    .card-body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
.home-page { max-width: 700px; margin: 12px auto 24px; text-align: center; }
.home-page h1 { margin: 8px 0 24px; }
.project-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; max-width: 580px; margin: 32px auto; }
.project-links .btn { padding: 12px 8px; font-size: 1.05rem; }
.knowledge-link { display: inline-block; margin-top: 8px; }
@media (max-width: 767px) {
    .project-links { gap: 16px 12px; margin: 24px auto; }
    .project-links .btn { font-size: .95rem; }
}

/* Shared search, pagination and record presentation. */
.filter-form { padding: 20px; background: #f3f7f4; border: 1px solid var(--line); border-radius: 12px; }
.filter-form label { display: block; color: #465e54; font-weight: 600; }
.search-field { position: relative; }
.search-input { padding-right: 53px; background: #fff; font-size: .95rem; }
.search-input::placeholder { color: #84918b; }
.search-clear { position: absolute; right: 6px; top: 5px; height: 33px; padding: 0 7px; border: 0; border-radius: 5px; background: transparent; color: #65776e; font-size: .78rem; }
.search-clear:hover { background: #eef4ef; color: var(--accent); }
.search-clear:focus-visible { outline: 2px solid var(--accent); }
.search-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 5px; z-index: 30; border: 1px solid #ccdbd1; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #17342f1a; }
.search-option { padding: 9px 10px; border-radius: 4px; color: #324b41; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.search-option:hover, .search-option[aria-selected="true"] { background: #e8f3ed; color: #07624d; }
.search-no-match { padding: 10px; font-size: .82rem; color: var(--muted); }
.card-title { font-size: 1.12rem; font-weight: 650; line-height: 1.5; }
.result-athlete { font-weight: 700; color: var(--ink); }
.result-number { font-weight: 650; color: #08705b; font-variant-numeric: tabular-nums; }
.result-meta { color: #52655d; }
.card-text { overflow-wrap: anywhere; }
.page-navigation { margin-top: 18px; text-align: center; }
.page-navigation .pagination { justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.page-navigation .page-link { display: grid; place-items: center; min-width: 38px; height: 38px; margin: 0; padding: 5px 9px; border: 1px solid #d2dfd6; border-radius: 7px !important; background: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.page-navigation .page-link:hover { background: #e8f3ed; border-color: #a8c7b7; }
.page-navigation .active .page-link { color: #fff; background: var(--accent); border-color: var(--accent); }
.page-navigation .disabled .page-link { color: #9ca9a1; background: #f5f7f5; }
.page-navigation .page-direction { font-size: 1.35rem; }
.page-gap { display: grid; place-items: center; min-width: 20px; color: var(--muted); }
.page-count { color: var(--muted); font-size: .82rem; margin: 0; }
.record-detail { min-width: 0; }
.record-header { display: flex; align-items: stretch; gap: 32px; padding-bottom: 26px; }
.record-heading { flex: 1; min-width: 0; }
.record-topline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 15px; font-size: .85rem; }
.event-label { padding: 3px 10px; background: #e6f0e9; color: #176349; border-radius: 5px; font-weight: 600; }
.record-id { color: var(--muted); }
.record-id code { color: #355f4c; font: inherit; font-weight: 700; user-select: all; }
.record-heading h1 { font-size: clamp(1.55rem, 3.2vw, 2.25rem); margin: 0 0 9px; font-weight: 750; overflow-wrap: anywhere; }
.record-race { font-size: 1rem; color: #435d50; font-weight: 500; line-height: 1.55; margin: 0 0 20px; overflow-wrap: anywhere; }
.record-meta { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 0; }
.record-meta dt, .record-metrics dt { color: var(--muted); font-size: .8rem; font-weight: 500; margin-bottom: 4px; }
.record-meta dd { font-size: .94rem; font-weight: 550; margin: 0; overflow-wrap: anywhere; }
.record-score { flex: 0 0 172px; align-self: center; border-left: 1px solid #cfddd3; padding: 12px 0 12px 28px; }
.record-score > span { font-size: .85rem; color: var(--muted); }
.record-score strong { color: #086a50; font-size: clamp(2.4rem, 4vw, 3.25rem); font-weight: 750; line-height: 1.3; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.unit { font-size: .78em; font-weight: 400; color: var(--muted); margin-left: 5px; }
.record-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 32px; border: 1px solid var(--line); border-radius: 10px; background: #f1f6f2; gap: 1px; }
.record-metrics > div { padding: 16px 20px; }
.record-metrics dd { margin: 0; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.record-section { margin-bottom: 24px; min-width: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.section-heading h2, .record-notes h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.section-heading > span { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.split-scroll { border: 1px solid #d5e1d9; border-radius: 9px; margin: 0; background: white; overflow-y: hidden; padding-bottom: 1px; }
.split-table { text-align: center; font-size: .94rem; width: 100%; }
.split-table > :not(caption) > * > * { padding: 14px 13px; border-bottom: 1px solid #e4ebe5; background-color: #fff; box-shadow: none; }
.split-table thead th { background: #eaf2ed; font-size: .83rem; font-weight: 650; color: #486253; }
.split-table tbody tr:nth-child(even) > * { background-color: #f7faf7; }
.split-table tbody tr:last-child > * { border-bottom: 0; }
.split-table th:first-child { position: sticky; left: 0; z-index: 1; min-width: 100px; text-align: left; border-right: 1px solid #dde7df; }
.split-table tbody th { font-size: .8rem; color: #5c7063; font-weight: 550; }
.split-table tbody td { font-weight: 600; color: #233e30; }
.split-table tbody td.missing-value { color: #9daaa1; font-weight: 400; }
.record-notes { border-top: 1px solid #d6e2da; margin-top: 28px; padding-top: 24px; display: grid; gap: 22px; }
.record-notes h2 { margin-bottom: 9px; }
.record-notes p, .record-remarks { margin: 0; font-size: .94rem; line-height: 1.8; color: #4a6053; overflow-wrap: anywhere; }
.record-attachment > a { overflow-wrap: anywhere; font-size: .9rem; }
.attachment-download { display: inline-block; margin-left: 18px; font-weight: 600; }
.record-actions { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; padding-top: 20px; }
.record-actions form { margin: 0; }
.simulation-help { max-width: 680px; margin: 18px auto; color: #52675a; text-align: center; font-size: .95rem; }
@media (max-width: 767px) {
    .filter-form { padding: 16px 12px; }
    .record-header { display: block; padding-bottom: 20px; }
    .record-score { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0 0; margin-top: 18px; border-left: 0; border-top: 1px solid var(--line); }
    .record-score strong { font-size: 2.5rem; }
    .record-meta { gap: 12px 24px; }
    .record-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
    .record-metrics > div { padding: 12px; }
    .record-metrics dd { font-size: 1.1rem; }
    .split-table > :not(caption) > * > * { padding: 12px 11px; }
    .split-table th:first-child { min-width: 88px; }
    .page-navigation .pagination { gap: 4px; }
    .page-navigation .page-link { min-width: 30px; height: 34px; padding: 4px 7px; }
    .page-gap { min-width: 12px; }
}

.file-view { font-weight: 600; }
.result-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; }
.result-fact { min-width: 0; max-width: 100%; }
.result-fact .text-muted { margin-right: 4px; }
