/* ==========================================================
   天使數字指引 — 毛玻璃 × 柔和天空
   色調取自：薄霧天空、地平線暖光、平靜水面
   ========================================================== */

:root {
    --ink: #22364f;
    --ink-soft: #46607f;
    --accent: #3f6190;
    --accent-deep: #2f4d77;
    --peach: #f3c9ae;
    --mist: #e8eef4;

    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 20px 55px rgba(52, 80, 118, 0.2);
    --radius: 28px;

    --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
    --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--ink);
    background: var(--mist);
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: rgba(243, 201, 174, 0.7);
}

/* ---------- 天空背景 ---------- */
.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(120% 55% at 50% 47%, rgba(255, 228, 208, 0.85) 0%, rgba(255, 228, 208, 0) 65%),
        linear-gradient(180deg,
            #96afc9 0%,
            #b6c9dc 26%,
            #d8e3ed 44%,
            #ebdfd5 51%,
            #c2d3e3 55%,
            #a8bfd6 76%,
            #94adc6 100%);
}

/* 水面微光 */
.sky::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    background: repeating-linear-gradient(0deg,
        rgba(255, 255, 255, 0.09) 0 2px,
        rgba(255, 255, 255, 0) 2px 11px);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 55%);
    mask-image: linear-gradient(180deg, transparent, #000 55%);
}

/* 天使光環 */
.halo {
    position: absolute;
    left: 50%;
    top: 210px;
    width: min(78vmin, 640px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    animation: breathe 9s ease-in-out infinite;
}

.halo::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle closest-side,
        rgba(255, 255, 255, 0) 0 57%,
        rgba(255, 255, 255, 0.55) 66%,
        rgba(255, 255, 255, 0.95) 77%,
        rgba(255, 255, 255, 0.45) 90%,
        rgba(255, 255, 255, 0) 100%);
    filter: blur(1.5px);
}

.halo::after {
    content: "";
    position: absolute;
    inset: 24%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.35);
}

/* 漂浮的玻璃球 */
.orb {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.35) 22%,
            rgba(170, 196, 228, 0.3) 56%,
            rgba(255, 206, 186, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        inset -10px -14px 30px rgba(120, 150, 200, 0.25),
        inset 8px 10px 24px rgba(255, 255, 255, 0.55),
        0 20px 50px rgba(90, 120, 170, 0.15);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: drift var(--t, 18s) ease-in-out infinite alternate;
}

.orb-1 { width: 150px; height: 150px; left: 5%;   top: 62%; --t: 20s; }
.orb-2 { width: 90px;  height: 90px;  right: 9%;  top: 30%; --t: 15s; animation-delay: -4s; }
.orb-3 { width: 220px; height: 220px; right: -70px; top: 66%; --t: 24s; animation-delay: -9s; }
.orb-4 { width: 58px;  height: 58px;  left: 15%;  top: 24%; --t: 13s; animation-delay: -2s; }
.orb-5 { width: 120px; height: 120px; left: 46%;  top: 80%; --t: 17s; animation-delay: -6s; }

@keyframes drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(14px, -28px, 0); }
}

@keyframes breathe {
    0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.035); }
}

/* ---------- 容器與頁頭 ---------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.site-header {
    text-align: center;
    margin: 3rem 0 3.2rem;
}

.site-logo {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.1rem;
    filter: drop-shadow(0 8px 20px rgba(52, 80, 118, 0.28));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--ink);
}

.eyebrow::before,
.eyebrow::after {
    content: "";
    width: 44px;
    height: 1px;
    background: linear-gradient(90deg, transparent, currentColor);
}

.eyebrow::after {
    transform: scaleX(-1);
}

.site-header h1 {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(2.2rem, 6vw, 3.3rem);
    letter-spacing: 0.18em;
    margin: 0.9rem 0 0.6rem;
    color: var(--ink);
    text-shadow: 0 2px 26px rgba(255, 255, 255, 0.8);
}

.subtitle {
    font-size: 1.05rem;
    letter-spacing: 0.22em;
    color: var(--ink);
    text-shadow: 0 1px 14px rgba(255, 255, 255, 0.7);
}

/* ---------- 毛玻璃卡片 ---------- */
main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-section,
.meaning-card,
.reflection-section,
.personalized-card,
.about-card {
    position: relative;
    isolation: isolate;
    padding: 2.2rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.2));
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.meaning-card {
    margin-bottom: 2rem;
}

.result-section > :last-child {
    margin-bottom: 0;
}

/* 個人化解讀：帶一點日出的暖光 */
.personalized-card {
    background: linear-gradient(145deg, rgba(255, 247, 239, 0.58), rgba(255, 255, 255, 0.22));
    border-color: rgba(255, 233, 215, 0.95);
    overflow: hidden;
}

.personalized-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    right: -70px;
    top: -70px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 212, 180, 0.6), rgba(255, 212, 180, 0) 70%);
}

h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--ink);
}

h2 {
    font-size: 1.35rem;
    text-align: center;
}

h3 {
    font-size: 1.15rem;
}

h3 i {
    color: #c48967;
    margin-right: 0.45rem;
}

.divider {
    position: relative;
    height: 1px;
    margin: 1.1rem 0 1.5rem;
    background: linear-gradient(90deg, transparent, rgba(63, 97, 144, 0.45), transparent);
}

.divider::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    background: #fff;
    border: 1px solid rgba(63, 97, 144, 0.5);
    transform: translate(-50%, -50%) rotate(45deg);
}

.meaning-text {
    font-size: 1.12rem;
    line-height: 2;
}

.meaning-note {
    margin-top: 1.1rem;
    padding: 0.8rem 1.1rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.4);
    border-left: 3px solid var(--peach);
    border-radius: 0 14px 14px 0;
}

.meaning-note[hidden] {
    display: none;
}

.prompt-text {
    color: var(--ink-soft);
    margin-top: 0.6rem;
}

/* ---------- 輸入元件 ---------- */
.input-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.3rem;
}

input[type="number"],
textarea {
    font-family: inherit;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 2px 8px rgba(80, 110, 150, 0.12);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

input[type="number"]::placeholder,
textarea::placeholder {
    color: #6d819a;
}

input[type="number"] {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.4rem;
    border-radius: 999px;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

textarea {
    display: block;
    width: 100%;
    min-height: 150px;
    padding: 1.1rem 1.3rem;
    margin: 1.1rem 0 0.7rem;
    border-radius: 22px;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
}

input[type="number"]:focus,
textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.72);
    border-color: #6f93c2;
    box-shadow: 0 0 0 4px rgba(120, 160, 210, 0.28), inset 0 2px 8px rgba(80, 110, 150, 0.1);
}

/* ---------- 按鈕 ---------- */
.primary-btn,
.secondary-btn {
    padding: 0.95rem 2rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(135deg, #3f6190, #5a7ca7);
    box-shadow: 0 10px 24px rgba(52, 84, 128, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.secondary-btn {
    color: var(--accent-deep);
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 22px rgba(52, 84, 128, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:hover {
    box-shadow: 0 14px 30px rgba(52, 84, 128, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 12px 28px rgba(52, 84, 128, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(63, 97, 144, 0.55);
}

/* ---------- 解讀文字 ---------- */
.personalized-text {
    font-size: 1.05rem;
    line-height: 2;
}

.personalized-text br {
    content: "";
    display: block;
    margin-top: 0.5rem;
}

.personalized-text strong {
    font-weight: 600;
    color: #1b2f4b;
    background: linear-gradient(transparent 62%, rgba(246, 196, 160, 0.55) 62%);
    padding: 0 0.1em;
}

/* ---------- 結果區塊動畫 ---------- */
.result-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-section.show {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 頁尾 ---------- */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 3.2rem;
}

.blessing {
    padding: 0.65rem 1.7rem;
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
}

/* ---------- 隱私提示與分享 ---------- */
.privacy-hint {
    margin-bottom: 1.3rem;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

.share {
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(63, 97, 144, 0.22);
    text-align: center;
}

.share[hidden] {
    display: none;
}

.share-title {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 0.12em;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--accent-deep);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(52, 84, 128, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
}

.share-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(63, 97, 144, 0.55);
}

.share-status {
    min-height: 1.4em;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--accent-deep);
}

.share-note {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.fine-print {
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(63, 97, 144, 0.22);
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--ink-soft);
}

.fine-print p + p {
    margin-top: 0.5rem;
}

.fine-print a {
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- 關於與贊助 ---------- */
.about-card {
    width: 100%;
}

.about-text p {
    margin-top: 0.9rem;
    line-height: 2;
}

.about-text p:first-child {
    margin-top: 0;
}

.about-text strong {
    font-weight: 600;
    color: #1b2f4b;
    background: linear-gradient(transparent 62%, rgba(246, 196, 160, 0.55) 62%);
    padding: 0 0.1em;
}

.support {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(63, 97, 144, 0.22);
    text-align: center;
}

.support h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
}

.support-lead {
    margin-top: 0.3rem;
    color: var(--ink-soft);
}

.support-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.6rem 2.4rem;
    margin-top: 1.4rem;
}

.support-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-width: 11rem;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--accent-deep);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 22px rgba(52, 84, 128, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.25s ease, background 0.25s ease;
}

.support-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
}

.support-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(63, 97, 144, 0.55);
}

.support-boba {
    color: #fff;
    background: var(--ink);
    border-color: rgba(255, 255, 255, 0.25);
}

.support-boba:hover {
    background: #2c4460;
}

.logo-ecpay {
    height: auto;
}

.logo-cards {
    max-width: 100%;
    height: auto;
}

.powered {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.powered img {
    height: 0.875rem;
    width: auto;
}

.contact {
    margin-top: 1.8rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.contact a {
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- 響應式 ---------- */
@media (max-width: 640px) {
    .container {
        padding: 1rem 1rem 2.5rem;
    }

    .site-header {
        margin: 2rem 0 2.4rem;
    }

    .input-section,
    .meaning-card,
    .reflection-section,
    .personalized-card,
    .about-card {
        padding: 1.6rem 1.3rem;
    }

    .input-group {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .halo {
        top: 170px;
        width: 96vw;
    }

    .orb-3,
    .orb-5 {
        display: none;
    }
}

/* ---------- 無障礙與相容性 ---------- */
@media (prefers-reduced-motion: reduce) {
    .halo,
    .orb,
    .fade-in {
        animation: none;
    }

    .result-section {
        transition: none;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .input-section,
    .meaning-card,
    .reflection-section,
    .personalized-card,
    .about-card {
        background: rgba(242, 247, 252, 0.9);
    }

    .blessing {
        background: rgba(242, 247, 252, 0.85);
    }
}
