* {
    margin:0; padding:0; box-sizing:border-box;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
html, body {
    background: #f8f9ff;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(68, 156, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 75%, rgba(120, 119, 198, 0.08) 0%, transparent 25%),
        linear-gradient(180deg, #f0f4ff 0%, #f8f9ff 100%);
    color: #222233;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    max-width: 1000px;
    height: 85vh;
    margin: 20px auto;
    display: flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(68, 156, 255, 0.15), 0 0 80px rgba(120, 119, 198, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(68, 156, 255, 0.15);
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: #8892b0;
    font-size: 12px;
    transition: all 0.3s;
}
.bottom-nav-item.active {
    color: #449cff;
    text-shadow: 0 0 8px rgba(68, 156, 255, 0.3);
}
.bottom-nav-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: all 0.3s;
}
.bottom-nav-item.active img {
    filter: brightness(1) drop-shadow(0 0 4px rgba(68, 156, 255, 0.4));
}

@media (max-width: 768px) {
    body { 
        padding: 0; 
        padding-bottom: 60px;
        height: auto;
        overflow-y: auto;
    }
    .app-container {
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        margin: 0;
        flex-direction: column;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.9);
    }

    .top-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.9);
        border-bottom: 1px solid rgba(68, 156, 255, 0.15);
        backdrop-filter: blur(12px);
    }
    .nav-group {
        display: flex;
        gap: 12px;
        align-items: center;
    }
    .nav-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(68, 156, 255, 0.06);
        color: #449cff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: pointer;
        border: 1px solid rgba(68, 156, 255, 0.15);
        transition: all 0.3s;
    }
    .nav-btn:hover {
        background: rgba(68, 156, 255, 0.15);
        color: #2563eb;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.25);
    }
    .nav-btn.green {
        color: #22c55e;
    }
    .user-avatar {
        width: 36px; height: 36px; background: linear-gradient(135deg, #449cff, #7877c6); border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 18px; color:#fff;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.3);
    }
    .logout-btn { color: #ff4d6d; font-size: 12px; cursor: pointer; }

    .style-sidebar {
        display: none !important;
    }

    .main-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 12px;
        background: transparent;
        height: auto;
        overflow: visible;
    }

    .vip-tip {
        width: 100%;
        padding: 8px 16px;
        background: rgba(68, 156, 255, 0.1);
        color: #2563eb;
        border-radius: 8px;
        font-size: 13px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        border-left: 4px solid #449cff;
        flex-shrink: 0;
        box-shadow: 0 0 10px rgba(68, 156, 255, 0.1);
    }
    .no-times-tip {
        padding: 8px 12px; background: rgba(255, 193, 7, 0.1); color: #d97706;
        border-radius: 8px; font-size: 13px; margin-bottom: 12px;
        flex-shrink: 0;
        border-left: 4px solid #f59e0b;
    }

    .intro-card {
        background: rgba(255, 255, 255, 0.6);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        color: #444;
        line-height: 1.5;
        flex-shrink: 0;
        font-size: 13px;
        border: 1px solid rgba(68, 156, 255, 0.15);
        backdrop-filter: blur(4px);
    }
    .intro-card h3 {
        margin-bottom: 6px;
        color: #2563eb;
        font-size: 15px;
    }

    .top-options {
        display: flex; gap: 8px; margin-bottom: 12px; font-size: 12px; color: #555;
        flex-wrap: wrap;
        flex-shrink: 0;
        align-items: center;
    }
    .top-options select {
        padding: 5px 8px; background: rgba(255, 255, 255, 0.8); color: #333;
        border: 1px solid rgba(68, 156, 255, 0.2); border-radius: 6px;
        font-size: 12px;
        outline: none;
        transition: all 0.3s;
    }
    .top-options select:focus {
        border-color: #449cff;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.2);
    }

    .chat-box {
        background: rgba(255, 255, 255, 0.7);
        border-radius: 12px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        height: auto;
        min-height: 300px;
        border: 1px solid rgba(68, 156, 255, 0.15);
        backdrop-filter: blur(4px);
    }

    #msg-area {
        min-height: 100px;
        max-height: 250px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-bottom: 8px;
    }
    #msg-area::-webkit-scrollbar {
        width: 4px;
    }
    #msg-area::-webkit-scrollbar-thumb {
        background: rgba(68, 156, 255, 0.4);
        border-radius: 2px;
    }

    .input-container {
        position: relative;
        border: 1px solid rgba(68, 156, 255, 0.15);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.8);
        padding: 10px;
        margin-top: 8px;
        backdrop-filter: blur(4px);
    }

    .msg {
        max-width: 80%;
        padding: 8px 12px;
        border-radius: 10px;
        line-height: 1.4;
        font-size: 14px;
        animation: fadeIn 0.3s ease;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .msg.user { align-self: flex-end; background: linear-gradient(135deg, #449cff, #7877c6); color: #fff; box-shadow: 0 0 8px rgba(68, 156, 255, 0.2); }
    .msg.bot { align-self: flex-start; background: rgba(68, 156, 255, 0.08); color: #222; border:1px solid rgba(68, 156, 255, 0.1); }
    .reply-item { margin: 4px 0; padding: 6px 8px; background: rgba(255, 255, 255, 0.9); border:1px solid rgba(68, 156, 255, 0.1); border-radius: 6px; font-size: 13px; color: #333; }

    .input-label {
        display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
        font-size: 13px; color: #555;
    }
    #user-input {
        width: 100%;
        min-height: 80px;
        max-height: 80px;
        background: transparent;
        border: none;
        color: #222;
        font-size: 14px;
        resize: none;
        outline: none;
    }
    .input-hint {
        font-size: 11px; color: #888; margin-top: 6px;
        display: flex; align-items: center; gap: 4px;
    }
    #send-btn {
        position: absolute;
        right: 10px; bottom: 10px;
        background: linear-gradient(135deg, #449cff, #7877c6);
        color: #fff; border: none;
        border-radius: 8px; padding: 8px 16px;
        font-size: 14px; cursor: pointer;
        box-shadow: 0 0 10px rgba(68, 156, 255, 0.3);
        transition: all 0.3s;
    }
    #send-btn:hover {
        box-shadow: 0 0 15px rgba(68, 156, 255, 0.4);
        transform: translateY(-1px);
    }
    #send-btn:disabled { background: #e0e0e0; cursor: not-allowed; box-shadow: none; transform: none; }

    .loading {
        position: fixed; top: 50%; left: 50%;
        transform: translate(-50%,-50%);
        background: rgba(255, 255, 255, 0.95);
        padding: 16px; border-radius: 10px;
        box-shadow:0 0 20px rgba(68, 156, 255, 0.2);
        display: none;
        color: #2563eb;
        border: 1px solid rgba(68, 156, 255, 0.2);
    }

    .bottom-nav {
        display: flex;
    }
}

@media (min-width: 769px) {
    .left-nav {
        width: 60px;
        background: rgba(255, 255, 255, 0.5);
        border-right: 1px solid rgba(68, 156, 255, 0.15);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        gap: 10px;
        backdrop-filter: blur(8px);
    }
    .nav-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(68, 156, 255, 0.06);
        color: #449cff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: pointer;
        border: 1px solid rgba(68, 156, 255, 0.15);
        transition: all 0.3s;
    }
    .nav-btn:hover {
        background: rgba(68, 156, 255, 0.15);
        color: #2563eb;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.25);
    }
    .nav-btn.blue { background: rgba(68, 156, 255, 0.15); color: #2563eb; box-shadow: 0 0 8px rgba(68, 156, 255, 0.25); }
    .nav-btn.green {
        background: rgba(34, 197, 94, 0.08);
        color: #22c55e;
    }
    .nav-btn.green:hover {
        background: rgba(34, 197, 94, 0.15);
        color: #16a34a;
    }
    .logout-btn { margin-top: auto; color: #ff4d6d; font-size: 12px; cursor: pointer; }
    .user-avatar {
        width: 36px; height: 36px; background: linear-gradient(135deg, #449cff, #7877c6); border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 18px; margin-top: auto; color:#fff;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.3);
    }

    .style-sidebar {
        width: 220px;
        background: rgba(255, 255, 255, 0.5);
        border-right: 1px solid rgba(68, 156, 255, 0.15);
        padding: 10px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 6px;
        backdrop-filter: blur(8px);
    }
    .style-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    .style-sidebar::-webkit-scrollbar-thumb {
        background: rgba(68, 156, 255, 0.4);
        border-radius: 2px;
    }
    .style-item {
        display: flex; align-items: center; padding: 10px 12px; border-radius: 6px;
        background: rgba(255, 255, 255, 0.7); cursor: pointer; font-size: 13px; color: #333;
        transition: all 0.3s;
        border: 1px solid rgba(68, 156, 255, 0.1);
        position: relative;
        overflow: hidden;
    }
    .style-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(68, 156, 255, 0.15), transparent);
        transition: left 0.5s;
    }
    .style-item:hover::before {
        left: 100%;
    }
    .style-item.active {
        background: linear-gradient(135deg, rgba(68, 156, 255, 0.15), rgba(120, 119, 198, 0.15));
        color: #2563eb;
        font-weight: 500;
        border-color: rgba(68, 156, 255, 0.3);
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.15);
    }
    .style-item input { display: none; }
    .style-item .icon { margin-right: 8px; }
    .style-item.disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }

    .main-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 20px;
        height: 100%;
        background: transparent;
        overflow: hidden;
    }

    .vip-tip {
        width: 100%;
        padding: 8px 16px;
        background: rgba(68, 156, 255, 0.1);
        color: #2563eb;
        border-radius: 6px;
        font-size: 13px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        border-left: 4px solid #449cff;
        flex-shrink: 0;
        box-shadow: 0 0 10px rgba(68, 156, 255, 0.1);
    }
    .no-times-tip {
        padding: 8px 12px; background: rgba(255, 193, 7, 0.1); color: #d97706;
        border-radius: 6px; font-size: 13px; margin-bottom: 12px;
        flex-shrink: 0;
        border-left: 4px solid #f59e0b;
    }

    .intro-card {
        background: rgba(255, 255, 255, 0.6);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        color: #444;
        line-height: 1.6;
        flex-shrink: 0;
        border: 1px solid rgba(68, 156, 255, 0.15);
        backdrop-filter: blur(4px);
    }
    .intro-card h3 {
        margin-bottom: 8px;
        color: #2563eb;
    }

    .top-options {
        display: flex; gap: 12px; margin-bottom: 12px; font-size: 13px; color: #555;
        flex-wrap: wrap;
        flex-shrink: 0;
        align-items: center;
    }
    .top-options select {
        padding: 6px 8px; background: rgba(255, 255, 255, 0.8); color: #333;
        border: 1px solid rgba(68, 156, 255, 0.2); border-radius: 6px;
        outline: none;
        transition: all 0.3s;
    }
    .top-options select:focus {
        border-color: #449cff;
        box-shadow: 0 0 8px rgba(68, 156, 255, 0.2);
    }

    .chat-box {
        flex: 1;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 12px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        height: 100%;
        overflow: hidden;
        border: 1px solid rgba(68, 156, 255, 0.15);
        backdrop-filter: blur(4px);
    }
    #msg-area {
        flex: 1;
        overflow-y: auto !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-height: 0;
    }
    #msg-area::-webkit-scrollbar {
        width: 4px;
    }
    #msg-area::-webkit-scrollbar-thumb {
        background: rgba(68, 156, 255, 0.4);
        border-radius: 2px;
    }
    .msg {
        max-width: 80%;
        padding: 10px 14px;
        border-radius: 10px;
        line-height: 1.5;
        animation: fadeIn 0.3s ease;
    }
    .msg.user { align-self: flex-end; background: linear-gradient(135deg, #449cff, #7877c6); color: #fff; box-shadow: 0 0 8px rgba(68, 156, 255, 0.2); }
    .msg.bot { align-self: flex-start; background: rgba(68, 156, 255, 0.08); color: #222; border:1px solid rgba(68, 156, 255, 0.1); }
    .reply-item { margin: 6px 0; padding: 6px 8px; background: rgba(255, 255, 255, 0.9); border:1px solid rgba(68, 156, 255, 0.1); border-radius: 6px; font-size: 13px; color: #333; }

    .input-container {
        position: relative;
        border: 1px solid rgba(68, 156, 255, 0.15);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.8);
        padding: 12px;
        flex-shrink: 0;
        backdrop-filter: blur(4px);
    }
    .input-label {
        display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
        font-size: 14px; color: #555;
    }
    #user-input {
        width: 100%;
        min-height: 160px;
        background: transparent;
        border: none;
        color: #222;
        font-size: 14px;
        resize: none;
        outline: none;
    }
    .input-hint {
        font-size: 12px; color: #888; margin-top: 8px;
        display: flex; align-items: center; gap: 6px;
    }
    #send-btn {
        position: absolute;
        right: 16px; bottom: 16px;
        background: linear-gradient(135deg, #449cff, #7877c6);
        color: #fff; border: none;
        border-radius: 8px; padding: 10px 20px;
        font-size: 16px; cursor: pointer;
        box-shadow: 0 0 10px rgba(68, 156, 255, 0.3);
        transition: all 0.3s;
    }
    #send-btn:hover {
        box-shadow: 0 0 15px rgba(68, 156, 255, 0.4);
        transform: translateY(-1px);
    }
    #send-btn:disabled { background: #e0e0e0; cursor: not-allowed; box-shadow: none; transform: none; }

    .loading {
        position: fixed; top: 50%; left: 50%;
        transform: translate(-50%,-50%);
        background: rgba(255, 255, 255, 0.95);
        padding: 20px; border-radius: 10px;
        box-shadow:0 0 20px rgba(68, 156, 255, 0.2);
        display: none;
        color: #2563eb;
        border: 1px solid rgba(68, 156, 255, 0.2);
    }
}

.invite-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.invite-modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    box-shadow: 0 8px 32px rgba(68, 156, 255, 0.2);
    border: 1px solid rgba(68, 156, 255, 0.2);
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    z-index: 999999;
}
.invite-header {
    text-align: center;
    margin-bottom: 20px;
}
.invite-header h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2563eb;
}
.invite-code {
    font-size: 16px;
    padding: 10px;
    background: rgba(68, 156, 255, 0.08);
    border-radius: 8px;
    display: inline-block;
    color: #333;
    border: 1px solid rgba(68, 156, 255, 0.15);
}
.code-text {
    color: #2563eb;
    font-size: 18px;
    margin-left: 5px;
}
.invite-rule {
    text-align: center;
    padding: 12px;
    background: rgba(68, 156, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 20px;
    color: #2563eb;
    line-height: 1.5;
    border: 1px solid rgba(68, 156, 255, 0.15);
}
.invite-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 10px;
}
.stat-item {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(68, 156, 255, 0.15);
}
.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}
.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #2563eb;
}
.invite-action {
    text-align: center;
}
.withdraw-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #449cff, #7877c6);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(68, 156, 255, 0.3);
    transition: all 0.3s;
}
.withdraw-btn:hover {
    box-shadow: 0 0 15px rgba(68, 156, 255, 0.4);
    transform: translateY(-1px);
}
.withdraw-tip {
    color: #d97706;
    background: rgba(255, 193, 7, 0.1);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}
/* 聊天消息带头像样式 */
.msg-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.msg-wrapper.user {
    flex-direction: row-reverse;
}
.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 14px;
    line-height: 1.5;
    word-break: break-all;
}
.msg-wrapper.user .msg-bubble {
    background: #007aff;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.msg-wrapper.bot .msg-bubble {
    background: #f2f3f5;
    color: #333;
    border-bottom-left-radius: 4px;
}
.reply-item {
    margin-bottom: 6px;
}