* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.navbar {
    background-color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    color: #e91e63;
    font-size: 24px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-auth {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login {
    background-color: #e91e63;
    color: white;
}

.btn-login:hover {
    background-color: #d81b60;
}

.btn-logout {
    background-color: #6c757d;
    color: white;
}

.btn-logout:hover {
    background-color: #5a6268;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 500;
    color: #333;
}

.rpm-count {
    color: #e91e63;
    font-size: 18px;
    font-weight: bold;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #e91e63;
    color: white;
}

.btn-primary:hover {
    background-color: #d81b60;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    margin-top: 15px;
    position: relative;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    overflow-y: auto;
}

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

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* 登录弹框特殊样式 */
.login-modal .modal-content {
    max-width: 400px;
    padding: 20px 35px 30px 35px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #e91e63;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e91e63;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-input,
.form-control,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: white;
}

.form-input:focus,
.form-control:focus,
select:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.forgot-password {
    color: #e91e63;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    display: inline-block;
}

.forgot-password:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    margin: 10px 0;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

.divider span {
    padding: 0 15px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.google-login-btn:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.auth-content {
    display: none;
}

.auth-content.active {
    display: block;
}

/* RPM购买区域 */
.purchase-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.purchase-config {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #e9ecef;
    color: #333;
}

.quantity-input {
    flex: 1;
    border: none;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    background: white;
}

.quantity-input:focus {
    outline: none;
}

.quantity-control:focus-within {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.price-display {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e9ecef;
}

.price-amount {
    font-size: 28px;
    font-weight: bold;
    color: #e91e63;
    margin-bottom: 20px;
}

.payment-options {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.payment-option {
    flex: 1;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: #e91e63;
}

.payment-option.selected {
    border-color: #e91e63;
    background-color: #fff5f8;
}

/* API Keys表格 */
.api-key-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #e91e63;
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.api-key-name {
    font-weight: 600;
    color: #333;
}

.api-key-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.api-key-secret {
    font-family: monospace;
    font-size: 12px;
    color: #666;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    margin: 10px 0;
    word-break: break-all;
}

.api-key-actions {
    display: flex;
    gap: 8px;
}

/* RPM包展开卡片 */
.rpm-packages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rpm-package {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.package-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.package-header:hover {
    background: #e9ecef;
}

.package-content {
    display: none;
    padding: 20px;
}

.package-content.show {
    display: block;
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.api-item {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: white;
    text-align: center;
}

.api-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.api-rpm {
    color: #e91e63;
    font-size: 14px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .purchase-section {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 15px;
    }

    .navbar {
        padding: 15px;
    }
}