/* ============================================
   图片转PDF工具 - 电影级沉浸式太空主题 v3
   系统字体栈 · 深色/浅色主题 · 响应式
   灵感来源: SpaceEdu 太空教育模板
   ============================================ */

/* --- CSS Variables (Dark Theme - Default) --- */
:root {
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;

    /* 深色主题 */
    --bg-body: #060a15;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-alt: rgba(20, 30, 50, 0.5);
    --bg-input: rgba(15, 23, 42, 0.7);

    --text-primary: #e8edf5;
    --text-secondary: #8b9cc0;
    --text-muted: #556585;

    --accent: #5b9fe6;
    --accent-hover: #74b0ed;
    --accent-light: rgba(91, 159, 230, 0.08);
    --accent-glow: rgba(91, 159, 230, 0.25);
    --accent-gradient: linear-gradient(135deg, #5b9fe6 0%, #a78bfa 50%, #22d3ee 100%);

    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-dashed: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-accent: 0 4px 20px rgba(91, 159, 230, 0.2);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;

    --toast-bg: rgba(15, 23, 42, 0.95);
    --toast-text: #e8edf5;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Light Theme --- */
[data-theme="light"] {
    --bg-body: #eef2f7;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-alt: rgba(247, 249, 252, 0.7);
    --bg-input: rgba(240, 244, 248, 0.85);

    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-muted: #8e9bae;

    --accent: #4A90D9;
    --accent-hover: #3a7bc8;
    --accent-light: rgba(74, 144, 217, 0.06);
    --accent-glow: rgba(74, 144, 217, 0.2);
    --accent-gradient: linear-gradient(135deg, #4A90D9 0%, #8b5cf6 50%, #06b6d4 100%);

    --border: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.14);
    --border-dashed: rgba(0, 0, 0, 0.15);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.1);
    --shadow-accent: 0 4px 16px rgba(74, 144, 217, 0.15);

    --toast-bg: rgba(26, 35, 50, 0.95);
    --toast-text: #ffffff;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    transition: background var(--transition-slow), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ============================================
   粒子星空 Canvas
   ============================================ */
#starCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   浮动光球层
   ============================================ */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 1.5s ease;
}

.anim .orb { opacity: 0; }
.anim.play .orb { opacity: 1; }

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation: orbFloat1 22s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation: orbFloat2 26s ease-in-out infinite;
    animation-delay: -8s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(34,211,238,0.15) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    animation: orbFloat3 20s ease-in-out infinite;
    animation-delay: -14s;
}

[data-theme="light"] .orb-1 {
    background: radial-gradient(circle, rgba(74,144,217,0.15) 0%, transparent 70%);
}
[data-theme="light"] .orb-2 {
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
}
[data-theme="light"] .orb-3 {
    background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -35px) scale(1.06); }
    66% { transform: translate(-25px, 25px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-35px, 30px) scale(1.04); }
    66% { transform: translate(30px, -20px) scale(0.96); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(25px, -30px) scale(1.08); }
}

/* ============================================
   入场动画系统
   ============================================ */

/* 初始隐藏 */
.anim .ent-fade,
.anim .ent-rise,
.anim .ent-reveal,
.anim .ent-settle,
.anim .ent-draw {
    opacity: 0;
}
.anim .ent-rise { transform: translateY(20px); }
.anim .ent-reveal { transform: translateY(14px) scale(0.97); }
.anim .ent-settle { transform: translateY(12px) scale(0.97); }
.anim .ent-draw { transform: scaleX(0); }

/* 播放 */
.anim.play .ent-fade {
    animation: entFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim.play .ent-rise {
    animation: entRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim.play .ent-reveal {
    animation: entReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim.play .ent-settle {
    animation: entSettle 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.anim.play .ent-draw {
    animation: entDraw 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 延迟序列 */
.anim.play .ent-delay-0 { animation-delay: 0.1s; }
.anim.play .ent-delay-1 { animation-delay: 0.2s; }
.anim.play .ent-delay-2 { animation-delay: 0.4s; }
.anim.play .ent-delay-3 { animation-delay: 0.55s; }
.anim.play .ent-delay-4 { animation-delay: 0.7s; }
.anim.play .ent-delay-5 { animation-delay: 0.9s; }

@keyframes entFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes entRise { from { opacity: 0; transform: translateY(20px) } to { opacity: 1; transform: none } }
@keyframes entReveal { from { opacity: 0; transform: translateY(14px) scale(0.97) } to { opacity: 1; transform: none } }
@keyframes entSettle { from { opacity: 0; transform: translateY(12px) scale(0.97) } to { opacity: 1; transform: none } }
@keyframes entDraw { from { transform: scaleX(0) } to { transform: scaleX(1) } }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .anim .ent-fade, .anim .ent-rise, .anim .ent-reveal,
    .anim .ent-settle, .anim .ent-draw {
        opacity: 1 !important;
        transform: none !important;
    }
    .orb { display: none; }
}

/* ============================================
   CDN Error Overlay
   ============================================ */
.cdn-error {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-body);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.cdn-error.show { display: flex; }
.cdn-error-inner {
    text-align: center;
    max-width: 400px;
    animation: entRise 0.5s ease-out;
}
.cdn-error-icon {
    color: var(--danger);
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}
.cdn-error-inner h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.cdn-error-inner p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.cdn-error-inner button {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.7rem 2rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-accent);
}
.cdn-error-inner button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* ============================================
   App Container
   ============================================ */
.app {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    overflow: hidden;
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all var(--transition);
    overflow: hidden;
}
[data-theme="light"] .theme-toggle {
    background: rgba(255,255,255,0.6);
    border-color: rgba(0,0,0,0.08);
}
.theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 20px var(--accent-glow);
}
.theme-toggle:active { transform: scale(0.95); }

.theme-icon {
    font-size: 1.15rem;
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="light"] .light-icon, :root .light-icon { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .dark-icon, :root .dark-icon { opacity: 0; transform: scale(0.5) rotate(90deg); }
[data-theme="dark"] .light-icon { opacity: 0; transform: scale(0.5) rotate(-90deg); }
[data-theme="dark"] .dark-icon { opacity: 1; transform: scale(1) rotate(0deg); }

/* ============================================
   Header
   ============================================ */
.header {
    text-align: center;
    flex-shrink: 0;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 8px 30px var(--accent-glow), 0 0 40px rgba(91,159,230,0.15);
    position: relative;
    animation: logoFloat 5s ease-in-out infinite;
}
.header-logo::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: calc(var(--radius-md) + 6px);
    background: var(--accent-gradient);
    opacity: 0.15;
    z-index: -1;
    filter: blur(16px);
    animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes logoPulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.08); }
}

.header-title {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.35rem;
    line-height: 1.15;
    position: relative;
}
/* 标题光晕 */
.header-title::after {
    content: '图片转PDF';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(30px);
    opacity: 0.3;
    pointer-events: none;
}

.header-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* ============================================
   Main Content Layout
   ============================================ */
.main-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ============================================
   Divider
   ============================================ */
.divider {
    display: none; /* 在grid布局中隐藏分隔线，用gap代替 */
}

/* ============================================
   Upload Zone
   ============================================ */
.upload-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}

.upload-zone {
    border: 2px dashed var(--border-dashed);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--accent-light), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.upload-zone:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 40px var(--accent-glow);
    transform: translateY(-2px);
}
.upload-zone:hover::before { opacity: 1; }

.upload-zone.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-lg), 0 0 60px var(--accent-glow);
    transform: scale(1.01);
}
.upload-zone.drag-over::before {
    opacity: 1;
    animation: pulseInner 1.5s ease-in-out infinite;
}
@keyframes pulseInner {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.upload-zone-inner {
    text-align: center;
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: var(--accent);
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: center;
    animation: uploadPulse 3s ease-in-out infinite;
}
@keyframes uploadPulse {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-5px); opacity: 1; }
}
.upload-zone:hover .upload-icon { animation: none; }
.upload-zone:hover .upload-icon svg { transform: scale(1.15); transition: transform var(--transition); }

.upload-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.3rem;
}
.upload-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.upload-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    opacity: 0.7;
}

/* ============================================
   光泽 Pill 选择图片按钮
   ============================================ */
.btn-select-images {
    font-family: var(--font-body);
    background: linear-gradient(180deg, #ffffff 0%, #d6e8f8 4%, #d9ecfe 72%, #ffffff 100%);
    color: #0a1628;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 12px 32px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.9rem;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 18px -8px rgba(255,255,255,0.5),
        0 0 26px rgba(255,255,255,0.15),
        inset 0 0 0 2px rgba(255,255,255,0.9);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-select-images::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, transparent 100%);
    border-radius: 999px 999px 0 0;
    pointer-events: none;
}
.btn-select-images:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 14px 28px -8px rgba(255,255,255,0.6),
        0 0 40px rgba(255,255,255,0.2),
        inset 0 0 0 2px rgba(255,255,255,0.95);
}
.btn-select-images:active {
    transform: translateY(-1px) scale(1.01);
}

[data-theme="light"] .btn-select-images {
    background: linear-gradient(180deg, #ffffff 0%, #e0ecf8 4%, #e3effe 72%, #ffffff 100%);
    box-shadow:
        0 10px 18px -8px rgba(74,144,217,0.3),
        0 0 26px rgba(74,144,217,0.1),
        inset 0 0 0 2px rgba(255,255,255,0.9);
}

/* ============================================
   Preview Area
   ============================================ */
.preview-area {
    margin-top: 1rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}
.preview-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.image-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    padding: 0 7px;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-clear-all {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    background: transparent;
    border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-clear-all:hover {
    background: var(--danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* ============================================
   Preview Grid - 玻璃拟态卡片
   ============================================ */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
}
.preview-item {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    box-shadow: var(--shadow-sm);
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
.preview-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow);
    transform: translateY(-4px);
}
.preview-item:hover .preview-thumb { filter: brightness(1.05) saturate(1.05); }
.preview-item.dragging { opacity: 0.35; transform: scale(0.92); border-color: var(--accent); }
.preview-item.drag-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.preview-item::before {
    content: attr(data-seq);
    position: absolute;
    top: 6px; left: 6px;
    z-index: 2;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition);
}
.preview-item:hover::before { opacity: 1; }

.preview-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg-card-alt);
    transition: filter var(--transition);
}
.preview-name {
    padding: 0.35rem 0.5rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-card-alt);
}
.preview-delete {
    position: absolute;
    top: 5px; right: 5px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition);
    line-height: 1;
    backdrop-filter: blur(4px);
    z-index: 3;
}
.preview-item:hover .preview-delete { opacity: 1; }
.preview-delete:hover {
    background: var(--danger);
    transform: scale(1.25) rotate(10deg);
}

/* ============================================
   Settings Section - 玻璃拟态卡片
   ============================================ */
.settings-section {
    position: relative;
}
.settings-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all var(--transition);
}
[data-theme="light"] .settings-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.settings-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.12);
}

.settings-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.settings-title svg { color: var(--accent); flex-shrink: 0; }

.setting-group {
    margin-bottom: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.setting-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.setting-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.select-wrapper { position: relative; }
.setting-select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2.2rem 0.5rem 0.7rem;
    cursor: pointer;
    appearance: none;
    transition: all var(--transition);
}
.setting-select:hover { border-color: var(--border-hover); }
.setting-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 15px var(--accent-glow);
}
.select-arrow {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.setting-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    transition: all var(--transition);
}
.setting-input:hover { border-color: var(--border-hover); }
.setting-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 15px var(--accent-glow);
}

/* ============================================
   光泽生成按钮 - 蓝色渐变 Pill
   ============================================ */
.btn-generate {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #3b82f6 100%);
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 20px -6px rgba(59,130,246,0.5),
        0 0 30px rgba(99,102,241,0.15),
        inset 0 0 0 1.5px rgba(255,255,255,0.2);
}
.btn-generate::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    border-radius: 999px 999px 0 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.btn-generate:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 12px 30px -6px rgba(59,130,246,0.6),
        0 0 50px rgba(99,102,241,0.2),
        inset 0 0 0 1.5px rgba(255,255,255,0.3);
}
.btn-generate:hover:not(:disabled)::before { opacity: 0.7; }
.btn-generate:active:not(:disabled) { transform: translateY(-1px) scale(1.01); }
.btn-generate:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.3);
}

/* ============================================
   Settings Tip
   ============================================ */
.settings-tip {
    margin-top: 0.7rem;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(91,159,230,0.1);
}
.settings-tip p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: var(--toast-bg);
    color: var(--toast-text);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}
.toast.toast-out { animation: toastOut 0.3s ease-in forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 800px) {
    .app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 1.5rem 1rem 3rem;
    }
    body { overflow: auto; }
    .main-content {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .header-title { font-size: 2.2rem; }
    .upload-zone { min-height: 160px; padding: 1.5rem 1rem; }
    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.65rem;
    }
    .settings-section { position: static; }
}

@media (max-width: 480px) {
    .app { padding: 1rem 0.75rem 2.5rem; }
    .header-title { font-size: 1.8rem; }
    .header-logo { width: 52px; height: 52px; }
    .header-logo svg { width: 28px; height: 28px; }
    .header-subtitle { font-size: 0.88rem; }
    .upload-zone { min-height: 140px; padding: 1.2rem 0.8rem; border-radius: var(--radius-md); }
    .upload-icon svg { width: 38px; height: 38px; }
    .preview-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
    .settings-card { padding: 1rem; }
    .toast-container { left: 1rem; right: 1rem; transform: none; }
    .toast { max-width: 100%; }
    .theme-toggle { top: 0.75rem; right: 0.75rem; width: 42px; height: 42px; }
    .btn-select-images { padding: 10px 24px; font-size: 0.88rem; }
}
