/* 张亦春金融学奖终审投票 —— 米黄底 + 深绿字 + 金色点缀 */
:root {
    --bg: #f3eddc;
    --card: #fffcf2;
    --card-soft: #faf5e6;
    --gold-soft: #fbf4e0;
    --ink: #1c3b2e;
    --ink-2: #5f7466;
    --ink-3: #748577;
    --ink-4: #8b9a8d;
    --line: #e1d7bf;
    --line-2: #e6dcc6;
    --line-3: #ece4ce;
    --gold: #b8912f;
    --gold-ink: #8a6b1c;
    --gold-light: #e9ce8a;
    --disabled: #d8d0ba;
    --disabled-ink: #8d9184;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 72px;
}

.wrap-wide {
    max-width: 900px;
}

/* 顶部 */
.head {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0;
    color: var(--gold-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
}

h1 {
    margin: 10px 0 0;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.4;
}

.lede {
    margin: 12px 0 0;
    color: var(--ink-2);
    font-size: 17px;
}

/* 匿名承诺：红色粗体，作为对投票人的明确保证 */
.pledge {
    margin: 12px 0 0;
    padding: 10px 0 10px 14px;
    border-left: 3px solid #a32b1e;
    color: #a32b1e;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.8;
    text-align: justify;
}

/* 卡片 */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px;
}

.card + .card {
    margin-top: 18px;
}

/* 倒计时 */
.countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 20px 20px 16px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: var(--gold-soft);
}

.cd-label {
    color: var(--gold-ink);
    font-size: 14px;
    letter-spacing: 3px;
}

.cd-units {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cd-num {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.cd-unit {
    margin-right: 8px;
    color: var(--ink-2);
    font-size: 15px;
}

.cd-deadline {
    color: #9a8f70;
    font-size: 14px;
    letter-spacing: 1px;
}

/* 表单 */
label.field {
    display: block;
}

.field-label {
    display: block;
    color: var(--gold-ink);
    font-size: 14px;
    letter-spacing: 2px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    margin-top: 4px;
    padding: 10px 2px;
    border: none;
    border-bottom: 1px solid var(--gold);
    background: transparent;
    color: var(--ink);
    font-size: 20px;
    letter-spacing: 2px;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-bottom-color: var(--ink);
}

input::placeholder {
    color: #b3b19c;
    letter-spacing: 0;
    font-size: 17px;
}

.btn {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 15px 20px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: var(--ink);
    color: var(--gold-light);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: filter .15s ease;
}

.btn:hover {
    filter: brightness(1.12);
}

.btn:disabled {
    border-color: var(--disabled);
    background: var(--disabled);
    color: var(--disabled-ink);
    cursor: not-allowed;
    filter: none;
}

.btn-sm {
    width: auto;
    margin: 0;
    padding: 9px 18px;
    font-size: 15px;
    letter-spacing: 1px;
}

.btn-ghost {
    display: inline-block;
    padding: 9px 20px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: var(--card);
    color: var(--gold-ink);
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--gold-soft);
}

button.btn-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--ink-4);
    font-size: 15px;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
}

/* 提示 */
.notice {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-left: 4px solid var(--ink);
    border-radius: 4px;
    background: #f7f2e2;
    color: var(--ink);
    font-size: 16px;
}

.notice.error {
    border-left-color: var(--gold);
    background: #fbf3dd;
}

.notice strong {
    font-weight: 600;
}

.hint {
    margin: 14px 0 0;
    color: var(--ink-4);
    font-size: 15px;
    line-height: 1.8;
}

/* 说明 */
.brief-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-3);
}

.brief-label {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
}

.brief-text {
    margin: 18px 0 0;
    color: #3d574a;
    font-size: 16.5px;
    line-height: 1.95;
    text-align: justify;
}

.brief-plain {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #ddd3b8;
}

.plain-line {
    margin: 0;
    color: #3d574a;
    font-size: 16px;
    line-height: 2;
    text-align: left;
}

/* 每个候选人作为一个不可分割的整块，窄屏时整体换行，不会把「（13分）」拆开 */
.score-item {
    display: inline-block;
    white-space: nowrap;
    margin-right: 10px;
}

.score-item:last-child {
    margin-right: 0;
}

.plain-heading {
    margin-top: 14px;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: .5px;
}

/* 评审环节行：比奖项标题低一级，左缩进；小标题独占一行，
   候选人另起一行排，避免「初评（满分30分）：」把第一行挤得只剩一个人。 */
.plain-sub {
    padding-left: 1.1em;
    line-height: 1.85;
}

.score-label {
    display: block;
    color: var(--gold-ink);
    font-weight: 600;
    line-height: 1.75;
}

.brief-invite {
    margin: 20px 0 0;
    padding: 14px 16px;
    border-left: 4px solid var(--gold);
    border-radius: 4px;
    background: var(--gold-soft);
    color: var(--ink);
    font-size: 17px;
    line-height: 1.8;
}

details.brief summary {
    cursor: pointer;
    list-style: none;
}

details.brief summary::-webkit-details-marker {
    display: none;
}

details.brief summary .toggle::after {
    content: "收起";
}

details.brief:not([open]) summary .toggle::after {
    content: "展开";
}

.toggle {
    color: var(--gold-ink);
    font-size: 15px;
    text-decoration: underline;
}

/* 奖项 */
.award {
    margin-top: 18px;
}

.award-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.award-no {
    color: var(--gold-ink);
    font-size: 18px;
    font-weight: 600;
}

.award-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.award-sub {
    margin: 6px 0 0;
    color: var(--ink-4);
    font-size: 15px;
}

.option {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}

.option:hover {
    border-color: var(--gold);
}

.option:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.option.on {
    border-color: var(--gold);
    background: var(--gold-soft);
}

.option .dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 1px solid #b8bda8;
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
    transition: box-shadow .12s ease;
}

.option.on .dot {
    box-shadow: inset 0 0 0 5px var(--ink);
    border-color: var(--ink);
}

.option .main {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.option .name {
    display: block;
    font-size: 18px;
    font-weight: 500;
}

.option .sub {
    display: block;
    margin-top: 2px;
    color: var(--ink-4);
    font-size: 14.5px;
}

.option .pdf {
    flex: 0 0 auto;
    padding: 3px 9px;
    border: 1px solid var(--gold);
    border-radius: 3px;
    color: var(--gold-ink);
    font-size: 13px;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    background: none;
    font-family: inherit;
}

.option .pdf:hover {
    background: var(--ink);
    color: var(--gold-light);
    border-color: var(--ink);
}

.award-tip {
    margin: 14px 0 0;
    color: #8b9a8d;
    font-size: 14.5px;
}

/* 提交 */
.actions {
    margin-top: 26px;
    text-align: center;
}

.actions .hint {
    margin-top: 12px;
}

/* 弹层 */
.mask {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 52, 42, .58);
    z-index: 50;
}

.mask.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
}

/* 候选人材料：宽高均占屏幕 90%，尽量给材料留出阅读空间 */
.modal-full {
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-full .modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line-2);
}

.modal-head h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
}

.modal-close {
    border: none;
    background: none;
    color: var(--ink-4);
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.modal-body {
    padding: 20px 22px 24px;
    overflow: auto;
}

.modal-body p {
    margin: 0 0 12px;
    color: var(--ink-2);
    font-size: 16.5px;
    line-height: 1.7;
}

.ticket-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: var(--card-soft);
    font-size: 15px;
}

.ticket-box .lbl {
    color: var(--ink-4);
    letter-spacing: 2px;
    font-size: 14px;
}

.ticket-box .code {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

.pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: var(--card-soft);
    font-size: 16px;
}

.pick-row .a {
    color: var(--ink-2);
}

.pick-row .b {
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .btn {
    margin-top: 0;
}

.modal-actions .btn-ghost {
    flex: 0 0 auto;
    padding: 15px 22px;
}

/* PDF 预览 */
/* 材料查看器：直接显示预渲染的页图，手机浏览器同样可预览 */
.material-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: #ece5d1;
}

.material-page {
    display: block;
    margin: 0 auto 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(20, 52, 42, .12);
}

.material-page:last-child {
    margin-bottom: 0;
}

.material-loading {
    padding: 40px 16px;
    color: var(--ink-4);
    font-size: 15px;
    text-align: center;
}

.modal-head-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.modal-meta {
    color: var(--gold-ink);
    font-size: 14px;
}

.pdf-fallback {
    flex: 0 0 auto;
    margin: 12px 0 0;
    color: var(--ink-4);
    font-size: 14px;
    line-height: 1.7;
}

.pdf-fallback a {
    color: var(--gold-ink);
    white-space: nowrap;
}

/* 结果页 */
.result-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold-light);
    font-size: 24px;
}

.result-rows {
    margin-top: 18px;
    border-top: 1px solid var(--line-3);
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-3);
    font-size: 16.5px;
}

.result-row .a {
    color: var(--ink-2);
}

.result-row .b {
    font-weight: 600;
}

.thanks-block {
    margin-top: 18px;
    padding: 22px 22px;
    border-radius: 10px;
    background: var(--ink);
    color: #eee5cd;
    font-size: 16.5px;
    line-height: 1.9;
}

/* 管理端 */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
}

.stat {
    padding: 18px 8px;
    text-align: center;
    border-right: 1px solid var(--line-3);
}

.stat:last-child {
    border-right: none;
}

.stat .n {
    display: block;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.stat .l {
    display: block;
    margin-top: 4px;
    color: var(--gold-ink);
    font-size: 13.5px;
    letter-spacing: 1px;
}

.deadline-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 18px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: var(--gold-soft);
    font-size: 15px;
}

.deadline-bar .l {
    color: var(--gold-ink);
    letter-spacing: 2px;
    font-size: 14px;
}

.deadline-bar .v {
    font-weight: 600;
    letter-spacing: 1px;
}

.section {
    margin-top: 18px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-3);
}

.section-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.section-head .n {
    color: var(--gold-ink);
    font-size: 15px;
}

.rank-row {
    padding: 14px 0;
    border-bottom: 1px solid #f2ecda;
}

.rank-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rank-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.rank-name {
    font-size: 17px;
}

.rank-votes {
    color: var(--gold-ink);
    font-size: 19px;
    font-weight: 600;
}

.rank-sub {
    margin: 2px 0 0;
    color: #8b9a8d;
    font-size: 14px;
}

.bar {
    height: 5px;
    margin-top: 8px;
    border-radius: 3px;
    background: var(--line-3);
    overflow: hidden;
}

.bar > i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--gold);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 6px;
}

.filters a {
    padding: 5px 14px;
    border: 1px solid #ddd3b8;
    border-radius: 20px;
    color: var(--ink-2);
    font-size: 14.5px;
    text-decoration: none;
}

.filters a.on {
    border-color: var(--gold);
    background: var(--ink);
    color: var(--gold-light);
}

.ticket-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f2ecda;
    font-size: 15.5px;
}

.ticket-row:last-child {
    border-bottom: none;
}

.ticket-row .code {
    flex: 1;
    letter-spacing: 1px;
    font-size: 16px;
}

.ticket-row .time {
    color: #b3b19c;
    font-size: 13.5px;
}

.pill {
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 13.5px;
}

.pill.unused {
    background: #efe8d4;
    color: #7d8c7f;
}

.pill.used {
    background: #e4dcc2;
    color: var(--ink);
}

.pill.submitted {
    background: var(--ink);
    color: var(--gold-light);
}

.inline-form {
    display: inline;
}

.link-danger {
    border: none;
    background: none;
    padding: 0;
    color: var(--gold-ink);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
}

.ops {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ops a,
.ops button {
    padding: 8px 16px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: none;
    color: var(--gold-ink);
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.ops a:hover,
.ops button:hover {
    background: var(--gold-soft);
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.form-row > label {
    flex: 0 0 76px;
    color: var(--ink-2);
    font-size: 15px;
}

.form-row input {
    flex: 1;
    margin-top: 0;
    font-size: 17px;
    padding: 8px 2px;
}

.codes {
    margin: 14px 0 0;
    padding: 14px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14.5px;
    line-height: 1.9;
    white-space: pre;
}

.foot {
    margin-top: 36px;
    text-align: center;
    color: #a8b3a5;
    font-size: 14px;
}

.foot a {
    color: var(--gold-ink);
}

.foot .build {
    display: block;
    margin-top: 6px;
    color: #bcbfae;
    font-size: 13px;
    letter-spacing: 1px;
}

/* 手机 */
@media (max-width: 560px) {
    .wrap {
        padding: 28px 16px 56px;
    }

    .card {
        padding: 22px 18px;
    }

    h1 {
        font-size: 26px;
    }

    .cd-num {
        font-size: 30px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat:nth-child(2) {
        border-right: none;
    }

    .stat:nth-child(1),
    .stat:nth-child(2) {
        border-bottom: 1px solid var(--line-3);
    }

    .section {
        padding: 18px 16px;
    }
}

