/* style.css (请替换现有内容) */

/* =============================================================== */
/* --- 1. 新增：页眉和页脚的通用样式 --- */
/* =============================================================== */

/* 页眉样式 */
.official-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    box-sizing: border-box;
}
.logo-group img {
    height: 40px;
}
.official-header nav a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    margin-left: 30px;
    transition: color 0.3s;
}
.official-header nav a:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

/* 页脚样式 */
.footer {
    width: 100%;
    background-color: #f1f3f4;
    color: #5f6368;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    margin-top: 20px; 
}
.footer a {
    color: #5f6368;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}
.footer a:hover {
    color: #1a73e8;
    text-decoration: underline;
}

/* =============================================================== */
/* --- 2. 页面主体布局和内容样式 (原样式，为兼容固定页眉做微调) --- */
/* =============================================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 修正：为固定页眉留出空间 */
.main-content-wrapper {
    flex-grow: 1;
    padding-top: 85px; /* 预留头部高度 */
    padding-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
    font-size: 1.8em;
}

/* 主题卡片布局 - 保持不变 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.theme-card {
    /* 移除：height: 400px; 或其他固定值 */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column; /* 垂直堆叠：容器在上，内容在下 */
}

.theme-content {
    padding: 15px;
    flex-grow: 1; /* 允许内容区域伸展以适应剩余空间，但如果容器被固定，这个作用有限 */
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* 预览图容器样式 - 保持不变 */
.preview-image-container {
    width: 100%;
    /* 移除 padding-top: 56.25%; 或 aspect-ratio，让 JS 动态控制比例 */
    position: relative; 
    background-color: #e9ecef; /* 留白区域的背景色 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 预览图图片样式 - 核心修改在这里 */
.preview-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 关键修改：使用 contain 来确保图片完整显示，不裁剪 */
    object-fit: contain; 
}

.theme-content {
    padding: 15px;
    flex-grow: 1;
}

.theme-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 10px;
    color: #007bff;
}

.prompt-label {
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.prompt-text-wrapper {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}

.prompt-text {
    font-size: 0.9em;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 复制按钮样式 - 保持不变 */
.copy-prompt {
    display: block;
    width: 100%; 
    margin-top: 15px;
    padding: 10px;
    background-color: #343a40;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.2s;
}
.copy-prompt:hover {
    background-color: #23272b; 
}

/* 通用按钮样式 - 保持不变 */
.utility-button, .load-more-button {
    padding: 12px 30px; 
    font-size: 16px; 
    cursor: pointer; 
    background-color: #343a40;
    color: white; 
    border: none; 
    border-radius: 5px;
    transition: background-color 0.2s;
    margin-top: 10px;
}
.utility-button:hover, .load-more-button:hover {
     background-color: #23272b;
}
.utility-button:disabled, .load-more-button:disabled {
     background-color: #adb5bd;
     cursor: not-allowed;
}

/* 移动端/较小屏幕适配 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .main-content-wrapper {
        padding-top: 90px; /* 移动端 header 稍高 */
    }
    .container {
        padding: 15px;
        box-shadow: none;
    }
    h1 {
        font-size: 1.5em;
    }
    .theme-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
        gap: 20px;
    }
    .official-header {
        padding: 15px 20px; /* 移动端内边距减小 */
    }
}