/* 图灵工坊 - 公共前台样式 */

/* Fixed navbar body offset */
body {
    padding-top: 3.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 30% 50%, rgba(13, 110, 253, 0.15), transparent 60%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Rotating words animation (JS-driven) */
.rotate-words {
    display: inline-block;
    color: #0d6efd;
    font-weight: 700;
    min-width: 3em;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Skill Cards */
.skill-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.skill-card .card-body {
    min-height: 120px;
}

.skill-card .skill-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 4px;
}

.skill-card .skill-name {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    text-decoration: none;
}

.skill-card .skill-name:hover {
    color: #0d6efd;
}

.skill-card .skill-author {
    font-size: 0.85rem;
    color: #6c757d;
}

.skill-card .skill-desc {
    font-size: 0.875rem;
    color: #495057;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Cards */
.category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: inherit;
}

/* CLI Code Block */
.cli-code-block {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.cli-code-block code {
    color: #e0e0e0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
}

.cli-code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cli-code-block .copy-btn:hover {
    opacity: 1;
}

/* 防止 .markdown-content 给 .cli-code-block 内的 code 加浅色背景，导致浅色文字看不清 */
.markdown-content .cli-code-block code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #e0e0e0;
}

/* Tag Cloud */
.tag-pill {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 50rem;
    background: #f0f2f5;
    color: #495057;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.tag-pill:hover {
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
}

/* Screenshot Carousel */
.screenshot-carousel .carousel-item img {
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.screenshot-carousel .carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Markdown Content */
.markdown-content h1 { font-size: 1.75rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.markdown-content h2 { font-size: 1.5rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.markdown-content h3 { font-size: 1.25rem; margin-top: 1rem; margin-bottom: 0.5rem; }
.markdown-content h4 { font-size: 1.1rem; margin-top: 0.75rem; margin-bottom: 0.5rem; }
.markdown-content p { margin-bottom: 0.75rem; line-height: 1.7; }
.markdown-content pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.markdown-content code {
    background: #f0f2f5;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}
.markdown-content pre code {
    background: transparent;
    padding: 0;
}
.markdown-content ul, .markdown-content ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.markdown-content blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}
.markdown-content table { width: 100%; margin-bottom: 1rem; }
.markdown-content th, .markdown-content td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
}
.markdown-content th { background: #f8f9fa; }

/* Version List */
.version-item {
    border-left: 3px solid #0d6efd;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

/* Stats Sidebar */
.stats-card .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.stats-card .stat-item:last-child {
    border-bottom: none;
}

.stats-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.stats-card .stat-value {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Related Skills */
.related-skill-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

.related-skill-item:hover {
    color: #0d6efd;
}

.related-skill-item:last-child {
    border-bottom: none;
}

/* Search Page */
.search-input-lg {
    font-size: 1.25rem;
    padding: 0.75rem 1.25rem;
    border-radius: 50rem;
}

/* Filter Tabs */
.filter-tabs .nav-link {
    color: #495057;
    border-radius: 50rem;
    padding: 0.35rem 1rem;
    font-size: 0.875rem;
}

.filter-tabs .nav-link.active {
    background: #0d6efd;
    color: #fff;
}

.filter-tabs .nav-link:hover:not(.active) {
    background: #f0f2f5;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Docs Page */
.docs-nav .nav-link {
    color: #495057;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

.docs-nav .nav-link:hover {
    background: #f0f2f5;
    color: #0d6efd;
}

.docs-body section {
    scroll-margin-top: 4.5rem;
}

.docs-body table th {
    background: transparent;
    font-weight: 500;
}

.docs-body .alert {
    border-left-width: 4px;
}

/* 文档页终端命令块：自包含样式，避免与 .markdown-content code 冲突 */
.docs-code {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}

.docs-code code {
    color: #e8e8e8;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre;
    display: block;
}

/* OS 命令块上方的系统标签 */
.docs-os-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
}

/* 路径信息盒子 */
.docs-paths {
    background: #f8f9fa;
    border-left: 3px solid #0d6efd;
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
}

.docs-paths > div + div {
    margin-top: 0.2rem;
}

.docs-paths .docs-path-label {
    display: inline-block;
    color: #6c757d;
    font-weight: 600;
    min-width: 130px;
}

.docs-paths code {
    color: #d63384;
    word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .skill-card .card-body {
        min-height: auto;
    }
}
