/* ============================================
   闪影AI - 样式表
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --secondary: #f59e0b;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== Navbar ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
    flex-shrink: 0;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-key {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-key:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-theme {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-theme:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.btn-mobile-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    font-size: 20px;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 8px 24px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.mobile-menu a {
    padding: 10px 0;
    color: var(--text-secondary);
    text-decoration: none !important;
    font-size: 15px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* ========== Main ========== */
main {
    min-height: calc(100vh - 64px - 80px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ========== Hero ========== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 80px 24px 60px;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-bg {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(168,85,247,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(99,102,241,0.2);
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 48px;
}

.btn-primary {
    padding: 12px 28px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 28px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-lg {
    padding: 14px 36px;
    font-size: 17px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.hero-visual {
    flex: 1;
    position: relative;
    z-index: 1;
    height: 400px;
    display: none;
}

@media (min-width: 1024px) {
    .hero-visual {
        display: block;
    }
}

.hero-card {
    position: absolute;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 16px;
    animation: float 3s ease-in-out infinite;
    white-space: nowrap;
}

.card-1 { top: 10%; left: 10%; animation-delay: 0s; }
.card-2 { top: 25%; right: 10%; animation-delay: 0.5s; }
.card-3 { bottom: 25%; left: 5%; animation-delay: 1s; }
.card-4 { bottom: 10%; right: 15%; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========== Section Common ========== */
.section-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 48px;
}

/* ========== Features ========== */
.features-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.feature-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* ========== Quick Start ========== */
.quickstart-section {
    background: var(--bg-secondary);
    padding: 80px 24px;
}

.quickstart-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.quickstart-content h2 {
    font-size: 32px;
    margin-bottom: 48px;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    width: 220px;
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-secondary);
    font-size: 14px;
}

.step-arrow {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
}

/* ========== FAQ ========== */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-q {
    padding: 18px 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
    user-select: none;
}

.faq-q:hover {
    background: var(--bg-secondary);
}

.faq-q span {
    transition: transform var(--transition);
}

.faq-item.open .faq-q span {
    transform: rotate(180deg);
}

.faq-a {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-item.open .faq-a {
    padding: 0 24px 18px;
    max-height: 200px;
}

/* ========== Workspace ========== */
.workspace {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

.workspace-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.workspace-sidebar h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-section select,
.sidebar-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: border var(--transition);
}

.sidebar-section select:focus,
.sidebar-section input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ========== 模型快捷选择 ========== */
.model-quick-select {
    display: flex;
    gap: 8px;
}

.model-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.model-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.model-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.workspace-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* ========== Prompt Area ========== */
.prompt-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.prompt-area textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: border var(--transition);
}

.prompt-area textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.prompt-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.prompt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.tag {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    color: var(--text-secondary);
}

.tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-generate {
    padding: 14px 32px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
    white-space: nowrap;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== Result Area ========== */
.result-area {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-empty {
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.result-empty p {
    font-size: 15px;
}

.result-loading {
    text-align: center;
}

.result-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    width: 100%;
}

.result-image-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

.result-image-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.result-image-item img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.result-image-item .img-actions {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.result-image-item .img-actions button {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.result-image-item .img-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.result-video {
    width: 100%;
    text-align: center;
}

.result-video video {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ========== Ref Upload ========== */
.ref-upload {
    position: relative;
}

.ref-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.ref-preview {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    transition: all var(--transition);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ref-preview:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.ref-preview.has-image {
    border-style: solid;
    padding: 4px;
}

.ref-preview img {
    max-height: 120px;
    border-radius: 4px;
}

/* ========== History ========== */
.history-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.history-header h2 {
    font-size: 28px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.history-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.history-card:hover {
    box-shadow: var(--shadow-md);
}

.history-card img,
.history-card video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.history-card .card-info {
    padding: 16px;
}

.history-card .card-prompt {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.history-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.history-card .card-actions {
    display: flex;
    gap: 8px;
}

.history-card .card-actions button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.history-card .card-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========== Guide ========== */
.guide-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.guide-page h2 {
    font-size: 28px;
    margin-bottom: 32px;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.guide-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.guide-card p, .guide-card li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 6px;
}

.guide-card ul {
    padding-left: 20px;
}

.guide-card code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}

.guide-code {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--primary);
    margin-top: 8px;
    word-break: break-all;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-icon {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

.api-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

[data-theme="dark"] .api-info {
    background: #052e16;
    border-color: #166534;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background: #22c55e;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-note {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.modal-note p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ========== Preview Modal ========== */
.preview-modal {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.preview-modal img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 18px;
}

.preview-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Footer ========== */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 32px 24px;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-copy p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        padding: 40px 24px;
        text-align: center;
    }
    .hero-title { font-size: 36px; }
    .hero-actions { justify-content: center; flex-wrap: wrap; }
    .hero-stats { justify-content: center; flex-wrap: wrap; }
    .workspace { flex-direction: column; }
    .workspace-sidebar { width: 100%; }
    .result-images { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .btn-mobile-menu { display: flex; }
    .mobile-menu.show { display: flex; }
    .hero-title { font-size: 28px; }
    .hero-desc { font-size: 15px; }
    .hero-stats { gap: 20px; }
    .features-grid { grid-template-columns: 1fr; }
    .steps { flex-direction: column; align-items: center; }
    .step-arrow { transform: rotate(90deg); }
    .prompt-actions { flex-direction: column; }
    .btn-generate { width: 100%; text-align: center; }
    .footer-content { flex-direction: column; text-align: center; }
    .history-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .result-images { grid-template-columns: 1fr; }
    .stat-item { align-items: center; }
}
