/* AI壁纸工具 - 暗黑主题 + 金色强调 */

/* ==================== 颜色变量 ==================== */
:root {
    /* 主色调 - 金色/橙色系 */
    --primary-gold: #e8a838;
    --primary-orange: #f0982a;
    --primary-hover: #f5b84d;
    --accent-gold: #d4952a;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #e8a838 0%, #f0982a 100%);
    --gradient-light: linear-gradient(135deg, rgba(232,168,56,0.15) 0%, rgba(240,152,42,0.1) 100%);
    --gradient-card: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    
    /* 背景色 - 暗黑系 */
    --bg-body: #0a0a0a;
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #222222;
    --bg-card: #1a1a1a;
    --bg-sidebar: #111111;
    --bg-header: #0d0d0d;
    
    /* 文字颜色 */
    --text-primary: #e8e8e8;
    --text-secondary: #999999;
    --text-light: #666666;
    --text-white: #ffffff;
    
    /* 边框 */
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    
    /* 功能色 */
    --success-color: #52c41a;
    --error-color: #ff4d4f;
    --warning-color: #faad14;
    --info-color: #1890ff;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.6);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 侧边栏宽度 */
    --sidebar-width: 220px;
}

/* ==================== 全局样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    padding-top: 48px; /* 顶栏高度 */
}

a { color: var(--primary-gold); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ==================== 整体布局：顶栏 + 侧边栏 + 内容区 ==================== */

/* ==================== 顶部栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

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

.logo { display: flex; align-items: center; }
.logo-icon-wrap {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, #e8a838, #f06529);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(232,168,56,0.35);
}
.logo-icon { font-size: 20px; color: #fff; }
.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin-left: 8px;
    letter-spacing: 0.5px;
}

/* 顶部导航隐藏 - 改用侧边栏 */
.nav { display: none; }

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

.search-box { display: none; }

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

.header-search-btn,
.mobile-menu-btn { display: none; }

.language-selector { position: relative; }

.language-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all 0.2s;
}
.language-select:hover { border-color: var(--border-hover); }
.language-select:focus { outline: none; border-color: var(--primary-gold); }
.language-select option { background: var(--bg-secondary); color: var(--text-primary); }

.header-login-btn {
    background: var(--gradient-primary);
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.header-login-btn:hover { opacity: 0.9; }

/* ==================== 用户菜单下拉 ==================== */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 4px 10px;
    color: var(--text-primary); cursor: pointer; transition: all 0.2s;
    font-size: 13px;
}
.user-menu-btn:hover { border-color: var(--primary-gold); background: rgba(232,168,56,0.08); }
.user-avatar-img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.user-nickname { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
    display: none; position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 200px; background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 300;
    overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-header { padding: 12px 16px; }
.user-dropdown-name { display: block; font-weight: 700; color: var(--text-white); font-size: 14px; }
.user-dropdown-coin { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--primary-gold); margin-top: 4px; }
.user-dropdown-divider { height: 1px; background: var(--border-color); margin: 0; }
.user-dropdown-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    color: var(--text-secondary); font-size: 13px; transition: all 0.15s; text-decoration: none;
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.user-dropdown-item i { font-size: 16px; width: 18px; text-align: center; }
.user-dropdown-logout:hover { color: var(--error-color); }

/* ==================== 收藏按钮 ==================== */
.action-fav-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 8px 16px;
    color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.action-fav-btn:hover { border-color: #ff6b81; color: #ff6b81; background: rgba(255,107,129,0.08); }
.action-fav-btn.favorited { border-color: #ff6b81; color: #ff6b81; background: rgba(255,107,129,0.12); }
.action-fav-btn.favorited i { color: #ff6b81; }

/* 模板库收藏按钮 */
.tc-fav-btn {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.5); border: none;
    color: #fff; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 10;
    backdrop-filter: blur(4px);
}
.tc-fav-btn:hover { background: rgba(255,107,129,0.6); transform: scale(1.1); }
.tc-fav-btn.favorited { background: rgba(255,107,129,0.6); color: #fff !important; }
.tc-fav-btn.favorited i,
.tc-fav-btn.favorited i::before { color: #fff !important; }
.tc-fav-btn.favorited:hover { background: rgba(255,107,129,0.75); transform: scale(1.1); }

/* ==================== 左侧导航栏 ==================== */
.sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 150;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
    color: var(--primary-gold);
    background: rgba(232,168,56,0.08);
    border-left-color: var(--primary-gold);
}

.sidebar-link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-product-link { opacity: 0.75; }
.sidebar-product-link:hover { opacity: 1; }
.sidebar-visit-site {
    margin-top: 4px;
    color: var(--primary-gold) !important;
    font-weight: 600;
    opacity: 0.85;
}
.sidebar-visit-site:hover { opacity: 1; background: rgba(232,168,56,0.08); }

/* ==================== 右侧主内容区 ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--spacing-lg);
    min-height: auto;
    background: var(--bg-body);
}

.wallpaper-container { width: 100%; max-width: 1000px; margin: 0 auto; }
.wallpaper-container.full-width { max-width: none; margin: 0; padding: 0 12px; }
.wallpaper-container.templates { max-width: 1400px; padding: 0 8px; }

/* ==================== 紧凑工具页标题 ==================== */
.page-tool-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 16px;
    flex-wrap: wrap;
}
.page-tool-icon {
    font-size: 22px;
    color: var(--primary-gold);
}
.page-tool-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}
.page-tool-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* 旧标题区兼容 */
.wallpaper-header {
    text-align: left;
    padding: 0 0 12px;
    margin-bottom: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
}
.wallpaper-header::after,
.wallpaper-header::before { display: none; }

.wallpaper-header h1 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--text-white);
}

.wallpaper-header h1 .title-text {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: var(--text-white);
    filter: none;
}
.wallpaper-header p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== 工具页 左右分栏 ==================== */
.wallpaper-content {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    align-items: stretch;
    min-height: calc(100vh - 48px - 80px);
    animation: fadeInUp 0.4s ease;
}

/* 左侧参数面板 */
.wallpaper-left-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.wallpaper-left-panel::before { display: none; }
.wallpaper-left-panel::after { display: none; }
.wallpaper-left-panel:hover { border-color: var(--border-hover); }

/* 右侧预览区 */
.wallpaper-right-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.wallpaper-right-panel::before { display: none; }
.wallpaper-right-panel::after { display: none; }
.wallpaper-right-panel:hover { border-color: var(--border-hover); }

/* ==================== 表单组 ==================== */
.form-group { margin-bottom: var(--spacing-lg); }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0;
    text-transform: none;
    position: relative;
    padding-left: 0;
}
.form-label::before { display: none; }

/* 输入框 */
.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}
.input-field::placeholder { color: var(--text-light); }
.input-field:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(232,168,56,0.15);
    background: var(--bg-secondary);
}

textarea.input-field {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* 选择框 */
.select-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.select-field:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(232,168,56,0.15);
    background: var(--bg-secondary);
}
.select-field option { background: var(--bg-secondary); color: var(--text-primary); }

/* ==================== 按钮 ==================== */
.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    color: #000;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0;
    box-shadow: none;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: none;
}
.btn-primary::before { display: none; }
.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(232,168,56,0.3);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
}

/* ==================== 风格卡片 ==================== */
.style-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.style-card {
    padding: 8px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}
.style-card::after { display: none; }
.style-card:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    transform: none;
    box-shadow: none;
}
.style-card.active {
    background: rgba(232,168,56,0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    font-weight: 700;
    box-shadow: none;
}

/* ==================== 张数选择器 ==================== */
.count-selector { display: flex; gap: 8px; }
.count-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.count-btn:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}
.count-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #000;
    font-weight: 700;
    box-shadow: none;
}

/* ==================== 预览区域 ==================== */
.preview-area {
    text-align: center;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
}

.preview-placeholder {
    color: var(--text-light);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    align-self: center;
    margin: auto;
}
.preview-placeholder p:first-child {
    font-size: 64px;
    filter: none;
    animation: none;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    cursor: zoom-in;
    transition: transform 0.2s;
}
.preview-image:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-lg);
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(232,168,56,0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 消息提示 ==================== */
.message-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
}
.message-box::before { display: none; }
.message-success {
    background: rgba(82,196,26,0.1);
    border: 1px solid rgba(82,196,26,0.3);
    color: #73d13d;
}
.message-error {
    background: rgba(255,77,79,0.1);
    border: 1px solid rgba(255,77,79,0.3);
    color: #ff7875;
}
.message-info {
    background: rgba(232,168,56,0.1);
    border: 1px solid rgba(232,168,56,0.3);
    color: var(--primary-gold);
}

/* ==================== 多图翻页 ==================== */
.preview-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 200px;
    justify-content: center;
}
.preview-img-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-btn:hover {
    background: var(--primary-gold);
    color: #000;
    border-color: transparent;
}
.slider-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ==================== 模态框 ==================== */
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
}
.modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    gap: 12px;
    border-radius: var(--radius-md);
}
.modal-content img {
    max-width: 85vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    object-fit: contain;
}
.modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }
.modal-nav { display: flex; align-items: center; gap: 20px; }
.modal-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-nav-btn:hover { background: rgba(255,255,255,0.2); }
.modal-counter { color: rgba(255,255,255,0.7); font-size: 14px; min-width: 60px; text-align: center; }
.modal-download-btn {
    padding: 8px 24px;
    background: var(--gradient-primary);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.modal-download-btn:hover { opacity: 0.9; color: #000; }

/* ==================== 操作按钮组 ==================== */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}
.action-buttons .btn-primary {
    width: auto;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* ==================== 导航下拉（遗留兼容，实际用侧边栏） ==================== */
.nav-dropdown { display: none; }
.nav-dropdown-trigger { display: none; }
.nav-dropdown-menu { display: none; }
.nav-link-tool { display: none; }

/* ==================== 底部 ==================== */
.footer {
    background: var(--bg-primary);
    color: var(--text-light);
    padding: 24px 20px 16px;
    margin-top: 0;
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 28px;
    margin-bottom: 16px;
}
.footer-brand-section { max-width: 300px; }
.footer-logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-logo-text { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.footer-desc { font-size: 13px; line-height: 1.6; color: var(--text-light); margin-bottom: 12px; }
.footer-social { display: flex; gap: 10px; }
.social-icon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    transition: background 0.2s;
}
.social-icon:hover { background: rgba(255,255,255,0.1); }
.social-icon img { width: 16px; height: 16px; }
.footer-section h4 { color: var(--text-primary); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 6px; }
.footer-section a { color: var(--text-light); font-size: 13px; }
.footer-section a:hover { color: var(--primary-gold); }
.contact-list li { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.contact-icon-img { width: 14px; height: 14px; }
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    text-align: center;
}
.copyright-links {
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    color: var(--text-light);
}
.copyright-links a { color: var(--text-light); }
.copyright-links a:hover { color: var(--primary-gold); }
.separator { color: var(--border-color); }

/* ==================== 首页专属 ==================== */
.home-hero {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 60px 0;
    animation: fadeInUp 0.8s ease;
}

/* Dynamic Wallpaper Showcase */
.wallpaper-showcase {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.showcase-item {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
/* Show background color immediately while image loads */
.showcase-item:nth-child(1) { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); }
.showcase-item:nth-child(2) { background: linear-gradient(135deg,#f093fb 0%,#f5576c 100%); }
.showcase-item:nth-child(3) { background: linear-gradient(135deg,#4facfe 0%,#00f2fe 100%); }
.showcase-item:nth-child(4) { background: linear-gradient(135deg,#43e97b 0%,#38f9d7 100%); }
.showcase-item.active {
    opacity: 1;
}

/* Ensure first image shows immediately */
.showcase-item:first-child {
    opacity: 1;
}

.home-hero-image { flex: 1; min-width: 0; }
.home-hero-content { max-width: 600px; min-width: 0; }
.home-hero-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.25;
    margin-bottom: 16px;
}
.home-hero-title span { color: var(--primary-gold); }
.home-hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}
.home-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-hero-primary {
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    animation: none;
}
.btn-hero-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #000;
    box-shadow: 0 4px 16px rgba(232,168,56,0.3);
}
.btn-hero-primary .ti { font-size: 16px; }

.btn-hero-secondary {
    padding: 10px 24px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-hero-secondary:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}
.btn-hero-secondary .ti { font-size: 16px; }

/* 首页段落 */
.home-section { padding: 32px 0; }
.home-section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 8px;
}
.home-section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 优势卡片 2x2 */
.home-advantages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.home-advantage-card {
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease backwards;
    position: relative;
    max-height: 200px;
}
.home-advantage-card:nth-child(1) { animation-delay: 0.1s; }
.home-advantage-card:nth-child(2) { animation-delay: 0.2s; }
.home-advantage-card:nth-child(3) { animation-delay: 0.3s; }
.home-advantage-card:nth-child(4) { animation-delay: 0.4s; }
.home-advantage-card:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 12px 24px rgba(232,168,56,0.15);
}
.home-advantage-card:hover h3 { color: #fff; }
.home-advantage-card:hover p { color: var(--text-primary); }
.home-advantage-text {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    min-width: 0;
}
.home-advantage-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    margin-bottom: 8px;
}
.home-advantage-card h3 { font-size: 13px; font-weight: 700; color: var(--text-white); margin-bottom: 4px; transition: color 0.3s; }
.home-advantage-card p { font-size: 11px; color: var(--text-secondary); line-height: 1.6; transition: color 0.3s; }
.home-advantage-img {
    position: relative;
    width: 42%;
    flex-shrink: 0;
    overflow: hidden;
}
.home-advantage-img::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to right, var(--bg-card) 0%, transparent 60%);
    pointer-events: none;
    transition: opacity 0.3s;
}
.home-advantage-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.home-advantage-card:hover .home-advantage-img img {
    transform: scale(1.08);
}

/* 工具卡片列表 - 水平自动滚动轮播 */
.home-tools-scroll {
    overflow: hidden;
    width: 100%;
}
.home-tools-track {
    display: flex;
    gap: 12px;
    animation: toolsScroll 30s linear infinite;
    width: max-content;
}
.home-tools-scroll:hover .home-tools-track {
    animation-play-state: paused;
}
@keyframes toolsScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 6px)); }
}
.home-tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    overflow: hidden;
    flex-shrink: 0;
    width: calc((100vw - var(--sidebar-width) - 48px - 24px - 24px) / 3);
    max-width: 320px;
}
.home-tool-card:hover {
    border-color: var(--primary-gold);
    background: var(--bg-secondary);
    color: inherit;
    box-shadow: 0 8px 16px rgba(232,168,56,0.1);
}
.home-tool-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}
.home-tool-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.home-tool-card:hover .home-tool-thumb img {
    transform: scale(1.05);
}
.home-tool-body {
    padding: 10px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.home-tool-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.home-tool-title-row h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
    white-space: nowrap;
}
.home-tool-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.home-tool-tag.tag-ai {
    background: rgba(232,168,56,0.15);
    color: var(--primary-gold);
}
.home-tool-tag.tag-tool {
    background: rgba(100,100,100,0.2);
    color: var(--text-secondary);
}
.home-tool-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 使用流程 */
.home-workflow-section { text-align: center; }
.home-workflow-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
}
.text-gradient {
    background: linear-gradient(135deg, #e8a838, #f06543);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.home-workflow {
    display: flex;
    gap: 0;
    margin-top: 24px;
    align-items: stretch;
}
.home-workflow-step {
    flex: 1;
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease backwards;
}
.home-workflow-step:nth-child(1) { animation-delay: 0.1s; }
.home-workflow-step:nth-child(3) { animation-delay: 0.2s; }
.home-workflow-step:nth-child(5) { animation-delay: 0.3s; }
/* Hover glow per color */
.home-workflow-step[data-color="orange"]:hover { border-color: rgba(232,168,56,0.5); box-shadow: 0 8px 24px rgba(232,168,56,0.12); }
.home-workflow-step[data-color="purple"]:hover { border-color: rgba(139,92,246,0.5); box-shadow: 0 8px 24px rgba(139,92,246,0.12); }
.home-workflow-step[data-color="green"]:hover  { border-color: rgba(16,185,129,0.5); box-shadow: 0 8px 24px rgba(16,185,129,0.12); }
.home-workflow-step:hover h4 { color: #fff; }
.home-workflow-step:hover p { color: var(--text-primary); }

/* Thumbnail area */
.home-workflow-thumb {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}
.home-workflow-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.home-workflow-step:hover .home-workflow-thumb img { transform: scale(1.06); }
.home-workflow-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 50%);
    pointer-events: none;
}
.home-workflow-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.home-workflow-tag {
    position: absolute;
    top: 14px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* Info area below thumb */
.home-workflow-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 4px;
}
.home-workflow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.home-workflow-step:hover .home-workflow-icon { transform: scale(1.15); }
.home-workflow-step[data-color="orange"]:hover .home-workflow-icon { box-shadow: 0 0 16px rgba(232,168,56,0.4); }
.home-workflow-step[data-color="purple"]:hover .home-workflow-icon { box-shadow: 0 0 16px rgba(139,92,246,0.4); }
.home-workflow-step[data-color="green"]:hover .home-workflow-icon  { box-shadow: 0 0 16px rgba(16,185,129,0.4); }
.home-workflow-step h4 { font-size: 14px; font-weight: 700; color: var(--text-white); transition: color 0.3s; }
.home-workflow-step p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; padding: 0 16px 16px; transition: color 0.3s; }

/* Connector arrow */
.home-workflow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 18px;
}

/* CTA */
.home-cta {
    position: relative;
    padding: 36px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 32px 0;
    overflow: hidden;
}
.home-cta-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}
.home-cta-glow-orange { background: #e8a838; top: -60px; left: -40px; }
.home-cta-glow-purple { background: #8b5cf6; bottom: -60px; right: -40px; }
.home-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.home-cta-text { flex: 1; }
.home-cta h2 { font-size: 20px; font-weight: 800; color: var(--text-white); margin-bottom: 6px; }
.home-cta p { font-size: 13px; color: var(--text-secondary); margin-bottom: 0; }

/* ==================== 快速模板 ==================== */
.quick-templates {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--spacing-lg);
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.qt-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.qt-btn {
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.qt-btn:hover {
    background: rgba(232,168,56,0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

/* ==================== 生成模式 ==================== */
.mode-selector { display: flex; gap: 8px; }
.mode-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.mode-btn::after { display: none; }
.mode-btn:hover {
    border-color: var(--primary-gold);
    transform: none;
    box-shadow: none;
}
.mode-btn.active {
    background: rgba(232,168,56,0.1);
    border-color: var(--primary-gold);
    box-shadow: none;
}
.mode-icon { font-size: 20px; color: #ffffff; }
.mode-text { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.mode-btn.active .mode-text { color: var(--primary-gold); }
.mode-btn.active .mode-icon { color: var(--primary-gold); }

/* ==================== 上传区域 ==================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.upload-icon-circle {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(232,168,56,0.12);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.upload-icon-circle i { font-size: 28px; color: var(--primary-gold); }
.upload-zone::before { display: none; }
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary-gold);
    background: rgba(232,168,56,0.05);
    transform: none;
    box-shadow: none;
}
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upload-placeholder p { font-size: 13px; color: var(--text-secondary); }

/* ==================== 滑块 ==================== */
.range-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-gold);
    cursor: pointer;
    border: 2px solid var(--bg-card);
}
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== 开关 ==================== */
.toggle-list { display: flex; flex-direction: column; gap: 10px; }
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--border-color);
    border-radius: 22px;
    cursor: pointer;
    transition: 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--gradient-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ==================== 功能信息卡片 ==================== */
.feature-info-cards {
    display: flex;
    gap: 10px;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}
.fi-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.fi-icon { font-size: 16px; }

/* ==================== 比较视图 ==================== */
.compare-wrap-vertical { display: flex; flex-direction: column; width: 100%; flex: 1; }
.compare-item-vertical { display: flex; flex-direction: column; flex: 1; }
.compare-item-vertical .compare-label { margin-bottom: 6px; }
.compare-img-full {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    cursor: zoom-in;
}
.compare-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}
.compare-divider::before, .compare-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.compare-divider-arrow {
    padding: 6px 16px;
    background: var(--gradient-primary);
    color: #000;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin: 0 12px;
}
.compare-wrap { display: flex; align-items: stretch; gap: 12px; width: 100%; flex: 1; }
.compare-item { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; }
.compare-item .preview-image { flex: 1; width: 100%; height: auto; max-height: none; object-fit: contain; margin-bottom: 0; }
.compare-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 8px;
}
.compare-arrow { font-size: 24px; color: var(--text-light); display: flex; align-items: center; padding-top: 28px; }

/* ==================== 壁纸模板库 ==================== */
.template-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
    padding: 7px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary-gold); color: var(--primary-gold); }
.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #000;
}
.template-search-bar { margin-bottom: var(--spacing-lg); }
.templates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.template-card {
    position: relative;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.template-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 24px rgba(232,168,56,0.2);
}
.tc-bg { 
    position: absolute; 
    inset: 0; 
    transition: transform 0.3s;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
.template-card:hover .tc-bg { transform: scale(1.03); }
.tc-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
}
.tc-info { margin-bottom: 8px; }
.tc-name { display: block; font-size: 14px; font-weight: 700; color: white; }
.tc-cat { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; display: block; }
.tc-use-btn {
    padding: 8px 0;
    background: var(--gradient-primary);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    width: 100%;
}
.template-card:hover .tc-use-btn { opacity: 1; }

/* ==================== 编辑器 ==================== */
.editor-panel .form-group { margin-bottom: 12px; }
.editor-panel .form-label { margin-bottom: 6px; font-size: 12px; }
.editor-panel { padding: 14px !important; }
.adjust-list { display: flex; flex-direction: column; gap: 6px; }
.adjust-row { display: flex; align-items: center; gap: 4px; }
.adjust-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; width: 58px; }
.adjust-row .range-slider { flex: 1; min-width: 0; }
.adjust-val { font-size: 12px; font-weight: 600; color: var(--primary-gold); width: 26px; text-align: right; }
.adj-step-btn {
    width: 22px; height: 22px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.adj-step-btn:hover { background: var(--bg-secondary); color: var(--primary-gold); }

.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.filter-item {
    text-align: center;
    cursor: pointer;
    padding: 4px 3px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s;
}
.filter-item:hover { border-color: var(--border-hover); background: var(--bg-tertiary); }
.filter-item.active { border-color: var(--primary-gold); background: rgba(232,168,56,0.08); }
.filter-preview { width: 100%; height: 28px; border-radius: 5px; margin-bottom: 3px; }
.filter-item span { font-size: 11px; color: var(--text-secondary); }
.filter-item.active span { color: var(--primary-gold); font-weight: 700; }

.transform-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.transform-btn {
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}
.transform-btn:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.editor-canvas-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== placeholder ==================== */
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--radius-md);
    position: relative;
}
.preview-placeholder[style*="background-image"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    border-radius: inherit;
    z-index: 0;
}
.preview-placeholder[style*="background-image"] > * {
    position: relative;
    z-index: 1;
}
.placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: rgba(232,168,56,0.1);
    border: 1px solid rgba(232,168,56,0.2);
    margin-bottom: 16px;
    animation: none;
    box-shadow: none;
}
.placeholder-icon .ti {
    font-size: 28px;
    color: var(--primary-gold);
}
.placeholder-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.placeholder-sub { font-size: 12px; color: var(--text-secondary); }

/* ==================== 子页面装饰隐藏 ==================== */
.page-deco { display: none; }
.page-breadcrumb { display: none; }
.page-highlights { display: none; }
.sr-tip-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.sr-tip { font-size: 13px; color: var(--text-secondary); }

/* 已上传缩略图 */
#uploadedThumbRow,
[id$="ThumbRow"] {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* 更换按钮 */
#reUploadBtn,
[id$="UploadBtn"] {
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    cursor: pointer;
}
#reUploadBtn:hover,
[id$="UploadBtn"]:hover {
    background: rgba(232,168,56,0.1) !important;
    color: var(--primary-gold) !important;
    border-color: var(--primary-gold) !important;
}

/* ==================== 旧首页兼容（隐藏） ==================== */
.hero-section,
.features-section,
.styles-section,
.workflow-section,
.cta-section,
.feat-tabs,
.feat-panel,
.hero-preview,
.hero-particles,
.hero-bg-grid { display: none !important; }

/* ==================== RTL ==================== */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--border-color); }
[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }
[dir="rtl"] .footer { margin-left: 0; margin-right: var(--sidebar-width); }
[dir="rtl"] .sidebar-link { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .sidebar-link.active { border-right-color: var(--primary-gold); }

/* ==================== 移动端折叠面板 ==================== */
.mobile-panel-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.mobile-panel-toggle i { transition: transform 0.3s; font-size: 16px; color: var(--primary-gold); }
.mobile-panel-toggle.collapsed i { transform: rotate(-90deg); }

/* 移动端底部固定操作栏 */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 190;
    gap: 8px;
    align-items: center;
}
.mobile-bottom-bar .btn-primary { flex: 1; margin: 0; padding: 12px 16px; }
.mobile-bottom-bar .btn-secondary { padding: 12px 16px; }

/* 侧边栏关闭按钮 */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.sidebar-close-btn:hover { color: var(--primary-gold); border-color: var(--primary-gold); }

/* ==================== 响应式 ==================== */

/* 中大屏：sidebar可见但空间收紧 */
@media (max-width: 1200px) {
    .home-hero { flex-direction: column; gap: 24px; padding: 32px 0; }
    .home-hero-content { max-width: 100%; flex-shrink: 1; }
    .home-hero-image { max-width: 100%; flex: none; }
    .home-hero-title { font-size: 28px; }
    .wallpaper-showcase { width: 100%; height: 380px; }
    .home-tool-card { width: calc((100vw - var(--sidebar-width) - 48px - 24px) / 3); max-width: 280px; }
}

@media (max-width: 1024px) {
    .wallpaper-content { grid-template-columns: 1fr !important; min-height: auto; }
    .home-hero { flex-direction: column; gap: 24px; padding: 32px 0; }
    .home-hero-content { max-width: 100%; flex-shrink: 1; }
    .home-hero-image { max-width: 100%; flex: none; }
    .wallpaper-showcase { width: 100%; max-width: 1000px; height: 300px; }
    .home-features-grid { grid-template-columns: 1fr; }
    .home-advantages-grid { grid-template-columns: repeat(2, 1fr); }
    .home-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .home-tool-card { width: calc((100vw - var(--sidebar-width) - 48px - 12px) / 2); max-width: 360px; }
    .templates-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 24px; }
    .seo-showcase-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    /* 侧边栏：隐藏，通过JS toggle显示为overlay */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 250;
        box-shadow: none;
        width: 80vw;
        max-width: 300px;
        position: fixed;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .sidebar-close-btn { display: flex; }
    /* 侧边栏遮罩 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: 48px;
        background: rgba(0,0,0,0.5);
        z-index: 240;
    }
    .sidebar-overlay.show { display: block; }
    /* body锁定滚动 */
    body.sidebar-open { overflow: hidden; }
    .main-content { margin-left: 0; padding: var(--spacing-md); }
    .footer { margin-left: 0; padding: 20px 16px 12px; }
    .seo-content { margin-left: 0; }
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        background: var(--bg-tertiary);
        border: none;
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 18px;
        cursor: pointer;
    }
    .home-hero { padding: 24px 0; gap: 20px; }
    .home-hero-content { max-width: 100%; }
    .home-hero-title { font-size: 24px; }
    .home-hero-desc { font-size: 13px; }
    .wallpaper-showcase { height: 220px; }
    .home-section-title { font-size: 18px; }
    .home-workflow { flex-direction: column; gap: 12px; }
    .home-workflow-connector { display: none; }
    .home-cta-inner { flex-direction: column; text-align: center; }
    .home-advantages-grid { grid-template-columns: 1fr; }
    .home-advantage-card { max-height: none; }
    .home-advantage-card { flex-direction: column; }
    .home-advantage-img { width: 100%; height: 120px; }
    .home-advantage-img::before { background: linear-gradient(to bottom, var(--bg-card) 0%, transparent 60%); }
    .home-tools-grid { grid-template-columns: 1fr; }
    .home-tool-card { width: calc(100vw - 48px); max-width: 400px; }
    /* 工具卡片滚动区 snap */
    .home-tools-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
    .home-tools-track { animation: none; }
    .home-tool-card { scroll-snap-align: start; width: 75vw; max-width: 300px; }
    .footer-content { grid-template-columns: 1fr; gap: 16px; }
    .footer-brand-section { max-width: 100%; }
    .templates-grid { grid-template-columns: repeat(2, 1fr); }
    .home-cta { padding: 24px 16px; margin: 20px 0; }
    .home-cta h2 { font-size: 18px; }
    /* 工具页面核心布局 */
    .wallpaper-content { grid-template-columns: 1fr !important; min-height: auto; }
    .wallpaper-right-panel { padding: var(--spacing-md); }
    .wallpaper-left-panel { padding: var(--spacing-md); }
    /* 移动端面板折叠 */
    .mobile-panel-toggle { display: flex; }
    .wallpaper-left-panel.mobile-collapsed {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        border: none;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
    }
    .wallpaper-left-panel.mobile-expanded {
        max-height: 2000px;
        opacity: 1;
        transition: max-height 0.5s ease, opacity 0.3s ease;
    }
    .user-nickname { display: none; }
    .language-select { padding: 8px 28px 8px 10px; font-size: 13px; min-height: 36px; }
    .language-selector { margin-right: 4px; }
    .filter-grid { grid-template-columns: repeat(4, 1fr); }
    .editor-panel { padding: 12px !important; }
    /* 触控优化 - 扩大触控区域 */
    .style-card { padding: 12px 10px; font-size: 14px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .qt-btn { padding: 8px 14px; font-size: 13px; min-height: 36px; }
    .count-btn { padding: 12px 0; min-height: 44px; }
    .mode-btn { padding: 12px 10px; min-height: 44px; }
    .filter-btn { padding: 10px 16px; min-height: 40px; }
    .btn-primary { padding: 14px 24px; font-size: 15px; min-height: 48px; }
    .btn-secondary { padding: 12px 20px; min-height: 44px; }
    /* range slider 触控优化 */
    .range-slider { height: 6px; }
    .range-slider::-webkit-slider-thumb { width: 24px; height: 24px; }
    .range-slider::-moz-range-thumb { width: 24px; height: 24px; }
    /* 上传区域优化 */
    .upload-zone { min-height: 64px; padding: 14px 16px; }
    /* 预览图限高 */
    .preview-image { max-height: 50vh; }
    /* 比较视图移动端适配 */
    .compare-wrap { flex-direction: column; gap: 8px; }
    .compare-arrow { display: none; }
    /* RTL适配 */
    [dir="rtl"] .main-content { margin-right: 0; }
    [dir="rtl"] .footer { margin-right: 0; }
    [dir="rtl"] .sidebar { transform: translateX(100%); right: 0; left: auto; }
    [dir="rtl"] .sidebar.show { transform: translateX(0); }
}

@media (max-width: 480px) {
    .home-hero-title { font-size: 20px; }
    .home-hero-actions { flex-direction: column; }
    .btn-hero-primary, .btn-hero-secondary { width: 100%; justify-content: center; min-height: 48px; }
    .wallpaper-showcase { height: 180px; border-radius: 10px; }
    .style-cards { grid-template-columns: repeat(2, 1fr); }
    .count-selector { flex-wrap: wrap; }
    .home-advantages-grid { gap: 10px; }
    .home-tool-card { width: calc(100vw - 32px); }
    .templates-grid { grid-template-columns: 1fr; }
    .header { padding: 0 12px; }
    .quick-templates { padding: 10px 12px; }
    .qt-btn { font-size: 12px; padding: 8px 12px; }
    .filter-grid { grid-template-columns: repeat(3, 1fr); }
    .page-tool-header h1 { font-size: 16px; }
    .page-tool-desc { display: none; }
    /* 进一步缩紧间距 */
    .form-group { margin-bottom: 16px; }
    .wallpaper-left-panel { padding: 12px; }
    .wallpaper-right-panel { padding: 12px; }
    /* 各页面小网格适配 */
    .st-style-grid, .atm-grid, .style-tag-grid, .i2i-style-grid, .tpl-grid { grid-template-columns: repeat(2, 1fr); }
    .icon-style-grid, .icon-size-grid { grid-template-columns: repeat(2, 1fr); }
    .preset-grid { grid-template-columns: repeat(4, 1fr); }
    .dir-grid { grid-template-columns: repeat(3, 1fr); }
    /* 模态框全屏 */
    .modal-content { max-width: 100vw; max-height: 100vh; padding: 8px; }
    .modal-content img { max-width: 96vw; max-height: 70vh; border-radius: 8px; }
    .modal-close { top: -40px; }
    .modal-download-btn { width: 100%; text-align: center; display: block; padding: 12px 24px; }
}

/* ==================== SEO功能展示区块 ==================== */
.seo-content {
    margin-left: var(--sidebar-width);
    padding: 24px 24px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.seo-content .container { max-width: 1100px; margin: 0 auto; }

/* 展示卡片网格 */
.seo-showcase-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 12px;
}
.seo-showcase-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
}
.seo-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(232,168,56,0.2);
}
.seo-showcase-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.seo-showcase-card:hover .seo-showcase-img {
    transform: scale(1.06);
}
.seo-showcase-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 10px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.seo-showcase-info h3 {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}
.seo-showcase-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    flex-shrink: 0;
}
.seo-keywords {
    text-align: center;
    padding: 8px 0 0;
}
.seo-keywords p {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.3));
    line-height: 1.8;
}
@media (max-width: 1200px) {
    .seo-showcase-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .seo-content { margin-left: 0; padding: 16px 12px; }
    .seo-showcase-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .seo-showcase-grid { grid-template-columns: repeat(2, 1fr); }
}
