/* 隱私權政策、使用條款、關於我們共用的「深海」樣式(對齊 App 的 lib/theme/app_theme.dart、lib/widgets/sea_bars.dart)
 * 頂欄:深海藍漸層 + 下緣淺波浪 + 兩道斜光 + 慢慢往上飄的細圈小氣泡
 * 頁尾:跟 App 導覽列一樣,浪打上米色沙灘 */

:root {
    --primary: #3A6FB8;
    --primary-dark: #1E2F5C;
    --primary-light: #8DB0DD;
    --bg: #F3F6FA;
    --surface: #FFFFFF;
    --surface-variant: #E9F1FB;
    --text: #2D2D3A;
    --text-2: #6B6B80;
    --sand: #F6ECD6;
    --sand-text: #8A8072;
    --gold: #FFC94D;
    --wave-h: 14px;
    --content-w: 760px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC",
        "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 頂欄 ---------- */

.sea {
    position: relative;
    color: #fff;
    z-index: 1;
}

/* 陰影包在外層:filter 要在 mask 之前,不然陰影會被波浪遮罩切掉 */
.sea-shadow {
    position: absolute;
    inset: 0;
    filter: drop-shadow(0 3px 8px rgba(30, 47, 92, 0.22));
    pointer-events: none;
}

.sea-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #2C4A7A 0%, #1E2F5C 100%);
    /* 上面整塊不透明,最下面 --wave-h 用一條重複的波浪剪出海水的邊(一個畫面寬約 2.5 個波) */
    -webkit-mask:
        linear-gradient(#000, #000) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0H160V7Q120 13 80 7T0 7Z'/%3E%3C/svg%3E") bottom / 40% var(--wave-h) repeat-x;
    mask:
        linear-gradient(#000, #000) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0H160V7Q120 13 80 7T0 7Z'/%3E%3C/svg%3E") bottom / 40% var(--wave-h) repeat-x;
}

/* 兩道從左上往右下的淡光 */
.beam {
    position: absolute;
    top: -20%;
    height: 140%;
    background: rgba(170, 225, 245, 0.13);
    transform: skewX(-24deg);
    filter: blur(18px);
}
.beam.b1 { left: 14%; width: 11%; }
.beam.b2 { left: 56%; width: 7%; background: rgba(170, 225, 245, 0.09); }

/* 白色細圈小氣泡,慢慢往上飄、左右輕晃 */
.bubble {
    position: absolute;
    bottom: -12px;
    left: var(--x);
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    border: 1px solid rgba(220, 245, 255, 0.6);
    border-radius: 50%;
    animation: rise var(--d) linear infinite;
    animation-delay: var(--delay);
    opacity: 0;
}
.bubble::after {
    content: "";
    position: absolute;
    left: 18%;
    top: 18%;
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
}

@keyframes rise {
    0%   { transform: translate(0, 0); opacity: 0; }
    10%  { opacity: 1; }
    25%  { transform: translate(4px, -60px); }
    50%  { transform: translate(-3px, -120px); }
    75%  { transform: translate(4px, -180px); }
    90%  { opacity: 1; }
    100% { transform: translate(0, -240px); opacity: 0; }
}

.sea-inner {
    position: relative;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 14px 20px calc(var(--wave-h) + 26px);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.topbar .mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: none;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* 語言切換:深海上的半透明膠囊,選中的變白 */
.lang-switcher {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.lang-btn {
    font: inherit;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lang-btn.active {
    background: #fff;
    border-color: #fff;
    color: var(--primary-dark);
}
.lang-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hero {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-height: 104px;
}

.hero-text {
    flex: 1;
    min-width: 0;
    padding-right: 92px; /* 讓位給右下的鯊鯊 */
}

.hero h1 {
    font-size: 27px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 10px rgba(10, 20, 50, 0.35);
}

.chip {
    margin-top: 10px;
    align-items: center;
    gap: 6px;
    padding: 3px 11px 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.88);
    font-size: 12.5px;
    line-height: 1.6;
}
.chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid rgba(220, 245, 255, 0.85);
    flex: none;
}

.tagline-hero {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

/* 鯊鯊站在頂欄右下,下半身跨過波浪,像從海裡探出來 */
.hero-shark {
    position: absolute;
    right: 8px;
    bottom: -18px;
    width: 116px;
    height: 116px;
    filter: drop-shadow(0 6px 10px rgba(10, 20, 50, 0.3));
    pointer-events: none;
}

/* ---------- 內容 ---------- */

main {
    position: relative;
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 26px 16px 8px;
    flex: 1;
}

/* 多語系:原本的切換規則不變 */
[data-lang] { display: none; }
[data-lang].active { display: block; }
.chip[data-lang].active { display: inline-flex; }

.section {
    position: relative;
    background: var(--surface);
    padding: 20px 20px 16px;
    border-radius: 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(30, 47, 92, 0.04), 0 6px 18px rgba(30, 47, 92, 0.06);
    border: 1px solid rgba(141, 176, 221, 0.18);
}

.section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 10px;
}
.section h2::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(var(--primary-light), var(--primary));
    flex: none;
}

p, li { font-size: 15px; margin-bottom: 8px; }
p:last-child, li:last-child { margin-bottom: 0; }

strong { color: var(--primary-dark); }

ul { list-style: none; padding-left: 0; }
ul + p { margin-top: 10px; }
li {
    position: relative;
    padding-left: 22px;
}
/* 項目符號是一顆小氣泡 */
li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 0.62em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    background: var(--surface-variant);
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(58, 111, 184, 0.35);
    text-underline-offset: 3px;
    word-break: break-word;
}
a:hover { text-decoration-color: var(--primary); }

/* 重點提醒(使用條款的「您對準時起床負全責」那段) */
.callout {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-variant);
    border-left: 4px solid var(--primary);
}

/* 聯絡:信箱單獨一塊淺藍底,長字串不會撐破手機寬度 */
.contact-mail {
    display: block;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-variant);
    overflow-wrap: anywhere;
}
/* 「Email:」當小標放上面,信箱自己一行,手機上不會被拆成兩段 */
.contact-mail strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

/* ---------- 頁尾:浪打上沙灘 ---------- */

.shore {
    position: relative;
    margin-top: 6px;
    background: var(--sand) url("img/sand.webp") center top / max(1200px, 100%) auto no-repeat;
    color: var(--sand-text);
}

.shore-edge {
    display: block;
    width: 100%;
    height: 22px;
    margin-bottom: -1px;
}

.shore-inner {
    position: relative;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 6px 20px 26px;
    min-height: 112px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.shore-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.shore-brand img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.shore-deco {
    position: relative;
    width: 190px;
    height: 92px;
    flex: none;
}
.shore-deco img { position: absolute; }
/* 睡著的鯊鯊躺在沙灘上 */
.shore-deco .nap {
    width: 84px;
    height: 84px;
    right: 22px;
    bottom: -14px;
    transform: rotate(-78deg);
    filter: drop-shadow(-4px 3px 3px rgba(138, 128, 114, 0.35));
}
.shore-deco .zz {
    position: absolute;
    right: 88px;
    top: 10px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(58, 111, 184, 0.55);
    letter-spacing: 1px;
    animation: zz 3.2s ease-in-out infinite;
}
.shore-deco .shell { width: 30px; height: 30px; left: 0; bottom: 4px; transform: rotate(-12deg); }
.shore-deco .star { width: 28px; height: 28px; left: 36px; bottom: 30px; transform: rotate(16deg); }

@keyframes zz {
    0%, 100% { transform: translateY(0); opacity: 0.55; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- 關於我們 ---------- */

.hero-app {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 6px 14px rgba(0, 0, 0, 0.3);
    display: block;
}

.video-card {
    max-width: 380px;
    padding: 10px;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: var(--primary-dark);
    box-shadow: 0 8px 22px rgba(30, 47, 92, 0.18);
}
.video-container {
    display: flex;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.video-container iframe {
    aspect-ratio: 9 / 16;
    width: 100%;
    max-width: 360px;
    height: auto;
    border: none;
    display: block;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid rgba(141, 176, 221, 0.22);
    min-width: 0;
}
.feature-grid .feature-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
.feature-item .icon {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(30, 47, 92, 0.08);
}
.feature-item .icon img { width: 28px; height: 28px; }
.feature-item .label {
    font-size: 13px;
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

/* 「會換表情」:一排鯊鯊的表情 */
.moods {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin: 4px 0 14px;
    padding: 10px 8px 4px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-variant), rgba(233, 241, 251, 0));
}
.moods img {
    width: 19%;
    max-width: 76px;
    height: auto;
    aspect-ratio: 1;
}

/* ---------- 寬螢幕 ---------- */

@media (min-width: 640px) {
    :root { --wave-h: 18px; }
    .sea-inner { padding: 20px 28px calc(var(--wave-h) + 36px); }
    .topbar { margin-bottom: 30px; }
    .hero { min-height: 130px; }
    .hero h1 { font-size: 36px; }
    .hero-text { padding-right: 160px; }
    .hero-shark { width: 160px; height: 160px; right: 24px; bottom: -24px; }
    main { padding: 34px 24px 8px; }
    .section { padding: 26px 28px 22px; }
    .section h2 { font-size: 19px; }
    p, li { font-size: 15.5px; }
    .feature-grid { grid-template-columns: repeat(4, 1fr); }
    .feature-grid .feature-item:last-child:nth-child(odd) { grid-column: auto; }
    .feature-item { flex-direction: column; text-align: center; padding: 14px 8px; }
    .feature-item .icon { width: 44px; height: 44px; border-radius: 12px; font-size: 23px; }
    .feature-item .icon img { width: 36px; height: 36px; }
    .shore-inner { padding: 8px 28px 30px; }
}

/* 減少動態:氣泡停在原位,不飄 */
@media (prefers-reduced-motion: reduce) {
    .bubble {
        animation: none;
        opacity: 1;
        bottom: auto;
        top: var(--y, 40%);
    }
    .shore-deco .zz { animation: none; }
    .lang-btn { transition: none; }
}
