/* Prompt Bible Styles */

/* 修复 Sticky 定位可能失效的问题 */
main {
    overflow: visible !important;
}

.prompt-main {
    padding: 2rem 0;
    background-color: #f8f9fa;
    min-height: calc(100vh - 160px);
}

.container {
    max-width: 1400px; /* 增加宽度以适应新布局 */
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: flex-start; /* 确保子元素高度自适应，不拉伸 */
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* height: fit-content;  不需要，align-items: flex-start 已经处理了 */
    position: -webkit-sticky; /* Safari 兼容 */
    position: sticky;
    top: 90px; /* 稍微加大一点间距 */
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    z-index: 10;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-group {
    margin-bottom: 1rem;
}

.nav-group-title {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 0.4rem 1rem 0.4rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: #f0f7ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

/* Content */
.content {
    flex: 1;
    min-width: 0;
}

.content-header {
    margin-bottom: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-header h1 {
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
    font-size: 2rem;
}

.content-header p {
    margin: 0;
    color: #666;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.subcategory-section {
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
}

.subcategory-title {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.subcategory-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: #2563eb;
    margin-right: 0.5rem;
    border-radius: 2px;
}

.prompt-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.prompt-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .prompt-card {
        flex-direction: row;
    }
}

/* Prompt Section */
.prompt-section {
    flex: 1;
    padding: 1.5rem;
    background-color: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.prompt-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
    margin-bottom: 1rem;
    flex: 1;
}

.copy-btn {
    align-self: flex-start;
    background-color: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.copy-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

/* Response Section */
.response-section {
    flex: 1.2;
    padding: 1.5rem;
    background-color: #fcfcfc;
}

.response-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.response-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
}

.model-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.response-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

.response-image {
    margin-top: 0.8rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #eee;
}

.response-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0 10px;
        gap: 1rem;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        max-height: 250px; /* 限制高度，避免占据首屏 */
        overflow-y: auto;
        border: 1px solid #e5e7eb;
        margin-bottom: 1rem;
    }

    .sidebar-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 5;
    }
    
    .content-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .prompt-card {
        flex-direction: column;
    }
    
    .prompt-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem;
    }

    .response-section {
        padding: 1rem;
    }

    .prompt-text {
        font-size: 13px; /* 稍微减小字体 */
        padding: 0.8rem;
        overflow-x: auto; /* 确保长代码可滚动 */
    }
}