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

:root {
    --primary-color: #ff2442;
    --primary-hover: #e01f3a;
    --secondary-color: #f8f8f8;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --success-color: #52c41a;
    --error-color: #ff4d4f;
    --warning-color: #faad14;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    margin-bottom: 30px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.config-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    text-align: left;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-panel,
.result-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
}

#adsContainer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-panel {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    border: 1px solid var(--border-color);
    padding: 15px;
}

.ad-panel:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.ad-panel-image-wrapper {
    width: 33.33%;
    flex-shrink: 0;
    background: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
}

.ad-panel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1/1;
}

.ad-panel-content {
    width: 66.67%;
    padding: 0 0 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-panel-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.ad-panel-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.ad-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.ad-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

.ad-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-light);
}

.ad-upload-placeholder svg {
    opacity: 0.5;
}

.ad-upload-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

.ad-upload-placeholder .upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ad-upload-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.ad-upload-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.ad-upload-preview .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.ad-upload-preview .remove-btn:hover {
    background: #c73e3e;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.ad-item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.ad-item-info {
    flex: 1;
}

.ad-item-info strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.ad-item-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.ad-item-meta {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
}

.ad-order {
    color: var(--text-light);
}

.status-enabled {
    color: var(--success-color);
    font-weight: bold;
}

.status-disabled {
    color: var(--error-color);
    font-weight: bold;
}

.ad-item-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.step-section {
    margin-bottom: 40px;
}

.step-section:last-child {
    margin-bottom: 0;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.1rem;
}

.step-header h2 {
    font-size: 1.3rem;
    color: var(--text-color);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--secondary-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #fff0f0;
}

.upload-placeholder svg {
    color: var(--text-light);
    margin-bottom: 15px;
}

.upload-placeholder p {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 5px;
}

.upload-hint {
    color: var(--text-light);
    font-size: 0.9rem;
}

.upload-preview {
    position: relative;
    display: inline-block;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.remove-btn:hover {
    transform: scale(1.1);
}

/* 风格网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.style-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.style-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.style-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.style-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.style-image-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.zoom-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}

.style-card:hover .zoom-icon {
    opacity: 1;
}

.zoom-icon:hover {
    background: rgba(0, 0, 0, 0.8);
}

.style-card .style-name {
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.style-card.custom-style {
    position: relative;
}

.delete-style-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 77, 79, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.delete-style-btn:hover {
    background: rgba(255, 77, 79, 1);
    transform: scale(1.1);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* 风格标签页 */
.style-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.style-tab {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.style-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.style-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.add-custom-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-custom-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* 自定义风格上传区域 */
.style-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--secondary-color);
}

.style-upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f0f0;
}

.style-upload-area.dragover {
    border-color: var(--primary-color);
    background: #e8f5e9;
}

.style-upload-placeholder {
    color: var(--text-light);
}

.style-upload-placeholder svg {
    margin-bottom: 10px;
    color: var(--text-light);
}

.style-upload-preview {
    position: relative;
    display: inline-block;
}

.style-upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.style-upload-preview .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.style-upload-preview .remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* 表单元素 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--error-color);
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* 按钮 */
.generate-btn,
.save-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.generate-btn:hover,
.save-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.generate-btn:disabled,
.save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果面板 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header h2 {
    font-size: 1.3rem;
    color: var(--text-color);
}

.result-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    min-height: 200px;
}

.alert-warning {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
    border-left: 4px solid var(--warning-color);
    padding: 15px 20px;
    border-radius: 8px;
    color: #d46b08;
    font-size: 1rem;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(250, 173, 20, 0.2);
    animation: pulse 2s infinite;
}

.alert-warning strong {
    color: #ad4e00;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    margin-bottom: 15px;
    opacity: 0.5;
}

.result-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: scale(1.02);
}

.result-item img {
    width: 100%;
    height: auto;
    display: block;
}

.result-item .download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-item .download-btn:hover {
    background: var(--primary-color);
    color: white;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

/* 确认对话框样式 */
.confirm-dialog-modal {
    max-width: 450px;
}

.confirm-dialog-icon {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.confirm-dialog-modal .modal-body p {
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

.toast.warning {
    background: var(--warning-color);
}

/* 配置按钮组 */
.config-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.test-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.test-btn:hover {
    background: #f0f0f0;
    border-color: var(--primary-color);
}

.test-btn:disabled {
    background: #eee;
    cursor: not-allowed;
    opacity: 0.6;
}

.test-btn.loading svg {
    animation: spin 0.8s linear infinite;
}

/* 测试结果 */
.test-result {
    padding: 16px;
    border-radius: 8px;
    margin-top: 10px;
}

.test-result.success {
    background: rgba(82, 196, 26, 0.1);
    border: 1px solid var(--success-color);
}

.test-result.error {
    background: rgba(255, 77, 79, 0.1);
    border: 1px solid var(--error-color);
}

.test-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.test-result.success .test-status {
    color: var(--success-color);
}

/* ==================== 用户认证系统样式 ==================== */

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

.user-info-display {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.user-info-display span {
    font-weight: 500;
}

.login-btn {
    padding: 8px 20px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.user-panel-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.user-panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 认证模态框样式 */
.auth-modal {
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-tab:hover {
    color: var(--primary-color);
}

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

.auth-message {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.auth-message.error {
    background: #fff1f0;
    color: var(--error-color);
    border: 1px solid #ffa39e;
}

/* 用户控制面板样式 */
.user-panel-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details h4 {
    margin-bottom: 4px;
    color: var(--text-color);
}

.user-details p {
    margin: 2px 0;
    color: var(--text-light);
    font-size: 14px;
}

.panel-section {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.panel-section h4 {
    margin-bottom: 16px;
    color: var(--text-color);
}

.recharge-info {
    margin-bottom: 12px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.recharge-info a {
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
}

.recharge-info a:hover {
    text-decoration: underline;
}

.api-permissions {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--secondary-color);
    border-radius: 8px;
}

/* API选择列表样式 */
.api-select-list {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.api-select-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.api-select-item:last-child {
    border-bottom: none;
}

.api-select-item:hover {
    background: var(--secondary-color);
}

.api-select-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.api-select-item.enabled {
    background: #f6ffed;
}

.api-select-item.already-owned {
    background: #f0f5ff;
}

.api-name {
    font-weight: 500;
    color: var(--text-color);
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:checked:disabled + .slider {
    background-color: var(--success-color);
    cursor: not-allowed;
}

input:checked:disabled + .slider:before {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:disabled + .slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
}

input:disabled + .slider:before {
    background-color: #ccc;
}

/* 购买信息样式 */
.purchase-info {
    margin: 16px 0;
    padding: 16px;
    background: #fff7e6;
    border-radius: 8px;
    border-left: 4px solid #fa8c16;
}

.purchase-info p {
    margin: 8px 0;
}

.purchase-cost {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.purchase-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.point-logs {
    max-height: 200px;
    overflow-y: auto;
}

.point-log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.point-log-item:last-child {
    border-bottom: none;
}

.log-type {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.log-type.earn {
    color: var(--success-color);
    background: #f6ffed;
}

.log-type.spend {
    color: var(--error-color);
    background: #fff1f0;
}

.log-description {
    flex: 1;
    margin: 0 12px;
    color: var(--text-light);
}

.log-time {
    font-size: 12px;
    color: var(--text-light);
}

.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

/* 管理员功能样式 */
.admin-section {
    background: #fff7e6;
    border-color: #ffd591;
}

.admin-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content:first-child {
    display: block;
}

.users-list,
.cards-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 16px;
}

.user-item,
.card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.user-item:last-child,
.card-item:last-child {
    border-bottom: none;
}

.user-item-info,
.card-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-role {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.user-role:contains('管理员') {
    background: #fff7e6;
    color: #fa8c16;
}

.user-points {
    color: var(--primary-color);
    font-weight: 600;
}

.user-item-actions {
    display: flex;
    gap: 8px;
}

.card-item.used {
    opacity: 0.6;
    background: var(--secondary-color);
}

.card-code {
    font-family: monospace;
    font-weight: 600;
}

.card-points {
    color: var(--success-color);
    font-weight: 600;
}

.card-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.card-status:contains('已使用') {
    background: var(--secondary-color);
    color: var(--text-light);
}

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

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d49a00;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #47a81a;
}

.panel-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 响应式设计 */
/* 用户API配置模态框样式 */
.user-api-config-modal {
    max-width: 500px;
}

.user-api-config-list {
    margin-bottom: 20px;
}

.api-config-item {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.api-config-item:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.api-config-item.active {
    background: #fff1f0;
    border-color: var(--primary-color);
}

.api-config-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.api-config-item-info {
    flex: 1;
}

.api-config-item-name {
    font-weight: 600;
    color: var(--text-color);
}

.api-config-item-status {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.api-config-item-status.configured {
    color: var(--success-color);
}

.api-config-item-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.api-config-item-toggle .toggle-label {
    font-size: 12px;
    color: var(--text-light);
}

.user-api-form-section {
    padding: 16px;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-top: 16px;
}

/* 当前使用API信息 */
.current-api-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e6f7ff;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-info-label {
    font-size: 13px;
    color: #666;
}

.api-info-name {
    font-size: 13px;
    font-weight: 600;
    color: #1890ff;
}

.user-api-form-section h4 {
    margin-bottom: 16px;
    color: var(--text-color);
}

.user-api-form-section .form-group {
    margin-bottom: 16px;
}

.user-api-form-section .input-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .user-info-display {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .user-panel-modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .purchase-options {
        flex-direction: column;
    }
    
    .user-item-actions {
        flex-direction: column;
    }
}

.test-result.error .test-status {
    color: var(--error-color);
}

.test-message {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* 响应式设计 */


@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .result-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .config-panel,
    .result-panel {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-area {
        padding: 20px;
    }

    .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 风格预览模态框 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.image-preview-modal.active {
    display: flex;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.preview-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.close-preview-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.close-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#fullPreviewImage {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.preview-caption {
    margin-top: 16px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
}