        :root {
            --primary: #6366f1;
            --primary-light: #818cf8;
            --primary-glow: rgba(99, 102, 241, 0.4);
            --bg-dark: #020617;
            --glass: rgba(15, 23, 42, 0.75);
            --glass-strong: rgba(15, 23, 42, 0.9);
            --glass-border: rgba(255, 255, 255, 0.08);
            --text-main: #f8fafc;
            --text-dim: #94a3b8;
            --chat-font-size: 16px;
            --a11y-min-font: 0.85rem;
            --a11y-min-tap: 44px;
            --radius-xl: 24px;
            --radius-lg: 18px;
            --radius-md: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }

        img, iframe, video {
            max-width: 100%;
            height: auto;
        }

        .flex {
            min-width: 0;
        }

        body {
            font-family: 'Outfit', 'Noto Sans TC', sans-serif;
            background-color: var(--bg-dark);
            background-image:
                radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
                linear-gradient(135deg, #020617 0%, #0f172a 100%);
            color: var(--text-main);
            min-height: 100dvh;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0;
            width: 100%;
        }

        .opc-container {
            width: 100%;
            max-width: 1100px;
            height: 90dvh;
            max-height: 920px;
            background: var(--glass);
            backdrop-filter: blur(25px);
            padding-bottom: env(safe-area-inset-bottom, 0px);
            -webkit-backdrop-filter: blur(25px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-xl);
            display: flex;
            flex-direction: column;
            box-shadow:
                0 0 0 1px rgba(255, 255, 255, 0.05),
                0 25px 50px -12px rgba(0, 0, 0, 0.7);
            margin: 10px;
            position: relative;
            overflow-y: auto;
            overflow-x: hidden;
            animation: containerIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes containerIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(20px);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        @media (max-width: 600px) {
            .opc-container {
                height: 100dvh;
                max-height: 100%;
                margin: 0;
                border-radius: 0;
                padding-bottom: env(safe-area-inset-bottom, 0px);
            }
        }

        /* PC 寬屏：放寬 header 元素限制 */
        @media (min-width: 601px) {
            .profile-chip { max-width: 220px !important; }
            .header button { max-width: 110px !important; }
        }

        .header {
            padding: calc(15px + env(safe-area-inset-top, 0px)) 15px 10px;
            min-height: 56px;
            height: auto;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
        }

        .header h1 {
            font-size: 1rem;
            font-weight: 600;
            line-height: 1.2;
        }

        .chat-area {
            flex: 1;
            min-height: 0; /* 允許 flex 子項目內部滾動 */
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 16px;
            -webkit-overflow-scrolling: touch;
            background-image:
                radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 20%);
        }

        #msg_list {
            flex: 1;
            min-height: 0; /* 允許 flex 子項目內部滾動 */
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch;
            will-change: transform;
        }

        /* 訊息泡泡樣式 */
        .msg {
            max-width: 85%;
            padding: 12px 18px;
            border-radius: var(--radius-lg);
            font-size: var(--chat-font-size);
            line-height: 1.6;
            position: relative;
            animation: msgIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        @keyframes msgIn {
            from {
                opacity: 0;
                transform: translateY(15px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        @keyframes fadeOut {
            0% {
                opacity: 1;
            }

            70% {
                opacity: 1;
            }

            100% {
                opacity: 0;
            }
        }

        .msg.received {
            align-self: flex-start;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-bottom-left-radius: 4px;
            color: #f1f5f9;
        }

        .msg.sent {
            align-self: flex-end;
            background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
            border-bottom-right-radius: 4px;
            box-shadow: 0 10px 15px -3px var(--primary-glow);
            color: #fff;
            height: auto;
        }

        .msg .sender {
            color: var(--text-dim);
        }

        .msg .content {
            word-break: break-word;
            font-weight: 600;
        }

        /* 翻譯 + 評鑒按鈕同行排列 */
        .msg .translation {
            margin-top: 6px;
            padding-top: 6px;
            border-top: 1px dashed rgba(255, 255, 255, 0.2);
            font-style: italic;
            color: var(--translation-color, #60a5fa);
            font-weight: 500;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            gap: 4px;
        }

        .msg-rating {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            flex-shrink: 0;
        }

        .msg-rating .rate-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.7rem;
            padding: 1px 2px;
            min-height: unset;
            line-height: 1;
            box-shadow: none;
            opacity: 0.65;
            transition: opacity 0.15s;
        }

        .msg-rating .rate-btn:hover {
            background: none;
            box-shadow: none;
            transform: none;
            opacity: 1;
        }

        .input-area {
            padding: 12px 16px;
            padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            display: flex;
            gap: 12px;
            margin: 0 16px 16px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
            position: relative;
        }

        input {
            flex: 1;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 12px 16px;
            color: white;
            outline: none;
            font-size: 16px;
            /* 防止 iOS 自動放大的關鍵 */
            transition: border-color 0.2s;
        }

        input:focus {
            border-color: var(--primary-light);
        }

        button {
            background: var(--primary);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: var(--radius-md);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            white-space: nowrap;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            min-height: var(--a11y-min-tap);
            font-size: var(--a11y-min-font);
        }

        button:hover {
            background: var(--primary-light);
            transform: translateY(-1px);
            box-shadow: 0 10px 15px -3px var(--primary-glow);
        }

        button:active {
            transform: scale(0.96) translateY(0);
        }

        .action-buttons {
            width: 100%;
            max-width: 90%;
            margin: 0 auto;
        }

        .action-buttons-inner {
            background: rgba(79, 70, 229, 0.15);
            border-top: 1px solid rgba(79, 70, 229, 0.3);
            display: flex;
            flex-direction: column;
            gap: 12px;
            z-index: 10;
        }

        footer a.cta-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: #a5b4fc;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 600;
            transition: color 0.2s;
        }

        footer a.cta-link:hover {
            color: #fff;
        }

        /* 特殊 UI - Developer Tools Landing Page */
        .landing-page {
            width: 100%;
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            -webkit-overflow-scrolling: touch;
        }

        .dev-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px;
            border-bottom: 1px solid var(--glass-border);
        }

        .dev-header .logo {
            font-weight: 700;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            gap: 10px;
            color: #fff;
            letter-spacing: -0.5px;
        }

        .dev-header .badge {
            background: rgba(99, 102, 241, 0.2);
            color: #818cf8;
            font-size: 0.7rem;
            padding: 3px 6px;
            border-radius: 6px;
            border: 1px solid rgba(99, 102, 241, 0.3);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .dev-header nav a {
            color: var(--text-dim);
            text-decoration: none;
            font-size: 0.9rem;
            transition: color 0.2s;
        }

        .dev-header nav a:hover {
            color: #fff;
        }

        .hero {
            padding: 40px 25px 20px;
            text-align: center;
        }

        .hero h1 {
            font-size: 2.2rem;
            font-weight: 700;
            margin-bottom: 16px;
            background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            line-height: 1.1;
            letter-spacing: -1px;
        }

        .hero p {
            color: var(--text-dim);
            font-size: 0.95rem;
            margin-bottom: 35px;
            line-height: 1.6;
            max-width: 90%;
            margin-left: auto;
            margin-right: auto;
        }

        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin: 0 auto;
        }

        .btn-primary {
            background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
            color: white;
            border: none;
            padding: 16px 20px;
            border-radius: var(--radius-md);
            font-weight: 700;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 10px 15px -3px var(--primary-glow);
            word-break: keep-all;
        }

        .btn-line {
            background: linear-gradient(135deg, #05b34b 0%, #06C755 100%);
            color: white;
            border: none;
            padding: 16px 20px;
            border-radius: var(--radius-md);
            font-weight: 700;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 10px 15px -3px rgba(6, 199, 85, 0.4);
            word-break: keep-all;
        }

        .btn-line:hover {
            transform: translateY(-2px);
            box-shadow: 0 20px 25px -5px rgba(6, 199, 85, 0.5);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 20px 25px -5px var(--primary-glow);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.03);
            color: #e2e8f0;
            border: 1px solid var(--glass-border);
            padding: 16px 20px;
            border-radius: 12px;
            font-weight: 600;
            cursor: pointer;
            font-size: 1.05rem;
            transition: all 0.2s;
            word-break: keep-all;
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
        }



        .window-controls {
            background: #18181b;
            padding: 12px 16px;
            display: flex;
            gap: 8px;
            border-bottom: 1px solid #27272a;
        }

        .window-controls i {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
        }

        .window-controls i:nth-child(1) {
            background: #ef4444;
        }

        .window-controls i:nth-child(2) {
            background: #eab308;
        }

        .window-controls i:nth-child(3) {
            background: #22c55e;
        }



        .features-section {
            padding: 0 25px 30px;
        }

        .features-section h3 {
            margin-bottom: 15px;
            font-size: 1.1rem;
            color: #f8fafc;
            font-weight: 600;
            border-bottom: 1px solid var(--glass-border);
            padding-bottom: 10px;
        }

        .compare-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            font-size: 0.85rem;
            table-layout: fixed;
        }

        .compare-table th,
        .compare-table td {
            padding: 12px 10px;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .compare-table th:first-child,
        .compare-table td:first-child {
            text-align: left;
            width: 40%;
        }

        .compare-table th {
            color: var(--text-dim);
            font-weight: 400;
        }

        .compare-table td {
            color: #e2e8f0;
        }

        .compare-table tr:last-child td {
            border-bottom: none;
        }

        .integrations {
            text-align: center;
            padding: 0 25px 40px;
        }

        .integrations h3 {
            margin-bottom: 20px;
            font-size: 1.1rem;
            color: #f8fafc;
        }

        .logos {
            display: flex;
            justify-content: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .logos span {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 0.8rem;
            color: var(--text-dim);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .config-panel {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--glass-border);
            padding: 24px;
            border-radius: var(--radius-lg);
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 20px;
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
        }

        .config-panel label {
            font-size: 0.8rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 600;
            margin-bottom: -5px;
        }

        .config-panel select {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: white;
            padding: 12px 15px;
            border-radius: 8px;
            outline: none;
            font-size: 0.95rem;
            width: 100%;
            appearance: none;
            -webkit-appearance: none;
        }

        .setup-screen {
            display: none;
            /* 隱藏舊的 setup-screen 樣式，避免衝突 */
        }

        /* Profile Modal/Chip 保持 */
        .profile-chip {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.1);
            padding: 6px 12px 6px 6px;
            border-radius: 20px;
            font-size: 0.9rem;
            max-width: 160px;
            overflow: hidden;
        }

        .profile-chip img {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .profile-chip span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .clear-btn {
            background: rgba(220, 38, 38, 0.2);
            color: #f87171;
            border: 1px solid rgba(220, 38, 38, 0.2);
            padding: 8px 14px;
            font-size: var(--a11y-min-font);
            border-radius: 8px;
            min-height: var(--a11y-min-tap);
        }

        .clear-btn:hover {
            background: #dc2626;
            color: white;
        }

        .guest-badge {
            background: #fbbf24;
            color: #000;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: bold;
            flex-shrink: 0;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .modal-content {
            background: #18181b;
            padding: 30px;
            border-radius: 16px;
            text-align: center;
            border: 1px solid #27272a;
            max-width: 400px;
            width: 100%;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        .modal-content h2 {
            color: #f8fafc;
            font-size: 1.5rem;
        }

        .modal-content button {
            margin-top: 20px;
            background: #4f46e5;
            border: none;
            padding: 12px;
            color: white;
            border-radius: 8px;
            width: 100%;
            cursor: pointer;
        }

        #qrcode {
            background: white;
            padding: 15px;
            border-radius: 8px;
            margin: 20px auto;
            display: inline-block;
        }

        #qrcode img {
            display: block;
        }

        /* --- Marketing Landing Page (5 Sections) --- */
        .marketing-landing {
            width: 100%;
            height: 100%;
            overflow-y: auto;
            scroll-snap-type: y mandatory;
            scroll-behavior: smooth;
            background: #000;
            -webkit-overflow-scrolling: touch;
        }

        .land-section {
            width: 100%;
            height: 100%;
            scroll-snap-align: start;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            text-align: center;
            overflow: hidden;
        }

        .land-section::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 1;
        }

        .land-content {
            position: relative;
            z-index: 10;
            max-width: 480px;
            width: 100%;
            padding: 40px 25px;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 24px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        .land-section h2 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 15px;
            background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            line-height: 1.2;
            letter-spacing: -1px;
        }

        .land-section p {
            font-size: 1rem;
            color: #94a3b8;
            margin-bottom: 30px;
            line-height: 1.6;
        }

        /* Section 1: 絕對無痕 (Dark Grey / Ash) */
        .section-1 {
            background: #0f172a url('land_1.png') no-repeat center center;
            background-size: cover;
        }

        .section-1::before {
            background: radial-gradient(circle at 70% 20%, rgba(239, 68, 68, 0.15), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(75, 85, 99, 0.2), transparent 50%);
        }

        /* Section 2: 完美避險 (Deep Blue) */
        .section-2 {
            background: #020617 url('land_2.png') no-repeat center center;
            background-size: cover;
        }

        .section-2::before {
            background: radial-gradient(circle at 10% 10%, rgba(30, 58, 138, 0.3), transparent 50%),
                radial-gradient(circle at 90% 90%, rgba(15, 23, 42, 0.3), transparent 50%);
        }

        /* Section 3: 跨國私會 (Cyberpunk Purple/Cyan) */
        .section-3 {
            background: #0a0a0a url('land_3.png') no-repeat center center;
            background-size: cover;
        }

        .section-3::before {
            background: radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.2), transparent 40%),
                radial-gradient(circle at 20% 90%, rgba(34, 211, 238, 0.15), transparent 40%);
        }

        /* Section 4: 主導權限 (Black / Maroon Royale) */
        .section-4 {
            background: #000 url('land_4.png') no-repeat center center;
            background-size: cover;
        }

        .section-4::before {
            background: radial-gradient(circle at 50% 50%, rgba(153, 27, 27, 0.15), transparent 70%),
                linear-gradient(to bottom, #000, #1a0a0a);
        }

        /* Section 5: 靈肉分離 (Blurry / Dark Teal) */
        .section-5 {
            background: #020617 url('land_5.png') no-repeat center center;
            background-size: cover;
        }

        .section-5::before {
            background: radial-gradient(circle at 40% 30%, rgba(20, 184, 166, 0.15), transparent 60%),
                radial-gradient(circle at 60% 70%, rgba(99, 102, 241, 0.1), transparent 60%);
        }

        .scroll-indicator {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            color: rgba(255, 255, 255, 0.3);
            font-size: 0.7rem;
            z-index: 20;
            animation: bounce 2s infinite;
        }

        @keyframes bounce {

            0%,
            20%,
            50%,
            80%,
            100% {
                transform: translateY(0) translateX(-50%);
            }

            40% {
                transform: translateY(-10px) translateX(-50%);
            }

            60% {
                transform: translateY(-5px) translateX(-50%);
            }
        }