/* ============================================
   匿屿寻风 - 完整样式表
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6a8aad;
    --primary-dark: #4a6a8a;
    --primary-light: #8aaccf;
    --primary-glow: rgba(106, 138, 173, 0.4);
    --text: #2c3e50;
    --text2: #607d8b;
    --text-light: rgba(255,255,255,0.9);
    --text-muted: rgba(255,255,255,0.6);
    --bg: #f0f4f8;
    --white: #fff;
    --border: #e0e8f0;
    --danger: #e57373;
    --success: #81c784;
    --warn: #ffb74d;
    --vip: #ffd700;
    --svip: #9c27b0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 16px;
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --night-primary: #2c3e50;
    --night-bg: #000000;
    --night-white: #050505;
    --night-text: #ffffff;
    --night-text2: #d6d6d6;
    --night-border: #333333;
    --app-height: 100vh;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

:root.night {
    --bg: var(--night-bg);
    --white: var(--night-white);
    --text: var(--night-text);
    --text2: var(--night-text2);
    --border: var(--night-border);
}

html, body {
    height: 100%;
    min-height: var(--app-height);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: #1a1a2e;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
}

/* --- App Container --- */
#app {
    height: var(--app-height);
    min-height: var(--app-height);
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    position: relative;
}

@media (min-width: 768px) {
    #app {
        max-width: 480px;
        box-shadow: 0 0 60px rgba(0,0,0,0.25);
        height: var(--app-height);
    }
}

/* --- Atmospheric Background Layer (desktop only) --- */
@media (min-width: 768px) {
    body::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background:
            linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%),
            linear-gradient(225deg, rgba(255,255,255,0.1) 0%, transparent 50%),
            url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&q=80') center center / cover no-repeat;
        z-index: -1;
    }
}

/* --- Loading Screen --- */
.loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #ede7f6 0%, #f3e5f5 50%, #fce4ec 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}
.loading-logo {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156,39,176,0.25), transparent);
    border: 2px solid rgba(156,39,176,0.35);
    animation: pulse 2s ease-in-out infinite;
}
.loading-text {
    color: rgba(156,39,176,0.75);
    font-size: 13px;
    letter-spacing: 2px;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; box-shadow: 0 0 0 0 rgba(156,39,176,0.4); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 20px 8px rgba(156,39,176,0.1); }
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 100%);
    color: var(--white);
    padding: max(12px, env(safe-area-inset-top)) 12px 8px;
    text-align: center;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
}
    .btn-icon {
        position: absolute;
        left: 12px;
        top: max(12px, env(safe-area-inset-top));
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.25); }
.top-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.95);
    letter-spacing: 1px;
}
.top-subtitle {
    font-size: 9px;
    opacity: 0.75;
    margin-top: 2px;
}
.top-vip-icon {
    position: absolute;
    right: 60px;
    top: max(14px, env(safe-area-inset-top));
    height: 0.8rem;
}
.title-en {
    font-size: 9px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    letter-spacing: 1px;
}

/* ============================================
   Page Home
   ============================================ */
.page-home {
    min-height: var(--app-height);
    height: var(--app-height);
    background:
        linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.55) 100%),
        url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&q=80') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Atmospheric floating orbs on homepage */
.page-home::before,
.page-home::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.page-home::before {
    width: 300px; height: 300px;
    top: -80px; right: -60px;
    background: radial-gradient(circle, rgba(156,39,176,0.12) 0%, transparent 70%);
    animation: float1 8s ease-in-out infinite;
}
.page-home::after {
    width: 200px; height: 200px;
    bottom: 200px; left: -40px;
    background: radial-gradient(circle, rgba(233,30,99,0.08) 0%, transparent 70%);
    animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, 20px) scale(1.05); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -15px) scale(1.08); }
}

.home-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: max(56px, var(--safe-top)) 24px max(80px, var(--safe-bottom));
    position: relative;
    z-index: 1;
    min-height: var(--app-height);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.home-content {
    width: 100%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
}

/* --- Fullscreen Home Main (desktop only) --- */
@media (min-width: 768px) {
    #app.max-width-reset {
        max-width: 100% !important;
        box-shadow: none !important;
    }
    #app.max-width-reset .home-main {
        padding-top: max(56px, env(safe-area-inset-top));
        padding-bottom: max(80px, env(safe-area-inset-bottom));
    }
}

/* --- Brand Header --- */
.home-brand {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 28px;
    animation: fadeInUp 0.8s ease both;
}
.brand-slogan {
    font-size: 22px;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
    letter-spacing: 3px;
    line-height: 1.8;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.brand-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    line-height: 1.9;
    margin-top: 4px;
}

/* --- Home Intro / Main Card --- */
.home-intro {
    width: 100%;
    max-width: 360px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 24px;
    padding: 28px 22px 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(16px);
    animation: fadeInUp 0.8s ease 0.2s both;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: visible;
}
.home-intro::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233,30,99,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.home-intro::after {
    content: '';
    position: absolute;
    bottom: -20px; left: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156,39,176,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.intro-line {
    font-size: 13.5px;
    color: rgba(255,255,255,0.7);
    line-height: 2;
    letter-spacing: 0.3px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.intro-line strong {
    color: rgba(233,30,99,1);
    font-weight: 500;
}

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

/* --- Gender Select --- */
.gender-select {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease 0.4s both;
}
.gender-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 16px 12px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}
.gender-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.35);
}
.gender-btn:active { transform: scale(0.97); }
.gender-btn.active {
    background: rgba(171,71,188,0.3);
    color: rgba(255,255,255,0.95);
    border-color: rgba(171,71,188,0.6);
    box-shadow: 0 4px 20px rgba(142,36,170,0.3), inset 0 0 12px rgba(255,255,255,0.08);
}
.gender-icon-male {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 6px;
    filter: grayscale(0.2);
    transition: filter 0.3s;
}
.gender-icon-female {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 6px;
    filter: grayscale(0.2);
    transition: filter 0.3s;
}
.gender-btn.active .gender-icon-male,
.gender-btn.active .gender-icon-female { filter: grayscale(0); }
.gender-label { font-size: 13px; letter-spacing: 0.5px; font-weight: 500; }

/* --- Age Select --- */
.age-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease 0.5s both;
}
.age-select-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.age-select-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.age-btn {
    padding: 7px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    letter-spacing: 0.3px;
}
.age-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.85);
}
.age-btn:active { transform: scale(0.95); }
.age-btn.active {
    background: rgba(233,30,99,0.2);
    color: rgba(255,255,255,0.95);
    border-color: rgba(233,30,99,0.5);
}

/* --- Start Button --- */
.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 56px;
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 50%, #7b1fa2 100%);
    color: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(142,36,170,0.4), 0 0 0 1px rgba(255,255,255,0.15);
    margin-bottom: 20px;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease 0.65s both;
}
.btn-start:hover {
    box-shadow: 0 6px 32px rgba(142,36,170,0.5), 0 0 0 1px rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
.btn-start:active { transform: scale(0.97) translateY(0); box-shadow: 0 2px 12px rgba(142,36,170,0.3); }
.btn-start-icon { font-size: 20px; }

/* --- Home Links --- */
.home-links {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.8s ease 0.8s both;
}
.home-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 5px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.home-link:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.85);
}

/* --- Home ICP --- */
.home-icp {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(12px, var(--safe-bottom));
    z-index: 20;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 16px);
    white-space: nowrap;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: clamp(8px, 2.2vw, 10px);
    letter-spacing: 0.2px;
}

/* ============================================
   Page Chat
   ============================================ */
.page-chat {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%),
        url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&q=80') center center / cover no-repeat;
}

/* ============================================
   Tab Bar
   ============================================ */
.tab-bar {
    position: absolute;
    top: 46px; left: 0; right: 0;
    display: flex;
    margin-top: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 99;
}
.tab-item {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 15px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    position: relative;
    transition: color 0.25s, background 0.25s;
}
.tab-item:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
}
.tab-item.active {
    color: rgba(255,255,255,0.95);
    font-weight: bold;
}
.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 3px 3px 0 0;
}
.tab-secret {
    font-size: 11px;
    color: var(--primary);
}
.tab-reconnect {
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
}
.tab-reconnect img {
    height: 0.8rem;
    width: 0.8rem;
    vertical-align: middle;
}

/* ============================================
   Page Chat Full
   ============================================ */
.page-chat-full {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%),
        url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&q=80') center center / cover no-repeat;
    z-index: 10;
}

/* ============================================
   Tab Panels
   ============================================ */
.tab-explore,
.tab-chat {
    position: absolute;
    top: 87px;
    left: 0; right: 0;
    bottom: 0;
}
.tab-explore { overflow-y: auto; background: rgba(255,255,255,0.08); }
.tab-chat { overflow: hidden; display: flex; flex-direction: column; }

/* ============================================
   Article Tool Bar
   ============================================ */
.article-tool-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}
.article-tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
}
.article-tool-btn:active { opacity: 0.8; }
.article-tool-btn .icon-comment::before { content: '💬'; }
.article-tool-btn .icon-link::before { content: '🔗'; }
.article-tool-btn .icon-heart::before { content: '♥'; }

/* ============================================
   Article Bottom Bar
   ============================================ */
.article-bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.3);
    font-size: 13px;
}
.article-bottom-bar .article-title {
    flex: 1;
    color: var(--text2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article-bottom-bar .article-next {
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
    padding: 4px 12px;
}

/* ============================================
   Title EN (English subtitle in top bar)
   ============================================ */
.title-en {
    font-size: 9px;
    opacity: 0.75;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
.top-vip-icon {
    position: absolute;
    right: 60px;
    top: 12px;
    height: 0.8rem;
}

/* ============================================
   Gender Icons (CSS-based)
   ============================================ */
.gender-icon-male {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: rgba(255,255,255,0.8);
    margin-bottom: 6px;
    transition: all 0.3s ease;
    position: relative;
}
.gender-icon-male::after {
    content: '♂';
    font-size: 22px;
    font-weight: bold;
}
.gender-btn.active .gender-icon-male {
    background: rgba(255,255,255,0.25);
    color: rgba(255,255,255,1);
    box-shadow: 0 0 16px rgba(255,255,255,0.2);
}
.gender-icon-female {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: rgba(255,255,255,0.8);
    margin-bottom: 6px;
    transition: all 0.3s ease;
}
.gender-icon-female::after {
    content: '♀';
    font-size: 22px;
    font-weight: bold;
}
.gender-btn.active .gender-icon-female {
    background: rgba(255,255,255,0.25);
    color: rgba(255,255,255,1);
    box-shadow: 0 0 16px rgba(255,255,255,0.2);
}

/* ============================================
   Chat Paired State
   ============================================ */
.chat-paired {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   Partner Bar
   ============================================ */
.partner-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.partner-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #ab47bc, #e91e63);
    color: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(233,30,99,0.4);
}
.partner-info { flex: 1; min-width: 0; }
.partner-name { font-size: 14px; font-weight: bold; color: rgba(255,255,255,0.92); }
.partner-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}
.partner-detail-item {
    padding: 1px 8px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.65);
}
.partner-detail-item.location {
    display: flex;
    align-items: center;
    gap: 2px;
}
.partner-detail-item.location::before {
    content: '📍';
    font-size: 10px;
}
.partner-labels { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.partner-label-tag {
    padding: 1px 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    font-size: 10px;
    color: rgba(255,255,255,0.65);
}
.partner-vip img { height: 16px; }
.inline-vip-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #3a2a00;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}
.inline-vip-tag.svip {
    background: linear-gradient(135deg, #d96cff, #8e24aa);
    color: #fff;
}
.btn-leave-chat {
    padding: 5px 12px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.btn-leave-chat:active {
    background: rgba(233,30,99,0.25);
    color: rgba(255,255,255,0.95);
    border-color: rgba(233,30,99,0.5);
    box-shadow: 0 0 8px rgba(233,30,99,0.3);
}

/* ============================================
   Message List (chatting state)
   ============================================ */
.tab-chat .message-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    position: static;
}

/* ============================================
   Chat Ended State
   ============================================ */
.chat-ended {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

/* ============================================
   Ended Tip
   ============================================ */
.ended-tip {
    text-align: center;
    padding: 40px 20px 20px;
}
.ended-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: wave 1.5s ease-in-out infinite;
}
@keyframes wave {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}
.ended-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 8px;
}
.ended-sub {
    font-size: 13px;
    color: var(--text2);
}

/* ============================================
   Re-match Button
   ============================================ */
.btn-rematch-wrap {
    padding: 16px 20px 12px;
    display: flex;
    justify-content: center;
}
.btn-rematch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    padding: 14px 32px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(254,83,81,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-rematch:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(254,83,81,0.25);
}
.btn-rematch-icon { font-size: 20px; }

/* ============================================
   Back Home Button
   ============================================ */
.btn-back-home-wrap {
    padding: 0 20px 16px;
    display: flex;
    justify-content: center;
}
.btn-back-home {
    padding: 10px 32px;
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-back-home:active {
    background: var(--border);
}

/* ============================================
   Leave Actions (after chat ends)
   ============================================ */
.leave-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 12px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
}
.leave-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    background: var(--bg);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
    transition: all 0.2s;
    border: 2px solid transparent;
}
.leave-action-item:active { transform: scale(0.95); }
.leave-action-item.informed {
    background: rgba(254, 83, 81, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   Clear Flow (Green Chat Acceleration)
   ============================================ */
.clear-flow-tip {
    text-align: center;
    padding: 8px;
    font-size: 12px;
}
.clear-flow-tip a {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================
   Continue Chat Button Wrap
   ============================================ */
.btn-continue-chat-wrap {
    padding: 12px 16px;
    margin-top: auto;
}

/* ============================================
   Sidebar Overlay
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

/* ============================================
   Tab Panel - 探索区
   ============================================ */
.tab-panel {
    position: absolute;
    top: 86px;
    left: 0; right: 0;
    bottom: 0;
    overflow-y: auto;
}
.explore-list { padding: 12px; }
.explore-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.explore-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.explore-author { font-weight: bold; font-size: 13px; color: rgba(255,255,255,0.9); }
.explore-likes { color: var(--primary-light); font-size: 13px; cursor: pointer; }
.explore-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.explore-edit-btn, .explore-delete-btn {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.explore-edit-btn {
    color: var(--primary-light);
    background: rgba(142,36,170,0.15);
}
.explore-edit-btn:hover {
    background: rgba(142,36,170,0.3);
}
.explore-delete-btn {
    color: #ff5252;
    background: rgba(255,82,82,0.15);
}
.explore-delete-btn:hover {
    background: rgba(255,82,82,0.3);
}
.explore-item-title { font-size: 15px; font-weight: bold; color: rgba(255,255,255,0.92); margin-bottom: 6px; }
.explore-item-content {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}
.explore-item-date { font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.explore-comment-title { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.explore-comment-empty { font-size: 12px; color: rgba(255,255,255,0.4); }
.explore-comment { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.12); }
.comment-content { font-size: 12px; color: rgba(255,255,255,0.6); flex: 1; }
.comment-report { font-size: 11px; color: rgba(255,255,255,0.4); cursor: pointer; }
.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.comment-date {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}
.comment-edit, .comment-delete {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}
.comment-edit {
    color: var(--primary-light);
    background: rgba(142,36,170,0.15);
}
.comment-edit:hover {
    background: rgba(142,36,170,0.3);
}
.comment-delete {
    color: #ff5252;
    background: rgba(255,82,82,0.15);
}
.comment-delete:hover {
    background: rgba(255,82,82,0.3);
}
.explore-more {
    text-align: center;
    padding: 14px;
    color: var(--primary-light);
    font-size: 13px;
    cursor: pointer;
}
.explore-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

/* ============================================
   探索区工具栏
   ============================================ */
.explore-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
}
.btn-publish {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(142,36,170,0.4);
    position: relative;
    z-index: 10;
}
.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142,36,170,0.5);
}
.btn-publish:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(142,36,170,0.3);
}
.btn-publish .icon-edit::before { content: '✏️'; }

/* ============================================
   文章操作按钮
   ============================================ */
.explore-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.explore-item-btns {
    display: flex;
    gap: 12px;
}
.explore-action-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}
.explore-action-btn:hover {
    color: var(--primary-light);
}
.explore-action-btn .icon-comment::before { content: '💬'; }

/* ============================================
   发布弹窗
   ============================================ */
.popup-publish-box .form-item,
.popup-comment-box .form-item {
    margin-bottom: 16px;
}
.popup-publish-box .form-label,
.popup-comment-box .form-label {
    display: block;
    font-size: 13px;
    color: #666666;
    margin-bottom: 8px;
    font-weight: 500;
}
.popup-publish-box .form-input,
.popup-comment-box .form-input,
.popup-publish-box .form-textarea,
.popup-comment-box .form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    color: #333333;
    outline: none;
    transition: border-color 0.2s;
}
.popup-publish-box .form-input:focus,
.popup-comment-box .form-input:focus,
.popup-publish-box .form-textarea:focus,
.popup-comment-box .form-textarea:focus {
    border-color: #ab47bc;
    background: #ffffff;
}
.popup-publish-box .form-input::placeholder,
.popup-comment-box .form-input::placeholder,
.popup-publish-box .form-textarea::placeholder,
.popup-comment-box .form-textarea::placeholder {
    color: #999999;
}
.popup-publish-box .form-textarea,
.popup-comment-box .form-textarea {
    resize: vertical;
    min-height: 100px;
}
.char-count {
    text-align: right;
    font-size: 11px;
    color: #999999;
    margin-top: 6px;
}
.popup-publish-box .char-count,
.popup-comment-box .char-count {
    color: #999999;
}
.publish-tips {
    font-size: 11px;
    color: #999999;
    text-align: center;
    margin-bottom: 12px;
}

/* ============================================
   评论弹窗
   ============================================ */
.popup-comment-box { max-width: 420px; }
.comment-article-preview {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.1);
}
.comment-article-title {
    font-size: 13px;
    font-weight: bold;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
}
.comment-article-content {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Tab Panel - 聊天区
   ============================================ */
.chat-matching {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
    height: 100%;
}
.matching-spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(254,83,81,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.matching-text { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.matching-sub { font-size: 13px; color: var(--text2); margin-bottom: 24px; }
.btn-cancel-match {
    padding: 8px 24px;
    background: var(--bg);
    color: var(--text2);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.chat-session {
    position: absolute;
    top: 115px;
    left: 0; right: 0;
    height: calc(var(--app-height) - 115px);
}

.message-list {
    position: absolute;
    top: 0; left: 0; right: 0;
    bottom: calc(55px + var(--safe-bottom));
    padding: 14px 14px calc(16px + var(--safe-bottom));
    overflow-y: auto;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
}
.message-item {
    display: flex;
    margin-bottom: 14px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-self { justify-content: flex-end; }
.msg-other { justify-content: flex-start; }
.msg-system { justify-content: center; }

.msg-content { max-width: 75%; }
.msg-self .msg-bubble {
    background: var(--primary);
    color: var(--white);
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}
.msg-other .msg-bubble {
    background: var(--bg);
    color: var(--text);
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.msg-time {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-align: right;
    margin-top: 3px;
}
.msg-self .msg-time { color: rgba(255,255,255,0.6); }
.msg-other .msg-time { color: #bbb; }

.msg-bubble.blurred {
    filter: blur(6px);
    user-select: none;
}
.msg-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
}
.msg-voice {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    cursor: pointer;
}
.voice-icon { font-size: 16px; color: var(--primary); }
.voice-text { font-size: 12px; color: var(--text2); }
.msg-voice.playing .voice-icon,
.msg-voice.playing .voice-text {
    color: var(--primary);
}
.msg-voice.playing .voice-icon {
    animation: voicePulse 1s ease-in-out infinite;
}
@keyframes voicePulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.msg-moderate {
    background: var(--bg);
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
}
.msg-moderate-warn { color: var(--warn); margin-bottom: 6px; }
.msg-moderate-btn {
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
}
.msg-topic {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-radius: 12px;
    padding: 10px 16px;
    text-align: center;
}
.topic-title { font-size: 14px; font-weight: bold; }

.msg-system-content {
    background: var(--bg);
    color: var(--text2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
}

.typing-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    color: var(--text2);
    font-size: 12px;
}
.typing-dots { display: flex; gap: 3px; }
.typing-dots span {
    width: 5px; height: 5px;
    background: var(--text2);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* ============================================
   Input Bar
   ============================================ */
.input-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px calc(8px + var(--safe-bottom));
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.4);
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
}
.read-status {
    color: #27ae60;
    font-size: 11px;
    margin-left: 6px;
}
.btn-emoji, .btn-pic, .btn-voice {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--text2);
    flex-shrink: 0;
}
.emoji-panel {
    position: absolute;
    bottom: calc(60px + var(--safe-bottom));
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.5);
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 49;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.emoji-item {
    font-size: 22px;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
}
.emoji-item:hover {
    background: rgba(0,0,0,0.08);
}
.btn-voice.recording {
    color: #e74c3c;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.recording-status {
    background: #fff0f0;
    border-top: 1px solid #fecaca;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    color: #e74c3c;
    position: relative;
}
.recording-status .recording-icon { vertical-align: middle; }
.btn-stop {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    margin-left: 12px;
    cursor: pointer;
}
.input-area { flex: 1; }
.input-field {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--bg);
    transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--primary); }
.btn-send {
    padding: 7px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-send:active { background: var(--primary-dark); }

/* ============================================
   Chat End Bar
   ============================================ */
.chat-end-bar {
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
}
.chat-end-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.chat-end-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}
.btn-report { background: var(--danger); color: var(--white); }
.btn-share-chat { background: var(--warn); color: var(--white); }
.btn-back-home { background: var(--bg); color: var(--text); }

.chat-continue-bar {
    padding: 10px 12px 14px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
}
.btn-continue-chat {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
}
.chat-continue-bar .btn-continue-chat:active { background: var(--primary-dark); }

/* ============================================
   Chat Idle
   ============================================ */
.chat-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
}
.idle-tip { color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.btn-start-chat-2 {
    padding: 12px 36px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.2s ease;
}
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    z-index: 201;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.sidebar.open { left: 0; }
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--primary);
    color: var(--white);
}
.sidebar-title { font-size: 15px; }
.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--white);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}
.sidebar-body { padding: 14px; }
.sidebar-desc {
    font-size: 12px;
    color: var(--text2);
    text-align: center;
    margin-bottom: 14px;
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
}
.sidebar-btn-login, .sidebar-btn-reg {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
}
.sidebar-btn-login { background: var(--primary); color: var(--white); }
.sidebar-btn-reg { background: var(--bg); color: var(--text); }

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.user-avatar {
    width: 46px; height: 46px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.user-info { flex: 1; }
.user-name { font-size: 15px; font-weight: bold; margin-bottom: 4px; }
.user-vip-tag {
    display: inline-block;
    padding: 2px 7px;
    background: var(--vip);
    color: #333;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 4px;
    margin-left: 6px;
}
.user-vip-tag.svip { background: var(--svip); color: #fff; }

.sidebar-section-title {
    font-size: 11px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 4px;
}
.sidebar-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.sidebar-setting-row:last-child { border-bottom: none; }
.setting-val { color: var(--primary); font-size: 12px; }
.sidebar-select-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
}
.sidebar-select {
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    max-width: 140px;
}
.sidebar-link {
    padding: 10px 0;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-version {
    text-align: center;
    font-size: 11px;
    color: var(--text2);
    padding-top: 10px;
}

/* ============================================
   Switch
   ============================================ */
.switch {
    position: relative;
    width: 42px; height: 24px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
    cursor: pointer;
}
.slider:before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(18px); }

/* ============================================
   Popup
   ============================================ */
.popup-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    min-height: var(--app-height);
    background: rgba(0,0,0,0.55);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom));
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.popup-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: calc(var(--app-height) - max(32px, var(--safe-top)) - max(32px, var(--safe-bottom)));
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.popup-vip-box { max-width: 420px; }
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.popup-title { font-size: 16px; font-weight: bold; }
.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text2);
    cursor: pointer;
    line-height: 1;
}
.popup-body { padding: 16px; }
.popup-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Form Elements
   ============================================ */
.form-item { margin-bottom: 14px; }
.form-label { font-size: 12px; color: var(--text2); margin-bottom: 5px; }
.form-input-wrap { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.nation-code {
    padding: 9px 10px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    font-size: 13px;
    color: var(--text2);
    white-space: nowrap;
}
.form-input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
input.form-input, textarea.form-input {
    color: #333;
}
.night input.form-input, .night textarea.form-input {
    color: rgba(255,255,255,0.95);
}
.form-input-wrap .form-input { border: none; border-radius: 0; }
.form-input:focus { border-color: var(--primary); }
.form-input-row { display: flex; gap: 8px; }
.form-input-row .form-input { flex: 1; }
.form-btn-sms {
    padding: 9px 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.form-btn-sms:disabled { background: #ccc; cursor: not-allowed; }

.form-radio-row { display: flex; gap: 16px; }
.form-radio { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; }
.form-radio input { width: auto; }

.form-agree {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 12px;
}
.form-agree input { width: auto; }
.form-agree a { color: var(--primary); text-decoration: none; }

.form-select, .form-textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--white);
}
.form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 80px; resize: vertical; }

.form-btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.form-btn-primary:active { background: var(--primary-dark); }
.form-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.form-btn-secondary {
    width: 100%;
    padding: 11px;
    background: var(--bg);
    color: var(--text);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 8px;
}
.form-btn-danger {
    width: 100%;
    padding: 11px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 8px;
}
.form-link-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
}
.form-link-row a { color: var(--primary); text-decoration: none; }
.form-desc {
    font-size: 12px;
    color: var(--text2);
    text-align: center;
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 14px;
}
.captcha-code {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #ffb020;
    border-radius: 8px;
    background: #fff7e6;
    color: #8a3b00;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}
.captcha-code b {
    color: #e53935;
    font-size: 28px;
    line-height: 1;
    letter-spacing: 4px;
    vertical-align: middle;
}
.form-hint {
    font-size: 11px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: center;
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
}

.support-contact {
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    line-height: 1.7;
    font-size: 14px;
}
.support-contact.loading {
    color: var(--text2);
}
.form-checkbox input { width: auto; }

/* ============================================
   VIP Page
   ============================================ */
.vip-desc-box {
    background: var(--bg);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 14px;
}
.vip-desc-box p { margin-bottom: 4px; }
.vip-desc-box b { color: var(--primary); }

.vip-tabs { display: flex; gap: 0; margin-bottom: 12px; }
.vip-tab {
    flex: 1;
    padding: 9px;
    text-align: center;
    font-size: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}
.vip-tab:first-child { border-radius: 8px 0 0 8px; }
.vip-tab:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.vip-tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.vip-match-time {
    text-align: center;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 12px;
}

.vip-card-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.vip-card-item {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.vip-card-item.svip { border-color: var(--svip); }
.vip-card-item.selected { border-color: var(--primary); background: rgba(254,83,81,0.08); }
.vip-card-item.svip.selected { border-color: var(--svip); background: rgba(156,39,176,0.08); }
.vip-card-name { font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.vip-card-price { font-size: 12px; color: var(--text2); }
.vip-card-real { font-size: 16px; font-weight: bold; color: var(--danger); margin-top: 4px; }

.vip-price-total { text-align: center; font-size: 14px; margin-bottom: 14px; }
.vip-price-total strong { color: var(--danger); font-size: 18px; }

.vip-tips {
    margin-top: 14px;
    font-size: 11px;
    color: var(--text2);
    line-height: 1.7;
    text-align: center;
}
.vip-tips p { margin-bottom: 3px; }

/* ============================================
   Secret Tags
   ============================================ */
.secret-current {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}
.secret-current b { color: var(--primary); }
.secret-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.secret-tag {
    padding: 5px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.secret-tag:hover,
.secret-tag.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.secret-desc {
    color: var(--text2);
    font-size: 12px;
    margin: -2px 0 12px;
    line-height: 1.5;
}

/* ============================================
   Share
   ============================================ */
.share-tip {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 12px;
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
}
.share-link-body { text-align: center; }
.share-link-text { font-size: 12px; color: var(--text2); margin-bottom: 8px; text-align: left; }
.share-link-url {
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    word-break: break-all;
    margin-bottom: 14px;
    text-align: left;
    color: var(--primary);
}

/* ============================================
   Labels Grid
   ============================================ */
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 320px; overflow-y: auto; }
.label-item {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}
.label-item.selected { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.78);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: toastPop 0.3s ease;
    pointer-events: none;
    text-align: center;
    max-width: 280px;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.info { background: rgba(0,0,0,0.78); }
@keyframes toastPop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   Niyu Xunfeng Visual Refresh
   ============================================ */
#app:not(.night) {
    --primary: #2f8f9d;
    --primary-dark: #0d5f71;
    --primary-light: #8fd8dc;
    --primary-glow: rgba(56, 189, 199, 0.34);
    --accent: #f3c56b;
    --accent-soft: rgba(243, 197, 107, 0.18);
    --ink: #12333c;
    --mist: rgba(238, 250, 249, 0.72);
    --glass: rgba(255, 255, 255, 0.16);
    --glass-strong: rgba(255, 255, 255, 0.82);
    --border-soft: rgba(255, 255, 255, 0.28);
    --shadow: 0 18px 55px rgba(10, 46, 58, 0.24);
    color: var(--ink);
}

body {
    background:
        radial-gradient(circle at 12% 18%, rgba(143,216,220,0.34), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(243,197,107,0.26), transparent 24%),
        linear-gradient(135deg, #071a22 0%, #0e3d49 46%, #d9c38d 100%);
}

@media (min-width: 768px) {
    body::before {
        background:
            radial-gradient(circle at 18% 16%, rgba(143,216,220,0.22), transparent 28%),
            radial-gradient(circle at 78% 10%, rgba(243,197,107,0.22), transparent 30%),
            linear-gradient(135deg, #061821 0%, #0e4350 48%, #d8bd7d 100%) !important;
    }
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: -1;
        background-image:
            linear-gradient(115deg, transparent 0 46%, rgba(255,255,255,0.10) 47%, transparent 49%),
            linear-gradient(135deg, transparent 0 58%, rgba(255,255,255,0.08) 59%, transparent 61%);
        opacity: 0.5;
    }
}

#app:not(.night) .loading {
    background:
        radial-gradient(circle at 50% 42%, rgba(143,216,220,0.34), transparent 26%),
        linear-gradient(160deg, #071a22 0%, #105162 52%, #f0c675 100%);
}
#app:not(.night) .loading-logo {
    width: 68px;
    height: 68px;
    border: 1px solid rgba(255,255,255,0.38);
    background:
        radial-gradient(circle at 50% 56%, #f3c56b 0 9%, transparent 10%),
        radial-gradient(ellipse at 50% 68%, #12333c 0 24%, transparent 25%),
        conic-gradient(from 180deg, rgba(143,216,220,0.1), rgba(143,216,220,0.92), rgba(243,197,107,0.76), rgba(143,216,220,0.1));
    box-shadow: 0 0 42px rgba(143,216,220,0.38);
    animation: islandPulse 2.6s ease-in-out infinite;
}
#app:not(.night) .loading-text {
    color: rgba(255,255,255,0.82);
    letter-spacing: 4px;
}

#app:not(.night) .page-home,
#app:not(.night) .page-chat-full,
#app:not(.night) .page-chat {
    background:
        radial-gradient(circle at 72% 12%, rgba(243,197,107,0.42), transparent 18%),
        radial-gradient(circle at 18% 20%, rgba(143,216,220,0.28), transparent 24%),
        linear-gradient(180deg, rgba(6,24,33,0.28) 0%, rgba(7,29,38,0.52) 46%, rgba(13,95,113,0.74) 100%),
        linear-gradient(160deg, #071a22 0%, #145d6c 52%, #e7c279 100%) !important;
}

#app:not(.night) .page-home::before,
#app:not(.night) .page-chat-full::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 78px;
    width: 330px;
    height: 128px;
    transform: translateX(-50%);
    border-radius: 52% 48% 12% 12% / 72% 72% 18% 18%;
    background:
        radial-gradient(ellipse at 50% 8%, rgba(243,197,107,0.34) 0 10%, transparent 11%),
        radial-gradient(ellipse at 50% 84%, rgba(5,26,32,0.78) 0 43%, transparent 44%),
        linear-gradient(180deg, transparent 0 44%, rgba(12,57,65,0.56) 45% 100%);
    filter: blur(0.2px);
    opacity: 0.86;
    animation: islandFloat 8s ease-in-out infinite;
}

#app:not(.night) .page-home::after,
#app:not(.night) .page-chat-full::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(100deg, transparent 13%, rgba(255,255,255,0.18) 14%, transparent 16%),
        linear-gradient(102deg, transparent 56%, rgba(255,255,255,0.13) 57%, transparent 60%),
        linear-gradient(104deg, transparent 76%, rgba(255,255,255,0.11) 77%, transparent 80%);
    background-size: 280px 130px, 360px 180px, 420px 220px;
    animation: windDrift 16s linear infinite;
    opacity: 0.48;
}

#app:not(.night) .top-bar {
    background: linear-gradient(180deg, rgba(5,23,31,0.64), rgba(5,23,31,0.18));
    border-bottom: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 12px 35px rgba(5,23,31,0.14);
    backdrop-filter: blur(18px);
}
#app:not(.night) .btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 14px;
    color: #eefafa;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
#app:not(.night) .top-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #f7ffff;
}
#app:not(.night) .title-en {
    color: rgba(236,252,252,0.62);
    letter-spacing: 2px;
}

#app:not(.night) .home-main {
    padding-left: 20px;
    padding-right: 20px;
}
#app:not(.night) .home-brand {
    margin-top: 36px;
    margin-bottom: 22px;
}
#app:not(.night) .home-brand::before {
    content: 'wind island';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 14px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(242,250,248,0.72);
    font-size: 10px;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
}
#app:not(.night) .brand-mark {
    width: 86px;
    height: 86px;
    margin: 0 auto 14px;
    border-radius: 28px;
    position: relative;
    background:
        radial-gradient(circle at 50% 32%, #ffe1a0 0 8px, transparent 9px),
        radial-gradient(ellipse at 50% 70%, #0d5f71 0 24px, transparent 25px),
        linear-gradient(145deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.30);
    box-shadow: 0 18px 40px rgba(5,23,31,0.22), inset 0 1px 0 rgba(255,255,255,0.26);
    backdrop-filter: blur(18px);
    animation: markBreathe 4.8s ease-in-out infinite;
}
#app:not(.night) .brand-mark::before,
#app:not(.night) .brand-mark::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(239,252,251,0.82), transparent);
}
#app:not(.night) .brand-mark::before {
    top: 28px;
    transform: rotate(-10deg);
    animation: windLine 3.8s ease-in-out infinite;
}
#app:not(.night) .brand-mark::after {
    top: 42px;
    transform: rotate(8deg);
    animation: windLine 4.4s ease-in-out infinite reverse;
}
#app:not(.night) .brand-slogan {
    color: #fff9e8;
    font-size: clamp(24px, 7vw, 31px);
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: 1.8px;
    text-shadow: 0 16px 38px rgba(0,0,0,0.32);
}
#app:not(.night) .brand-tagline {
    max-width: 340px;
    margin: 9px auto 0;
    color: rgba(239,252,251,0.76);
    font-size: 13px;
    line-height: 1.8;
}

#app:not(.night) .home-intro {
    max-width: 366px;
    padding: 24px 22px 22px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)),
        radial-gradient(circle at 92% 8%, rgba(243,197,107,0.18), transparent 32%);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 28px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.26);
    backdrop-filter: blur(22px);
    overflow: visible;
}
#app:not(.night) .home-intro::before {
    width: 116px;
    height: 116px;
    top: -54px;
    right: -36px;
    background: radial-gradient(circle, rgba(243,197,107,0.36), transparent 64%);
}
#app:not(.night) .home-intro::after {
    width: 126px;
    height: 74px;
    left: 18px;
    bottom: -28px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(143,216,220,0.24), transparent 70%);
}
#app:not(.night) .intro-line {
    color: rgba(245,253,252,0.82);
    font-size: 13.5px;
    line-height: 2.05;
}
#app:not(.night) .intro-line strong {
    color: #ffe1a0;
    font-weight: 800;
}

#app:not(.night) .gender-select {
    width: 100%;
    max-width: 366px;
    gap: 12px;
}
#app:not(.night) .gender-btn,
#app:not(.night) .age-btn,
#app:not(.night) .home-link {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    color: rgba(243,251,250,0.78);
    backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}
#app:not(.night) .gender-btn {
    min-height: 92px;
    border-radius: 22px;
}
#app:not(.night) .gender-btn:hover,
#app:not(.night) .age-btn:hover,
#app:not(.night) .home-link:hover {
    transform: translateY(-2px);
    border-color: rgba(243,197,107,0.52);
    background: rgba(255,255,255,0.2);
}
#app:not(.night) .gender-btn.active {
    color: #07333d;
    background: linear-gradient(135deg, rgba(255,235,180,0.92), rgba(143,216,220,0.88));
    border-color: rgba(255,255,255,0.72);
    box-shadow: 0 14px 34px rgba(12,78,91,0.28);
}
#app:not(.night) .gender-icon-male,
#app:not(.night) .gender-icon-female {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.22);
}
#app:not(.night) .gender-btn.active .gender-icon-male,
#app:not(.night) .gender-btn.active .gender-icon-female {
    background: rgba(255,255,255,0.42);
    color: #0d5f71;
}

#app:not(.night) .age-select {
    width: 100%;
    max-width: 380px;
}
#app:not(.night) .age-select-label {
    color: rgba(242,251,249,0.64);
}
#app:not(.night) .age-btn {
    padding: 8px 13px;
    border-radius: 999px;
}
#app:not(.night) .age-btn.active {
    color: #092d36;
    background: linear-gradient(135deg, #ffe1a0, #8fd8dc);
    border-color: rgba(255,255,255,0.6);
}

#app:not(.night) .btn-start,
#app:not(.night) .form-btn-primary,
#app:not(.night) .btn-send,
#app:not(.night) .btn-publish,
#app:not(.night) .btn-rematch,
#app:not(.night) .btn-start-chat-2,
#app:not(.night) .sidebar-btn-login,
#app:not(.night) .vip-tab.active,
#app:not(.night) .secret-tag.active,
#app:not(.night) .secret-tag:hover {
    background: linear-gradient(135deg, #ffe1a0 0%, #8fd8dc 45%, #2f8f9d 100%);
    color: #07333d;
    border-color: transparent;
    box-shadow: 0 15px 34px rgba(12,78,91,0.28);
}
#app:not(.night) .btn-start {
    position: relative;
    overflow: hidden;
    min-height: 60px;
    min-width: min(320px, calc(100vw - 72px));
    padding: 18px 64px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.4px;
}
#app:not(.night) .btn-start::before {
    content: '';
    position: absolute;
    inset: -80% auto -80% -40%;
    width: 32%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.62), transparent);
    animation: shimmerSweep 3.8s ease-in-out infinite;
}
#app:not(.night) .btn-start-icon {
    font-size: 22px;
    filter: drop-shadow(0 4px 8px rgba(7,51,61,0.24));
}

#app:not(.night) .home-icp {
    color: rgba(240,251,250,0.38);
}

#app:not(.night) .tab-bar {
    background: rgba(5,23,31,0.34);
    border-bottom: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(18px);
}
#app:not(.night) .tab-item {
    color: rgba(239,252,251,0.58);
}
#app:not(.night) .tab-item.active {
    color: #fff9e8;
}
#app:not(.night) .tab-item.active::after {
    left: 28%;
    right: 28%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ffe1a0, #8fd8dc, transparent);
    box-shadow: 0 0 16px rgba(143,216,220,0.58);
}

#app:not(.night) .tab-explore {
    background: rgba(237,250,249,0.24);
}
#app:not(.night) .explore-toolbar {
    padding: 14px 14px 8px;
}
#app:not(.night) .explore-item,
#app:not(.night) .popup-box,
#app:not(.night) .sidebar,
#app:not(.night) .leave-actions,
#app:not(.night) .chat-ended {
    background: rgba(245,252,250,0.86);
    border: 1px solid rgba(255,255,255,0.58);
    box-shadow: 0 16px 44px rgba(8,49,60,0.18);
    backdrop-filter: blur(20px);
}
#app:not(.night) .explore-item {
    border-radius: 24px;
    padding: 16px;
}
#app:not(.night) .explore-author,
#app:not(.night) .explore-item-title {
    color: #12333c;
}
#app:not(.night) .explore-item-content,
#app:not(.night) .comment-content {
    color: rgba(18,51,60,0.72);
}
#app:not(.night) .explore-likes,
#app:not(.night) .explore-action-btn {
    color: #2f8f9d;
}
#app:not(.night) .tab-explore,
#app:not(.night) .explore-toolbar {
    color: #12333c;
}
#app:not(.night) .explore-item-date,
#app:not(.night) .explore-comment-title,
#app:not(.night) .explore-comment-empty,
#app:not(.night) .comment-date,
#app:not(.night) .comment-report,
#app:not(.night) .explore-empty,
#app:not(.night) .explore-more {
    color: rgba(18,51,60,0.66);
}
#app:not(.night) .explore-comment {
    border-top-color: rgba(18,51,60,0.12);
}
#app:not(.night) .comment-content {
    color: rgba(18,51,60,0.86);
}
#app:not(.night) .explore-edit-btn,
#app:not(.night) .comment-edit {
    color: #0d5f71;
    background: rgba(47,143,157,0.12);
}
#app:not(.night) .explore-delete-btn,
#app:not(.night) .comment-delete {
    color: #b42318;
    background: rgba(180,35,24,0.10);
}
#app:not(.night) .popup-publish-box,
#app:not(.night) .popup-comment-box {
    color: #12333c;
}
#app:not(.night) .popup-publish-box .form-label,
#app:not(.night) .popup-comment-box .form-label {
    color: rgba(18,51,60,0.82);
}
#app:not(.night) .popup-publish-box .form-input,
#app:not(.night) .popup-comment-box .form-input,
#app:not(.night) .popup-publish-box .form-textarea,
#app:not(.night) .popup-comment-box .form-textarea {
    background: #ffffff;
    border-color: rgba(18,51,60,0.18);
    color: #12333c;
    -webkit-text-fill-color: #12333c;
}
#app:not(.night) .popup-publish-box .form-input::placeholder,
#app:not(.night) .popup-comment-box .form-input::placeholder,
#app:not(.night) .popup-publish-box .form-textarea::placeholder,
#app:not(.night) .popup-comment-box .form-textarea::placeholder {
    color: rgba(18,51,60,0.48);
    -webkit-text-fill-color: rgba(18,51,60,0.48);
}
#app:not(.night) .popup-publish-box .char-count,
#app:not(.night) .popup-comment-box .char-count,
#app:not(.night) .publish-tips {
    color: rgba(18,51,60,0.62);
}
#app:not(.night) .comment-article-title {
    color: #12333c;
}
#app:not(.night) .comment-article-content {
    color: rgba(18,51,60,0.72);
}

#app:not(.night) .partner-bar {
    background: rgba(6,26,34,0.48);
    border-bottom: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(20px);
}
#app:not(.night) .partner-avatar {
    background:
        radial-gradient(circle at 35% 30%, #fff2c3, transparent 28%),
        linear-gradient(135deg, #8fd8dc, #2f8f9d);
    color: #07333d;
    box-shadow: 0 12px 24px rgba(47,143,157,0.32);
}
#app:not(.night) .partner-name {
    color: #f8ffff;
}
#app:not(.night) .partner-detail-item,
#app:not(.night) .partner-label-tag,
#app:not(.night) .btn-leave-chat {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(242,252,251,0.76);
}

#app:not(.night) .message-list {
    background:
        linear-gradient(180deg, rgba(236,251,249,0.22), rgba(236,251,249,0.08)),
        radial-gradient(circle at 12% 18%, rgba(255,225,160,0.14), transparent 26%);
    backdrop-filter: blur(7px);
}
#app:not(.night) .message-item {
    animation: messageFloatIn 0.36s cubic-bezier(.2,.9,.2,1) both;
}
#app:not(.night) .msg-bubble {
    box-shadow: 0 10px 24px rgba(7,36,45,0.12);
}
#app:not(.night) .msg-self .msg-bubble {
    background: linear-gradient(135deg, #2f8f9d, #0d5f71);
    border-radius: 20px 20px 6px 20px;
    color: #f7ffff;
}
#app:not(.night) .msg-other .msg-bubble {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.64);
    border-radius: 20px 20px 20px 6px;
    color: #173640;
}
#app:not(.night) .msg-system-content,
#app:not(.night) .msg-moderate {
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(255,255,255,0.52);
    color: rgba(18,51,60,0.64);
}
#app:not(.night) .msg-time {
    color: rgba(238,250,249,0.66);
}
#app:not(.night) .msg-other .msg-time {
    color: rgba(18,51,60,0.48);
}

#app:not(.night) .input-bar {
    gap: 8px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(248,253,252,0.88);
    border-top: 1px solid rgba(255,255,255,0.62);
    box-shadow: 0 -16px 42px rgba(7,35,44,0.16);
    backdrop-filter: blur(22px);
}
#app:not(.night) .btn-emoji,
#app:not(.night) .btn-pic,
#app:not(.night) .btn-voice {
    width: 35px;
    height: 35px;
    border-radius: 14px;
    background: rgba(47,143,157,0.10);
    border: 1px solid rgba(47,143,157,0.12);
    font-size: 19px;
}
#app:not(.night) .input-field,
#app:not(.night) .form-input,
#app:not(.night) .form-select,
#app:not(.night) .form-textarea,
#app:not(.night) .sidebar-select {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(47,143,157,0.18);
    color: #12333c;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
#app:not(.night) .input-field:focus,
#app:not(.night) .form-input:focus,
#app:not(.night) .form-select:focus,
#app:not(.night) .form-textarea:focus {
    border-color: rgba(47,143,157,0.58);
    box-shadow: 0 0 0 4px rgba(143,216,220,0.18);
}

#app:not(.night) .sidebar {
    border-radius: 0 28px 28px 0;
}
#app:not(.night) .sidebar-header,
#app:not(.night) .popup-header {
    background:
        radial-gradient(circle at 90% 0%, rgba(255,225,160,0.26), transparent 34%),
        linear-gradient(135deg, rgba(47,143,157,0.14), rgba(143,216,220,0.08));
    border-color: rgba(47,143,157,0.12);
}
#app:not(.night) .sidebar-title,
#app:not(.night) .popup-title {
    color: #12333c;
    letter-spacing: 0.6px;
}
#app:not(.night) .sidebar-link,
#app:not(.night) .sidebar-setting-row {
    border-color: rgba(47,143,157,0.12);
}
#app:not(.night) .sidebar-section-title {
    color: #2f8f9d;
    letter-spacing: 1.2px;
}
#app:not(.night) .user-avatar {
    background: linear-gradient(135deg, #ffe1a0, #8fd8dc);
    color: #07333d;
}

#app:not(.night) .popup-mask {
    background:
        radial-gradient(circle at 50% 12%, rgba(143,216,220,0.28), transparent 30%),
        rgba(4,18,24,0.62);
    backdrop-filter: blur(6px);
}
#app:not(.night) .popup-box {
    border-radius: 28px;
    animation: modalRise 0.28s cubic-bezier(.2,.9,.2,1) both;
}
#app:not(.night) .vip-desc-box,
#app:not(.night) .secret-current,
#app:not(.night) .support-contact,
#app:not(.night) .form-desc,
#app:not(.night) .share-tip,
#app:not(.night) .comment-article-preview {
    background: linear-gradient(135deg, rgba(143,216,220,0.15), rgba(255,225,160,0.13));
    border: 1px solid rgba(47,143,157,0.14);
    border-radius: 18px;
    color: rgba(18,51,60,0.76);
}
#app:not(.night) .vip-card-item {
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 0%, rgba(255,225,160,0.24), transparent 32%),
        rgba(255,255,255,0.68);
    border: 1px solid rgba(47,143,157,0.16);
}
#app:not(.night) .vip-card-item.selected {
    background: linear-gradient(135deg, rgba(255,225,160,0.42), rgba(143,216,220,0.38));
    border-color: rgba(47,143,157,0.58);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(47,143,157,0.18);
}
#app:not(.night) .vip-card-real,
#app:not(.night) .vip-price-total strong {
    color: #c27b16;
}
#app:not(.night) .secret-tag {
    border-radius: 999px;
}
#app:not(.night) .switch input:checked + .slider {
    background: linear-gradient(135deg, #8fd8dc, #2f8f9d);
}

@keyframes islandPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 34px rgba(143,216,220,0.30); }
    50% { transform: scale(1.07); box-shadow: 0 0 52px rgba(255,225,160,0.34); }
}
@keyframes islandFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}
@keyframes windDrift {
    from { background-position: -220px 0, -320px 20px, -380px 80px; }
    to { background-position: 520px 0, 460px 20px, 560px 80px; }
}
@keyframes shimmerSweep {
    0%, 58% { left: -42%; opacity: 0; }
    70% { opacity: 1; }
    100% { left: 122%; opacity: 0; }
}
@keyframes messageFloatIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalRise {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes markBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes windLine {
    0%, 100% { opacity: 0.42; transform: translateX(-4px) rotate(-10deg); }
    50% { opacity: 0.92; transform: translateX(6px) rotate(-7deg); }
}

/* ============================================
   Night Mode
   ============================================ */
.night .msg-other .msg-bubble { background: rgba(255,255,255,0.85); color: #2c3e50; backdrop-filter: blur(8px); }
.night .msg-system-content { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); backdrop-filter: blur(4px); }
.night .tab-bar { border-color: rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); backdrop-filter: blur(12px); }
.night .top-bar { background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.4) 100%); color: #b0bec5; }
.night .top-bar .btn-icon { color: #b0bec5; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.night .popup-header { border-color: rgba(255,255,255,0.1); }
.night .top-title, .night .title-en { color: rgba(255,255,255,0.9); }
.night .popup-box { background: rgba(30,42,56,0.98); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.1); }
.night .popup-publish-box input[type="text"],
.night .popup-publish-box textarea,
.night .popup-comment-box input[type="text"],
.night .popup-comment-box textarea,
.night .popup-publish-box .form-input,
.night .popup-publish-box .form-textarea,
.night .popup-comment-box .form-input,
.night .popup-comment-box .form-textarea {
    background: #1a1a2e !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 14px !important;
    padding: 12px 14px;
    outline: none;
    -webkit-text-fill-color: #ffffff !important;
}
.night .popup-publish-box .form-input::placeholder,
.night .popup-publish-box .form-textarea::placeholder,
.night .popup-comment-box .form-input::placeholder,
.night .popup-comment-box .form-textarea::placeholder {
    color: rgba(255,255,255,0.5) !important;
}
.night .popup-publish-box .form-label,
.night .popup-comment-box .form-label {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}
.night .popup-publish-box .char-count,
.night .popup-comment-box .char-count {
    color: rgba(255,255,255,0.6);
}
.night .page-home {
    background:
        linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%),
        url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&q=80') center center / cover no-repeat;
}
.night .explore-item {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.night .explore-item .explore-author,
.night .explore-item .explore-item-title {
    color: rgba(255,255,255,0.9);
}
.night .explore-item .explore-item-content,
.night .explore-item .comment-content {
    color: rgba(255,255,255,0.65);
}
.night .explore-item .explore-item-date,
.night .explore-item .explore-comment-title,
.night .explore-comment-empty,
.night .explore-item .comment-report {
    color: rgba(255,255,255,0.45);
}
.night .explore-action-btn {
    color: rgba(255,255,255,0.5);
}
.night .explore-action-btn:hover {
    color: var(--primary-light);
}
.night .char-count {
    color: rgba(255,255,255,0.4);
}
.night .popup-publish-box .char-count,
.night .popup-comment-box .char-count {
    color: rgba(255,255,255,0.6);
}
.night .publish-tips {
    color: rgba(255,255,255,0.5);
}
.night .btn-publish {
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
}
.night .comment-article-preview {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}
.night .explore-comment {
    border-top-color: rgba(255,255,255,0.1);
}

html.night,
html.night body,
html.night #app,
#app.night {
    background: #000 !important;
    color: #fff !important;
}
html.night body::before { background: #000 !important; }
html.night body::after,
.night .page-home::before,
.night .page-home::after,
.night .page-chat-full::before,
.night .page-chat-full::after {
    display: none !important;
    content: none !important;
    background: none !important;
    animation: none !important;
}
.night .page,
.night .page-home,
.night .page-chat-full,
.night .tab-panel,
.night .tab-chat,
.night .tab-explore,
.night .chat-paired,
.night .chat-ended,
.night .chat-matching,
.night .chat-idle,
.night .message-list,
.night .sidebar,
.night .popup-box,
.night .leave-actions,
.night .partner-bar,
.night .input-bar,
.night .emoji-panel {
    background: #000 !important;
    color: #fff !important;
    border-color: #333 !important;
}
.night .top-bar,
.night .tab-bar {
    background: #000 !important;
    color: #fff !important;
    border-color: #333 !important;
}
.night .tab-panel,
.night .tab-explore,
.night .tab-chat {
    top: 86px !important;
}
.night .explore-toolbar {
    background: #000 !important;
    color: #fff !important;
    border-color: #333 !important;
    box-shadow: none !important;
}
.night .btn-publish {
    background: #090909 !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    box-shadow: none !important;
}
.night .sidebar-header,
.night .btn-start,
.night .form-btn-primary,
.night .btn-send,
.night .btn-publish,
.night .btn-start-chat-2 {
    color: #fff !important;
}
.night .sidebar-desc,
.night .sidebar-user,
.night .sidebar-select-btn,
.night .leave-action-item,
.night .msg-other .msg-bubble,
.night .msg-moderate,
.night .msg-system-content,
.night .form-desc,
.night .form-btn-secondary,
.night .secret-current,
.night .secret-tag,
.night .support-contact,
.night .share-tip,
.night .comment-article-preview,
.night .explore-item,
.night .explore-comment {
    background: #090909 !important;
    color: #fff !important;
    border-color: #333 !important;
}
.night .secret-tag.active,
.night .secret-tag:hover {
    background: var(--primary) !important;
    color: #fff !important;
}
.night input,
.night textarea,
.night select,
.night .form-input,
.night .form-select,
.night .form-textarea,
.night .sidebar-select {
    background: #050505 !important;
    color: #fff !important;
    border-color: #333 !important;
    -webkit-text-fill-color: #fff !important;
}
.night option {
    background: #000;
    color: #fff;
}
.night input::placeholder,
.night textarea::placeholder {
    color: rgba(255,255,255,0.55) !important;
    -webkit-text-fill-color: rgba(255,255,255,0.55) !important;
}
.night .home-link,
.night .home-icp,
.night .top-title,
.night .title-en,
.night .tab-item,
.night .partner-name,
.night .partner-details,
.night .matching-text,
.night .matching-sub,
.night .ended-text,
.night .ended-sub,
.night .sidebar-link,
.night .sidebar-section-title,
.night .sidebar-setting-row,
.night .user-name,
.night .form-label,
.night .form-hint,
.night .secret-desc,
.night .explore-author,
.night .explore-item-title,
.night .explore-item-content,
.night .comment-content,
.night .char-count,
.night .publish-tips,
.night .typing-tip,
.night .msg-time {
    color: #fff !important;
}
.night .msg-self .msg-bubble {
    color: #fff !important;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 500px) {
    html, body {
        width: 100%;
        overflow: hidden;
    }

    #app {
        max-width: 100%;
        width: 100%;
        height: var(--app-height);
        min-height: var(--app-height);
        overflow: hidden;
    }

    .page,
    .page-home,
    .page-chat-full {
        height: var(--app-height);
        min-height: var(--app-height);
    }

    .page-home {
        overflow: hidden;
    }

    .home-main {
        height: var(--app-height);
        min-height: var(--app-height);
        justify-content: flex-start;
        padding: max(58px, calc(var(--safe-top) + 50px)) 18px max(96px, calc(var(--safe-bottom) + 80px));
        overflow: hidden;
    }

    .home-content {
        max-width: 360px;
        transform: scale(var(--home-scale, 1));
    }

    .home-brand {
        margin-top: 8px;
        margin-bottom: 16px;
    }

    #app:not(.night) .brand-mark {
        width: 68px;
        height: 68px;
        border-radius: 22px;
        margin-bottom: 10px;
    }

    #app:not(.night) .brand-slogan {
        font-size: clamp(21px, 6.3vw, 26px);
        line-height: 1.35;
    }

    #app:not(.night) .brand-tagline {
        font-size: 12px;
        line-height: 1.65;
    }

    #app:not(.night) .home-intro {
        width: 100%;
        max-width: none;
        padding: 16px 18px 16px;
        margin-bottom: 16px;
        border-radius: 24px;
        overflow: visible;
    }

    #app:not(.night) .intro-line {
        display: block;
        font-size: clamp(11px, 3.2vw, 12.5px);
        line-height: 1.55;
        margin: 0 0 6px;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }

    #app:not(.night) .intro-line:last-child {
        margin-bottom: 0;
    }

    .gender-select {
        margin-bottom: 14px;
    }

    #app:not(.night) .gender-btn {
        min-height: 78px;
        padding: 12px 10px;
        border-radius: 18px;
    }

    .gender-icon-male,
    .gender-icon-female {
        width: 38px;
        height: 38px;
        margin-bottom: 4px;
    }

    .age-select {
        margin-bottom: 16px;
    }

    .age-select-btns {
        gap: 6px;
    }

    #app:not(.night) .age-btn {
        padding: 7px 10px;
        font-size: 11.5px;
    }

    #app:not(.night) .btn-start {
        min-height: 58px;
        min-width: min(300px, calc(100vw - 56px));
        padding: 16px 46px;
        font-size: 17px;
        margin-bottom: 14px;
    }

    .home-links {
        margin-bottom: 10px;
    }

    .tab-explore,
    .tab-chat,
    .tab-panel {
        bottom: 0;
    }

    .chat-session {
        height: calc(var(--app-height) - 115px);
    }

    .message-list {
        bottom: calc(58px + var(--safe-bottom));
        padding-bottom: calc(18px + var(--safe-bottom));
    }

    .input-bar {
        min-height: calc(56px + var(--safe-bottom));
    }

    .popup-mask {
        align-items: flex-start;
    }

    .popup-box {
        margin: auto 0;
    }
}

@media (max-width: 380px) {
    .home-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    #app:not(.night) .home-intro {
        width: 100%;
        padding: 14px 14px 13px;
        border-radius: 20px;
        margin-bottom: 12px;
    }

    #app:not(.night) .intro-line {
        font-size: clamp(10.5px, 3.05vw, 11.5px);
        line-height: 1.48;
        letter-spacing: 0;
        margin-bottom: 5px;
    }

    #app:not(.night) .brand-slogan {
        font-size: clamp(19px, 5.9vw, 23px);
    }

    #app:not(.night) .brand-tagline {
        font-size: 11px;
    }

    #app:not(.night) .btn-start {
        min-height: 56px;
        min-width: min(280px, calc(100vw - 44px));
        padding: 15px 34px;
        font-size: 16px;
    }

    .home-main {
        padding-bottom: max(104px, calc(var(--safe-bottom) + 88px));
    }
}

@media (max-width: 500px) and (max-height: 760px) {
    .home-content { --home-scale: 0.94; }
}

@media (max-width: 500px) and (max-height: 700px) {
    .home-content { --home-scale: 0.88; }

    .home-main {
        padding-top: max(54px, calc(var(--safe-top) + 46px));
    }
}

@media (max-width: 500px) and (max-height: 640px) {
    .home-content { --home-scale: 0.80; }

    .home-main {
        padding-top: max(50px, calc(var(--safe-top) + 42px));
    }
}

@media (max-width: 500px) and (max-height: 580px) {
    .home-content { --home-scale: 0.72; }

    .home-main {
        padding-top: max(46px, calc(var(--safe-top) + 38px));
    }
}
