@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;700&family=Inter:wght@300;400;600;700&display=swap");

:root {
    --bg: #f8f1ea;
    --surface: rgba(255, 255, 255, 0.66);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --line: rgba(188, 138, 95, 0.15);
    --muted: rgba(74, 63, 53, 0.66);
    --accent: #bc8a5f;
    --deep: #4a3f35;
    --shadow: 0 10px 40px -10px rgba(74, 63, 53, 0.08);
    --shadow-strong: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--deep);
    font-family: Inter, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(188, 138, 95, 0.05);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.topbar-inner {
    max-width: 1120px;
    height: 80px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
}

.logo {
    max-height: 100%;
    max-width: 260px;
    object-fit: contain;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 128px 24px 96px;
    text-align: center;
}

.hero-glow {
    position: absolute;
    left: 50%;
    top: -140px;
    width: min(900px, 120vw);
    height: 500px;
    transform: translateX(-50%);
    background: rgba(188, 138, 95, 0.05);
    filter: blur(140px);
    border-radius: 999px;
}

.hero h1 {
    position: relative;
    margin: 0 0 24px;
    font-family: "Noto Serif TC", serif;
    font-size: clamp(48px, 7vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-shadow: 0 0 15px rgba(188, 138, 95, 0.2);
}

.hero > p,
.eyebrow {
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--accent);
    font-size: 12px;
    font-weight: 300;
    opacity: 0.9;
}

.gender-toggle {
    position: relative;
    display: inline-flex;
    margin-top: 56px;
    padding: 6px;
    border: 1px solid rgba(188, 138, 95, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gender-toggle button {
    border: 0;
    border-radius: 999px;
    padding: 12px 44px;
    color: var(--accent);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gender-toggle button.active {
    color: #fff;
    background: var(--deep);
    box-shadow: var(--shadow);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 128px;
}

.card,
.analysis-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.form-card,
.card {
    padding: 48px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    align-items: end;
}

label span {
    display: block;
    margin: 0 0 16px 4px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

select,
.primary-btn {
    width: 100%;
    min-height: 62px;
    border-radius: 16px;
    border: 1px solid rgba(188, 138, 95, 0.2);
    font: inherit;
}

select {
    padding: 0 20px;
    color: var(--deep);
    background: rgba(255, 255, 255, 0.5);
    font-family: "Noto Serif TC", serif;
    font-size: 20px;
    cursor: pointer;
    outline: none;
}

.primary-btn {
    padding: 0 20px;
    border: 0;
    color: #fff;
    background: var(--deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.primary-btn:hover {
    background: #16120f;
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn[disabled] {
    cursor: wait;
    opacity: 0.48;
}

.calendar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 32px;
    padding: 24px 4px 0;
    border-top: 1px solid rgba(188, 138, 95, 0.05);
}

.calendar-row p {
    margin: 4px 0 0;
    font-family: "Noto Serif TC", serif;
    font-size: 18px;
    font-style: italic;
    opacity: 0.8;
}

.term-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border: 1px solid rgba(188, 138, 95, 0.2);
    border-radius: 999px;
    background: rgba(188, 138, 95, 0.1);
}

.term-badge span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.term-badge strong {
    font-family: "Noto Serif TC", serif;
    font-size: 22px;
}

.error-text {
    margin: 18px 0 0;
    color: #9d342f;
    font-weight: 700;
}

.result-panel {
    margin-top: 96px;
}

.result-panel > * + * {
    margin-top: 112px;
}

h2 {
    margin: 0 0 48px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.term-grid,
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.term-copy p {
    margin: 0 0 18px;
    font-family: "Noto Serif TC", serif;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.45;
}

.term-copy strong {
    color: var(--accent);
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

th,
td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(188, 138, 95, 0.05);
    text-align: left;
}

th {
    color: var(--accent);
    background: rgba(188, 138, 95, 0.1);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

td {
    font-family: "Noto Serif TC", serif;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 64px;
}

.section-heading h2 {
    margin: 0;
    color: var(--deep);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(30px, 5vw, 44px);
    letter-spacing: 0;
    text-transform: none;
}

.day-master {
    width: min(100%, 310px);
    min-width: 260px;
    padding: 42px 54px 38px;
    border: 1px solid rgba(188, 138, 95, 0.3);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.day-master-term {
    position: absolute;
    top: -12px;
    right: -12px;
    display: inline-flex !important;
    min-width: 52px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff !important;
    font-family: Inter, sans-serif;
    font-size: 9px !important;
    font-weight: 700;
    letter-spacing: 0.16em !important;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    opacity: 1 !important;
}

.day-master span {
    display: block;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5em;
    opacity: 0.6;
    white-space: nowrap;
}

.day-master strong {
    display: block;
    margin-top: 20px;
    font-family: "Noto Serif TC", serif;
    font-size: clamp(86px, 9vw, 104px);
    line-height: 1;
    text-shadow: 0 0 15px rgba(188, 138, 95, 0.2);
}

.day-master em {
    display: block;
    margin-top: 24px;
    color: var(--accent);
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.3em;
    line-height: 1.4;
    text-transform: uppercase;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.pillar {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.15s ease;
}

.pillar-label {
    display: block;
    margin-bottom: 24px;
    color: rgba(188, 138, 95, 0.6);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.glyph {
    display: flex;
    width: 96px;
    height: 96px;
    align-items: center;
    justify-content: center;
    margin: 12px auto;
    border: 1px solid var(--element-border-color, rgba(188, 138, 95, 0.2));
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--deep);
    font-family: "Noto Serif TC", serif;
    font-size: 48px;
    font-weight: 700;
}

.bars {
    display: grid;
    gap: 18px;
}

.bar-row {
    display: grid;
    grid-template-columns: 46px 1fr 52px;
    gap: 14px;
    align-items: center;
}

.bar-name {
    font-family: "Noto Serif TC", serif;
    font-size: 22px;
    font-weight: 700;
}

.bar-track {
    height: 26px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(188, 138, 95, 0.08);
}

.bar-fill {
    height: 100%;
    width: var(--bar-width);
    border-radius: inherit;
    background: var(--element-color);
}

.bar-value {
    text-align: right;
    color: var(--muted);
    font-weight: 700;
}

.verdict dl {
    margin: 0;
}

.verdict div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0 16px;
    border-bottom: 1px solid rgba(188, 138, 95, 0.05);
}

.verdict dt {
    color: rgba(188, 138, 95, 0.6);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.verdict dd {
    margin: 0;
    font-family: "Noto Serif TC", serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
}

.analysis-card {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 7vw, 80px);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 48px;
    box-shadow: var(--shadow-strong);
}

.analysis-card::before {
    content: "";
    position: absolute;
    inset: -8px;
    z-index: -1;
    border-radius: 56px;
    background: linear-gradient(to right, rgba(188, 138, 95, 0.2), rgba(254, 215, 170, 0.2));
    filter: blur(24px);
    opacity: 0.4;
}

.analysis-card::after {
    content: "";
    position: absolute;
    top: -128px;
    right: -128px;
    width: 400px;
    height: 400px;
    border-radius: 999px;
    background: rgba(188, 138, 95, 0.05);
    filter: blur(120px);
}

.analysis-card h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 32px;
    color: var(--deep);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(30px, 5vw, 48px);
    letter-spacing: 0;
    text-transform: none;
}

.analysis-card p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    color: rgba(188, 138, 95, 0.8);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(18px, 2vw, 20px);
    font-weight: 300;
    line-height: 1.625;
}

.analysis-card .primary-btn {
    position: relative;
    z-index: 1;
    width: auto;
    min-width: 260px;
    max-width: 100%;
    margin-top: 36px;
    white-space: normal;
    line-height: 1.6;
    padding: 16px clamp(32px, 6vw, 64px);
    border-radius: 16px;
    font-size: 12px;
    letter-spacing: 0.5em;
}

.ai-output {
    position: relative;
    z-index: 1;
    margin-top: clamp(40px, 7vw, 80px);
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid rgba(188, 138, 95, 0.1);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.4);
    font-family: "Noto Serif TC", serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.8;
    text-align: justify;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-output::before {
    content: "AI Strategic Life Analysis";
    display: block;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(188, 138, 95, 0.1);
    color: var(--accent);
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4em;
    line-height: 1.6;
    text-transform: uppercase;
}

.ai-loading {
    white-space: normal;
}

.ai-loading p {
    margin: 0;
    color: var(--deep);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.55;
    text-align: left;
}

.cosmic-progress {
    height: 12px;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid rgba(188, 138, 95, 0.18);
    border-radius: 999px;
    background: rgba(188, 138, 95, 0.08);
}

.cosmic-progress-fill {
    position: relative;
    height: 100%;
    min-width: 18px;
    border-radius: inherit;
    background: linear-gradient(90deg, #84a98c, #e29578, #ddb892, #a5a5a5, #83c5be);
    transition: width 1.2s ease;
}

.cosmic-progress-glow {
    position: absolute;
    top: 50%;
    right: 0;
    width: 18px;
    height: 18px;
    transform: translate(40%, -50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 18px rgba(188, 138, 95, 0.72);
}

.cosmic-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.cosmic-steps span {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(188, 138, 95, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    color: rgba(74, 63, 53, 0.72);
    font-family: "Noto Serif TC", serif;
    font-size: 16px;
    font-weight: 700;
}

.ai-loading-hint {
    display: block;
    margin-top: 18px;
    color: rgba(188, 138, 95, 0.78);
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.7;
    text-transform: uppercase;
}

.crystal-recommendations {
    margin-top: 36px;
    padding-top: 32px;
    border-top: 1px solid rgba(188, 138, 95, 0.1);
    white-space: normal;
}

.recommendation-heading h3 {
    margin: 10px 0 8px;
    color: var(--deep);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.35;
}

.recommendation-heading p {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.recommendation-card {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border: 1px solid rgba(188, 138, 95, 0.16);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--deep);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    border-color: rgba(188, 138, 95, 0.34);
    background: rgba(255, 255, 255, 0.78);
}

.recommendation-element {
    align-self: flex-start;
    padding: 4px 10px;
    border: 1px solid var(--element-color);
    border-radius: 999px;
    color: var(--element-color);
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.recommendation-card strong {
    font-family: "Noto Serif TC", serif;
    font-size: 24px;
    line-height: 1.35;
}

.recommendation-card p {
    flex: 1;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

.recommendation-cta {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.mail-panel {
    position: relative;
    z-index: 1;
    margin-top: 36px;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(188, 138, 95, 0.1);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mail-copy h3 {
    margin: 10px 0 10px;
    color: var(--deep);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.35;
}

.mail-copy p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.85;
}

.mail-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
    margin-top: 24px;
}

.mail-email {
    min-width: 0;
}

.mail-email input {
    width: 100%;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid rgba(188, 138, 95, 0.24);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.62);
    color: var(--deep);
    font: inherit;
}

.mail-email input:focus {
    border-color: rgba(188, 138, 95, 0.48);
    background: rgba(255, 255, 255, 0.86);
}

.mail-consent {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    align-items: flex-start;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.mail-consent input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--deep);
}

.mail-consent span {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
}

.mail-website {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mail-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.mail-status.success {
    color: #5f7f62;
}

.mail-status.error {
    color: #9d342f;
}

footer {
    padding: 96px 24px;
    border-top: 1px solid rgba(188, 138, 95, 0.1);
    background: rgba(255, 255, 255, 0.2);
    color: var(--accent);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1em;
    opacity: 0.5;
}

.hidden {
    display: none !important;
}

@media (max-width: 860px) {
    .form-card,
    .card {
        padding: 24px;
    }

    .form-grid,
    .term-grid,
    .two-col,
    .pillars,
    .recommendation-grid {
        grid-template-columns: 1fr;
    }

    .calendar-row,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading {
        margin-bottom: 40px;
    }

    .day-master {
        width: 100%;
        min-width: 0;
        padding: 36px 28px 32px;
    }

    .day-master strong {
        font-size: 82px;
    }

    .gender-toggle {
        width: 100%;
        max-width: 420px;
    }

    .gender-toggle button {
        flex: 1;
        padding-inline: 16px;
    }

    .mail-form {
        grid-template-columns: 1fr;
    }

    .mail-form .primary-btn {
        width: 100%;
    }

    .topbar-inner {
        justify-content: center;
    }

    .logo {
        max-width: 220px;
    }
}
