:root {
    --ink: #142d2b;
    --muted: #60716f;
    --paper: #f7f8f3;
    --card: rgba(255, 255, 255, 0.88);
    --line: #dfe6df;
    --teal: #0c766d;
    --teal-dark: #07584f;
    --mint: #c9e8dd;
    --coral: #f27d5f;
    --cream: #f1ead9;
    --danger: #b84238;
    --shadow: 0 24px 70px rgba(27, 62, 58, 0.10);
    --progress: 0deg;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, #f5f5ee 0%, #f9fbf7 40%, #edf4ef 100%);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    line-height: 1.65;
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.page-glow {
    position: fixed;
    z-index: -1;
    width: 38rem;
    height: 38rem;
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
}

.page-glow-one {
    top: -19rem;
    right: -12rem;
    background: radial-gradient(circle, rgba(242, 125, 95, 0.18), transparent 68%);
}

.page-glow-two {
    top: 35rem;
    left: -22rem;
    background: radial-gradient(circle, rgba(12, 118, 109, 0.13), transparent 68%);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    color: white;
    background: var(--ink);
    border-radius: 11px 11px 11px 3px;
    place-items: center;
}

.header-pill {
    padding: 7px 14px;
    color: var(--teal-dark);
    background: rgba(201, 232, 221, 0.65);
    border: 1px solid rgba(12, 118, 109, 0.12);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.page-wrap,
.admin-wrap {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0 100px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 70px;
    align-items: center;
    min-height: 430px;
    padding: 34px 0 70px;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.hero h1,
.admin-heading h1 {
    max-width: 760px;
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(42px, 6vw, 74px);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.hero-description {
    max-width: 620px;
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-top: 34px;
    color: #47615e;
    font-size: 13px;
}

.hero-meta span {
    position: relative;
}

.hero-meta span:not(:last-child)::after {
    position: absolute;
    top: 50%;
    right: -14px;
    width: 3px;
    height: 3px;
    background: var(--coral);
    border-radius: 50%;
    content: "";
}

.hero-visual {
    position: relative;
    height: 330px;
}

.market-card {
    position: absolute;
    overflow: hidden;
    border: 1px solid rgba(20, 45, 43, 0.08);
    box-shadow: var(--shadow);
}

.market-card-back {
    top: 5px;
    right: 6px;
    display: flex;
    flex-direction: column;
    width: 210px;
    height: 170px;
    padding: 28px;
    color: var(--ink);
    background: var(--cream);
    border-radius: 26px 26px 8px 26px;
    transform: rotate(7deg);
}

.market-card-back span {
    color: #826f51;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.market-card-back strong {
    margin-top: auto;
    font-family: Georgia, serif;
    font-size: 37px;
}

.market-card-front {
    bottom: 12px;
    left: 2px;
    width: 280px;
    height: 210px;
    padding: 32px;
    color: white;
    background: var(--ink);
    border-radius: 10px 30px 30px 30px;
    transform: rotate(-3deg);
}

.market-card-front::after {
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 130px;
    height: 130px;
    background: var(--coral);
    border-radius: 50%;
    content: "";
    opacity: 0.88;
}

.market-card-front p {
    position: relative;
    z-index: 1;
    margin: 26px 0 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: 20px;
    line-height: 1.45;
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 8px;
    height: 48px;
}

.mini-chart i {
    width: 11px;
    background: var(--mint);
    border-radius: 4px 4px 1px 1px;
}

.mini-chart i:nth-child(1) { height: 32%; }
.mini-chart i:nth-child(2) { height: 52%; }
.mini-chart i:nth-child(3) { height: 42%; }
.mini-chart i:nth-child(4) { height: 72%; }
.mini-chart i:nth-child(5) { height: 63%; }
.mini-chart i:nth-child(6) { height: 100%; background: var(--coral); }

.status-panel {
    display: grid;
    min-height: 220px;
    color: var(--muted);
    place-items: center;
    text-align: center;
}

.loader {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 14px;
    border: 3px solid var(--mint);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.survey-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.progress-card {
    position: sticky;
    top: 24px;
    padding: 26px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(20, 45, 43, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(27, 62, 58, 0.07);
    backdrop-filter: blur(14px);
    text-align: center;
}

.progress-label {
    margin: 0 0 20px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.progress-ring {
    position: relative;
    display: grid;
    width: 112px;
    height: 112px;
    margin: 0 auto 18px;
    background: conic-gradient(var(--teal) var(--progress), #dfe8e1 0);
    border-radius: 50%;
    place-items: center;
    transition: background 0.25s ease;
}

.progress-ring::before {
    position: absolute;
    width: 84px;
    height: 84px;
    background: #f9fbf8;
    border-radius: 50%;
    content: "";
}

.progress-ring span {
    position: relative;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
}

.progress-card > p:not(.progress-label) {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.progress-line {
    overflow: hidden;
    height: 5px;
    margin: 20px 0 14px;
    background: #dfe8e1;
    border-radius: 999px;
}

.progress-line span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--coral);
    border-radius: inherit;
    transition: width 0.25s ease;
}

.progress-card small {
    color: #84928f;
    font-size: 11px;
}

.survey-form {
    min-width: 0;
}

.question-card {
    min-width: 0;
    margin: 0 0 22px;
    padding: 34px 36px 36px;
    background: var(--card);
    border: 1px solid rgba(20, 45, 43, 0.08);
    border-radius: 24px;
    box-shadow: 0 16px 55px rgba(27, 62, 58, 0.065);
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.question-card:hover {
    box-shadow: 0 20px 65px rgba(27, 62, 58, 0.095);
    transform: translateY(-1px);
}

.question-card.is-invalid {
    border-color: rgba(184, 66, 56, 0.6);
    box-shadow: 0 18px 55px rgba(184, 66, 56, 0.10);
}

.question-card legend {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    width: 100%;
    padding: 0;
}

.question-number {
    color: var(--coral);
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.question-title {
    font-family: Georgia, "Songti SC", serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
}

.required-mark {
    margin-top: 3px;
    padding: 3px 8px;
    color: var(--teal-dark);
    background: var(--mint);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.question-hint {
    margin: 8px 0 22px 54px;
    color: #899693;
    font-size: 12px;
}

.option-list {
    display: grid;
    gap: 10px;
    margin-left: 54px;
}

.option-item {
    position: relative;
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 14px 16px;
    color: #314d49;
    background: #f8faf7;
    border: 1px solid #e4eae4;
    border-radius: 13px;
    cursor: pointer;
    transition: 0.18s ease;
}

.option-item:hover {
    background: white;
    border-color: rgba(12, 118, 109, 0.35);
}

.option-item:has(input:checked) {
    color: var(--teal-dark);
    background: rgba(201, 232, 221, 0.38);
    border-color: var(--teal);
    box-shadow: inset 3px 0 0 var(--teal);
}

.option-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.option-control {
    position: relative;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-top: 2px;
    background: white;
    border: 1.5px solid #a9b7b3;
    border-radius: 50%;
}

input[type="checkbox"] + .option-control {
    border-radius: 5px;
}

.option-item input:focus-visible + .option-control {
    outline: 3px solid rgba(12, 118, 109, 0.22);
    outline-offset: 2px;
}

.option-item input:checked + .option-control {
    background: var(--teal);
    border-color: var(--teal);
}

.option-item input:checked + .option-control::after {
    position: absolute;
    inset: 4px;
    background: white;
    border-radius: 50%;
    content: "";
}

.option-item input[type="checkbox"]:checked + .option-control::after {
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    background: transparent;
    border: solid white;
    border-width: 0 2px 2px 0;
    border-radius: 0;
    transform: rotate(45deg);
}

.option-text {
    line-height: 1.45;
}

.privacy-card,
.admin-note {
    display: flex;
    gap: 14px;
    margin: 28px 0 18px;
    padding: 18px 20px;
    color: #5e6f6c;
    background: rgba(241, 234, 217, 0.72);
    border: 1px solid rgba(130, 111, 81, 0.14);
    border-radius: 16px;
    font-size: 12px;
}

.privacy-card p,
.admin-note p {
    margin: 3px 0 0;
}

.privacy-icon {
    display: grid;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: white;
    background: #8f7958;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-weight: 700;
    place-items: center;
}

.form-error {
    min-height: 24px;
    margin: 12px 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 58px;
    padding: 14px 24px;
    color: white;
    background: var(--ink);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 35px rgba(20, 45, 43, 0.20);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: 0.2s ease;
}

.primary-button:hover {
    background: var(--teal-dark);
    transform: translateY(-2px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.primary-button.compact {
    width: auto;
    min-width: 150px;
    min-height: 48px;
    display: inline-flex;
}

.button-arrow {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.primary-button:hover .button-arrow {
    transform: translateX(3px);
}

.footer-note {
    margin: 22px 0 0;
    color: #7d8a87;
    font-size: 12px;
    text-align: center;
}

.success-panel {
    max-width: 720px;
    margin: 40px auto 0;
    padding: 60px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(20, 45, 43, 0.08);
    border-radius: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.success-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 28px;
    color: white;
    background: var(--teal);
    border: 10px solid var(--mint);
    border-radius: 50%;
    font-size: 27px;
    place-items: center;
}

.success-panel h2,
.contact-dialog h2 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: 34px;
}

.success-panel > p:not(.eyebrow):not(.receipt) {
    color: var(--muted);
}

.receipt {
    margin: 28px 0;
    padding: 11px;
    background: #f3f6f2;
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.contact-dialog {
    width: min(510px, calc(100% - 32px));
    padding: 42px;
    color: var(--ink);
    background: #fff;
    border: 0;
    border-radius: 26px;
    box-shadow: 0 34px 100px rgba(9, 31, 28, 0.30);
}

.contact-dialog::backdrop {
    background: rgba(12, 35, 32, 0.56);
    backdrop-filter: blur(5px);
}

.dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    color: var(--muted);
    background: #f1f4f0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 21px;
    place-items: center;
}

.contact-dialog > p:not(.eyebrow) {
    color: var(--muted);
}

.contact-link {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding: 16px 18px;
    color: var(--teal-dark);
    background: rgba(201, 232, 221, 0.44);
    border: 1px solid rgba(12, 118, 109, 0.22);
    border-radius: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.is-hidden {
    display: none !important;
}

/* Admin */
.admin-body {
    background: #f3f6f2;
}

.admin-wrap {
    max-width: 980px;
}

.admin-heading {
    margin: 32px 0 50px;
}

.admin-heading h1 {
    font-size: clamp(40px, 6vw, 64px);
}

.admin-heading > p:last-child {
    color: var(--muted);
    font-size: 17px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 22px;
}

.metric-card,
.download-card {
    padding: 34px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(27, 62, 58, 0.07);
}

.metric-card {
    display: flex;
    flex-direction: column;
    min-height: 270px;
    color: white;
    background: var(--ink);
    border: 0;
}

.metric-card > span {
    color: var(--mint);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.metric-card strong {
    margin: auto 0 0;
    font-family: Georgia, serif;
    font-size: 76px;
    line-height: 1;
}

.metric-card small {
    margin-top: 9px;
    color: #a9c2be;
}

.download-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 270px;
}

.file-badge {
    display: inline-block;
    padding: 5px 9px;
    color: var(--teal-dark);
    background: var(--mint);
    border-radius: 7px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.download-card h2 {
    margin: 18px 0 6px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 26px;
}

.download-card p {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 13px;
}

.admin-note {
    margin-top: 22px;
    display: block;
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 22px;
    }

    .hero-visual {
        display: none;
    }

    .survey-layout {
        grid-template-columns: 1fr;
    }

    .progress-card {
        z-index: 5;
        top: 10px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        align-items: center;
        padding: 14px 18px;
        border-radius: 16px;
        text-align: left;
    }

    .progress-label,
    .progress-ring,
    .progress-card small {
        display: none;
    }

    .progress-card > p:not(.progress-label) {
        white-space: nowrap;
    }

    .progress-line {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-header,
    .page-wrap,
    .admin-wrap {
        width: min(100% - 24px, 1120px);
    }

    .site-header {
        padding: 16px 0;
    }

    .page-wrap,
    .admin-wrap {
        padding-top: 28px;
    }

    .hero {
        padding: 10px 4px 46px;
    }

    .hero h1 {
        font-size: 43px;
    }

    .hero-description {
        margin-top: 20px;
        font-size: 15px;
    }

    .hero-meta span:last-child {
        width: 100%;
    }

    .hero-meta span:nth-child(2)::after {
        display: none;
    }

    .question-card {
        padding: 26px 18px 22px;
        border-radius: 18px;
    }

    .question-card legend {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px;
    }

    .required-mark {
        display: none;
    }

    .question-title {
        font-size: 18px;
    }

    .question-hint,
    .option-list {
        margin-left: 42px;
    }

    .option-item {
        padding: 13px;
        font-size: 14px;
    }

    .success-panel {
        padding: 42px 22px;
    }

    .contact-dialog {
        padding: 38px 24px 26px;
    }

    .admin-heading {
        margin-top: 14px;
    }

    .metric-card,
    .download-card {
        padding: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
