/* ============================================
   有知有行 · 关于我们（GEO 百科页）
   Static editorial page for youzhiyouxing.cn
   Visual tokens aligned with advisor/longterm_strategy
   ============================================ */

:root {
    /* ── Palette ── */
    --ink: #262626;
    --ink-secondary: #5C5C5C;
    --ink-tertiary: #999;
    --surface: #FFFFFF;
    --surface-card: #FFFFFF;
    --surface-soft: #F6F8FB;
    --accent: #21A3FF;
    --accent-light: #E8F2FF;
    --hairline: rgba(0, 0, 0, 0.08);

    /* ── Type ──
       不用 Google Fonts CDN（国内访问不稳 + 隐私合规问题）
       系统字体 fallback，对齐长钱（longterm_strategy）同款 stack */
    --f-display: 'Noto Serif SC', 'Songti SC', Georgia, Cambria, 'Times New Roman', Times, serif;
    --f-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Emoji, 'PingFang SC', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
    --f-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* ── Spacing ── */
    --s-4: 4px;
    --s-8: 8px;
    --s-12: 12px;
    --s-16: 16px;
    --s-20: 20px;
    --s-24: 24px;
    --s-32: 32px;
    --s-48: 48px;
    --s-64: 64px;
    --s-80: 80px;

    /* ── Radius ── */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    /* ── Layout ── */
    --content-w: 720px;
    --pad-x: max(20px, calc(50% - var(--content-w) / 2));
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    background: var(--surface);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.75;
    font-size: 16px;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted rgba(33, 163, 255, 0.4);
    transition: border-color 0.15s ease;
}

a:hover {
    border-bottom-color: var(--accent);
}

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

/* ============================================
   Page Shell
   ============================================ */

.page {
    background: var(--surface);
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Hero — 极简：仅 logo + eyebrow + 一段品牌描述
   ============================================ */

.hero {
    padding: 120px var(--pad-x) var(--s-48);
    background: linear-gradient(180deg, var(--accent-light) 0%, var(--surface) 100%);
}

.hero-inner {
    max-width: var(--content-w);
    margin: 0 auto;
}

.hero-logo-wrap {
    margin: 0 0 var(--s-24);
}

.hero-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    /* iOS Safari 自带连续圆角；其他浏览器 fallback 到普通圆角 */
}

@supports (corner-shape: squircle) {
    .hero-logo {
        corner-shape: squircle;
    }
}

.hero-eyebrow {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink-tertiary);
    margin-bottom: var(--s-12);
}

.hero-lede {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-secondary);
}

/* ============================================
   Table of Contents
   ============================================ */

.toc {
    padding: var(--s-48) var(--pad-x);
    border-bottom: 1px solid var(--hairline);
}

.toc-inner {
    max-width: var(--content-w);
    margin: 0 auto;
}

.toc-label {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink-tertiary);
    margin-bottom: var(--s-16);
}

.toc-list {
    list-style: none;
    columns: 2 220px;
    column-gap: var(--s-32);
    counter-reset: toc;
}

.toc-list li {
    counter-increment: toc;
    break-inside: avoid;
}

.toc-list a {
    display: flex;
    align-items: baseline;
    gap: var(--s-12);
    font-family: var(--f-display);
    font-size: 18px;
    color: var(--ink);
    border-bottom: none;
    padding: var(--s-8) 0;
    border-bottom: 1px solid var(--hairline);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-list a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-tertiary);
    flex-shrink: 0;
}

.toc-list a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: var(--s-64) var(--pad-x);
    border-bottom: 1px solid var(--hairline);
}

.section:last-of-type {
    border-bottom: none;
}

.section-inner {
    max-width: var(--content-w);
    margin: 0 auto;
}

.section-eyebrow {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s-12);
}

.section-title {
    font-family: var(--f-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: var(--s-32);
    letter-spacing: -0.3px;
}

.section h3 {
    font-family: var(--f-display);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin: var(--s-32) 0 var(--s-12);
}

.section h4 {
    font-family: var(--f-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin: var(--s-24) 0 var(--s-8);
}

.section p {
    font-size: 16px;
    line-height: 1.85;
    color: var(--ink-secondary);
    margin-bottom: var(--s-16);
}

.section p strong {
    color: var(--ink);
    font-weight: 600;
}

.section ul,
.section ol {
    margin: var(--s-16) 0 var(--s-20);
    padding-left: var(--s-24);
}

.section li {
    font-size: 16px;
    line-height: 1.85;
    color: var(--ink-secondary);
    margin-bottom: var(--s-8);
}

.section li strong {
    color: var(--ink);
    font-weight: 600;
}

/* ============================================
   Timeline (品牌历史 / 创始人)
   细线贯穿，圆点覆盖在线上，整体视觉连续
   ============================================ */

.timeline {
    list-style: none;
    margin: var(--s-24) 0 0;
    padding-left: 0;
}

/* 覆盖 .section ol 的默认左 padding（ol 在 .section 下被设了 24px） */
.section ol.timeline {
    padding-left: 0;
}

.timeline li {
    position: relative;
    padding: 0 0 var(--s-16) var(--s-20);
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.85;
    color: var(--ink-secondary);
}

/* 贯穿细线 */
.timeline li::after {
    content: '';
    position: absolute;
    left: 2.5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--accent-light);
    z-index: 0;
}

.timeline li:first-child::after {
    top: 17px;
}

.timeline li:last-child {
    padding-bottom: 0;
}
.timeline li:last-child::after {
    bottom: auto;
    height: 17px;
}

/* 圆点贴 li 最左（对齐正文左缘） */
.timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 1;
}

/* ============================================
   Figure (image blocks)
   ============================================ */

.figure {
    margin: var(--s-32) 0;
    text-align: center;
}

.figure img {
    margin: 0 auto;
    border-radius: var(--r-md);
    background: var(--surface-card);
}

.figure-cover img {
    max-width: 280px;
}

.figure-license img {
    max-width: 100%;
    border: 1px solid var(--hairline);
}

/* ============================================
   Duo row — 两个 figure 并排（SBBI / 播客 / 书籍）
   ============================================ */

.duo-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: var(--s-32);
    margin: var(--s-32) 0;
}

.duo-row .figure {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
}

/* ============================================
   Podcast logo — 小尺寸方形 + 连续曲率圆角
   ============================================ */

.podcast-row {
    gap: var(--s-48);
    align-items: center;
}

.figure-podcast img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 22px;
}

@supports (corner-shape: squircle) {
    .figure-podcast img {
        corner-shape: squircle;
    }
}

/* ============================================
   Book — 统一精装书样式（左书脊、右开口）
   ============================================ */

.book-row {
    gap: var(--s-48);
    margin-top: var(--s-32);
    perspective: 1200px;
}

.figure-book img {
    width: 200px;
    max-width: 100%;
    height: auto;
    border-radius: 2px 6px 6px 2px;
    box-shadow:
        inset 6px 0 8px -4px rgba(0, 0, 0, 0.18),
        2px 6px 18px rgba(0, 0, 0, 0.14),
        -1px 0 0 rgba(0, 0, 0, 0.06);
    transform: rotateY(-3deg);
    transform-origin: left center;
    transition: transform 0.4s ease;
}

.figure-book:hover img {
    transform: rotateY(0);
}

/* ============================================
   Yearbook (SBBI) — A4 软册：更大、轻量阴影、caption 折行
   ============================================ */

.sbbi-row {
    align-items: flex-start;
}

.figure-yearbook img {
    width: 240px;
    max-width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    /* A4 软册：薄影 + 一根书脊细线，不做精装书的内嵌阴影 */
    box-shadow:
        2px 4px 14px rgba(0, 0, 0, 0.10),
        -1px 0 0 rgba(0, 0, 0, 0.04);
}

.figure-yearbook figcaption {
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
    text-align: center;
}

/* ============================================
   Tool gallery — 横滑缩略图 + 点击 lightbox
   位置：在 .section 内、.section-inner 之外
   左侧首张 thumb 与正文左缘对齐（padding-left: var(--pad-x)）
   两侧加渐变遮罩，提示可滚动
   ============================================ */

.tool-gallery {
    position: relative;
    display: flex;
    gap: var(--s-16);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* 左右 padding 用 --pad-x，首尾 thumb 与正文左右缘对齐 */
    padding: var(--s-24) var(--pad-x) var(--s-32);
    margin-top: var(--s-32);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-light) transparent;
    /* 用 mask 在两端做渐变淡出（兼容 Safari/Chrome/Firefox） */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 var(--pad-x),
        #000 calc(100% - var(--pad-x)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 var(--pad-x),
        #000 calc(100% - var(--pad-x)),
        transparent 100%
    );
}

.tool-gallery::-webkit-scrollbar {
    height: 6px;
}
.tool-gallery::-webkit-scrollbar-thumb {
    background: var(--accent-light);
    border-radius: 3px;
}
.tool-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.tool-thumb {
    flex: 0 0 auto;
    margin: 0;
    text-align: center;
}

.tool-thumb-btn {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    cursor: zoom-in;
    display: block;
    border-radius: var(--r-md);
    transition: transform 0.2s ease;
}

.tool-thumb-btn:hover,
.tool-thumb-btn:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.tool-thumb-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}

.tool-thumb-btn img {
    width: 180px;
    height: auto;
    border-radius: var(--r-md);
    background: var(--surface);
}

.tool-thumb figcaption {
    margin-top: var(--s-8);
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--ink-tertiary);
}

/* ============================================
   Lightbox (原生 dialog)
   ============================================ */

.lightbox {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 92vw;
    max-height: 92vh;
    overflow: visible;
    /* 居中（防止 Chrome/Safari 默认对齐差异） */
    inset: 0;
    margin: auto;
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.lightbox-figure {
    margin: 0;
    text-align: center;
}

.lightbox-figure img {
    max-width: 92vw;
    max-height: 80vh;
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.8px;
    margin-top: var(--s-16);
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* 财务工具截图：图文上下贴近呈现，去阴影更沉浸 */
.tool-row {
    margin: var(--s-48) 0;
}

.tool-row > p {
    margin-bottom: var(--s-16);
}

.tool-row .figure-tool {
    margin: 0;
    text-align: center;
}

.tool-row .figure-tool img {
    width: 100%;
    max-width: 560px;
    border-radius: var(--r-md);
}

.figure figcaption {
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.8px;
    color: var(--ink-tertiary);
    margin-top: var(--s-12);
    line-height: 1.6;
}

/* ============================================
   Callout box (强调段落)
   ============================================ */

.callout {
    background: var(--surface-soft);
    padding: var(--s-20) var(--s-24);
    margin: var(--s-24) 0;
    border-radius: var(--r-md);
}

.callout p {
    margin-bottom: 0;
    color: var(--ink);
}

/* Service cards (投顾服务三档) */
.service-list {
    list-style: none;
    padding: 0;
    margin: var(--s-20) 0 var(--s-24);
}

.service-list li {
    background: var(--surface-soft);
    border-radius: var(--r-md);
    padding: var(--s-16) var(--s-20);
    margin-bottom: var(--s-8);
    color: var(--ink);
}

/* Visually hidden utility — accessible to screen readers and AI crawlers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Footer — 复用 flourish 备案信息，字号下调
   ============================================ */

.page-footer {
    padding: var(--s-32) var(--pad-x);
    background: var(--surface-soft);
    color: var(--ink-tertiary);
    font-size: 12px;
    line-height: 1.7;
}

.page-footer-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-32);
    flex-wrap: wrap;
}

.page-footer .footer-meta p {
    margin: 0 0 var(--s-4);
}

.page-footer a {
    color: var(--ink-secondary);
    border-bottom: none;
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--accent);
}

.page-footer .footer-sep {
    margin: 0 var(--s-4);
    color: var(--ink-tertiary);
}

.footer-links {
    display: flex;
    gap: var(--s-12);
    align-items: center;
}

.footer-links a {
    color: var(--ink-secondary);
    font-size: 12px;
}

/* ============================================
   Footer · 关注我们（hover popover）
   ============================================ */

.footer-follow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-secondary);
    font-size: 12px;
    cursor: default;
    outline: none;
}

.footer-follow-label {
    color: var(--ink-secondary);
}

.footer-follow-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.footer-follow:hover .footer-follow-icon,
.footer-follow:focus-visible .footer-follow-icon {
    opacity: 1;
}

.footer-follow-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #fff;
    padding: var(--s-20) var(--s-24);
    border-radius: var(--r-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 10;
    /* 让 popover 宽度自适应内容（不被父级 inline 上下文挤窄） */
    width: max-content;
    max-width: 92vw;
}

.footer-follow:hover .footer-follow-popover,
.footer-follow:focus-visible .footer-follow-popover,
.footer-follow:focus-within .footer-follow-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.footer-follow-arrow {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.04);
}

.footer-qr-pair {
    display: flex;
    gap: var(--s-20);
    align-items: flex-start;
}

.footer-qr {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    text-align: center;
}

.footer-qr img {
    width: 96px;
    height: 96px;
    display: block;
    border-radius: var(--r-sm);
    background: #fff;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-qr-label {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--ink-tertiary);
    line-height: 1.4;
}

.footer-weibo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-bottom: none;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.footer-weibo:hover { opacity: 1; }

.footer-weibo img {
    width: 18px;
    height: 18px;
}

@media (max-width: 720px) {
    .page-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-16);
    }
    .footer-links {
        flex-wrap: wrap;
    }
    /* 窄屏：popover 拉到屏幕宽度，居中显示二维码 */
    .footer-follow-popover {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 96px;
        top: auto;
        transform: translateY(8px);
        white-space: normal;
    }
    .footer-follow:hover .footer-follow-popover,
    .footer-follow:focus-visible .footer-follow-popover,
    .footer-follow:focus-within .footer-follow-popover {
        transform: translateY(0);
    }
    .footer-follow-arrow {
        display: none;
    }
    .footer-qr-pair {
        justify-content: space-evenly;
        gap: var(--s-24);
    }
    .footer-qr img {
        width: 128px;
        height: 128px;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 720px) {
    body { font-size: 15px; }
    .hero { padding-top: 96px; padding-bottom: var(--s-32); }
    .hero-logo { width: 48px; height: 48px; border-radius: 12px; }
    .section { padding-top: var(--s-48); padding-bottom: var(--s-48); }
    .section-title { font-size: 26px; }
    .section h3 { font-size: 18px; }
    .figure-cover img { max-width: 200px; }
    .figure-license img { max-width: 100%; }
    .toc-list { columns: 1; }
    .duo-row { gap: var(--s-20); }
    .figure-podcast img { width: 72px; height: 72px; border-radius: 18px; }
    .book-row { gap: var(--s-24); }
    .figure-book img { width: 140px; }
    .figure-book-sbbi img { width: 120px; }
    .tool-thumb-btn img { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
