/* ============================================================
   设计 Token（CSS 自定义属性）
   修改这里即可全局换色/换字体
   ============================================================ */

:root {
    --bg:         #f7f5f0;              /* 页面底色（米白） */
    --paper:      #fffdf8;              /* 卡片/图片占位背景 */
    --text:       #161514;              /* 主文字色 */
    --muted:      #7c766d;             /* 次要文字、导航、标注 */
    --soft:       #b9b1a6;             /* 更淡的文字，如 EXIF 标签名 */
    --line:       rgba(22, 21, 20, .14); /* 分割线、边框 */
    --font-serif: Georgia, "Times New Roman", serif;
    --font-sans:  Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}


/* ============================================================
   全局重置 & 基础元素
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button {
    border: 0;
    color: inherit;
    font: inherit;
}


/* ============================================================
   顶部导航栏
   布局：三列 Grid —— 左: 页面标签 | 中: Logo | 右: 导航菜单
   sticky 吸顶，毛玻璃背景
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
    padding: 18px clamp(18px, 4vw, 56px) 14px;
    background: rgba(247, 245, 240, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

/* Logo 文字（备用：图片加载失败时显示） */
.brand {
    grid-column: 2;
    font-family: var(--font-serif);
    font-size: 24px;
    letter-spacing: .025em;
    line-height: 1;
    white-space: nowrap;
}

/* Logo 图片容器：固定裁剪区域 138×34 */
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 138px;
    height: 34px;
    overflow: hidden;
}

.brand-logo img {
    width: 138px;
    height: 78px;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

/* 左侧：当前页面名称（如 "Landscape"） */
.page-label {
    grid-column: 1;
    justify-self: start;
    max-width: 34vw;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧：导航链接组 */
.site-nav {
    grid-column: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 26px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: .04em;
    line-height: 1.4;
}

.site-nav a {
    border-bottom: 1px solid transparent;
    padding-bottom: 4px;
}

/* hover 和当前页高亮：下划线 + 深色 */
.site-nav a:hover,
.site-nav a.is-active {
    border-color: currentColor;
    color: var(--text);
}


/* ============================================================
   标题 & 正文基础字型
   ============================================================ */

h1,
h2 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -.025em;
}

h1 {
    max-width: 780px;
    font-size: clamp(46px, 7vw, 96px);
    line-height: .96;
}

h2 {
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.05;
}

p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}


/* ============================================================
   照片列表区域（首页 / 分类页 / 标签页 通用）
   ============================================================ */

.archive-section {
    padding: 10px clamp(18px, 4vw, 56px) clamp(64px, 8vw, 112px);
}

/* 列表头：左侧标题 + 右侧照片数量 */
.archive-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding-top: 0;
}

/* 仅显示数量，右对齐（首页 Overview 用） */
.archive-head-count {
    justify-content: flex-end;
}

/* 列表头 h1：使用无衬线字体，更小尺寸 */
.archive-head h1 {
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 500;
    letter-spacing: .01em;
    line-height: 1.2;
}

/* 无障碍隐藏（仅屏幕阅读器可见） */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.archive-head span {
    color: var(--muted);
    font-size: 13px;
}


/* ============================================================
   瀑布流图片网格（CSS columns 实现）
   桌面 4 列 → 平板 3/2 列 → 手机 1 列（见响应式区块）
   ============================================================ */

.masonry-grid {
    column-count: 4;
    column-gap: 18px;
}

/* 单张图片卡片：禁止在列间断裂 */
.work-tile {
    display: inline-block;
    width: 100%;
    margin: 0 0 18px;
    break-inside: avoid;
}

.work-tile a {
    position: relative;
    display: block;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    background: var(--paper);
    text-align: left;
}

/* 图片：轻微降饱和度，hover 时变暗 */
.work-tile img {
    width: 100%;
    height: auto;
    filter: saturate(.96) contrast(.98);
    transition: opacity .22s ease, transform .45s ease;
}

/* 图片下方标题 + 副标题 */
.work-caption {
    display: grid;
    gap: 4px;
    padding: 10px 0 0;
    background: var(--bg);
}

.work-caption strong {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.15;
}

.work-caption small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.work-tile a:hover img {
    opacity: .82;
}

/* 列表为空时的占位提示（column-span: all 使其横跨所有列） */
.empty-state {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    padding: 28px;
    color: var(--muted);
    background: rgba(255, 255, 255, .36);
    font-size: 14px;
    column-span: all;
}


/* ============================================================
   照片详情页 · 杂志双栏布局
   左: 大图 | 右: 粘性信息面板
   ============================================================ */

.photo-detail {
    display: grid;
    gap: clamp(26px, 4vw, 58px);
    padding: 18px clamp(18px, 4vw, 56px) clamp(48px, 7vw, 90px);
}

/* 双栏比例：图片 1.12 : 信息面板 0.62 */
.magazine-detail {
    grid-template-columns: minmax(0, 1.12fr) minmax(330px, .62fr);
    align-items: start;
}

.detail-figure,
.magazine-figure {
    display: grid;
    place-items: center;
    background: transparent;
}

/* 图片区：高度撑满视口减去导航栏高度 */
.magazine-figure {
    min-height: calc(100vh - 148px);
}

/* 图片：等比缩放，不超出视口高度 */
.detail-figure img,
.magazine-figure img {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 164px);
    height: auto;
    object-fit: contain;
}

/* 右侧信息面板：粘性跟随滚动 */
.magazine-panel {
    position: sticky;
    top: 112px;
    display: grid;
    gap: 24px;
    min-height: calc(100vh - 148px);
    align-content: center;
    border-left: 1px solid var(--line);
    padding-left: clamp(24px, 3vw, 38px);
}


/* ============================================================
   照片详情页 · 信息面板内部组件
   ============================================================ */

/* 场景类型标注（如 "LANDSCAPE"） */
.detail-kicker {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .16em;
    line-height: 1.5;
    text-transform: uppercase;
}

.magazine-panel h1 {
    font-family: var(--font-serif);
    margin-top: 12px;
    font-size: clamp(26px, 3.2vw, 46px);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.04;
}

/* 中文副标题 */
.detail-subtitle {
    margin-top: 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

/* SEO 描述段落 */
.detail-desc {
    max-width: 460px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.75;
}

/* EXIF 信息表格：两列 Grid（标签名 + 值） */
.detail-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.detail-list div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding: 9px 0;
}

.detail-list dt {
    color: var(--soft);
    font-size: 11px;
    letter-spacing: .1em;
    line-height: 1.5;
    text-transform: uppercase;
}

.detail-list dd {
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
}

/* 上一张 / 下一张翻页按钮 */
.detail-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-pager a,
.detail-pager span {
    border: 1px solid var(--line);
    padding: 10px 12px;
    color: var(--text);
    font-size: 12px;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
}

/* 无法翻页时按钮变灰 */
.detail-pager span {
    color: var(--soft);
}

.detail-pager a:hover {
    background: var(--text);
    color: var(--bg);
}


/* ============================================================
   照片详情页 · 博客正文区（Story）
   ============================================================ */

.story-section {
    max-width: 1120px;
    margin: 0 clamp(18px, 4vw, 56px) clamp(72px, 9vw, 128px);
    border-top: 1px solid var(--line);
    padding-top: clamp(22px, 3vw, 38px);
}

/* 两列：左侧 "Story" 标签 | 右侧正文 */
.magazine-story {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: clamp(22px, 5vw, 72px);
    align-items: start;
}

.story-content {
    display: grid;
    gap: 22px;
    min-width: 0;
}

/* 正文段落：两端对齐，行高宽松 */
.story-copy {
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    hyphens: auto;
    line-height: 1.85;
    text-align: justify;
    text-align-last: left;
}

.story-copy p + p {
    margin-top: 18px;
}


/* ============================================================
   About / Contact 内容页
   两列 Grid：左侧细标题列 | 右侧正文列
   ============================================================ */

.content-page {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 680px);
    gap: clamp(24px, 5vw, 70px);
    align-items: start;
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(48px, 8vw, 108px) clamp(18px, 4vw, 56px) clamp(90px, 12vw, 160px);
}

.content-page h1 {
    max-width: 640px;
    font-size: clamp(26px, 3.3vw, 44px);
    line-height: 1.05;
}

.content-copy {
    display: grid;
    max-width: 760px;
    gap: 18px;
}

/* 富文本正文段落（body_en 富文本渲染区） */
.long-copy p {
    color: var(--text);
    font-size: 16px;
    line-height: 1.9;
}

/* Contact 联系方式列表（各 section 为一条联系信息） */
.contact-list {
    display: grid;
    max-width: 620px;
    gap: 26px;
}

.contact-list section {
    display: grid;
    gap: 7px;
}

.contact-list h2 {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.contact-list p {
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

/* 通用下划线链接样式（可在富文本 a 标签上使用） */
.text-link {
    border-bottom: 1px solid currentColor;
}


/* ============================================================
   页脚
   ============================================================ */

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 24px clamp(18px, 4vw, 56px) 30px;
    color: var(--muted);
    font-size: 12px;
}


/* ============================================================
   响应式断点
   1100px: 瀑布流 4列 → 3列
    800px: 双栏布局折叠为单列，导航居中
    560px: 瀑布流 → 单列，字体缩小
   ============================================================ */

@media (max-width: 1100px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    /* 导航栏：三列 Grid 折叠为单列堆叠 */
    .site-header {
        grid-template-columns: 1fr;
    }

    .brand,
    .page-label,
    .site-nav {
        grid-column: auto;
    }

    .brand {
        justify-self: center;
    }

    .page-label {
        justify-self: center;
    }

    .site-nav {
        justify-content: center;
    }

    /* 瀑布流 2 列 */
    .masonry-grid {
        column-count: 2;
    }

    /* 照片详情：双栏折叠为单列，图片在上信息在下 */
    .photo-detail,
    .magazine-detail {
        grid-template-columns: 1fr;
    }

    /* 信息面板：取消粘性，改为顶部边线分隔 */
    .magazine-panel {
        position: static;
        grid-template-columns: 1fr;
        min-height: auto;
        align-content: start;
        border-top: 1px solid var(--line);
        border-left: 0;
        padding-top: 22px;
        padding-left: 0;
    }

    /* Story 区：两列折叠 */
    .magazine-story {
        grid-template-columns: 1fr;
    }

    /* About/Contact 两列折叠 */
    .content-page {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    /* 瀑布流退化为单列 */
    .masonry-grid {
        column-count: 1;
    }

    /* 减少左右内边距 */
    .archive-section,
    .photo-detail {
        padding-left: 14px;
        padding-right: 14px;
    }

    h1 {
        font-size: 42px;
    }

    /* 页脚改为纵向堆叠 */
    .site-footer {
        flex-direction: column;
    }
}


/* ============================================================
   照片详情页 · 标签组件
   显示在 EXIF 列表下方，翻页按钮上方
   ============================================================ */

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

/* 单个标签：边框风格，hover 反色 */
.detail-tag {
    display: inline-block;
    border: 1px solid var(--line);
    padding: 4px 10px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    transition: background .18s, color .18s;
}

.detail-tag:hover {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}
