/* 通用样式 - Chrome兼容性增强 */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Chrome特定重置 */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Chrome渲染优化 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
}

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

/* 登录注册页面 */
.auth-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 400px;
    margin: 50px auto;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

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

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.auth-tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
}

.auth-form {
    display: none;
}

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

.form-group {
    margin-bottom: 10px;
    flex-shrink: 0;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #5a67d8;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 主应用界面 */
.main-app {
    display: none;
}

.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.header h1 {
    color: #333;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

/* 三栏布局 */
.three-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    min-height: calc(100vh - 140px);
    max-height: calc(100vh - 140px);
    overflow: visible;
}

.column {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100%;
}

.column h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 18px;
}

/* 标签页 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
}

.tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100% - 60px);
    padding-bottom: 20px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 文件上传 - 减少高度为按钮腾出空间 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e3f2fd;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.upload-area p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.upload-area:hover p {
    color: #667eea;
}

.file-input {
    display: none;
}


.upload-preview {
    width: 100%;
    max-width: 100%;
    max-height: 100px;
    height: auto;
    margin: 0;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    background-color: #f8f9fa;
}

#modelPreviewContainer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 150px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#modelPreviewContainer:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

#modelPreviewContainer #modelPreview {
    max-height: 130px;
    max-width: 100%;
    width: 100%;
    height: 130px;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: block;
}

#modelPreviewContainer #modelPreview:hover {
    transform: scale(1.02);
}

#modelPreviewContainer #modelName {
    display: none;
}

#modelPreviewContainer button {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

#modelPreviewContainer:hover button {
    opacity: 1;
}

#modelPreviewContainer button:hover {
    background: rgba(90, 103, 216, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

#modelPreviewContainer button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}


/* 文本输入 - 减少高度 */
.text-input {
    width: 100%;
    min-height: 180px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    flex-shrink: 0;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮样式 - 确保可见 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: auto;
    flex-shrink: 0;
    min-height: 48px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 结果展示 */
.result-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.result-image {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    object-fit: contain; /* 改为 contain 以保持图片比例 */
    object-position: center;
    transition: transform 0.3s ease;
    background-color: #f8f9fa; /* 添加背景色 */
    display: block;
}

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

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 选中模特显示区域 - Chrome兼容性优化 */
.selected-model-display {
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    /* Chrome兼容性 */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
}

.selected-model-info {
    /* Chrome兼容性 - Flexbox */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-gap: 15px;
    -moz-gap: 15px;
    gap: 15px;
}

.selected-model-info > span {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.selected-model-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-model-image {
    width: 50px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.selected-model-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 上传图标样式 */
.upload-icon {
    font-size: 48px;
    color: #999;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.add-model-item:hover .upload-icon {
    color: #667eea;
}

.add-model-item span {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 预设模特容器 */
.preset-models-container {
    display: contents;
}

.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
    grid-column: 1 / -1;
}

/* 错误和空状态消息样式 */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #667eea;
    font-size: 14px;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模特卡片样式 */
.model-card {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    /* 确保卡片在网格中正确对齐 */
    min-height: 120px;
    max-width: 200px;
    justify-self: center;
}

.model-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.model-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.model-card img {
    width: 100%;
    height: calc(100% - 40px);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.model-card:hover img {
    transform: scale(1.05);
}

.model-card .model-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-align: center;
    border-top: 1px solid #eee;
    backdrop-filter: blur(5px);
}

/* 自定义上传选中时的显示样式 */
.selected-model-content .upload-icon {
    font-size: 24px;
    color: #667eea;
    margin-right: 8px;
}

.selected-model-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 历史记录 */
.history-gallery {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    min-height: 300px;
}

.history-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-item img {
    width: 100%;
    height: 120px;
    object-fit: contain; /* 改为 contain 以保持图片比例 */
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #f8f9fa; /* 添加背景色 */
}

.history-item-info {
    font-size: 12px;
    color: #666;
}

.history-item-type {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 4px;
}

/* 管理员后台 */
.admin-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 10px auto;
    max-width: 1400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

.admin-panel .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.admin-panel .header h1 {
    color: white;
    font-size: 24px;
    margin: 0;
}

.admin-panel .header .logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-panel .header .logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
}

.admin-tab {
    flex: 1;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    text-align: center;
    border-radius: 6px;
    font-weight: 500;
}

.admin-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.admin-tab:hover:not(.active) {
    background: #e9ecef;
    color: #667eea;
}

.admin-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.admin-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 22px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
    position: relative;
}

.admin-content h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* 设置各列宽度 */
.table th:nth-child(1), .table td:nth-child(1) { width: 15%; } /* 用户名 */
.table th:nth-child(2), .table td:nth-child(2) { width: 12%; } /* 类型 */
.table th:nth-child(3), .table td:nth-child(3) { width: 20%; } /* 注册时间 */
.table th:nth-child(4), .table td:nth-child(4) { width: 15%; } /* 积分 */
.table th:nth-child(5), .table td:nth-child(5) { width: 38%; } /* 操作 */

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: #f8f9ff;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.table tr:last-child td {
    border-bottom: none;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.edit-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.detail-btn {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    color: white;
}

.detail-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #520dc2 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* 积分显示样式 */
.points-display {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .three-column-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-container {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .admin-panel {
        margin: 10px;
        padding: 20px;
    }
}

/* 错误消息 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

/* 成功消息 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* 积分显示样式 */
.user-points {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 对话框样式 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: dialogSlideIn 0.3s ease-out;
}

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

.dialog h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.dialog p {
    margin-bottom: 15px;
    color: #666;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.dialog-buttons button:first-child {
    background: #667eea;
    color: white;
}

.dialog-buttons button:first-child:hover {
    background: #5a67d8;
}

.dialog-buttons button:last-child {
    background: #6c757d;
    color: white;
}

.dialog-buttons button:last-child:hover {
    background: #5a6268;
}

/* 统计卡片样式 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stats-card h4 {
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.stats-card p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* 表格中操作按钮样式 */
#usersTableBody button {
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#usersTableBody button:first-child {
    background: #28a745;
    color: white;
}

#usersTableBody button:first-child:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

#usersTableBody button:last-child {
    background: #17a2b8;
    color: white;
}

#usersTableBody button:last-child:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* 统计卡片美化 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-card h4 {
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-card p {
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-card p:last-child {
    border-bottom: none;
}

.stats-card p::before {
    content: '▸';
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.stats-card p strong {
    font-weight: 600;
    color: #fff;
}

/* 模特选择区域样式 */
.model-selection-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.model-selection-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.model-preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.model-info {
    flex: 1;
    text-align: left;
}

.model-info span {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.change-model-btn {
    background: #667eea;
    color: black;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.change-model-btn:hover {
    background: #5a67d8;
    color: black;
}

.model-placeholder p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 重复的弹窗样式已删除，使用后面统一的定义 */

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0; /* 防止尾部被压缩 */
}

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

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

.model-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.model-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.model-modal-close:hover {
    color: #667eea;
}

/* 9宫格样式 */
.model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.model-grid-item {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.model-grid-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.model-grid-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.model-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.model-grid-item:hover img {
    transform: scale(1.05);
}

/* 第一格加号按钮样式 */
.add-model-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ccc;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.add-model-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.add-model-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.add-model-item .plus-icon,
.add-model-item .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.add-model-item:hover .plus-icon,
.add-model-item:hover .upload-icon {
    transform: rotate(90deg);
}

.model-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 15px 10px 10px;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
}

.model-selection-container {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
}

.model-selection-type {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    accent-color: #667eea;
}

.radio-option:hover {
    color: #667eea;
}

.model-section {
    display: none;
}

.model-section.active {
    display: block;
}

/* 预设模特下拉菜单样式 */
.preset-dropdown-container {
    position: relative;
    width: 100%;
}

.preset-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.preset-dropdown:hover {
    border-color: #667eea;
}

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

.dropdown-selected {
    display: flex;
    align-items: center;
    flex: 1;
}

.dropdown-selected .placeholder {
    color: #999;
    font-style: italic;
}

.dropdown-selected .selected-model {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-weight: 500;
}

.dropdown-selected .selected-model img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.dropdown-arrow {
    color: #667eea;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.preset-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background: #f8f9ff;
}

.dropdown-item.selected {
    background: #e3f2fd;
    color: #667eea;
    font-weight: 500;
}

.dropdown-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #eee;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.dropdown-item img:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.dropdown-selected .selected-model img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #eee;
    background: #f8f9fa;
}

.dropdown-item .model-info {
    flex: 1;
}

.dropdown-item .model-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.dropdown-item .model-size {
    font-size: 12px;
    color: #999;
}

.preset-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    /* 确保网格在小屏幕上也能正常显示 */
    min-height: 200px;
}

/* 预设模特网格滚动条样式 */
.preset-models-grid::-webkit-scrollbar {
    width: 8px;
}

.preset-models-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    margin: 5px 0;
}

.preset-models-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.preset-models-grid::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* 响应式设计：在小屏幕上调整网格列数 */
@media (max-width: 768px) {
    .preset-models-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
        max-height: 350px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .preset-models-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-height: 300px;
        padding: 10px;
    }
}

/* 下拉菜单滚动条样式 */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* 弹窗基础样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Chrome兼容性 - Flexbox */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    z-index: 1000;
    -webkit-animation: fadeIn 0.3s ease-out;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

.modal-header {
    /* Chrome兼容性 - Flexbox */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    /* Chrome兼容性 - Flexbox */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    -webkit-gap: 10px;
    -moz-gap: 10px;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}