:root {
    /* 核心色板 */
    --primary-color: #ff2442;
    --primary-hover: #e0203a;
    --primary-light: rgba(255, 36, 66, 0.08);
    --secondary-color: #333333;
    --text-primary: #1f1f1f;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --bg-page: #f6f8fa;
    --bg-card: #ffffff;
    --border-color: #eaeaea;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    
    /* 尺寸与间距 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 32px rgba(255, 36, 66, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-lg) var(--spacing-md);
}

/* 布局容器 */
body > h1, 
.mode-layer, 
.card, 
.ai-expert-section {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 标题样式 */
h1.header-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md) 0;
}

h1.header-with-logo .header-logo {
    height: 48px;
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

h1.header-with-logo span {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #333 0%, #000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 模式选择器 */
.mode-layer {
    margin-bottom: var(--spacing-lg);
}

.mode-layer h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xs);
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.mode-option {
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-xs);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1;
    min-height: auto;
}

.mode-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mode-option.active {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.mode-option.active .mode-icon {
    transform: scale(1.1);
}

.mode-option.active .mode-title {
    color: var(--primary-color);
}

.mode-icon {
    font-size: 28px;
    margin-bottom: var(--spacing-sm);
    transition: transform 0.3s ease;
}

.mode-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    transition: color 0.3s ease;
}

.mode-desc {
    display: none;
}

/* 通用卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid rgba(0,0,0,0.02);
}

/* 输入区域样式 */
.input-group {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"], 
textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:focus, 
textarea:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    display: none; /* JS control */
}

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

/* 按钮样式 */
button {
    cursor: pointer;
    font-family: inherit;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.actions > button {
    width: 100% !important;
    flex: none !important;
}

#analyzeBtn, #publishBtn, .action-btn {
    flex: 1 !important;
    padding: 14px 24px !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    min-height: 48px !important;
    height: auto !important;
    max-height: none !important;
    line-height: 1.5 !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* 确保按钮内的span和svg不影响按钮大小 */
#analyzeBtn > span,
#publishBtn > span,
#analyzeBtn > svg,
#publishBtn > svg {
    flex-shrink: 0;
    line-height: 1;
}

#analyzeBtn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.2);
}

#analyzeBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 36, 66, 0.3);
}

#analyzeBtn:active {
    transform: translateY(0);
}

#publishBtn {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* 发布按钮启用时的红色样式 */
#publishBtn:not(:disabled) {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.2);
}

#publishBtn:not(:disabled):hover {
    background: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 36, 66, 0.3);
}

#publishBtn:not(:disabled):active {
    transform: translateY(0);
}

#publishBtn:disabled {
    background: #f5f5f5 !important;
    color: #ccc !important;
    cursor: not-allowed;
    border-color: transparent !important;
    box-shadow: none;
}

/* 状态和进度 */
.status {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: center;
    display: none;
}

.status.error {
    background: #fff2f0;
    color: var(--error-color);
    border: 1px solid #ffccc7;
    display: block;
}

.status.info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    display: block;
}

.progress-section {
    margin-top: var(--spacing-xl);
    background: #fafafa;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.progress-bar-container {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.steps-container {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 0;
    right: 0;
    height: 2px;
    background: #eee;
    z-index: 0;
}

.step-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.step-item.active .step-dot {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.step-item.completed .step-dot {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.step-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* 结果面板 */
.note-panel {
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-xl);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.result-header span {
    font-size: 18px;
    font-weight: 700;
}

/* 切换开关 */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 24px;
    transition: .3s;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 内容展示 */
.content-section {
    animation: fadeIn 0.5s ease;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

.section-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary-color);
}

.content-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.content-desc {
    font-size: 15px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    margin-bottom: 24px;
    background: #f9f9f9;
    padding: 16px;
    border-radius: var(--radius-md);
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
}

.images-grid .image-item,
.images-grid .image-upload-area {
    position: relative;
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
}

.images-grid .image-item {
    aspect-ratio: 3/4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #eee;
}

.images-grid .image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto;
    border-radius: 0;
    cursor: zoom-in;
    transition: transform 0.2s;
    background: #eee;
}

.images-grid .image-item img:hover {
    transform: scale(1.02);
}

.images-grid .image-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 16px;
    line-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.images-grid .image-item-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
}

.images-grid .image-item-loading .progress-text {
    font-size: 12px;
    color: #666;
}

.images-grid .image-upload-area {
    aspect-ratio: 3/4;
    border-radius: var(--radius-sm);
    border: 2px dashed #e0e0e0;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.images-grid .image-upload-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-secondary);
}

.images-grid .image-upload-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.images-grid img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    transition: transform 0.2s;
    background: #eee;
}

.images-grid img:hover {
    transform: scale(1.02);
}

/* 本地上传区域优化 */
.local-upload {
    background: #f9f9f9;
    border: 2px dashed #e0e0e0;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}

.local-upload:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.file-upload-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.local-upload-list {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* 上传列表容器样式 */
#localUploadList:not(.empty),
#aiimageUploadList:not(.empty),
#aivideoUploadList:not(.empty),
#promptgenUploadList:not(.empty) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

/* 上传文件项样式 */
.local-upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 100%;
    min-width: 0;
    transition: all 0.2s;
}

.local-upload-item:hover {
    border-color: #ff2442;
    box-shadow: 0 2px 4px rgba(255, 36, 66, 0.1);
}

.local-upload-item .file-preview {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    object-fit: cover;
}

.local-upload-item .file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.local-upload-item .file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.local-upload-item .file-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.local-upload-item .file-size {
    font-size: 11px;
    color: #6b7280;
}

.local-upload-item .file-delete-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #ff2442;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.local-upload-item .file-delete-btn:hover {
    background: #e01e3c;
    transform: scale(1.05);
}

.local-upload-item .file-delete-btn:active {
    transform: scale(0.95);
}

/* 响应式调整 */
@media (max-width: 600px) {
    body {
        padding: 12px;
        transition: padding 0.3s ease;
    }
    
    /* 当处于功能页面时（非首页），移除body内边距 */
    body.feature-active {
        padding: 0;
    }
    
    .card {
        padding: 16px;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    /* 功能页面下卡片全宽 */
    body.feature-active .card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    
    .mode-options {
        gap: 8px;
    }
    
    h1.header-with-logo span {
        font-size: 22px;
    }
    
    .steps-container {
        display: none; /* 移动端隐藏详细步骤，节省空间 */
    }
}

/* 爆款创作样式 */
.burst-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.burst-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.burst-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.burst-card-body {
    padding: var(--spacing-md);
}

.burst-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.burst-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.burst-card-metrics {
    display: flex;
    gap: var(--spacing-md);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.burst-card-actions {
    margin-top: var(--spacing-md);
}

/* 复刻并生成按钮 - 极致美感优化 */
.burst-card-actions button.primary {
    width: 100%;
    padding: 10px 12px !important;
    background: linear-gradient(135deg, #ff2442 0%, #ff4d6a 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.25) !important;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.burst-card-actions button.primary:hover {
    background: linear-gradient(135deg, #ff4d6a 0%, #ff2442 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 36, 66, 0.35) !important;
}

@media (max-width: 600px) {
    .burst-card-actions button.primary {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
}

.burst-card-actions button.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 36, 66, 0.2) !important;
    opacity: 0.9;
}

.burst-card-actions button.primary:disabled {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none;
}

/* 热门关键词样式 */
.chip {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}
