:root {
    --paper: #f1eadc;
    --paper-deep: #e4d9c6;
    --ink: #17150f;
    --muted: #686155;
    --line: #b8ae9e;
    --accent: #ad2d24;
    --accent-dark: #812019;
    --white: #fffdf8;
    --success: #2f6848;
    --error: #98271f;
    --shadow: 0 22px 60px rgba(38, 29, 17, .14);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper-deep);
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
}

button,
input {
    font: inherit;
}

button,
label[for],
input[type="checkbox"] {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

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

.registration-page {
    min-height: 100vh;
    background-color: var(--paper-deep);
    background-image:
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(82, 66, 42, .018) 4px 5px);
}

.registration-shell {
    display: grid;
    grid-template-columns: minmax(340px, .83fr) minmax(540px, 1.17fr);
    width: min(1280px, calc(100% - 48px));
    min-height: 760px;
    margin: 48px auto 24px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.event-panel {
    position: relative;
    display: flex;
    min-height: 760px;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 42px 40px;
    overflow: hidden;
    color: #f8f0df;
    background: var(--ink);
}

.event-panel::before {
    position: absolute;
    top: 82px;
    right: -72px;
    width: 230px;
    height: 230px;
    border: 40px solid var(--accent);
    border-radius: 50%;
    content: "";
    opacity: .92;
}

.event-panel::after {
    position: absolute;
    right: 42px;
    bottom: 198px;
    width: 102px;
    height: 1px;
    background: rgba(248, 240, 223, .45);
    content: "";
    transform: rotate(-38deg);
    transform-origin: right center;
}

.event-panel__topline {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(248, 240, 223, .3);
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: .16em;
}

.event-panel__title {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 64px 0 50px;
}

.eyebrow,
.section-number {
    margin: 0 0 16px;
    color: var(--accent);
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.event-panel h1 {
    max-width: 440px;
    margin: 0;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: clamp(58px, 6.2vw, 92px);
    font-weight: 700;
    letter-spacing: -.07em;
    line-height: .99;
    text-wrap: balance;
}

.event-panel h1 span {
    display: block;
}

.event-panel h1 span:last-child {
    margin-left: .36em;
    color: var(--paper);
    -webkit-text-stroke: 1px rgba(248, 240, 223, .68);
}

.event-panel__lead {
    max-width: 390px;
    margin: 30px 0 0;
    color: rgba(248, 240, 223, .73);
    font-size: 15px;
    line-height: 1.9;
    text-wrap: pretty;
}

.event-notes {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 0;
    padding-top: 25px;
    border-top: 1px solid rgba(248, 240, 223, .3);
}

.event-notes div {
    min-width: 0;
}

.event-notes dt {
    margin-bottom: 8px;
    color: var(--accent);
    font-family: "Courier New", monospace;
    font-size: 11px;
}

.event-notes dd {
    margin: 0;
    color: rgba(248, 240, 223, .72);
    font-size: 12px;
    line-height: 1.6;
}

.form-panel {
    padding: 54px clamp(42px, 5vw, 74px) 60px;
    background: var(--paper);
}

.form-panel__heading {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "number note" "title note";
    align-items: end;
    padding-bottom: 27px;
    border-bottom: 1px solid var(--ink);
}

.form-panel__heading .section-number {
    grid-area: number;
    margin-bottom: 6px;
}

.form-panel__heading h2,
.success-panel h2 {
    grid-area: title;
    margin: 0;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 38px;
    letter-spacing: -.04em;
    line-height: 1.15;
}

.form-panel__heading > p:last-child {
    grid-area: note;
    margin: 0 0 3px 24px;
    color: var(--muted);
    font-size: 12px;
}

.form-panel__heading > p:last-child span,
.field label > span:not(.optional),
.upload-field label > span:not(.optional) {
    color: var(--accent);
}

.system-notice,
.form-message {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid var(--error);
    color: var(--error);
    background: rgba(152, 39, 31, .055);
    font-size: 13px;
}

.registration-form {
    padding-top: 28px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.field label,
.upload-field__heading label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 50px;
    padding: 11px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    font-size: 16px;
    transition: border-color .18s ease;
}

.field input::placeholder {
    color: #958c7d;
}

.field input:focus {
    border-color: var(--accent);
    outline: 0;
}

input[aria-invalid="true"] + .field-error,
.field-error:not(:empty) {
    color: var(--error);
}

.field-error {
    min-height: 20px;
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

.upload-field {
    margin-top: 18px;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
}

.upload-field__heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.upload-field__heading label {
    margin: 0;
}

.upload-field__heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.optional {
    margin-left: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.upload-index {
    color: var(--line);
    font-family: "Courier New", monospace;
    font-size: 25px;
    line-height: 1;
}

.file-picker {
    display: grid;
    grid-template-columns: 130px 1fr;
    min-height: 50px;
    margin-top: 13px;
    border: 1px solid var(--ink);
    background: rgba(255, 253, 248, .38);
    transition: background-color .18s ease;
}

.file-picker:hover {
    background: var(--white);
}

.file-picker__action,
.file-picker__name {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 15px;
}

.file-picker__action {
    justify-content: center;
    color: var(--white);
    background: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.file-picker__name {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-input:focus-visible + .file-picker {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
}

.upload-progress {
    margin: 22px 0 8px;
}

.upload-progress__meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.upload-progress__track {
    height: 4px;
    overflow: hidden;
    background: var(--paper-deep);
}

.upload-progress__track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width .15s linear;
}

.consent-row {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    margin-top: 24px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.consent-row input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.submit-button {
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 13px 20px;
    border: 1px solid var(--accent);
    border-radius: 0;
    color: var(--white);
    background: var(--accent);
    font-weight: 700;
    transition: background-color .18s ease, border-color .18s ease;
}

.submit-button:hover:not(:disabled) {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
}

.submit-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.success-panel {
    padding-top: 74px;
}

.success-panel > p:not(.section-number) {
    max-width: 450px;
    color: var(--muted);
}

.registration-number {
    margin: 35px 0 28px;
    padding: 22px 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    font-family: "Courier New", monospace;
    font-size: clamp(22px, 4vw, 34px);
    letter-spacing: .06em;
}

.text-button {
    min-height: 44px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
    background: transparent;
}

.site-footer {
    display: flex;
    width: min(1280px, calc(100% - 48px));
    justify-content: space-between;
    margin: 0 auto 34px;
    color: #635949;
    font-family: "Courier New", monospace;
    font-size: 10px;
    letter-spacing: .1em;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent);
}

/* 后台 */
.admin-page {
    min-height: 100vh;
    background: #eee8dc;
}

.admin-header {
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
}

.admin-header__inner {
    display: flex;
    width: min(1280px, calc(100% - 48px));
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.admin-brand {
    color: var(--ink);
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.admin-brand small {
    margin-left: 10px;
    color: var(--muted);
    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .15em;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav a,
.link-button {
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    text-decoration: none;
}

.admin-nav a:hover,
.link-button:hover {
    color: var(--accent);
}

.admin-main {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.admin-titlebar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.admin-titlebar h1 {
    margin: 5px 0 0;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 42px;
    line-height: 1.15;
}

.admin-count {
    margin: 0 0 4px;
    color: var(--muted);
    font-family: "Courier New", monospace;
    font-size: 12px;
}

.admin-panel {
    border: 1px solid var(--ink);
    background: var(--paper);
}

.password-panel {
    max-width: 680px;
    padding: 30px;
}

.password-panel__heading {
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.password-panel__heading h2 {
    margin: 0;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 28px;
}

.password-panel__heading p,
.password-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.password-form {
    max-width: 480px;
}

.password-form .field {
    margin-bottom: 16px;
}

.password-panel > .form-message {
    max-width: 480px;
    margin: 0 0 20px;
}

.form-message--success {
    border-color: var(--success);
    color: var(--success);
    background: rgba(47, 104, 72, .06);
}

.search-form {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.search-form input {
    min-width: 0;
    flex: 1;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 0;
    background: var(--white);
    font-size: 14px;
}

.search-form button {
    min-width: 92px;
    min-height: 44px;
    border: 1px solid var(--ink);
    border-radius: 0;
    color: var(--white);
    background: var(--ink);
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .08em;
    white-space: nowrap;
}

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

.admin-table tbody tr:hover {
    background: rgba(255, 253, 248, .72);
}

.record-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.record-link:hover {
    text-decoration: underline;
}

.empty-state {
    padding: 70px 24px;
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.pagination__links {
    display: flex;
    gap: 8px;
}

.pagination a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
    gap: 24px;
}

.video-panel {
    padding: 18px;
    border: 1px solid var(--ink);
    background: var(--ink);
}

.video-panel video {
    display: block;
    width: 100%;
    max-height: 70vh;
    background: #000;
}

.video-status {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    color: rgba(255, 253, 248, .76);
    background: #24211c;
    font-size: 11px;
}

.video-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d79b31;
    box-shadow: 0 0 0 3px rgba(215, 155, 49, .13);
    content: "";
}

.video-status[data-state="ready"]::before {
    background: #69b982;
    box-shadow: 0 0 0 3px rgba(105, 185, 130, .14);
}

.video-status[data-state="error"]::before {
    background: #dc665d;
    box-shadow: 0 0 0 3px rgba(220, 102, 93, .14);
}

.video-caption {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    color: rgba(255, 253, 248, .68);
    font-size: 11px;
}

.record-meta {
    margin: 0;
    border: 1px solid var(--ink);
    background: var(--paper);
}

.record-meta div {
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
}

.record-meta div:last-child {
    border-bottom: 0;
}

.record-meta dt {
    color: var(--muted);
    font-family: "Courier New", monospace;
    font-size: 10px;
    letter-spacing: .08em;
}

.record-meta dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.record-meta dd.record-remarks {
    white-space: pre-wrap;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: var(--ink);
}

.login-card {
    width: min(460px, 100%);
    padding: 42px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.login-card__mark {
    width: 42px;
    height: 42px;
    margin-bottom: 35px;
    border: 10px solid var(--accent);
    border-radius: 50%;
}

.login-card h1 {
    margin: 0;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 36px;
}

.login-card > p {
    margin: 8px 0 30px;
    color: var(--muted);
    font-size: 13px;
}

.login-card .field {
    margin-bottom: 17px;
}

@media (max-width: 920px) {
    .registration-shell {
        grid-template-columns: 1fr;
        width: min(720px, calc(100% - 32px));
        margin-top: 24px;
    }

    .event-panel {
        min-height: 520px;
    }

    .event-panel h1 {
        font-size: clamp(58px, 12vw, 86px);
    }

    .form-panel {
        padding: 46px clamp(28px, 7vw, 60px) 54px;
    }

    .site-footer {
        width: min(720px, calc(100% - 32px));
    }

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

@media (max-width: 640px) {
    .registration-shell {
        width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .event-panel {
        min-height: 470px;
        padding: 26px 22px 28px;
    }

    .event-panel::before {
        top: 74px;
        right: -95px;
        width: 210px;
        height: 210px;
        border-width: 34px;
    }

    .event-panel__title {
        padding: 48px 0 38px;
    }

    .event-panel h1 {
        font-size: clamp(52px, 17vw, 72px);
    }

    .event-panel__lead {
        font-size: 14px;
    }

    .event-notes {
        gap: 10px;
    }

    .event-notes dd {
        font-size: 10px;
    }

    .form-panel {
        padding: 38px 20px 46px;
    }

    .form-panel__heading {
        display: block;
    }

    .form-panel__heading > p:last-child {
        margin: 10px 0 0;
    }

    .field-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .file-picker {
        grid-template-columns: 112px 1fr;
    }

    .site-footer {
        width: calc(100% - 40px);
        margin-top: 18px;
    }

    .admin-header__inner,
    .admin-main {
        width: calc(100% - 28px);
    }

    .admin-brand small {
        display: none;
    }

    .admin-header__inner {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 0 6px;
    }

    .admin-nav {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .admin-nav a,
    .link-button {
        font-size: 12px;
    }

    .admin-titlebar {
        display: block;
    }

    .admin-titlebar h1 {
        font-size: 34px;
    }

    .admin-count {
        margin-top: 10px;
    }

    .admin-table thead {
        display: none;
    }

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

    .admin-table tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
    }

    .admin-table td {
        display: grid;
        grid-template-columns: 92px 1fr;
        padding: 5px 0;
        border: 0;
    }

    .admin-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: "Courier New", monospace;
        font-size: 10px;
    }

    .pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .password-panel {
        padding: 22px 18px;
    }

    .login-card {
        padding: 32px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
