/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题颜色 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --background-dark: #0f172a;
    --background-card: #1e293b;
    --background-lighter: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ========== 顶部导航栏 ========== */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
    }
    50% {
        filter: drop-shadow(0 2px 12px rgba(102, 126, 234, 0.5));
    }
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--background-lighter);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--primary-color);
}

/* ========== 主内容区域 ========== */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px 40px;
}

.content-container {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 35px;
    position: relative;
}

/* ========== 左侧提示词配置区域 ========== */
.prompt-section {
    background: var(--background-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.section-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.prompt-content {
    min-height: 400px;
}

/* ========== 右侧提示词预览区域（固定悬浮） ========== */
.preview-section {
    position: sticky;
    top: 90px;
    height: fit-content;
    animation: fadeInRight 0.6s ease 0.2s backwards;
    align-self: start;
}

.preview-section .section-header h2 {
    font-size: 22px;
}

.preview-content {
    background: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: var(--background-dark);
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: var(--background-lighter);
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
    background: var(--background-lighter);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--secondary-color);
}

.btn-selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
    color: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
}

/* ========== 底部 ========== */
.footer {
    background: var(--background-card);
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

.footer-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== 动画效果 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .content-container {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: static;
    }

    .preview-content {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .nav-list {
        display: none;
    }

    .main-content {
        padding: 20px;
    }

    .prompt-section {
        padding: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-container {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .header-container {
        height: 60px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .btn {
        font-size: 14px;
        padding: 12px 20px;
    }
}
