:root {
    --paper: #f5f1e8;
    --paper-deep: #ece5d8;
    --card: #fffdf8;
    --ink: #1d1b18;
    --ink-soft: #4a453d;
    --muted: #837a6c;
    --line: #e3dbcd;
    --line-strong: #d3c8b6;
    --red: #a81f2d;
    --red-deep: #8c1824;
    --red-tint: #fbeeec;
    --green: #3d7a4a;
    --shadow: 0 10px 30px rgba(35, 28, 18, .07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #e8e1d4;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(168, 31, 45, .06), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(70, 60, 40, .08), transparent 40%);
    color: var(--ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button { font-family: inherit; }

.page {
    position: relative;
    max-width: 760px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--paper);
    box-shadow: 0 0 80px rgba(40, 30, 15, .12);
    overflow-x: hidden;
}

/* ---------- 通用按钮 ---------- */
.btn-primary {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 14px 20px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(168, 31, 45, .22);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: translateY(1px) scale(.995); background: var(--red-deep); }
.btn-primary:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }

.btn-ghost {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-soft);
    border-radius: 10px;
    font-size: 15px;
    padding: 13px 22px;
    cursor: pointer;
}

/* ---------- 开始页 ---------- */
.screen { min-height: 100vh; }

.screen-start {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px 24px 22px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, .65), rgba(245, 241, 232, 0) 42%),
        var(--paper);
}

.start-top { padding-top: 10px; }

.seal-lg {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 8px 18px rgba(168, 31, 45, .25);
    transform: rotate(-2deg);
    margin-bottom: 22px;
}
.seal-lg span { display: inline-block; transform: rotate(2deg); white-space: nowrap; }

.org {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--red);
    font-weight: 600;
}

.start-title {
    margin: 0 0 18px;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
    font-size: 31px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 1px;
}

.lead {
    margin: 0 0 24px;
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.85;
}

.record-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--red);
    border-radius: 10px;
    margin-bottom: 26px;
}
.rec-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--red-tint);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-notice strong { display: block; font-size: 14px; margin-bottom: 3px; }
.record-notice p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.btn-start { font-size: 17px; padding: 16px; }

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

.start-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 1px;
}
.start-meta i { display: block; width: 3px; height: 3px; background: var(--line-strong); border-radius: 50%; }

.start-footer {
    text-align: center;
    font-size: 11px;
    color: #a3988a;
    letter-spacing: 2px;
    padding-top: 26px;
}

/* ---------- 顶部录音/进度条 ---------- */
.survey { padding-bottom: 104px; }

.survey-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(245, 241, 232, .94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 9px;
}

.rec-state {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--red);
    font-weight: 600;
    letter-spacing: .5px;
}
.rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 0 rgba(168, 31, 45, .45);
    animation: pulse 1.8s infinite;
}
.rec-state.paused .rec-dot { background: #b3a99a; animation: none; }
.rec-state.paused { color: var(--muted); }
.rec-state.error .rec-dot { background: #c98b22; animation: none; }
.rec-state.error { color: #9a6a10; }
.rec-time {
    font-variant-numeric: tabular-nums;
    font-family: "SF Mono", "Consolas", monospace;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: 0;
}

.step-indicator { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.step-indicator b { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }

.progress { height: 2px; background: var(--line); }
.progress span {
    display: block;
    height: 100%;
    background: var(--red);
    transition: width .35s ease;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(168, 31, 45, .45); }
    70% { box-shadow: 0 0 0 8px rgba(168, 31, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 31, 45, 0); }
}

/* ---------- 逐题页面 ---------- */
.q-page { display: none; padding: 8px 18px 6px; }
.q-page.is-active { display: block; }

.step-head { padding: 20px 4px 6px; }
.step-kicker {
    margin: 0 0 6px;
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--red);
    font-weight: 700;
}
.step-head h2 {
    margin: 0;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
    font-size: 24px;
    letter-spacing: 1px;
}
.step-sub { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }
.step-note {
    margin: 22px 4px 6px;
    font-size: 11.5px;
    color: #9b9184;
    text-align: center;
}
.step-note .req { margin: 0 2px; }

/* ---------- 自动信息卡 ---------- */
.meta-card {
    background: rgba(255, 253, 248, .7);
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 14px 0 6px;
}
.meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12.5px;
    flex-wrap: wrap;
}
.meta-row + .meta-row { border-top: 1px dotted var(--line); }
.meta-k { color: var(--muted); flex: 0 0 auto; }
.meta-v { color: var(--ink); font-variant-numeric: tabular-nums; }
.meta-gps { font-size: 12px; color: var(--green); }
.meta-auto { margin-left: auto; font-style: normal; font-size: 10px; color: #a99e8e; }
.meta-input {
    flex: 1;
    min-width: 140px;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    background: transparent;
    padding: 3px 2px;
    font-size: 12.5px;
    color: var(--ink);
}
.meta-input:focus { outline: none; border-bottom-color: var(--red); }

/* ---------- 题目卡片 ---------- */
.q {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 16px 16px;
    margin: 14px 0;
    box-shadow: var(--shadow);
}

.q-head { display: flex; gap: 9px; align-items: flex-start; }
.q-no {
    flex: 0 0 auto;
    min-width: 34px;
    height: 20px;
    padding: 0 6px;
    border: 1px solid var(--red);
    border-radius: 4px;
    color: var(--red);
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .5px;
    margin-top: 2px;
    font-family: "SF Mono", "Consolas", monospace;
}
.q-title {
    margin: 0;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: .3px;
}
.req { color: var(--red); font-style: normal; margin-left: 3px; }
.q-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.q-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 10px;
    color: var(--red);
    border: 1px solid rgba(168, 31, 45, .35);
    background: var(--red-tint);
    padding: 1px 7px;
    border-radius: 20px;
    letter-spacing: 1px;
}
.q-tip { margin: 8px 2px 0; font-size: 11.5px; color: var(--red); }

.q.invalid { border-color: rgba(168, 31, 45, .55); animation: shake .32s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---------- 选项 ---------- */
.q-body { margin-top: 14px; }

.select-wrap { position: relative; }
.select-wrap select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 8px;
    padding: 12px 40px 12px 13px;
    font-size: 14.5px;
    color: var(--ink);
    font-family: inherit;
}
.select-wrap select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(168, 31, 45, .08); }
.select-wrap::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.options { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }

.option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option .ind {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    border: 1.5px solid #c9bfae;
    border-radius: 50%;
    position: relative;
    transition: all .15s ease;
}
.option .ind-check { border-radius: 5px; }
.option .txt { flex: 1; }
.option .note { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; flex: 0 0 auto; }
.option .note-stop { color: var(--red); }
.option .note-go { color: var(--green); }
.option.on { border-color: var(--red); background: var(--red-tint); }
.option.on .ind { border-color: var(--red); background: var(--red); }
.option.on .ind::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.option.on .ind-check::after {
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 0;
    background: transparent;
    transform: translate(-50%, -65%) rotate(-45deg);
}
.option.on .note-stop { color: var(--red-deep); }

.other-wrap { padding: 2px 0 0 0; }
.other-input, .text-input, textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--ink);
    resize: vertical;
}
.other-input:focus, .text-input:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(168, 31, 45, .08);
}
.text-input { margin-top: 12px; }

/* ---------- 评分 ---------- */
.score-block { margin-top: 15px; }
.legend {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.scale { display: flex; gap: 4px; }
.scale-btn {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.scale-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
    transition: all .13s ease;
}
.scale-btn.on span {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(168, 31, 45, .18);
}

/* ---------- 网格题 ---------- */
.grid { margin-top: 14px; }
.grid-legend { margin-bottom: 2px; }
.grid-row {
    padding: 13px 0 14px;
    border-top: 1px dotted var(--line);
}
.grid-row:first-of-type { border-top: 0; }
.row-label {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.55;
    margin-bottom: 9px;
    color: var(--ink);
}
.scale-extra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 7px;
    border: 1px dashed var(--line-strong);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11.5px;
    color: var(--muted);
    cursor: pointer;
}
.scale-extra input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-extra.on { border-color: var(--red); color: var(--red); background: var(--red-tint); border-style: solid; }

.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { flex: 1; min-width: 84px; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    color: var(--ink-soft);
    transition: all .13s ease;
}
.pill.on span { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

.reason {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fbf7ef;
    border-left: 2px solid var(--red);
    border-radius: 0 8px 8px 0;
}
.reason-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: var(--red-deep);
    font-weight: 600;
    margin-bottom: 6px;
}
.reason-label span { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.reason textarea { font-size: 13px; background: #fff; }

/* ---------- 底部导航 ---------- */
.step-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 760px;
    display: flex;
    gap: 10px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: rgba(245, 241, 232, .96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    z-index: 40;
}
.step-nav .btn-primary { flex: 2; padding: 13px; }
.step-nav .btn-ghost { flex: 1; padding: 13px; }
.step-nav.single .btn-primary { flex: 1; }

.upload-state {
    position: fixed;
    top: 64px;
    right: 16px;
    z-index: 50;
    background: rgba(29, 27, 24, .88);
    color: #fff;
    font-size: 11.5px;
    padding: 7px 12px;
    border-radius: 20px;
    letter-spacing: .5px;
}

/* ---------- 结束页 ---------- */
.screen-done {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: var(--paper);
}
.done-inner { text-align: center; max-width: 420px; }
.done-mark {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin: 0 auto 22px;
    background: #edf3ed;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfe2d1;
}
.done-mark.stop { background: var(--red-tint); color: var(--red); border-color: #eccbc7; }
.done-inner h2 {
    font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
    font-size: 26px;
    margin: 0 0 10px;
    letter-spacing: 1px;
}
.done-inner p { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; line-height: 1.8; }
.done-meta {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 26px 0 8px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.done-meta span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.done-meta strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.done-hint { margin-top: 18px !important; font-size: 12px !important; color: #a3988a !important; }

.noscript {
    position: fixed;
    inset: 0;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    font-size: 15px;
    z-index: 99;
}

@media (max-width: 360px) {
    .scale-btn span { height: 31px; font-size: 12px; }
    .start-title { font-size: 28px; }
    .q { padding: 16px 13px 14px; }
}

@media (min-width: 761px) {
    body { padding: 24px 0; }
    .page { min-height: calc(100vh - 48px); border-radius: 16px; overflow: hidden; }
    .step-nav { bottom: 24px; border-radius: 0 0 16px 16px; }
}
