* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: #f7efe6 url("../img/pattern.svg") repeat;
    background-size: 120px;
    color: #3a1d14;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}
button { font-family: inherit; border: 0; outline: 0; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: #9a7b6c; font-size: 13px; }

/* 头部 */
.m-head {
    position: relative;
    background: radial-gradient(ellipse at 50% -20%, #f2412c 0%, #c4140f 45%, #8e0a0a 100%);
    color: #ffe7a8;
    text-align: center;
    overflow: hidden;
    padding: 26px 18px 34px;
}
.m-head::before {
    content: "";
    position: absolute; inset: 0;
    background: repeating-conic-gradient(from 0deg at 50% -10%, rgba(255, 215, 120, .10) 0 6deg, transparent 6deg 14deg);
    pointer-events: none;
}
.m-head::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px; height: 26px;
    background: url("../img/wave.svg") bottom center / 100% 100% no-repeat;
}
.m-head.has-img { padding: 0; }
.m-head.has-img::before, .m-head.has-img::after { display: none; }
.m-head img { display: block; width: 100%; }
.m-head-inner { position: relative; z-index: 1; }
.m-head-badge {
    display: inline-block; padding: 2px 14px; margin-bottom: 10px;
    border: 1px solid rgba(255, 220, 140, .7); border-radius: 20px;
    font-size: 12px; letter-spacing: 4px; color: #ffe2a0;
    background: rgba(0, 0, 0, .12);
}
.m-head h1 {
    font-size: 19px; line-height: 1.45; font-weight: 800; letter-spacing: 1px;
    background: linear-gradient(180deg, #fff6d6 0%, #ffd56a 60%, #f0ad2c 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 6px rgba(80, 0, 0, .25);
}
.m-head h2 { margin-top: 4px; font-size: 15px; font-weight: 600; color: #ffe2a0; }

.m-main { padding: 0 14px 10px; margin-top: -10px; position: relative; z-index: 2; }

.m-card {
    background: #fffdf9;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(150, 40, 20, .08);
    border: 1px solid #f3dcc4;
}
.m-loading, .m-msg { text-align: center; padding: 30px 18px; }
.m-msg h3 { font-size: 20px; color: #b3120f; margin: 10px 0 6px; }
.m-msg p { color: #7a5a4c; }

.spinner {
    width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%;
    border: 3px solid #f3d3b3; border-top-color: #c4140f; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.m-icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; position: relative; }
.m-icon::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; color: #fff; }
.icon-ok { background: linear-gradient(135deg, #f5c04a, #e08a12); box-shadow: 0 6px 16px rgba(224, 138, 18, .35); }
.icon-ok::after { content: "✓"; }
.icon-wait { background: linear-gradient(135deg, #e84a33, #b3120f); box-shadow: 0 6px 16px rgba(179, 18, 15, .3); animation: pulse 2s ease-in-out infinite; }
.icon-wait::after { content: "⏳"; font-size: 32px; }
.icon-warn { background: linear-gradient(135deg, #9a7b6c, #6b4c3e); }
.icon-warn::after { content: "!"; font-weight: 800; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.m-identity {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fffdf9; border: 1px solid #f3dcc4; border-radius: 30px;
    padding: 8px 14px; margin: 0 0 12px; font-size: 14px;
    box-shadow: 0 4px 14px rgba(150, 40, 20, .08);
}
.m-identity b { color: #b3120f; font-size: 16px; }
.m-identity .anon { margin-left: auto; font-size: 12px; color: #9a7b6c; }
.tag { padding: 1px 10px; border-radius: 12px; font-size: 13px; color: #fff; font-weight: 600; }
.tag-gold { background: linear-gradient(90deg, #e9a11b, #d07a06); }
.tag-red { background: linear-gradient(90deg, #e2382a, #b3120f); }

.m-topic { text-align: center; }
.m-topic-round {
    display: inline-block; font-size: 13px; color: #fff; padding: 1px 14px; border-radius: 12px;
    background: linear-gradient(90deg, #c4140f, #e2382a);
}
.m-topic-name { font-size: 18px; font-weight: 800; color: #8e0a0a; margin: 10px 0 4px; line-height: 1.45; }
.m-topic-unit { font-size: 14px; color: #8a6a5a; }

.m-tip {
    font-size: 13px; color: #8a5a2a; background: #fff4dc; border: 1px dashed #f0c46a;
    padding: 9px 12px; border-radius: 10px; margin-bottom: 12px;
}
.m-tip b { color: #c4140f; }

/* 评分项 */
.crit { transition: border-color .2s; }
.crit.unset { border-color: #f3dcc4; }
.crit:not(.unset) { border-color: #f0b44a; }
.crit-head { display: flex; align-items: center; gap: 8px; }
.crit-no {
    width: 24px; height: 24px; border-radius: 50%; flex: none; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #e2382a, #b3120f);
}
.crit-name { font-size: 17px; font-weight: 700; color: #5a1a0e; }
.crit-max { margin-left: auto; font-size: 13px; color: #b0641a; background: #fff1d6; padding: 1px 10px; border-radius: 10px; }
.crit-desc { margin: 10px 0 4px; font-size: 13px; color: #6b4c3e; }
.crit-desc summary { color: #b3120f; cursor: pointer; font-size: 13px; outline: none; }
.crit-desc[open] summary { margin-bottom: 6px; }
.crit-points, .crit-std { background: #fbf4ec; border-radius: 8px; padding: 8px 10px; margin-top: 6px; line-height: 1.7; }
.crit-std ul { padding-left: 18px; }

.chips { display: flex; gap: 8px; margin: 10px 0 2px; }
.chip {
    flex: 1; padding: 6px 0; border-radius: 8px; font-size: 14px; color: #8e0a0a;
    background: #fff6ea; border: 1px solid #f0d3b0;
}
.chip small { color: #a8826d; font-size: 12px; }
.chip.on { background: linear-gradient(135deg, #e2382a, #b3120f); color: #ffe7a8; border-color: #b3120f; }
.chip.on small { color: #ffd8a0; }

.crit-input { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.btn-step {
    width: 34px; height: 34px; border-radius: 50%; flex: none; font-size: 22px; line-height: 1;
    color: #b3120f; background: #fff1e4; border: 1px solid #f0c9a8;
}
.btn-step:active { background: #ffe0c4; }
.crit-input input[type=range] {
    flex: 1; min-width: 0; height: 6px; -webkit-appearance: none; appearance: none;
    background: linear-gradient(90deg, #f6c35c, #e2382a); border-radius: 3px; outline: none;
}
.crit.unset input[type=range] { background: #ecdccd; }
.crit-input input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 3px solid #c4140f; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.crit.unset input[type=range]::-webkit-slider-thumb { border-color: #c9b2a2; }
.crit-val { display: flex; align-items: baseline; gap: 2px; flex: none; }
.crit-val input {
    width: 58px; height: 38px; text-align: center; font-size: 20px; font-weight: 800; color: #b3120f;
    border: 1.5px solid #f0c9a8; border-radius: 8px; background: #fff; outline: none; font-family: inherit;
    -moz-appearance: textfield;
}
.crit-val input::-webkit-outer-spin-button, .crit-val input::-webkit-inner-spin-button { -webkit-appearance: none; }
.crit-val input::placeholder { font-size: 13px; font-weight: 400; color: #c9b2a2; }
.crit-val input:focus { border-color: #c4140f; }
.crit-val span { font-size: 13px; color: #8a6a5a; }

/* 底部提交栏 */
.m-bar-space { height: 76px; }
.m-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #a80d0b, #7d0607);
    box-shadow: 0 -4px 16px rgba(100, 0, 0, .25);
    color: #ffe7a8;
}
.m-bar-total { display: flex; align-items: baseline; gap: 4px; }
.m-bar-total small { font-size: 12px; opacity: .85; }
.m-bar-total b { font-size: 28px; color: #ffd56a; font-weight: 800; }
.m-bar-total span { font-size: 13px; opacity: .8; }
.m-bar-count { font-size: 12px; opacity: .85; margin-left: auto; }
.btn-submit {
    padding: 0 22px; height: 44px; border-radius: 22px; font-size: 16px; font-weight: 700;
    color: #7d0607; background: linear-gradient(180deg, #ffe9a6, #f5b935);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}
.btn-submit:disabled { opacity: .6; }
.btn-ghost {
    padding: 0 18px; height: 44px; border-radius: 22px; font-size: 15px;
    color: #8e0a0a; background: #fff; border: 1px solid #e8c7a8;
}

.m-lock {
    display: inline-block; margin: 12px 0 6px; padding: 3px 14px; border-radius: 14px;
    background: #fff1d6; color: #b0641a; font-size: 13px;
}
.m-mytable { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; text-align: left; }
.m-mytable td { padding: 8px 6px; border-bottom: 1px dashed #efdcc8; }
.m-mytable td:last-child { text-align: right; font-weight: 600; color: #8e0a0a; }
.m-mytable tfoot td { border-bottom: 0; font-size: 16px; font-weight: 800; color: #b3120f; padding-top: 10px; }

.m-countdown { display: flex; justify-content: center; gap: 8px; margin: 18px 0 12px; }
.m-countdown span { font-size: 13px; color: #8a6a5a; }
.m-countdown b {
    display: inline-block; min-width: 44px; padding: 6px 4px; margin-right: 2px; border-radius: 8px;
    font-size: 24px; color: #ffe7a8; background: linear-gradient(180deg, #d42318, #8e0a0a);
}

/* 弹窗 & 提示 */
.modal {
    position: fixed; inset: 0; z-index: 50; background: rgba(40, 0, 0, .55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box { width: 100%; max-width: 380px; background: #fffdf9; border-radius: 16px; padding: 20px 18px 16px; }
.modal-box h3 { text-align: center; color: #b3120f; font-size: 18px; }
.modal-topic { text-align: center; color: #6b4c3e; font-size: 14px; margin-top: 4px; }
.modal-warn { text-align: center; color: #c4140f; font-size: 13px; margin-bottom: 12px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns button { flex: 1; }
.toast {
    position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 60;
    max-width: 80%; padding: 10px 18px; border-radius: 10px; text-align: center;
    background: rgba(40, 10, 5, .85); color: #fff; font-size: 14px;
}

.m-foot { text-align: center; padding: 14px 0 24px; }
.m-foot a { color: #b09080; font-size: 12px; text-decoration: none; }
