﻿/* ===============================
⭐ 全局
=============================== */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    color: #fff;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.3)), url('/images/hero.jpg') center/cover no-repeat fixed;
}

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        background: linear-gradient(rgba(10,10,20,0.65), rgba(10,10,20,0.4)), url('/images/hero.png') center/cover no-repeat;
    }

/* ===============================
⭐ 顶部导航（玻璃）
=============================== */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.logo-title {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===============================
⭐ PC菜单
=============================== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}

.nav-link {
    font-size: 15px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu .nav-link,
.nav-menu a {
    color: white !important;
    text-decoration: none;
    font-size: 15px;
}

.nav-menu form {
    display: inline;
}

.nav-menu button {
    background: none;
    border: none;
    color: white;
    padding: 0;
}

/* ===============================
⭐ 页面主体
=============================== */
.main-container {
    width: 100%;
    min-height: 100vh;
    padding-top: 140px;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* ===============================
⭐ 主玻璃卡
=============================== */
.glass-card,
.product-card {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 50px 30px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(16px) saturate(120%) brightness(1.02);
    -webkit-backdrop-filter: blur(16px) saturate(120%) brightness(1.02);
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 25px 50px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ===============================
⭐ HERO
=============================== */
.hero-center {
    text-align: center;
    margin-bottom: 50px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #00f0ff, #6a5cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 18px;
    opacity: 0.9;
}

.hero-buttons {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.btn-primary {
    padding: 12px 28px;
    border-radius: 30px;
    background: linear-gradient(135deg, #00f0ff, #6a5cff);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    padding: 12px 28px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    text-decoration: none;
}

/* ===============================
⭐ 手机菜单系统
=============================== */
.menu-toggle,
.mobile-menu {
    display: none;
}

.mobile-panel {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 320px;
    padding: 28px;
    background: rgba(20,20,35,0.08);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

    .mobile-panel .nav-link {
        font-size: 18px;
        margin: 14px 0;
        font-weight: 600;
    }

/* ===============================
⭐ 手机端媒體查詢响应式 (修復斷點及歪斜)
=============================== */
@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .nav-menu {
        display: none !important;
    }

    .top-nav {
        width: 100%;
        padding: 12px 15px;
    }

    .nav-left {
        width: 100%;
        display: flex;
        align-items: center;
    }

    .logo-img {
        width: 58px;
        height: 58px;
        min-width: 58px;
    }

    .logo-title {
        font-size: 18px;
        margin-left: 10px;
        flex: 1;
        text-align: left;
    }

    /* ⭐ 主容器寬度修正 */
    .main-container {
        width: 100% !important;
        max-width: 100vw !important;
        padding-top: 110px;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ⭐ 核心玻璃卡修復與隔離 */
    .glass-card,
    .product-card,
    .main-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 20px auto !important;
        padding: 20px 14px !important;
        border-radius: 28px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
        backdrop-filter: blur(20px) saturate(150%) !important;
        box-shadow: 0 10px 35px rgba(0,0,0,0.28) !important;
        overflow: hidden !important;
        transform: translateZ(0);
        will-change: transform;
    }

    .products-grid,
    .plans-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ⭐ HERO */
    .hero-title {
        font-size: 30px;
        line-height: 1.3;
        word-break: break-word;
    }

    .hero-sub {
        font-size: 15px;
        line-height: 1.7;
    }

    .hero-buttons {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

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

    /* ⭐ 手机菜单 */
    .mobile-menu {
        position: fixed;
        inset: 0;
        display: none;
        justify-content: center;
        align-items: flex-start;
        z-index: 2500;
        width: 100vw;
        max-width: 100vw;
        background: rgba(0,0,0,0.18);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

        .mobile-menu.show {
            display: flex;
        }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        cursor: pointer;
        margin-left: auto;
        flex-shrink: 0;
    }

        .menu-toggle span {
            width: 100%;
            height: 3px;
            background: #fff;
            border-radius: 2px;
        }

    .mobile-panel {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: min(85vw, 320px);
        max-width: calc(100vw - 30px);
        margin: 90px auto 0 auto;
        padding: 28px;
        background: linear-gradient(rgba(10,10,20,0.65), rgba(10,10,20,0.4)), url('/images/hero.png') center/cover no-repeat;
        backdrop-filter: blur(45px) saturate(180%) brightness(1.1);
        -webkit-backdrop-filter: blur(45px) saturate(180%) brightness(1.1);
        border-radius: 28px;
        border: 1px solid rgba(255,255,255,0.25);
        box-shadow: 0 25px 60px rgba(0,0,0,0.4);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        .mobile-panel .nav-link {
            font-size: 18px;
            margin: 14px 0;
            font-weight: 600;
        }

    /* ⭐ 輸入框與按鈕的統一安全覆蓋 */
    input, textarea {
        background: rgba(255,255,255,0.2) !important;
        border: 1px solid rgba(255,255,255,0.25) !important;
        color: #fff !important;
        border-radius: 20px !important;
    }

    button:not(.pay-btn) {
        background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
        color: white !important;
        border-radius: 30px !important;
        border: none !important;
    }

    /* ===============================
    ⭐ CONTACT CARD 修正 
    =============================== */
    .contact-card,
    .contact-form,
    .ai-chat-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 16px !important;
        border-radius: 28px !important;
    }
}

/* ===============================
⭐ Products 頁手機玻璃修復（SmarterASP / iOS Safari）
   避免 nested backdrop-filter + fixed background + translateZ 在手機變白板
=============================== */
.main-panel,
.product-glass,
.plan-glass,
.contact-form,
.ai-chat-card {
    position: relative;
    z-index: 0;
    background: rgba(35, 38, 55, 0.34);
    background-clip: padding-box;
    border: 1px solid rgba(255,255,255,0.20);
    overflow: hidden;
    isolation: isolate;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}

.main-panel::before,
.product-glass::before,
.plan-glass::before,
.contact-form::before,
.ai-chat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.055));
}

@media (max-width: 900px) {
    body {
        background-attachment: scroll !important;
        background-color: #101322 !important;
    }

    body::before {
        position: fixed;
        transform: none !important;
        will-change: auto !important;
    }

    .glass-card,
    .product-card,
    .main-panel,
    .product-glass,
    .plan-glass,
    .contact-form,
    .ai-chat-card,
    .mobile-panel {
        transform: none !important;
        will-change: auto !important;
        background-color: rgba(35, 38, 55, 0.46) !important;
        background-clip: padding-box !important;
        -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
        backdrop-filter: blur(16px) saturate(140%) !important;
        isolation: isolate !important;
    }

    .product-glass {
        background: rgba(35, 38, 55, 0.42) !important;
    }

    .plan-glass {
        background: rgba(35, 38, 55, 0.46) !important;
    }
}

@supports (-webkit-touch-callout: none) {
    @media (max-width: 900px) {
        .glass-card,
        .product-card,
        .main-panel,
        .product-glass,
        .plan-glass,
        .contact-form,
        .ai-chat-card,
        .mobile-panel {
            background-color: rgba(35, 38, 55, 0.54) !important;
            -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
            backdrop-filter: blur(14px) saturate(135%) !important;
        }
    }
}

/* ===============================
⭐ Medical Translator press-and-hold layout
=============================== */
.chatcat-page {
    min-height: calc(100vh - 120px);
    color: #fff;
    padding: 60px 20px;
}

.translator-wrap {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.conversation-glass-frame {
    width: min(100%, 940px);
    height: min(58vh, 560px);
    min-height: 360px;
    margin: 38px auto 24px;
    padding: 20px;
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 24px 70px rgba(0,0,0,0.38);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    overflow: hidden;
}

.chat-container {
    height: 100%;
    overflow-y: auto;
    padding: 4px 10px 4px 4px;
    scroll-behavior: smooth;
}

.empty-hint {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    color: rgba(255,255,255,0.72);
    font-size: 18px;
    line-height: 1.8;
}

.message-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    align-items: stretch;
}

.mini-glass-card {
    text-align: left;
    min-height: 118px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    box-shadow: 0 12px 34px rgba(0,0,0,0.28);
}

.button-row-below {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    width: min(100%, 560px);
    margin: 0 auto;
}

.hold-record-btn {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.speak-btn.recording {
    transform: scale(0.97);
    filter: brightness(1.14);
}

@media (max-width: 700px) {
    .conversation-glass-frame {
        height: 56vh;
        min-height: 420px;
        margin-top: 28px;
        padding: 14px;
        border-radius: 24px;
    }

    .message-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mini-glass-card {
        min-height: 108px;
        padding: 16px;
    }

    .button-row-below {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}
/* Voicemail Translator page */
.vt-page {
    min-height: calc(100vh - 80px);
    padding: 24px 12px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.vt-main {
    width: min(980px, 100%);
}

.vt-glass,
.vt-small-glass,
.vt-panel {
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.16);
    box-shadow: 0 18px 45px rgba(0,0,0,.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
}

.vt-glass {
    padding: 22px;
}

.vt-main h1 {
    text-align: center;
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    font-weight: 800;
}

.vt-subtitle {
    text-align: center;
    margin: 0 0 18px;
    opacity: .86;
}

.vt-panel {
    position: relative;
    overflow: hidden;
    padding: 18px;
    margin-bottom: 18px;
}

.vt-row {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

    .vt-row label,
    .vt-upload label {
        font-weight: 700;
    }

    .vt-row select,
    .vt-upload input {
        width: 100%;
        border-radius: 14px;
        border: 1px solid rgba(255,255,255,.38);
        background: rgba(255,255,255,.72);
        padding: 11px 12px;
        color: #111;
    }

.vt-actions,
.vt-upload {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.vt-upload {
    align-items: center;
}

.vt-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 800;
    cursor: pointer;
    background: rgba(120,120,120,.45);
    color: #fff;
    transition: transform .12s ease, opacity .12s ease;
}

    .vt-btn:hover:not(:disabled) {
        transform: translateY(-1px);
    }

    .vt-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.vt-btn-primary {
    background: linear-gradient(135deg, #1278ff, #36a3ff);
}

.vt-btn-secondary {
    background: linear-gradient(135deg, #4b5563, #111827);
}

.vt-status {
    min-height: 28px;
    padding-top: 6px;
    font-weight: 700;
}

.vt-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.vt-small-glass {
    padding: 16px;
    min-height: 210px;
}

    .vt-small-glass h2 {
        margin: 0 0 10px;
        font-size: 1.15rem;
    }

.vt-textbox {
    min-height: 135px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.45);
    color: #111;
}

.vt-speak {
    margin-top: 12px;
}

.vt-recording-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.vt-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: #39ff14;
    box-shadow: 0 0 18px #39ff14;
    animation: vtScan 1.4s linear infinite alternate;
}

.vt-scan-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #39ff14;
    font-weight: 900;
    text-shadow: 0 0 14px rgba(57,255,20,.85);
    animation: vtScanText 1.4s linear infinite alternate;
    white-space: nowrap;
}

.d-none {
    display: none !important;
}

@keyframes vtScan {
    from {
        top: 18px;
    }

    to {
        top: calc(100% - 18px);
    }
}

@keyframes vtScanText {
    from {
        top: 0;
    }

    to {
        top: calc(100% - 36px);
    }
}

@media (max-width: 720px) {
    .vt-page {
        padding: 14px 10px;
    }

    .vt-glass {
        padding: 16px;
        border-radius: 20px;
    }

    .vt-result-grid {
        grid-template-columns: 1fr;
    }

    .vt-actions,
    .vt-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .vt-btn {
        width: 100%;
    }
}


/* ===============================
   Contact page contrast fix
   Makes text readable on dark/glass mobile backgrounds
=============================== */
.contact-page .contact-form,
.contact-page .ai-chat-card {
    background: rgba(18, 24, 42, 0.62) !important;
    color: #ffffff !important;
}

.contact-page .contact-form .card,
.contact-page .contact-form h1,
.contact-page .ai-chat-card h2,
.contact-page .ai-chat-card .ai-subtitle {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.contact-page .contact-form input,
.contact-page .contact-form textarea,
.contact-page .ai-chat-card textarea,
.contact-page .ai-chat-card .ai-answer-box {
    background: rgba(12, 18, 34, 0.42) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.42) !important;
    caret-color: #ffffff;
}

.contact-page .contact-form input::placeholder,
.contact-page .contact-form textarea::placeholder,
.contact-page .ai-chat-card textarea::placeholder {
    color: rgba(255, 244, 190, 0.92) !important;
    opacity: 1;
}

.contact-page .contact-form input:focus,
.contact-page .contact-form textarea:focus,
.contact-page .ai-chat-card textarea:focus {
    border-color: rgba(255, 244, 190, 0.82) !important;
    box-shadow: 0 0 0 3px rgba(255, 244, 190, 0.18) !important;
    background: rgba(8, 13, 28, 0.56) !important;
}

@media (max-width: 900px) {
    .contact-page .contact-form,
    .contact-page .ai-chat-card {
        background: rgba(18, 24, 42, 0.68) !important;
        background-color: rgba(18, 24, 42, 0.68) !important;
    }
}

@supports (-webkit-touch-callout: none) {
    @media (max-width: 900px) {
        .contact-page .contact-form,
        .contact-page .ai-chat-card {
            background: rgba(18, 24, 42, 0.76) !important;
            background-color: rgba(18, 24, 42, 0.76) !important;
        }
    }
}
