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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

.chat-wrapper {
    max-width: 475px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
}

.header {
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(10px);
}

.bot-avatar svg {
    width: 24px;
    height: 24px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
}

.settings-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

.disclaimer {
    background: #fff3cd;
    border-bottom: 1px solid #ffeeba;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #856404;
    flex-shrink: 0;
}

.disclaimer-icon {
    font-size: 14px;
}

.settings-menu {
    position: fixed;
    top: 64px;
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 200;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-menu.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.menu-header {
    padding: 20px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

.menu-user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.menu-user-avatar svg {
    width: 24px;
    height: 24px;
}

.menu-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.menu-user-info {
    flex: 1;
}

.menu-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.menu-user-balance {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.menu-items {
    padding: 8px 0;
    margin-top: 8px;
}

.menu-item {
    padding: 14px 16px;
    font-size: 15px;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: #f0f4f8;
    padding-left: 20px;
}

.menu-item svg {
    width: 20px;
    height: 20px;
    color: #667eea;
    flex-shrink: 0;
}

.chat-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.chat-container::-webkit-scrollbar {
    width: 4px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.welcome-icon svg {
    width: 40px;
    height: 40px;
}

.welcome-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.welcome-desc {
    font-size: 14px;
    color: #718096;
    margin-bottom: 24px;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.action-tag {
    padding: 10px 20px;
    background: #fff;
    border-radius: 25px;
    font-size: 14px;
    color: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.action-tag:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.message-row {
    margin-bottom: 20px;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-content.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-content.ai .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.message-content.user .message-avatar {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.message-avatar svg {
    width: 20px;
    height: 20px;
}

.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.message-content.ai .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-left-radius: 6px;
}

.message-content.user .message-bubble {
    background: #fff;
    color: #2c3e50;
    border-bottom-right-radius: 6px;
    border: 1px solid #e2e8f0;
}

.loading-bubble {
    padding: 14px 20px;
}

.loading-text {
    color: #fff;
    font-size: 14px;
}

.loading-text::after {
    content: '';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.quick-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 6px 8px 6px 0;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    color: #667eea;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
}

.quick-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.timer-bar {
    background: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: #2f855a;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.timer-progress {
    flex: 1;
    max-width: 150px;
    height: 6px;
    background: #e8f5e9;
    border-radius: 3px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.input-area {
    background: #fff;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.input-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.tool-btn svg {
    width: 20px;
    height: 20px;
}

.input-box-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0f4f8;
    border-radius: 24px;
    padding: 10px 10px 10px 16px;
    transition: all 0.3s ease;
}

.input-box {
    flex: 1;
    height: 36px;
    max-height: 120px;
    background: transparent;
    border: none;
    font-size: 15px;
    line-height: 1.5;
    outline: none;
    resize: none;
    color: #2c3e50;
    overflow-y: auto;
}

.input-box::placeholder {
    color: #a0aec0;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.send-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
}

.action-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.action-content {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 16px 0 30px;
    max-width: 475px;
    margin: 0 auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.action-item {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: background 0.2s ease;
}

.action-item svg {
    width: 20px;
    height: 20px;
    color: #667eea;
}

.action-item:hover {
    background: #f0f4f8;
}

.action-item.cancel {
    color: #a0aec0;
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.action-item.cancel svg {
    display: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 340px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header .close {
    font-size: 28px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-header .close:hover {
    color: #718096;
}

.modal-body {
    padding: 24px;
}

.wx-login-btn {
    width: 100%;
    height: 48px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.wx-login-btn:hover {
    background: #06ad56;
    transform: translateY(-1px);
}

.divider {
    text-align: center;
    margin: 0 0 20px;
    color: #a0aec0;
    font-size: 14px;
    position: relative;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e2e8f0;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.phone-login {
    display: flex;
    gap: 12px;
}

.phone-login input {
    flex: 1;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.phone-login input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.phone-login button {
    width: 110px;
    height: 44px;
    background: #eef2ff;
    color: #667eea;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.phone-login button:hover:not(:disabled) {
    background: #e0e7ff;
}

.phone-login button:disabled {
    color: #a0aec0;
    background: #f0f4f8;
}

.code-input {
    margin-top: 14px;
}

.code-input input {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.code-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.faq-modal {
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
}

.faq-modal .modal-body {
    max-height: 55vh;
    overflow-y: auto;
    padding: 16px;
}

.faq-item {
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.faq-item:hover {
    background: #eef2ff;
    border-color: #667eea;
    transform: translateX(4px);
}

.faq-item span {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
}

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.back-btn {
    font-size: 22px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #fff;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.session-list {
    padding: 16px;
}

.session-item {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.session-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.session-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.session-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #718096;
}

.recharge-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
}

.balance-label {
    font-size: 15px;
    opacity: 0.9;
}

.balance-value {
    font-size: 42px;
    font-weight: 700;
    margin-top: 12px;
}

.package-list {
    padding: 20px 16px;
}

.package-item {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.package-item.selected {
    border-color: #667eea;
    background: #f8f5ff;
}

.package-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.package-info {
    flex: 1;
}

.package-name {
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
}

.package-desc {
    font-size: 13px;
    color: #718096;
    margin-top: 4px;
}

.package-tag {
    font-size: 11px;
    padding: 3px 10px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 12px;
    margin-left: 8px;
}

.package-price {
    font-size: 24px;
    font-weight: 700;
    color: #e53e3e;
}

.package-price span {
    font-size: 14px;
}

.pay-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    background: #fff;
    border-radius: 20px;
    z-index: 300;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pay-modal .modal-title {
    text-align: center;
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
}

.pay-modal .modal-subtitle {
    text-align: center;
    font-size: 14px;
    color: #718096;
    margin-bottom: 24px;
}

.pay-modal .price {
    text-align: center;
    font-size: 40px;
    font-weight: 700;
    color: #e53e3e;
    margin-bottom: 24px;
}

.pay-modal .price span {
    font-size: 16px;
}

.qrcode-box {
    width: 180px;
    height: 180px;
    margin: 0 auto 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.pay-tips {
    text-align: center;
    font-size: 13px;
    color: #718096;
    margin-bottom: 24px;
}

.pay-modal .close-btn {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 22px;
    font-size: 15px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pay-modal .close-btn:hover {
    background: #f0f4f8;
}

.text-center { text-align: center; }
.text-red { color: #e53e3e; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }