/* Topbar Styles - 顶部导航栏样式 */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Back Button */
.back-button {
    display: flex;
    align-items: center;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
    color: #4285f4;
}

.back-link svg {
    transition: transform 0.3s ease;
    color: currentColor;
}

.back-link:hover svg {
    transform: translateX(-2px);
}

.back-link span {
    margin-left: 4px;
}

/* Topbar Title */
.topbar .title {
    margin-left: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    flex-shrink: 0;
}

/* User Info Container */
.topbar .user-info,
.topbar .user-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    position: relative;
}



/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

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

/* User Balance */
.user-balance {
    background: #333;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #4285f4;
    font-weight: 500;
    border: 1px solid #4285f4;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-balance .balance-icon {
    color: #ffd700;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 280px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

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

/* Dropdown Header */
.user-dropdown-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    text-align: center;
}

.user-dropdown-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.user-dropdown-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    overflow: hidden;
}

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

.edit-avatar-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #4285f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #1a1a1a;
}

.edit-avatar-icon:hover {
    background: #3367d6;
    transform: scale(1.1);
}

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

.user-email {
    font-size: 12px;
    color: #888;
}

/* Dropdown Body */
.user-dropdown-body {
    padding: 12px;
}

.user-balance-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 8px;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.balance-info span:first-child {
    font-size: 12px;
    color: #888;
}

.balance-amount {
    font-size: 16px;
    font-weight: 600;
    color: #4285f4;
}

.recharge-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recharge-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

/* Dropdown Items */
.user-dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.user-dropdown-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.user-dropdown-item.danger {
    color: #ef4444;
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.user-dropdown-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .topbar {
        padding: 0 15px;
    }
    
    .topbar .title {
        font-size: 18px;
        margin-left: 8px;
    }
    
    .user-dropdown {
        min-width: 260px;
        right: -10px;
    }
    
    .back-button {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0 10px;
    }
    
    .topbar .title {
        font-size: 16px;
        margin-left: 5px;
    }
    
    .user-dropdown {
        min-width: 240px;
        right: -15px;
    }
    
    .auth-buttons {
        gap: 8px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.modal-header .close {
    color: #888;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Avatar Upload Modal */
.avatar-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.current-avatar {
    position: relative;
}

.current-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #333;
}

.upload-section {
    text-align: center;
}

.upload-btn {
    padding: 12px 24px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.upload-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.upload-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* Recharge Modal */
.recharge-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.current-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
}

.current-balance span:first-child {
    color: #888;
    font-size: 14px;
}

.current-balance .balance-amount {
    color: #4285f4;
    font-size: 18px;
    font-weight: 600;
}

.recharge-options h4,
.payment-methods h4 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.amount-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.amount-btn {
    padding: 12px;
    background: #2a2a2a;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover,
.amount-btn.selected {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.custom-amount {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-amount label {
    color: #ccc;
    font-size: 14px;
    white-space: nowrap;
}

.custom-amount input {
    flex: 1;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.custom-amount input:focus {
    outline: none;
    border-color: #4285f4;
}

.payment-options {
    display: flex;
    gap: 16px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
}

.payment-option input[type="radio"] {
    accent-color: #4285f4;
}

/* 按钮样式已移至 main.css 中统一管理 */

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .payment-options {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 15% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .current-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .amount-buttons {
        grid-template-columns: 1fr;
    }
}

/* Topbar Layout */
.topbar-left {
    display: flex;
    align-items: center;
}

/* Auth Buttons Styling */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 70px;
}

.auth-buttons .btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .auth-buttons {
        gap: 8px;
    }
    
    .auth-buttons .btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 60px;
    }
}