/* ========================================
   全局基础样式 (blog-common)
   由 blog.php 文章页和列表页共用
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #4dabf7 !important;
}

/* 首页横幅 */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
    background-color: var(--bs-body-bg);
    transition: background-color 0.3s ease;
}

/* 背景媒体（视频或图片） */
.hero-bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 背景图片层 */
.hero-bg-image {
    z-index: 0;
    transition: opacity 1s ease, background-color 0.3s ease;
}

/* 背景视频层 */
.hero-bg-video {
    z-index: 1;
    opacity: 1;
    transition: opacity 1s ease;
}

/* 遮罩层 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* 内容层 */
.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-section h1 {
    animation: fadeInUp 1s ease-out;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 关于我们 */
.about-content {
    font-size: 1.1rem;
    text-align: justify;
}

.about-content h1, .about-content h2, .about-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.about-content p {
    margin-bottom: 1rem;
}

/* 团队卡片 */
.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.team-card img {
    height: 250px;
    object-fit: cover;
}

.member-desc {
    font-size: 0.9rem;
    color: #666;
}

/* 博客卡片 */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 博客文章页 */
.blog-post {
    max-width: 1000px;
    margin: 0 auto;
}

/* 评论区容器 */
.comments-section {
    max-width: 1000px;
    margin: 0 auto;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-content a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
}

/* 代码块样式 */
.code-block-wrapper {
    position: relative;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e4e8;
    display: flex;
    flex-direction: column;
}

.code-block-wrapper pre {
    margin: 0;
    overflow-x: auto;
}

/* 行内代码 */
.post-content > p code,
.post-content > ul code,
.post-content > ol code,
.post-content > div code,
.post-content > span code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', monospace;
    font-size: 0.9em;
    color: #e06c75;
    border: 1px solid #e1e4e8;
}

.post-content pre {
    position: relative;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    line-height: 1.5;
}

.post-content pre code {
    background: transparent !important;
    padding: 16px 20px;
    color: #333333 !important;
    font-size: 14px;
    line-height: 1.6;
    border: none !important;
    display: block;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', monospace;
    text-shadow: none;
}

.code-block-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid #e1e4e8;
    border-radius: 6px 6px 0 0;
}

.code-language {
    font-size: 11px;
    color: #666666;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    margin-right: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-copy-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #d1d5db;
    color: #4b5563;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1f2937;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.code-copy-btn:active {
    transform: translateY(0);
}

.code-copy-btn.copied {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
}

.code-block-wrapper::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.code-block-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 5px;
}

.code-block-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 5px;
    border: 2px solid #f3f4f6;
}

.code-block-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 语法高亮 */
.post-content pre .token.comment,
.post-content pre .token.prolog,
.post-content pre .token.doctype,
.post-content pre .token.cdata {
    color: #6b7280;
    font-style: italic;
}

.post-content pre .token.punctuation {
    color: #4b5563;
}

.post-content pre .token.namespace {
    opacity: .7;
}

.post-content pre .token.property,
.post-content pre .token.tag,
.post-content pre .token.boolean,
.post-content pre .token.number,
.post-content pre .token.constant,
.post-content pre .token.symbol,
.post-content pre .token.deleted {
    color: #d97706;
}

.post-content pre .token.selector,
.post-content pre .token.attr-name,
.post-content pre .token.string,
.post-content pre .token.char,
.post-content pre .token.builtin,
.post-content pre .token.inserted {
    color: #16a34a;
}

.post-content pre .token.operator,
.post-content pre .token.entity,
.post-content pre .token.url,
.post-content pre .token.variable {
    color: #0ea5e9;
}

.post-content pre .token.atrule,
.post-content pre .token.attr-value,
.post-content pre .token.function,
.post-content pre .token.class-name {
    color: #3b82f6;
}

.post-content pre .token.keyword {
    color: #9333ea;
    font-weight: 600;
}

.post-content pre .token.regex,
.post-content pre .token.important {
    color: #d97706;
}

.code-block-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.code-block-wrapper:focus-within .code-copy-btn {
    opacity: 1;
}

@media (max-width: 768px) {
    .code-block-wrapper {
        border-radius: 6px;
        margin: 1rem 0;
    }
    .post-content pre code {
        padding: 12px 16px;
        font-size: 13px;
        line-height: 1.5;
    }
    .code-copy-btn {
        top: 6px;
        right: 6px;
        padding: 4px 10px;
        font-size: 11px;
        opacity: 1;
    }
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #666;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.post-content ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

/* 页脚 */
footer {
    margin-top: 4rem;
    background: #ffffff !important;
    border-top: 1px solid #dee2e6;
}

footer .container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

footer > .container > p:first-child {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #495057;
    font-weight: 400;
}

footer .container > div:nth-child(2) {
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

footer a.text-white {
    color: #6c757d !important;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

footer a.text-white:hover {
    color: #007bff !important;
    text-decoration: underline;
    transform: translateY(-2px);
}

footer .bi-file-earmark-text,
footer .bi-shield-check,
footer .bi-envelope {
    margin-right: 8px;
    vertical-align: middle;
    font-size: 1.1rem;
    color: #495057;
}

footer p.mb-1 {
    margin-bottom: 0.5rem !important;
    line-height: 1.6;
}

footer .text-white-50 {
    color: #6c757d !important;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

footer .text-white-50:hover {
    color: #007bff !important;
    text-decoration: underline;
}

footer .beian-item {
    padding: 8px 15px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    transition: background 0.3s ease;
}

footer .beian-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 后台侧边栏 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #667eea;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
    }
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .sidebar {
        position: relative;
        top: 0;
    }
    footer .text-white-50 {
        display: block;
        margin: 0.5rem 0;
    }
    footer .text-white-50.me-3 {
        margin-right: 0 !important;
    }
    footer p.mb-1 {
        font-size: 0.9rem;
    }
    footer .bi-file-earmark-text,
    footer .bi-shield-check,
    footer .bi-envelope {
        font-size: 1rem;
        margin-right: 5px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    footer > .container > p:first-child {
        font-size: 1rem;
    }
}

/* 置顶和精选 */
.list-group-item-action {
    transition: all 0.3s ease;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.card-header.bg-danger,
.card-header.bg-warning {
    font-weight: 600;
    font-size: 1.1rem;
}

.card-header i {
    margin-right: 5px;
}

.card-title i.bi-pin-angle-fill,
.card-title i.bi-star-fill {
    font-size: 1.2rem;
    margin-right: 5px;
}

.blog-list-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.blog-list-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.blog-list-card .card-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.blog-list-card .card-title i {
    font-size: 1.1rem;
}

.bi-pin-angle-fill {
    animation: pinBounce 2s ease-in-out infinite;
    color: #dc3545;
}

@keyframes pinBounce {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.bi-star-fill {
    animation: starPulse 2s ease-in-out infinite;
    color: #ffc107;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip-inner {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 5px 10px;
}

/* 按钮增强 */
.btn {
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #6c757d;
    border: none;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
    border-color: #36d1dc;
}

/* 卡片通用 */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

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

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 表单 */
.form-control {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 表格 */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table th {
    background: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6 !important;
}

.table td, .table th {
    padding: 1rem;
    vertical-align: middle;
}

/* 标签 */
.badge {
    padding: 0.5em 1em;
    font-weight: 500;
    border-radius: 20px;
}

/* 分页 */
.pagination .page-link {
    border: none;
    color: #667eea;
    margin: 0 2px;
    border-radius: 6px;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #8ff8c2 0%, #66d2f0 100%);
    border-color: transparent;
}

.pagination .page-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ========================================
   AI摘要打字机效果（共用）
   ======================================== */
.typing-text {
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}
.typing-text::after {
    content: "|";
    animation: blink 1s infinite;
    margin-left: 2px;
}
@keyframes blink {
    0%,100% { opacity: 1; }
    50% { opacity: 0; }
}
.typing-done::after {
    display: none;
}
