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

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    background: rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 1.2rem;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s;
}

.header-nav a:hover, .header-nav a.nav-active {
    background: rgba(255,255,255,0.2);
}

.main-container {
    max-width: 98%;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.step-label {
    font-size: 0.9rem;
    color: #666;
}

.progress-step.active .step-label {
    color: #333;
    font-weight: bold;
}

.progress-line {
    width: 100px;
    height: 3px;
    background: #ddd;
    margin: 0 1rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(600px, 700px) 1fr;
    gap: 1.5rem;
}

.left-panel {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.right-panel {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.panel-section {
    margin-bottom: 1.5rem;
}

.info-config-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-section {
    grid-column: 1;
}

.config-section {
    grid-column: 2;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.section-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.required-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.required-label::before {
    content: '*';
    color: #e53e3e;
    margin-right: 4px;
}

.form-row {
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    min-height: 120px;
    resize: vertical;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.config-hint {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 8px;
    border: 1px solid #fef3c7;
}

.config-hint input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: #667eea;
}

.config-hint label {
    font-size: 0.85rem;
    color: #78350f;
    font-weight: 500;
}

.config-select-wrapper {
    display: flex;
    gap: 0.5rem;
}

.config-select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.config-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.upload-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #7c8eea;
}

.add-config-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.add-config-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}

.upload-placeholder {
    aspect-ratio: 1;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-placeholder:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 2rem;
    color: #999;
    margin-bottom: 5px;
}

.uploaded-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
}

.uploaded-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 320px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-hint-btn {
    align-self: flex-end;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

.ai-hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.ai-hint-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.config-group {
    margin-bottom: 1rem;
    font-weight: 500;
    color: #555;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #f0f0f0;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: #333;
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.button-group .generate-btn {
    flex: 1;
    width: auto;
}

.batch-btn {
    flex: 1;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.batch-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.batch-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.preview-ratio {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-ratio select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.result-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #555;
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.subtitle-icon {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #666;
    margin-right: 10px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.image-type-header {
    grid-column: 1 / -1;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.image-section {
    margin-bottom: 2rem;
}

.image-type-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.generated-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.placeholder-image {
    width: 100%;
    padding-bottom: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #ddd;
}

.placeholder-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.image-item.placeholder .image-content {
    opacity: 0.6;
}

.image-item.placeholder .edit-btn.disabled,
.image-item.placeholder .regenerate-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-item {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.image-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.image-content {
    padding: 1rem;
    background: #fff;
}

.image-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-actions {
    display: flex;
    gap: 0.75rem;
}

.image-actions button {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn {
    background: #667eea;
    color: #fff;
}

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

.regenerate-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.regenerate-btn:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
    transform: translateY(-1px);
}

.upload-area-small {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area-small:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.edit-btn, .regenerate-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn {
    background: #667eea;
    color: #fff;
}

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

.regenerate-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.regenerate-btn:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
    transform: translateY(-1px);
}

.image-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 10;
    opacity: 1;
}

.image-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-item.failed .image-checkbox {
    pointer-events: none;
    opacity: 0.3;
}

.image-item.failed {
    opacity: 0.7;
}

.image-item.processing .image-checkbox {
    pointer-events: none;
    opacity: 0.5;
}

.text-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    min-height: 200px;
}

.product-info-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
}

.product-info-card h4 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.product-info-card p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.product-info-card pre {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.product-info-header {
    position: relative;
    padding-right: 50px;
}

.product-info-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-edit-text {
    padding: 0.3rem 0.7rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit-text:hover {
    background: #5a6fd6;
}

.btn-regenerate-text {
    padding: 0.3rem 0.7rem;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-regenerate-text:hover {
    background: #d97706;
}

.product-info-edit {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

.product-info-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-save-text {
    padding: 0.4rem 1rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-text:hover {
    background: #5a6fd6;
}

.btn-cancel-text {
    padding: 0.4rem 1rem;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-text:hover {
    background: #f5f5f5;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    text-align: center;
}

.action-bar {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

.action-bar .btn-primary,
.action-bar .btn-secondary {
    max-width: 200px;
    flex-shrink: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
}

/* 进度条新样式 */
.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s;
}

.progress-step.active .step-dot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.progress-line {
    width: 60px;
    height: 2px;
    background: #ddd;
    margin: 0 1rem;
    transition: all 0.3s;
}

.progress-line.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 面板卡片 */
.panel-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.edit-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* 商品信息网格 */
.product-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}

.product-images {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.product-images .small-image {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.more-images {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    border: 1px solid #eee;
}

.product-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.85rem;
    color: #999;
    flex-shrink: 0;
    width: 80px;
}

.info-value {
    font-size: 0.85rem;
    color: #333;
    flex: 1;
    text-align: left;
    word-break: break-word;
}

/* 多选框网格 */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.checkbox-card:hover {
    background: #f0f0f0;
}

.checkbox-card input[type="checkbox"] {
    display: none;
}

.checkbox-card input[type="checkbox"]:checked + .check-icon {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.checkbox-card input[type="checkbox"]:checked ~ .checkbox-label {
    color: #333;
    font-weight: 500;
}

.checkbox-card input[type="checkbox"]:checked {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    color: transparent;
    transition: all 0.2s;
}

.checkbox-card input[type="checkbox"]:checked + .check-icon {
    opacity: 1;
    border-color: #667eea;
}

.checkbox-label {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* 预览网格 */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.preview-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-image-wrapper {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f8f9fa;
}

.preview-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-info {
    padding: 0.75rem;
}

.preview-title {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.375rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f5f5f5;
    color: #666;
}

.action-btn:hover {
    background: #667eea;
    color: #fff;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #999;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state span {
    font-size: 0.9rem;
}

/* 面板标题 */
.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    z-index: 1001;
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 1rem;
    margin: 0;
}

.close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #eee;
}

.modal-body {
    padding: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

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

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #eee;
}

/* 按钮样式 */
.btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: #ffffff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}

.mt-2 {
    margin-top: 0.5rem;
}

.btn-secondary.mt-2 {
    flex: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    background: linear-gradient(135deg, #7c8eea 0%, #8a5bb2 100%);
}

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

.image-modal, .section-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.image-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.image-preview-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.image-preview-container {
    flex: 1;
}

.image-preview-container img {
    width: 50%;
    max-width: 150px;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.upload-reference-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.preview-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.upload-area-small {
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.upload-area-small:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.reference-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 200px;
    min-height: 80px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    justify-content: flex-start;
    align-items: flex-start;
}

.reference-images-container .no-images {
    color: #999;
    font-size: 12px;
}

.reference-image-item {
    width: 60px;
    height: 60px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.reference-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reference-image-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reference-image-item .remove-btn:hover {
    background: rgba(255,0,0,0.8);
}

.preview-label.mt-2 {
    margin-top: 1rem;
}

.upload-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 12px;
}

.upload-options label {
    cursor: pointer;
}

.loading-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

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

.loading-text {
    font-size: 14px;
    color: #666;
}

.upload-icon {
    font-size: 2rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.upload-area-small span:last-child {
    font-size: 0.9rem;
    color: #666;
}

.image-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
}

.info-row {
    margin-bottom: 1rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.info-row input, .info-row textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

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

.product-info-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
}

.product-info-summary h4 {
    color: #333;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s;
}

.checkbox-item:hover {
    background: #f0f0f0;
}

.checkbox-item input {
    width: 18px;
    height: 18px;
}

.checkbox-item span {
    font-size: 0.9rem;
}

.image-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.image-select-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.image-select-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-select-item input {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.25rem;
    font-size: 0.75rem;
    text-align: center;
}

.detail-preview {
    min-height: 500px;
}

.detail-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.detail-section .section-title {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.detail-section .section-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #555;
}

@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .left-panel {
        position: static;
    }
    
    .info-config-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-nav {
        gap: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-bar {
        flex-wrap: wrap;
    }
    
    .progress-line {
        display: none;
    }
    
    .upload-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.history-modal-content {
    max-width: 650px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#history-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* ========== 批处理modal样式 ========== */
.batch-modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.batch-config-section {
    margin-bottom: 1.5rem;
}

.batch-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.batch-config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.batch-config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #333;
}

.batch-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.batch-checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.batch-checkbox-card:hover {
    background: #f0f0f0;
}

.batch-checkbox-card input[type="checkbox"] {
    display: none;
}

.batch-check-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    opacity: 0;
}

.batch-checkbox-card input[type="checkbox"]:checked + .batch-check-icon {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
}

.batch-checkbox-card input[type="checkbox"]:checked ~ .batch-checkbox-label {
    color: #333;
    font-weight: 500;
}

.batch-checkbox-label {
    font-size: 0.8rem;
    color: #666;
}

/* 批处理状态标签 */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

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

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

.status-badge.batch-complete {
    background: #d4edda;
    color: #155724;
}

/* ========== detail.php 专用样式 ========== */
.detail-page .main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.detail-page .progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.detail-page .progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2rem;
}

.detail-page .step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    margin-bottom: 0.5rem;
}

.detail-page .progress-step.active .step-dot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.detail-page .step-label {
    font-size: 0.85rem;
    color: #999;
}

.detail-page .progress-step.active .step-label {
    color: #333;
    font-weight: 500;
}

.detail-page .progress-line {
    width: 60px;
    height: 2px;
    background: #ddd;
}

.detail-page .progress-line.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.detail-page .content-wrapper {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
}

.detail-page .left-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-page .panel-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.detail-page .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.detail-page .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.detail-page .edit-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.detail-page .select-all-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.detail-page .generated-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.detail-page .generated-images-grid::-webkit-scrollbar {
    width: 6px;
}

.detail-page .generated-images-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.detail-page .generated-images-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.detail-page .generated-images-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.detail-page .generated-image-item {
    position: relative;
    width: 100%;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.detail-page .generated-image-item:hover {
    border-color: #667eea;
}

.detail-page .generated-image-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.detail-page .generated-image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
}

.detail-page .generated-image-item .select-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    border: 2px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.detail-page .generated-image-item:hover .select-overlay {
    border-color: #667eea;
}

.detail-page .generated-image-item.selected .select-overlay {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.detail-page .reference-item .remove-ref-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.detail-page .reference-item:hover .remove-ref-btn {
    display: flex;
}

.detail-page .reference-item .remove-ref-btn:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
}

.detail-page .upload-ref-area {
    margin-top: 1rem;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.detail-page .upload-ref-area:hover {
    border-color: #667eea;
}

.detail-page .upload-ref-area .upload-icon {
    display: block;
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.detail-page .upload-ref-area span {
    color: #999;
    font-size: 0.85rem;
}

.detail-page .btn-save-ref-images {
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-page .btn-save-ref-images:hover {
    background: #5a6fd6;
}

.detail-page .product-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-page .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.detail-page .checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.detail-page .checkbox-card:hover {
    background: #f0f0f0;
}

.detail-page .checkbox-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e9ecef;
}

.detail-page .checkbox-card.disabled:hover {
    background: #e9ecef;
}

.detail-page .checkbox-card input[type="checkbox"] {
    display: none;
}

.detail-page .check-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    opacity: 0;
}

.detail-page .checkbox-card input[type="checkbox"]:checked + .check-icon {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
}

.detail-page .checkbox-card input[type="checkbox"]:checked ~ .checkbox-label {
    color: #333;
    font-weight: 500;
}

.detail-page .checkbox-label {
    font-size: 0.8rem;
    color: #666;
}

.detail-page .generate-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 0.5rem;
}

.detail-page .generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.detail-page .generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.detail-page .right-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.detail-page .panel-header {
    margin-bottom: 1rem;
}

.detail-page .panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.detail-page .option-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.detail-page .option-preview-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    display: none;
}

.detail-page .option-preview-item.active {
    display: block;
}

.detail-page .option-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.detail-page .option-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.detail-page .option-count {
    font-size: 0.75rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: auto;
}

.detail-page .refresh-desc-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #667eea;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
}

.detail-page .refresh-desc-btn:hover {
    background: rgba(102, 126, 234, 0.15);
}

.detail-page .refresh-desc-btn.loading {
    animation: spin 0.8s linear infinite;
}

.detail-page .option-preview-item.has-image .refresh-desc-btn {
    display: inline-block;
}

.detail-page .option-preview-item.has-image .action-btn-group {
    display: flex;
}

.detail-page .option-preview-item:not(.has-image) .action-btn-group {
    display: none;
}

.detail-page .option-preview-content {
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

.detail-page .option-preview-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-page .option-preview-content .image-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    max-height: 50%;
    overflow: hidden;
    z-index: 10;
    box-sizing: border-box;
}

.detail-page .option-preview-content.multi-images {
    display: flex;
    gap: 2px;
    padding: 2px;
}

.detail-page .option-preview-content.multi-images img {
    flex: 1;
    border-radius: 4px;
}

.detail-page .option-preview-content .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.85rem;
}

.detail-page .loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 0.85rem;
    gap: 10px;
}

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

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

.detail-page .preview-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.detail-page .preview-image-wrapper {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f8f9fa;
}

.detail-page .preview-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-page .preview-info {
    padding: 0.75rem;
}

.detail-page .preview-title {
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-page .preview-actions {
    display: flex;
    gap: 0.375rem;
}

.detail-page .action-btn {
    flex: 1;
    padding: 0.3rem;
    font-size: 0.7rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #f5f5f5;
    color: #666;
}

.detail-page .action-btn:hover {
    background: #667eea;
    color: #fff;
}

.detail-page .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #999;
    grid-column: 1 / -1;
}

.detail-page .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.detail-page .empty-state span {
    font-size: 0.85rem;
}

.detail-page .action-bar {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 1rem;
}

.detail-page .loading-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.detail-page .loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.detail-page .loading-text {
    font-size: 14px;
    color: #666;
}

.detail-page .action-btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.detail-page .action-btn-group .action-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-page .action-btn-group .action-btn:hover {
    background: #667eea;
    color: white;
}

.detail-page .image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.detail-page .image-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.detail-page .image-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10002;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.detail-page .image-modal .modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.detail-page .image-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.detail-page .image-modal .close-btn:hover {
    color: #333;
}

.detail-page .image-modal .modal-body {
    padding: 1.5rem;
}

.detail-page .image-modal .image-preview-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-page .image-modal .image-preview-container {
    flex: 1;
    min-width: 0;
}

.detail-page .image-modal .image-preview-container img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.detail-page .image-modal .upload-reference-container {
    flex: 1;
    min-width: 0;
}

.detail-page .image-modal .preview-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.detail-page .image-modal .preview-label.mt-2 {
    margin-top: 1rem;
}

.detail-page .image-modal .reference-images-container {
    min-height: 80px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}

.detail-page .image-modal .reference-images-container .no-images {
    color: #ccc;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
}

.detail-page .image-modal .reference-image-item {
    position: relative;
    width: calc(33.33% - 0.35rem);
    aspect-ratio: 1;
}

.detail-page .image-modal .reference-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.detail-page .image-modal .reference-image-item .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.detail-page .image-modal .upload-area-small {
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.detail-page .image-modal .upload-area-small:hover {
    border-color: #667eea;
}

.detail-page .image-modal .upload-area-small .upload-icon {
    display: block;
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.detail-page .image-modal .upload-area-small span {
    color: #999;
    font-size: 0.85rem;
}

.detail-page .image-modal .image-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-page .image-modal .info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.detail-page .image-modal .info-row label {
    width: 80px;
    font-size: 0.85rem;
    color: #666;
    flex-shrink: 0;
    padding-top: 0.4rem;
}

.detail-page .image-modal .info-row select,
.detail-page .image-modal .info-row input,
.detail-page .image-modal .info-row textarea {
    flex: 1;
    padding: 0.4rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
}

.detail-page .image-modal .info-row textarea {
    resize: vertical;
    min-height: 60px;
}

.detail-page .image-modal .modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
}

.detail-page .image-modal .modal-footer .btn-secondary,
.detail-page .image-modal .modal-footer .btn-primary {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.detail-page .image-modal .modal-footer .btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.detail-page .image-modal .modal-footer .btn-secondary:hover {
    background: #e0e0e0;
}

.detail-page .image-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.detail-page .image-modal .modal-footer .btn-primary:hover {
    opacity: 0.9;
}

.history-loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f8f9fa;
}

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

.history-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.draft-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.draft-thumb-placeholder {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.history-info {
    flex: 1;
    margin: 0 1rem;
    min-width: 0;
}

.history-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-time {
    font-size: 0.8rem;
    color: #999;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-load-draft {
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-load-draft:hover {
    background: #5a6fd6;
}

.btn-delete-draft {
    padding: 0.4rem 0.8rem;
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-draft:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-view-detail {
    padding: 0.4rem 0.6rem;
    background: #f0f4ff;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-view-detail:hover {
    background: #667eea;
    color: #fff;
}

.preview-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;
}

.option-preview-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}