/* ======================================================================
   profile.css — 个人档案浮层（主页 #subpage-profile）· v1.9.8
   ----------------------------------------------------------------------
   1.9.8：由独立二级页 page2/profile.html 整体并入主页，本文件按
   「浮层内嵌」口径改写 —— 变量 / 重置 / 外壳全部作用域化到
   #subpage-profile（详见下方基调注释），不再触碰主页全局。
   设计口径：与主页电视墙同一套 CRT 视觉语言 ——
     · 磷光绿文字（#dff5e6）+ 红蓝会聚误差 + 辉光（抄自 styles.css 的 .tv-label）
     · VT323 点阵字体做英文 / 数字，Fusion Pixel Profile 做中文像素正文
     · 整页扫描线 + 暗角 + 轻微闪烁（纯 CSS，不依赖 JS / canvas）
   ====================================================================== */

/* ---------- 字体 ---------- */
/* 中文像素正文：本页专用子集（由完整字体 fusion-pixel-full.ttf 子集化，
   生成流程同 js/tools/subset_fusion_pixel.py，源字符集 = 本页实际文字）。
   ⚠ 本页正文改动、新增汉字后必须重新生成，否则缺字回退系统字体 */
@font-face {
    font-family: 'Fusion Pixel Profile';
    src: url('../fonts/fusion-pixel-profile.woff2?v=20261001') format('woff2');
    font-display: swap;
}
/* 英文 / 数字点阵：与主页大电视副文案同源（styles.css 已有同源定义，此份为档案浮层兜底） */
@font-face {
    font-family: 'VT323';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('../fonts/vt323-latin-400-normal.woff2?v=20260904') format('woff2');
}

/* ---------- 基调 ----------
   1.9.8：由独立页并入主页浮层 #subpage-profile ——
   原 :root 变量（--ink / --bg 等）会覆盖主页色板，现全部作用域化到浮层根；
   原 * 通配重置 / html 背景 / body.page-profile 外壳规则随之删除。 */
#subpage-profile {
    --ink: #dff5e6;                 /* 磷光绿主文字（同电视墙标签） */
    --ink-dim: rgba(206, 240, 219, 0.55);
    --ink-faint: rgba(206, 240, 219, 0.30);
    --line: rgba(150, 255, 196, 0.22);   /* 表格描边 */
    --gold: #ffd75e;                /* 金色强调（同主页 #skills） */
    --bg: #050807;                  /* 近黑底，带一点绿 */
    --font-pixel: 'Fusion Pixel Profile', 'VT323', ui-monospace, 'Courier New', monospace;
    --font-dot: 'VT323', ui-monospace, 'Courier New', monospace;
    background: var(--bg);          /* 覆盖 .subpage 默认深底：档案页近黑带绿 */
}

/* 浮层滚动容器外壳：像素字体 + 磷光绿文字（原 body.page-profile 口径） */
#subpage-profile .subpage__scroll {
    color: var(--ink);
    font-family: var(--font-pixel);
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 浮层内局部重置（替代原 * 通配重置，不影响主页）。
   ⚠ 必须用 :where() 把特异性降为 0 —— 若写成 #subpage-profile *（1,0,0），
   会压过本文件所有类级 margin/padding 规则（.p-stage 居中、表格内距全部失效，
   实测导致整版内容顶到左边缘）。:where 后特异性 = 0，类规则正常获胜。 */
:where(#subpage-profile) :where(*, *::before, *::after) {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- CRT 包裹层：闪烁的是整层（亮度），扫描线挂叠层 ---------- */
.crt {
    position: relative;
    min-height: 100vh;
    /* 轻微不规则的亮度闪烁 —— 周期互质、相位错开，与电视墙同思路 */
    animation:
        profileFlicker 7.3s steps(1, end) infinite,
        profileFlicker2 3.7s steps(1, end) infinite;
}

/* 扫描线 + 暗角（v1.9.8：场同步移动亮带已按要求整体移除；
   第十一轮：z-index 9 → 1 —— 原先叠层压在内容（z-index 2）之上，
   连照片也被盖了一层条纹；现降到内容层之下，只作用于页面背景，
   照片与文字不再有条纹覆盖（用户点名「仅展示图像本身」） */
.crt-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        /* 扫描线（2px 周期） */
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0.22) 2px, rgba(0, 0, 0, 0.22) 3px
        ),
        /* 暗角 */
        radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

/* ---------- 磷光文字工具：红蓝会聚误差 + 辉光（同 .tv-label 口径） ---------- */
.p-top, .p-title, .dossier-h, .dossier-name, .dossier-tagline,
.info-table th, .info-table td, .skill-name, .skill-val,
.exp-time, .exp-title, .exp-desc, .dossier-para,
.dossier-chips li, .p-foot {
    text-shadow:
        -1px 0 0 rgba(255, 96, 84, 0.30),
        1px 0 0 rgba(96, 168, 255, 0.30),
        0 0 3px rgba(150, 255, 196, 0.6),
        0 0 10px rgba(150, 255, 196, 0.35),
        0 0 22px rgba(98, 200, 157, 0.18);
}

/* ---------- 占位符观感：虚线下划 + 半透明 + 悬停提亮 ---------- */
.ph {
    color: var(--ink-dim);
    border-bottom: 1px dashed var(--ink-faint);
    padding-bottom: 1px;
    transition: color 0.25s, border-color 0.25s;
}
.ph:hover { color: var(--ink); border-color: var(--line); }
.ph--en { font-family: var(--font-dot); }

/* ---------- 顶栏 ---------- */
.p-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
    padding: 22px 28px 0;
}
/* 浮层版顶栏（1.9.8）：「返回主页」由全站 .subpage__back 胶囊承担，
   栏内只保留右侧 OSD 台标（AGE / REC / 日期），靠右对齐 */
.p-top--overlay { justify-content: flex-end; }
.p-back {
    color: var(--ink-dim);
    text-decoration: none;
    font-size: 17px;
    letter-spacing: 0.06em;
    transition: color 0.25s;
}
.p-back:hover { color: var(--ink); }

/* 右侧 OSD 台标：频道号 + REC + 日期
   v1.9.8：① baseline → center 垂直居中对齐，三段文字严格同一中线；
   ② 原字符「●」不在 VT323 字符集内，回退系统字体导致 REC 行错位 ——
   改用 CSS 圆点（.p-channel__dot）绘制，尺寸与基线完全可控 */
.p-channel {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;          /* 三段严格同一行，任何窗口宽度都不换行 */
    gap: 16px;
    font-family: var(--font-dot);
    font-size: 26px;            /* 1.9.8：19 → 26px（用户要求「文字要大」） */
    line-height: 1;
    white-space: nowrap;
    color: var(--ink-dim);
}
.p-channel__no { color: var(--ink); letter-spacing: 0.1em; }
.p-channel__rec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ff6a5e;
}
.p-channel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6a5e;
    box-shadow: 0 0 6px rgba(255, 106, 94, 0.8);
    animation: profileBlink 1.6s steps(1, end) infinite;
}
.p-channel__date {
    letter-spacing: 0.08em;
    /* 光学补偿：VT323 数字/句点字形视觉重心比 REC 的大写字母低约 1px，
       即使盒子已严格居中（getBoundingClientRect center diff = 0），肉眼仍会看到 REC 偏高。
       上移 1px 使两段文字视觉中心对齐。 */
    transform: translateY(-1px);
}

/* ---------- 主舞台 ---------- */
.p-stage {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 34px 28px 60px;
}

/* 页标题 */
.p-title {
    font-size: 46px;
    font-weight: 400;           /* 像素字体本身粗壮，不加粗 */
    letter-spacing: 0.12em;
    line-height: 1;
    margin-bottom: 40px;        /* 原 .p-note 提示行删除后，由此补回与档案头的间距 */
}
.p-title__sub {
    display: block;
    margin-top: 10px;
    font-family: var(--font-dot);
    font-size: 22px;
    letter-spacing: 0.28em;
    color: var(--ink-dim);
    text-shadow:
        -1px 0 0 rgba(255, 96, 84, 0.22),
        1px 0 0 rgba(96, 168, 255, 0.22),
        0 0 4px rgba(150, 255, 196, 0.4);
}

/* ---------- 档案头：照片 + 简介 ---------- */
.dossier-head {
    display: grid;
    grid-template-columns: 232px 1fr;
    gap: 34px;
    align-items: start;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(150, 255, 196, 0.025);
    margin-bottom: 46px;
}

/* 照片：CRT 屏幕框外形保留，但原图直出 —— 无扫描线叠层、无滤镜；
   已改为 button（v1.9.8），点击展开大图预览（fpx-lightbox 体系） */
.dossier-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 14px / 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.6),
        inset 0 0 34px rgba(0, 0, 0, 0.55),
        0 0 22px rgba(150, 255, 196, 0.10);
    /* button 复位：去掉 UA 默认底色 / 描边 / 字体 */
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0;
    cursor: zoom-in;
    display: block;
}
@media (pointer: coarse) {
    .dossier-photo { cursor: pointer; }
}
.dossier-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* v1.9.8：独立合成层，根治「滚动中照片像素化」——
       根因：.crt 整层挂着两个无限闪烁动画（opacity），整页内容因此被提升为一个
       合成层；滚动时 Chromium 会对新进入视口的图块按**低质量插值**重新栅格化，
       大幅下采样的照片（1455×1939 → 约 380px 显示宽）在滚动中就呈现块状像素感、
       停下后才重栅回清晰。translateZ(0) 把照片单独提升为常驻合成层：
       只在打开浮层时全质量栅格化一次，滚动期间合成器仅平移该层、零重栅 ——
       照片在滚动全程保持同一画质，无任何变化 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.dossier-name {
    font-size: 34px;
    line-height: 1.1;
}
.dossier-name__en {
    margin-left: 14px;
    font-size: 22px;
    letter-spacing: 0.14em;
}
.dossier-tagline {
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.9;
    max-width: 34em;
}
.dossier-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.dossier-chips li {
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--ink-dim);
}

/* ---------- 分节标题 ---------- */
.dossier-sec { margin-bottom: 46px; }
.dossier-h {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 23px;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.dossier-h i {
    font-style: normal;
    font-family: var(--font-dot);
    font-size: 20px;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 215, 94, 0.45);
}
.dossier-h__en {
    margin-left: auto;
    font-family: var(--font-dot);
    font-size: 17px;
    letter-spacing: 0.24em;
    color: var(--ink-faint);
    text-shadow: none;
}

/* ---------- 01 · 基本信息表：三组「键-值」横排 ---------- */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}
.info-table th, .info-table td {
    padding: 11px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.info-table th {
    width: 13%;
    color: var(--ink-dim);
    font-weight: 400;
    letter-spacing: 0.1em;
    white-space: nowrap;
    background: rgba(150, 255, 196, 0.035);
}
.info-table td { width: 20.33%; }

/* ---------- 02 · 技能表 ---------- */
.skill-table {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.skill-row {
    display: grid;
    grid-template-columns: 12em 1fr 4.5em;
    align-items: center;
    gap: 18px;
}
.skill-name { font-size: 16px; }
.skill-val {
    font-family: var(--font-dot);
    font-size: 18px;
    text-align: right;
    color: var(--ink-dim);
}
/* 熟练度条：底槽 + 金色填充（--lv 由行内 style 提供，占位 00%） */
.skill-bar {
    position: relative;
    height: 10px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: rgba(150, 255, 196, 0.04);
    overflow: hidden;
}
.skill-bar__fill {
    position: absolute;
    inset: 0;
    width: var(--lv, 0%);
    background: linear-gradient(
        to bottom,
        rgba(255, 215, 0, 0.75), rgba(255, 185, 0, 0.45)
    );
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
    /* 条纹刻度，向像素观感靠拢 */
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(0, 0, 0, 0.25) 0px, rgba(0, 0, 0, 0.25) 2px,
            transparent 2px, transparent 8px
        ),
        linear-gradient(to bottom, rgba(255, 215, 0, 0.75), rgba(255, 185, 0, 0.45));
}

/* ---------- 03 · 经历时间线 ---------- */
.exp-list {
    list-style: none;
    position: relative;
    padding-left: 22px;
}
/* 时间线主轴 */
.exp-list::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--line);
}
.exp-item {
    position: relative;
    display: grid;
    grid-template-columns: 11em 1fr;
    gap: 20px;
    padding: 12px 0 14px;
}
/* 节点圆点 */
.exp-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 22px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-dim);
    box-shadow: 0 0 8px rgba(150, 255, 196, 0.5);
}
.exp-time {
    font-family: var(--font-dot);
    font-size: 18px;
    letter-spacing: 0.06em;
    color: var(--ink-dim);
    padding-top: 2px;
}
.exp-title { font-size: 17px; }
.exp-desc {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--ink-dim);
}

/* ---------- 04 · 自我评价 ---------- */
.dossier-para {
    font-size: 16px;
    line-height: 2.05;
    max-width: 46em;
}

/* ---------- 页脚 ---------- */
.p-foot {
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-dim);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.p-foot__hint {
    font-family: var(--font-dot);
    letter-spacing: 0.3em;
    color: var(--ink-faint);
    text-shadow: none;
}

/* ---------- 动画 ---------- */
/* 整页亮度闪烁：两把周期互质的方波叠加 → 不规则、不连续 */
@keyframes profileFlicker {
    0%, 100% { opacity: 1; }
    31% { opacity: 1; }
    32% { opacity: 0.94; }
    33% { opacity: 1; }
    71% { opacity: 1; }
    72% { opacity: 0.90; }
    73% { opacity: 0.97; }
    74% { opacity: 1; }
}
@keyframes profileFlicker2 {
    0%, 100% { opacity: 1; }
    12% { opacity: 1; }
    13% { opacity: 0.96; }
    14% { opacity: 1; }
    55% { opacity: 1; }
    56% { opacity: 0.92; }
    57% { opacity: 1; }
}
/* 场同步亮带下扫：已随移动亮带整体删除（v1.9.8） */
/* REC 红点呼吸 */
@keyframes profileBlink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0.15; }
}
/* 打字机光标（js/profile-type.js 消费）：磷光绿色块，随打字位置移动、间歇闪烁 */
.tw-caret {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 1px;
    vertical-align: -0.12em;
    background: var(--ink);
    box-shadow: 0 0 6px rgba(150, 255, 196, 0.6);
    animation: twCaretBlink 0.8s steps(1, end) infinite;
}
@keyframes twCaretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .p-title { font-size: 36px; }
    .dossier-head { grid-template-columns: 1fr; }
    .dossier-photo { max-width: 280px; }
    /* 信息表在窄屏退化为两列键值（第三组键值换行） */
    .info-table th { width: 22%; }
    .info-table td { width: 44.66%; }
    .skill-row { grid-template-columns: 9em 1fr 3.6em; gap: 10px; }
    .exp-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- 照片大图预览弹窗（js/fpx-lightbox.js 消费，同项目页口径） ----------
   深色遮罩贴合档案页近黑底；结构 / 交互与项目页完全一致
   （点击照片展开、关闭按钮 / 遮罩空白 / ESC 关闭、打开期间锁定滚动） */
.fpx-lb {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: grid;
    place-items: center;
    padding: clamp(16px, calc(4vw / var(--vzu, 1)), 48px);
    background: rgba(3, 6, 5, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 420ms;
}
.fpx-lb.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fpx-lb__stage {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: grid;
    place-items: center;
    transform-origin: 50% 50%;
}
.fpx-lb__stage #fpx-lb-full {
    position: relative;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(calc(100vh / var(--vzu, 1)) - 96px);
    border-radius: 6px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.fpx-lb__stage #fpx-lb-lqip {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) saturate(1.15);
    transform: scale(1.04);
}
.fpx-lb__close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 9991;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #f2efe8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .28s cubic-bezier(.22, 1, .36, 1), background .28s ease;
}
.fpx-lb__close:hover {
    transform: rotate(90deg) scale(1.06);
    background: rgba(255, 255, 255, 0.14);
}
