/* 沈阳地铁乘客意见征集问卷 —— H5 样式
   设计基准 375px，向上自适应到 750px，向下兼容 320px */

:root {
    --brand: #005BAC;
    --brand-2: #0A7BC4;
    --brand-deep: #00427F;
    --brand-soft: #EAF2FA;
    --ink: #171A21;
    --ink-2: #3D4553;
    --sub: #79808D;
    --line: #E7EAEF;
    --bg: #F1F3F7;
    --card: #FFFFFF;
    --ok: #1B9C6B;
    --danger: #D64545;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px -8px rgba(16, 24, 40, .12);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

.shell {
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
}

/* ---------- 头部 ---------- */
.hero {
    position: relative;
    background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 62%, #2E9BD6 100%);
    color: #fff;
    padding: 30px 20px 54px;
    overflow: hidden;
}

.hero-art {
    position: absolute;
    inset: 0;
    opacity: .21;
    pointer-events: none;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    letter-spacing: .12em;
    opacity: .92;
    text-transform: uppercase;
}

.hero-brand .mark {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #fff;
    color: var(--brand);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0;
}

.hero h1 {
    position: relative;
    margin: 14px 0 6px;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: .01em;
}

.hero p {
    position: relative;
    margin: 0;
    font-size: 13px;
    opacity: .88;
}

/* ---------- 说明卡 ---------- */
.intro-wrap {
    margin: -38px 14px 0;
    position: relative;
    z-index: 2;
}

.intro-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 16px 14px;
}

.intro-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--sub);
    margin-bottom: 10px;
}

.intro-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
}

.intro-text {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.75;
    margin: 0;
}

.intro-text.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.intro-toggle {
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 13px;
    padding: 6px 0 0;
    cursor: pointer;
    font-weight: 600;
}

/* ---------- 进度 ---------- */
.progress {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(241, 243, 247, .92);
    backdrop-filter: saturate(160%) blur(8px);
    padding: 10px 14px 8px;
}

.progress-bar {
    height: 5px;
    border-radius: 3px;
    background: #DFE4EC;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand), #3AA0DD);
    transition: width .28s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--sub);
    margin-top: 6px;
}

/* ---------- 题目 ---------- */
.questions {
    padding: 6px 14px 0;
}

.q {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    scroll-margin-top: 64px;
}

.q-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.q-no {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 6px;
    padding: 2px 7px;
    letter-spacing: .04em;
    flex: none;
}

.q-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    flex: 1 1 220px;
}

.q-flag {
    font-size: 11px;
    color: var(--sub);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 5px;
    flex: none;
}

.q-hint {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--sub);
    line-height: 1.6;
}

.opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.opt {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #FBFCFE;
    cursor: pointer;
    transition: border-color .16s, background .16s;
    user-select: none;
}

.opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.opt-box {
    flex: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #C3CAD6;
    border-radius: 50%;
    background: #fff;
    margin-top: 1px;
    position: relative;
    transition: border-color .16s, background .16s;
}

.opt.multi .opt-box {
    border-radius: 5px;
}

.opt input:checked ~ .opt-box {
    border-color: var(--brand);
    background: var(--brand);
}

.opt input:checked ~ .opt-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(42deg);
}

.opt.multi input:checked ~ .opt-box::after {
    left: 5px;
    top: 1px;
}

.opt:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.opt:active {
    transform: scale(.995);
}

.opt-code {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--sub);
    flex: none;
    min-width: 14px;
    margin-top: 1px;
}

.opt:has(input:checked) .opt-code {
    color: var(--brand);
}

.opt-text {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
}

.opt:has(input:checked) .opt-text {
    color: var(--ink);
    font-weight: 500;
}

/* 其他说明输入 */
.other-wrap {
    display: none;
    margin-top: 8px;
    padding-left: 27px;
}

.other-wrap.is-open {
    display: block;
}

.other-wrap input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}

.other-wrap input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 91, 172, .12);
}

/* 折叠 */
.fold-hidden {
    display: none;
}

.more-btn {
    margin-top: 2px;
    border: 1px dashed #C8D2E0;
    background: #fff;
    color: var(--brand);
    border-radius: 10px;
    padding: 9px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.more-btn:active {
    background: var(--brand-soft);
}

/* 矩阵 */
.matrix {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mrow {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px 12px;
    background: #FBFCFE;
}

.mrow.is-error {
    border-color: var(--danger);
    background: #FFF8F8;
}

.mrow-label {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink);
    margin-bottom: 8px;
}

.mrow-label b {
    font-weight: 600;
}

.mrow-label span {
    display: block;
    color: var(--sub);
    font-size: 12px;
    margin-top: 2px;
}

.mopts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mopt {
    position: relative;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 2px;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    transition: .16s;
    user-select: none;
}

.mopt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mopt:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px -2px rgba(0, 91, 172, .5);
}

/* 文本题 */
textarea.ta {
    width: 100%;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14.5px;
    line-height: 1.65;
    font-family: inherit;
    color: var(--ink);
    background: #FBFCFE;
    resize: vertical;
    min-height: 92px;
    outline: none;
}

textarea.ta:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 91, 172, .12);
}

.counter {
    text-align: right;
    font-size: 12px;
    color: var(--sub);
    margin-top: 5px;
}

/* 错误 */
.err {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 7px;
}

.other-wrap input.err-input {
    border-color: var(--danger);
    background: #FFF8F8;
}

.other-wrap input.err-input::placeholder {
    color: #C97B7B;
}

.q.has-error {
    border: 1px solid #F0C6C6;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, .07);
}

/* ---------- 提交栏 ---------- */
.submit-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -18px rgba(16, 24, 40, .45);
}

.submit-inner {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.submit-note {
    font-size: 12px;
    color: var(--sub);
    line-height: 1.4;
    flex: 1;
}

.btn-primary {
    flex: none;
    border: 0;
    border-radius: 11px;
    padding: 12px 26px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(0, 91, 172, .7);
    transition: .18s;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px -6px rgba(0, 91, 172, .7);
}

.btn-primary[disabled] {
    opacity: .62;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- 提示条 ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%) translateY(8px);
    background: rgba(23, 26, 33, .92);
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: .22s;
    z-index: 40;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notice {
    margin: 12px 14px 0;
    border-radius: 10px;
    background: #FFF7E6;
    border: 1px solid #F5DFB2;
    color: #8A5A00;
    font-size: 13px;
    padding: 10px 12px;
    line-height: 1.6;
}

.notice.danger {
    background: #FFF2F2;
    border-color: #F3C9C9;
    color: #A03030;
}

/* ---------- 完成页 ---------- */
.done-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.done-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--brand), #3AA0DD);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 36px;
    box-shadow: 0 12px 28px -10px rgba(0, 91, 172, .8);
    margin-bottom: 22px;
}

.done-page h1 {
    font-size: 21px;
    margin: 0 0 10px;
    color: var(--ink);
}

.done-page p {
    color: var(--sub);
    font-size: 14px;
    margin: 0 0 8px;
    line-height: 1.75;
}

.done-card {
    margin-top: 26px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    width: 100%;
    max-width: 420px;
    text-align: left;
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.8;
}

.done-card b {
    color: var(--brand);
}

.footer-note {
    text-align: center;
    font-size: 11.5px;
    color: #A8AEB9;
    padding: 18px 0 26px;
}
