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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 107, 107, 0.2);
    padding: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
    font-size: 32px;
    font-weight: 700;
}

/* 设置区域 */
.settings-section {
    background: #fff5f5;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #ffe0e0;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
    font-size: 15px;
}

.setting-label::before {
    content: "⚙️ ";
}

.model-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ff9a9e;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.model-select:hover {
    border-color: #ff6b6b;
}

.model-select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 154, 158, 0.1);
}

optgroup {
    font-weight: bold;
    font-size: 13px;
    color: #ff6b6b;
}

option {
    padding: 8px;
    color: #333;
}

/* 名称管理区域 */
.names-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #ffe8a1;
}

.names-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.names-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.names-title::before {
    content: "👥 ";
}

.clear-names-btn {
    padding: 8px 18px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.clear-names-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ffd700;
}

.name-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.name-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 154, 158, 0.4);
}

.name-tag .remove-name {
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.name-tag .remove-name:hover {
    opacity: 1;
}

.empty-names {
    width: 100%;
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

/* 上传区域 */
.upload-section {
    border: 3px dashed #ff9a9e;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    background: #fff5f5;
    transition: all 0.3s;
}

.upload-section:hover {
    border-color: #ff6b6b;
    background: #ffe8e8;
    transform: translateY(-2px);
}

.upload-label {
    display: inline-block;
    padding: 14px 35px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.upload-label::before {
    content: "📁 ";
}

.upload-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

#imageInput {
    display: none;
}

.file-name {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.preview-image {
    max-width: 100%;
    max-height: 450px;
    margin-top: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 按钮 */
.upload-btn {
    display: block;
    width: 220px;
    margin: 25px auto;
    padding: 14px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn::before {
    content: "🚀 ";
}

.upload-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

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

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    margin: 30px 0;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff9a9e;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.loading p {
    margin-top: 15px;
    color: #666;
    font-size: 15px;
}

/* 消息提示 */
.message {
    display: none;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid;
    font-size: 15px;
}

.message.show {
    display: block;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* 结果区域 */
.result-section {
    display: none;
    margin-top: 40px;
}

.result-section.show {
    display: block;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #ff9a9e;
}

h2 {
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

h2::before {
    content: "📊 ";
}

.model-badge {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.model-badge.free {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.model-badge.premium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
}

th, td {
    padding: 16px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    font-size: 16px;
}

tbody tr:nth-child(even) {
    background: #fff5f5;
}

tbody tr:hover {
    background: #ffe8e8;
    transition: background 0.3s;
}

td {
    color: #555;
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .setting-row {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-label {
        min-width: auto;
        margin-bottom: 8px;
    }

    .names-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .upload-section {
        padding: 25px 15px;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px;
    }
}
