:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-dark: #0f0f1a;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 动态背景 */
.background-anim {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(240, 147, 251, 0.15) 0%, transparent 50%);
    z-index: -1;
}

/* 布局 */
.app-container { display: flex; min-height: 100vh; }

/* 玻璃态通用 */
.glass-panel, .glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* 侧边栏 */
.sidebar {
    width: 320px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: 0 20px 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid var(--glass-border);
    background: rgba(15, 15, 26, 0.6);
}

.logo-area h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.divider-line { height: 1px; background: var(--glass-border); margin: 0.5rem 0; }

.settings-group h3 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 输入框组 */
.input-group { margin-bottom: 1rem; }
.input-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 6px;
    display: block;
}

input[type="text"], input[type="password"], input[type="number"], textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

.main-header { margin-bottom: 2rem; text-align: center; }
.main-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.main-header p { color: var(--text-muted); }

/* 输入区 */
.input-section { padding: 1.5rem; margin-bottom: 2.5rem; }
textarea { height: 100px; resize: none; background: rgba(255,255,255,0.05); border: none; font-size: 1.05rem; margin-bottom: 1.5rem; }

.action-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;}
.inspirations { display: flex; gap: 10px; flex-wrap: wrap; }

.chip {
    background: rgba(255,255,255,0.1); border: none; padding: 6px 14px; border-radius: 20px;
    color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 0.85rem;
}
.chip:hover { background: rgba(255,255,255,0.2); color: white; }

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white; border: none; padding: 12px 30px; border-radius: var(--radius-md);
    font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    min-width: 150px; position: relative;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-loading { display: none; }
.btn-primary.loading .btn-content { display: none; }
.btn-primary.loading .btn-loading { display: inline-block; }
.btn-text { background: none; border: none; color: #ff6b6b; cursor: pointer; font-size: 0.9rem; padding: 5px; }
.btn-text:hover { opacity: 0.8; }

/* 画廊 */
.gallery-header { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
.gallery-grid { display: grid; gap: 1.5rem; }
.cols-1 { grid-template-columns: 1fr; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.image-card {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    aspect-ratio: 1/1; background: rgba(0,0,0,0.2); transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}
.image-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.3); z-index: 2; }
.image-card img { width: 100%; height: 100%; object-fit: cover; }

.image-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, transparent);
    padding: 2.5rem 1rem 1rem; opacity: 0; transform: translateY(10px);
    transition: all 0.3s ease;
}
.image-card:hover .image-overlay { opacity: 1; transform: translateY(0); }

.img-prompt {
    font-size: 0.85rem; color: #eee; margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-meta { font-size: 0.7rem; color: #888; display: flex; gap: 10px; margin-bottom: 8px; }
.overlay-actions { display: flex; justify-content: space-between; align-items: center; }
.img-time { font-size: 0.75rem; color: #aaa; }

.btn-icon {
    background: rgba(255,255,255,0.2); color: white; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: 0.2s;
}
.btn-icon:hover { background: var(--primary-color); }

/* Switch & Range */
.toggle-switch { display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 10px; }
.toggle-switch input { display: none; }
.toggle-switch .slider {
    width: 36px; height: 20px; background: #444; border-radius: 20px; position: relative; transition: 0.3s;
}
.toggle-switch .slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; background: white;
    border-radius: 50%; top: 2px; left: 2px; transition: 0.3s;
}
.toggle-switch input:checked + .slider { background: var(--primary-color); }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }

/* 响应式 */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; padding: 1.5rem; }
    .main-content { padding: 1.5rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
.stats-card {
    /* 确保 stats-card 是 glass-card 的样式 */
    padding: 1.5rem;
}

.stats-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

.btn-text {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-text:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.btn-text:active {
    transform: translateY(0);
}

/* 禁用状态 */
.btn-text:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}