/* ============================================================
   辰思阁AI编程 - 前端样式
   署名: 微信 liyuchentopfun / QQ 2473801920
   ============================================================ */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #667eea;
    --accent-hover: #764ba2;
    --accent-glow: rgba(102, 126, 234, 0.3);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #334155;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
.navbar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.logo-icon {
    font-size: 24px;
}

.logo .accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* 主内容 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
}

/* Hero */
.hero {
    text-align: center;
    padding: 48px 0 40px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 .accent {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* 编程区 */
.coding-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-select {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

#prompt-input {
    width: 100%;
    min-height: 200px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    line-height: 1.7;
}

#prompt-input::placeholder {
    color: var(--text-muted);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
}

.generate-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.output-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.code-container {
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
}

.code-container pre {
    margin: 0;
    padding: 16px 20px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-container .placeholder {
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
}

.output-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.output-meta span {
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 20px;
}

/* 预览区 */
.preview-section {
    margin-bottom: 32px;
}

.preview-frame {
    width: 100%;
    min-height: 400px;
    border: none;
    background: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* 关于 */
.about-section {
    text-align: center;
    padding: 48px 0;
}

.about-section h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.about-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.footer-contact {
    font-size: 12px !important;
}

/* Toast */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--error);
    color: #fff;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 加载动画 */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 响应式 */
@media (max-width: 900px) {
    .coding-section {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .stats-row {
        gap: 24px;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 24px 16px;
    }
    
    .hero {
        padding: 32px 0 24px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero-desc {
        font-size: 15px;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .generate-btn {
        width: 100%;
    }
}
