/* ============================================
   Theme AutoDeepDive - 编辑风格博客样式
   基于 theme-magazine 扩展，增加分类色彩系统和更大的文章字体
   ============================================ */

/* === 基础排版 === */
body { font-family: 'Inter', system-ui, sans-serif; }
.font-serif { font-family: 'Newsreader', Georgia, serif; }

/* === 动画效果 === */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* === 卡片悬停 === */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(26, 47, 35, 0.08);
}

/* === 图片缩放 === */
.img-zoom-img {
    transition: transform 0.5s ease;
}
.img-zoom-img:hover,
.card-hover:hover .img-zoom-img {
    transform: scale(1.05);
}

/* === 链接下划线动画 === */
.link-underline { position: relative; }
.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}
.link-underline:hover::after { width: 100%; }

/* === 分类横向导航栏 === */
.category-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}
.category-bar::-webkit-scrollbar { display: none; }

/* === 分类色彩 Pill === */
.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
}
.cat-pill:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* === 视差容器 === */
.parallax-container { overflow: hidden; }
.parallax-image {
    transform: translateY(0);
    will-change: transform;
}

/* === 文本截断 === */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   文章内容排版 - 编辑风格大字体，与后台编辑器样式一致
   ============================================ */
.article-content {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.125rem;   /* 比 magazine 更大，提升阅读体验 */
    line-height: 1.9;
    color: #1a2f23;
}

.article-content p {
    margin: 0 0 1.25rem;
}

.article-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    font-family: 'Newsreader', Georgia, serif;
}

.article-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 1.75rem 0 0.625rem;
    font-family: 'Newsreader', Georgia, serif;
}

.article-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.article-content a {
    color: #D97706;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content blockquote {
    border-left: 3px solid #D97706;
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: #6B7F71;
    font-style: italic;
}

.article-content ul, .article-content ol {
    padding-left: 1.75rem;
    margin: 1rem 0;
}
.article-content ul li { list-style-type: disc; }
.article-content ol li { list-style-type: decimal; }
.article-content li { margin-bottom: 0.375rem; }

.article-content pre {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
    margin: 1.25rem 0;
}

.article-content code {
    background: #f0f0f0;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 0.875rem;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content hr {
    border: none;
    border-top: 1px solid #E8E4DD;
    margin: 2rem 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.article-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.25rem 0;
}
.article-content table td,
.article-content table th {
    border: 1px solid #E8E4DD;
    padding: 0.625rem 0.875rem;
    min-width: 80px;
}
.article-content table th {
    background: #FAF7F2;
    font-weight: 600;
}

/* 表格横向滚动容器（宽表格在手机不溢出） */
.article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content figure {
    margin: 1.25rem 0;
}
.article-content figure img {
    margin: 0;
}
.article-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6B7F71;
    margin-top: 0.625rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-style: italic;
}

/* ============================================
   多图布局（import-blog 脚本生成的 HTML 结构）
   ============================================ */

/* 两图并排 */
.article-content .image-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}
.article-content .image-duo figure {
    margin: 0;
}
.article-content .image-duo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0.5rem;
}

/* 三图布局（主图+右侧堆叠） */
.article-content .image-trio {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}
.article-content .image-trio figure:first-child {
    grid-row: span 2;
    margin: 0;
}
.article-content .image-trio figure {
    margin: 0;
}
.article-content .image-trio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0.5rem;
}

/* 图片画廊（4+图，2x2网格，第一图占两行） */
.article-content .image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 2rem 0;
}
.article-content .image-gallery figure {
    margin: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    position: relative;
}
.article-content .image-gallery figure:first-child {
    grid-row: span 2;
}
.article-content .image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

/* 响应式：移动端图片布局回退为单列 */
@media (max-width: 768px) {
    .article-content .image-duo,
    .article-content .image-trio,
    .article-content .image-gallery {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .article-content .image-trio figure:first-child,
    .article-content .image-gallery figure:first-child {
        grid-row: span 1;
    }
}

/* ============================================
   全局移动端适配
   ============================================ */
@media (max-width: 640px) {
    /* 正文字体缩小，避免单行字数过少 */
    .article-content {
        font-size: 1rem;
        line-height: 1.8;
    }
    .article-content h1 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
    .article-content h2 { font-size: clamp(1.1rem, 4vw, 1.375rem); }
    .article-content h3 { font-size: 1rem; }

    /* 代码块：允许换行，防止横向溢出 */
    .article-content pre {
        white-space: pre-wrap;
        word-break: break-all;
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }

    /* blockquote 收窄 padding */
    .article-content blockquote {
        padding-left: 0.875rem;
        margin: 1rem 0;
    }
}

/* ============================================
   灯箱
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 47, 35, 0.95);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
    text-align: center;
    color: #FAF7F2;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    margin-top: 1rem;
    opacity: 0.8;
}
.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FAF7F2;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FAF7F2;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-prev { left: -4rem; }
.lightbox-next { right: -4rem; }
.lightbox-counter {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #FAF7F2;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

/* ===== About 页面专用样式 ===== */

/* About 页面：有 hero 时隐藏模板自动生成的 h1 标题（避免重复） */
article:has(.about-hero) header { display: none; }

/* Hero 两栏：图片 | 文字 */
.article-content .about-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 3rem; }
.article-content .about-hero-image img { width: 100%; border-radius: 1rem; object-fit: cover; aspect-ratio: 4/5; display: block; }
.article-content .about-hero-content { display: flex; flex-direction: column; gap: 1rem; }
.article-content .about-subtitle { color: #D97706; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; margin: 0; }
.article-content .about-hero-title { font-family: 'Newsreader', Georgia, serif; font-size: 2.25rem; font-weight: 700; line-height: 1.15; color: #1a2f23; margin: 0; }
.article-content .about-hero-content p { color: #6B7F71; line-height: 1.75; margin: 0; }

.article-content .about-values { margin: 2.5rem 0; }
.article-content .about-values h2 { margin-bottom: 1.5rem; }
.article-content .values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.article-content .value-card { background: #FFFFFF; border-radius: 0.75rem; padding: 1.5rem; text-align: center; border: 1px solid #E8E4DD; }
.article-content .value-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: #1a2f23; }
.article-content .value-card p { color: #6B7F71; font-size: 0.95rem; margin: 0; }

.article-content .about-timeline { margin: 2.5rem 0; }
.article-content .about-timeline h2 { margin-bottom: 1.5rem; }
.article-content .timeline-list { padding-left: 0; border-left: 2px solid #E8E4DD; margin-left: 1rem; }
.article-content .timeline-item { position: relative; padding: 0 0 2rem 2rem; }
.article-content .timeline-item::before { content: ''; position: absolute; left: -0.3125rem; top: 0.375rem; width: 0.5rem; height: 0.5rem; background: #D97706; border-radius: 50%; }
.article-content .timeline-date { display: block; color: #D97706; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.article-content .timeline-item h3 { margin: 0.25rem 0 0.5rem; }
.article-content .timeline-item p { color: #6B7F71; margin: 0; }

.article-content .about-contact { margin: 2.5rem 0; padding: 2rem; background: #F5F1EB; border-radius: 0.75rem; }
.article-content .about-contact p { margin: 0 0 0.5rem; }
.article-content .about-contact p:last-child { margin: 0; }

@media (max-width: 768px) {
    .article-content .about-hero { grid-template-columns: 1fr; gap: 2rem; }
    .article-content .about-hero-image img { aspect-ratio: 3/2; }
    .article-content .about-hero-title { font-size: 1.75rem; }
    .article-content .values-grid { grid-template-columns: 1fr; }
    .article-content .team-member { flex-direction: column; align-items: center; text-align: center; }
}

.article-content .member-avatar-img { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
