﻿/* Mobile-first questionnaire layout — UTF-8 */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; color: #f5f5f7; background: #0f0f14; }

.bg-layer { position: fixed; inset: 0; z-index: 0; background-image: url("../Images/background.png"); background-position: center center; background-size: cover; background-repeat: no-repeat; }

.page-shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top, 0)) calc(16px + env(safe-area-inset-right, 0)) calc(16px + env(safe-area-inset-bottom, 0)) calc(16px + env(safe-area-inset-left, 0)); }

/* Intro — Title/Logo 顶距 10%；正文有字号上限；纵向用 space-between 分段均分留白，避免出现「一整条中空带」 */
.intro-panel { display: flex; flex-direction: column; align-items: stretch; flex: 1; width: 100%; max-width: 520px; margin: 0 auto; min-height: 0; transition: transform 0.55s ease, opacity 0.55s ease; will-change: transform, opacity; }

    .intro-panel.is-exiting { transform: translateY(72px); opacity: 0; pointer-events: none; }

.intro-content { flex: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; width: 100%; min-height: 0; box-sizing: border-box; /* 按钮与底边的留白（明显一点，避免贴底）；含安全区 */ padding-bottom: calc(clamp(28px, calc(18px + 5.5vh), 88px) + env(safe-area-inset-bottom, 0)); }

.intro-head { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; width: 100%; }

.intro-title-img { display: block; margin: 10% auto 0; max-width: 88vw; width: min(92%, 420px); height: auto; }

.intro-logo-img { display: block; margin: 16px auto 0; max-width: 72vw; width: min(78%, 340px); height: auto; }

.intro-card { flex: 0 1 auto; display: flex; flex-direction: column; justify-content: flex-start; margin: 0; min-height: 0; width: 100%; padding: clamp(14px, 2.5vh, 22px) clamp(16px, 4vw, 22px); border-radius: 14px; background: rgba(0, 0, 0, 0.38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, 0.08); }

.intro-text { margin: 0; /* vw+vh+vmin 略增强随屏变化；上限 18px 与 .q-heading 一致，选项仍为 15px，整体阶次：选项 < 首页说明 ≈ 题目标题 */ font-size: clamp(14px, calc(3.05vw + 0.72vh + 0.2vmin), 18px); line-height: 1.62; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 12px rgba(0, 0, 0, 0.45); }

.btn-start { flex-shrink: 0; margin-top: 0; margin-left: auto; margin-right: auto; padding: 0; border: none; background: transparent; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; display: flex; justify-content: center; align-items: center; width: auto; max-width: 100%; }

    .btn-start img { display: block; margin-left: auto; margin-right: auto; width: clamp(200px, calc(58vw + 2vh), 340px); max-width: 78vw; height: auto; }

.pulse-target { animation: breathe 2.6s ease-in-out infinite alternate; }

@keyframes breathe {
    from { transform: scale(1); }
    to { transform: scale(1.13); }
}

@media (prefers-reduced-motion: reduce) {
    .intro-panel { transition: none; }

    .pulse-target { animation: none; }
}

/* Survey — 顶部留白，题目区不贴边 */
.survey-root { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding-top: clamp(28px, 8vh, 52px); box-sizing: border-box; }

.is-hidden { display: none !important; }

.survey-root.is-hidden { display: none !important; }

.progress-bar { text-align: center; margin-top: 0; margin-bottom: clamp(16px, 3vh, 28px); font-size: 14px; opacity: 0.92; letter-spacing: 0.02em; }

.survey-section { display: flex; flex-direction: column; padding: 16px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); margin-bottom: clamp(14px, 3vh, 22px); }

    .survey-section:last-child { margin-bottom: 0; }

.survey-step { display: none; flex-direction: column; flex: 1; min-height: 0; }

    .survey-step.is-active { display: flex; }

.q-heading { margin: 0 0 14px; font-size: clamp(16px, 4.2vw, 18px); font-weight: 600; line-height: 1.45; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 0, 0, 0.35); }

.option-list { display: flex; flex-direction: column; gap: 10px; }

.option-btn { min-height: 46px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(20, 20, 28, 0.55); color: #f5f5f7; font-size: 15px; text-align: left; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease; }

    .option-btn:active { transform: scale(0.98); }

    .option-btn.is-selected { border-color: rgba(255, 214, 120, 0.95); background: rgba(255, 200, 80, 0.22); }

    .option-btn.toggle.is-selected { border-color: rgba(120, 210, 255, 0.95); background: rgba(80, 170, 255, 0.22); }

.btn-next,
.btn-submit { margin-top: auto; padding: 14px 18px; border-radius: 12px; border: none; font-size: 16px; font-weight: 600; cursor: pointer; touch-action: manipulation; background: linear-gradient(180deg, rgba(255, 210, 120, 1), rgba(230, 170, 60, 1)); color: #1a1206; }

    .btn-next:disabled,
    .btn-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.field-group { margin-bottom: 14px; }

    .field-group label { display: block; margin-bottom: 6px; font-size: 14px; opacity: 0.95; }

    .field-group input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(10, 10, 16, 0.65); color: #fff; font-size: 16px; }

        .field-group input::placeholder { color: rgba(255, 255, 255, 0.4); }

.form-message { min-height: 1.4em; margin: 10px 0; font-size: 14px; color: #ffb4b4; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

    .form-message.is-ok { color: #b8f5c8; }

.contact-section .field-group { margin-bottom: 12px; }

.btn-submit { display: block; width: min(100%, 440px); margin: 14px auto 8px; padding: 15px 18px; }

.contact-section { padding-bottom: 18px; }

/* Modal — Success dialog (no alert) */
.modal-overlay[hidden] { display: none !important; }

.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.modal-card { width: min(92vw, 420px); border-radius: 16px; padding: 18px 16px 16px; color: #f5f5f7; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); outline: none; }

.modal-title { font-size: 18px; font-weight: 700; margin: 2px 0 10px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65); }

.modal-desc { font-size: 14px; line-height: 1.65; opacity: 0.95; margin: 0 0 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }

.modal-btn { display: block; width: min(100%, 320px); margin: 0 auto; padding: 14px 18px; border-radius: 12px; border: none; font-size: 16px; font-weight: 700; cursor: pointer; touch-action: manipulation; background: linear-gradient(180deg, rgba(255, 210, 120, 1), rgba(230, 170, 60, 1)); color: #1a1206; }

@media (prefers-reduced-motion: no-preference) {
    .modal-overlay { animation: modalFadeIn 160ms ease-out both; }
    .modal-card { animation: modalPopIn 180ms ease-out both; }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPopIn {
    from { transform: translateY(8px) scale(0.98); }
    to { transform: translateY(0) scale(1); }
}
