/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== 顶部导航 ===== */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ===== 介绍横幅 ===== */
.intro-banner {
    background: white;
    padding: 2.5rem;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.intro-banner h2 {
    color: #667eea;
    margin-bottom: 0.8rem;
    font-size: 1.8rem;
}

.intro-banner p {
    color: #666;
    font-size: 1.1rem;
}

/* ===== 搜索和筛选区 ===== */
.search-section {
    margin: 2rem auto;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
}

#search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease;
}

#search-btn:hover {
    transform: translateY(-2px);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e1e5eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-tag:hover,
.filter-tag.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===== 模板网格 ===== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    padding-bottom: 3rem;
}

.template-card {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid #667eea;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.template-card h3 {
    color: #333;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.template-card .scenario {
    display: inline-block;
    background: #f0f4ff;
    color: #667eea;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.template-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f5f7fa;
    color: #666;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.template-card .preview {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card .action-hint {
    margin-top: 1rem;
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
    font-size: 1.1rem;
}

/* ===== 弹窗样式 ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0 2rem;
    flex-wrap: wrap;
}

.meta-tag {
    background: #f0f4ff;
    color: #667eea;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.prompt-section,
.tips-section,
.example-section {
    margin-bottom: 2rem;
}

.prompt-section h3,
.tips-section h3,
.example-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.prompt-text,
.example-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    white-space: pre-wrap;
    font-family: "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
    overflow-x: auto;
}

.copy-btn {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
}

.copy-btn.copied {
    background: #10b981;
}

/* ===== 页脚 ===== */
.site-footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.site-footer a {
    color: #667eea;
}

.site-footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #718096;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
}
