/* ============================================================
   Easin — Code · Craft · AI
   编辑部风格 · 参考 about.senbuzy.com
   深夜蓝底 + 暖白大字 · 无卡片纯排版 · 3D Logo 星球
   ============================================================ */

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

:root {
    --bg: #0a0e16;
    --bg-elev: rgba(244, 241, 234, 0.04);
    --ink: #f4f1ea;
    --ink-dim: rgba(244, 241, 234, 0.55);
    --ink-faint: rgba(244, 241, 234, 0.28);
    --line: rgba(244, 241, 234, 0.14);
    --accent: #3DDC84;
    --serif-cn: "Chiron GoRound TC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Helvetica Neue", var(--serif-cn);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 背景微光 + 视差（极克制） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 220, 132, 0.05), transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(90, 120, 200, 0.04), transparent 60%);
    background-position-y: var(--bg-shift, 0);
}

/* 黑客帝国数字雨（位于渐变之上、内容之下） */
#matrix-rain {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    opacity: 0.45;
    pointer-events: none;
}

::selection { background: rgba(61, 220, 132, 0.3); }

/* ============================================================
   角落标签
   ============================================================ */
.corner {
    position: fixed;
    z-index: 100;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--ink-dim);
    line-height: 1.5;
    text-transform: uppercase;
    pointer-events: none;
}
.corner span { color: var(--ink-faint); font-size: 11px; }
.corner-tl { top: 28px; left: 32px; }
.corner-tr { top: 28px; right: 32px; text-align: right; }
.corner-bl { bottom: 28px; left: 32px; }
.corner-br { bottom: 28px; right: 32px; text-align: right; }

@media (max-width: 768px) {
    .corner-bl, .corner-br { display: none; }
    .corner-tl { top: 18px; left: 18px; }
    .corner-tr { top: 18px; right: 18px; }
}

/* ============================================================
   主容器 — 内容列
   ============================================================ */
.page {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* ============================================================
   Hero
   ============================================================ */
.s-hero {
    min-height: 92vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 100px 0 60px;
}

.hero-title {
    font-size: clamp(64px, 12vw, 110px);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--ink);
    animation: heroIn 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.hero-sub {
    margin-top: 20px;
    font-size: 14px;
    color: var(--ink-dim);
    max-width: 460px;
    line-height: 2;
    animation: heroIn 1.2s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- 3D Logo 星球 ---------- */
.hero-galaxy {
    position: relative;
    width: min(560px, 92vw);
    height: min(560px, 92vw);
    max-height: 68vh;
    margin-top: 20px;
    animation: heroIn 1.4s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-galaxy-scene {
    position: absolute;
    inset: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.hero-galaxy-scene:active { cursor: grabbing; }

/* 极淡的中心辉光（星球氛围） */
.hero-galaxy-scene::before {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(61, 220, 132, 0.05) 0%,
        rgba(90, 120, 200, 0.03) 45%,
        transparent 70%);
    pointer-events: none;
}

.logo-sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
}

.logo-sphere-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(244, 241, 234, 0.03);
    border: 1px solid rgba(244, 241, 234, 0.08);
    will-change: transform, opacity;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0) invert(1);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.logo-sphere-item:hover {
    background: rgba(61, 220, 132, 0.12);
    border-color: rgba(61, 220, 132, 0.5);
    box-shadow: 0 0 24px rgba(61, 220, 132, 0.18);
}

.logo-sphere-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.galaxy-hint {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    text-transform: uppercase;
    animation: heroIn 1.2s 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- SCROLL 指示 ---------- */
.scroll-ind {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    letter-spacing: 0.35em;
    color: var(--ink-faint);
}
.scroll-ind i {
    display: block;
    width: 1px;
    height: 42px;
    background: linear-gradient(180deg, var(--ink-faint), transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
    transform-origin: top;
}
@keyframes scrollPulse {
    0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ============================================================
   区块通用 — 编辑部排版
   ============================================================ */
.s-block { padding: 110px 0 0; }

.s-block > h2 {
    font-size: clamp(40px, 7vw, 56px);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 64px;
    color: var(--ink);
}

/* ============================================================
   Works — 时间线作品（标题可点击跳转）
   ============================================================ */
.entry {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 28px;
    padding: 36px 0;
    border-top: 1px solid var(--line);
}

.entry:last-child { border-bottom: 1px solid var(--line); }

.entry-years {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    padding-top: 8px;
}

.entry-body h3 {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.entry-body h3 a {
    color: var(--ink);
    text-decoration: none;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.entry-body h3 a:hover {
    background-size: 100% 1px;
}

.entry-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.entry-body p {
    font-size: 14px;
    color: var(--ink-dim);
    max-width: 560px;
    line-height: 1.9;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 36px;
}

.contact-links a {
    font-size: 17px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s;
    padding-bottom: 2px;
}

.contact-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.footer {
    margin-top: 90px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.06em;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer a { color: inherit; text-decoration: none; }
.footer .author { color: var(--ink-dim); }

/* ============================================================
   角落 noko
   ============================================================ */
.noko-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 64px;
    height: 64px;
    z-index: 200;
    cursor: pointer;
    perspective: 200px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    will-change: transform;
    animation: noko-bob 4s ease-in-out infinite;
}

.noko-float img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(244, 241, 234, 0.04);
    pointer-events: none;
}

@keyframes noko-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

@media (max-width: 600px) { .noko-float { display: none; } }

/* ============================================================
   胶片噪点 + 暗角
   ============================================================ */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(4, 6, 10, 0.35) 100%);
}

/* ============================================================
   滚动入场
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
                transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
    .entry { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
    .entry-years { padding-top: 0; }
    .work { grid-template-columns: 1fr; gap: 8px; padding: 30px 0; }
    .work-num { padding-top: 0; font-size: 13px; }
    .s-block { padding-top: 80px; }
    .footer { flex-direction: column; }
}

/* ============================================================
   无障碍
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .noko-float { animation: none; }
    .hero-title, .hero-sub, .hero-galaxy, .galaxy-hint { animation: none; }
    .scroll-ind i { animation: none; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .noise-overlay, .vignette, #matrix-rain { display: none; }
}

/* 时间线内嵌图片（如 token 用量统计卡） */
.entry-body .entry-img {
    display: block; margin-top: 12px;
    max-width: 207px; width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    cursor: zoom-in;
    transition: transform 0.2s;
}
.entry-body .entry-img:hover { transform: translateY(-2px); }
