/* ==========================================================
   挠点 · Engineer Node — 工程图纸视觉体系
   ----------------------------------------------------------
   设计意图：把站点从"普通博客"变成"一张摊开的工程图纸"。

   三条主线：
     1) 图纸底纹 —— 全站方格纸网格 + 米白图纸底色，取代纯白背景
     2) 制图语言 —— 图框、轴线编号、尺寸标注、图签栏（title block）
     3) 节点意象 —— 点阵与连线，呼应 Engineer Node 的 "Node"

   实现方式：全部通过 CSS 伪元素与背景渐变完成，不改动既有 DOM 结构，
            因此对 Bootstrap 4 页面零侵入，任何新页面只要引入本文件即可继承。
   配色：墨线 #2C2C2A + 赭橙 #BA7517，与品牌主色一致。
   ========================================================== */

:root {
    /* —— 图纸底色（替代纯白，微微泛暖，像硫酸纸晒图） —— */
    --eng-paper:      #F6F4EF;
    --eng-paper-deep: #EDE9E1;

    /* —— 墨线（工程制图的主色） —— */
    --eng-ink:        #2C2C2A;
    --eng-ink-soft:   #5F5E5A;
    --eng-ink-faint:  #9A9892;

    /* —— 网格两级：粗网格定位，细网格铺底 —— */
    --eng-grid:       rgba(44, 44, 42, 0.070);
    --eng-grid-fine:  rgba(44, 44, 42, 0.030);

    /* —— 赭橙强调色：图纸上的标注、引线、重点 —— */
    --eng-accent:      #BA7517;
    --eng-accent-wash: rgba(186, 117, 23, 0.10);

    /* —— 图纸深色区（hero / 统计区 / 页脚） —— */
    --eng-dark:        #23231F;
    --eng-dark-2:      #1B1B18;
    --eng-dark-line:   rgba(255, 255, 255, 0.055);

    --eng-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ==========================================================
   1. 全站图纸底纹
   ========================================================== */

body {
    background-color: var(--eng-paper);
    background-image:
        /* 粗网格 —— 每 120px 一根，作为定位轴线 */
        linear-gradient(to right,  var(--eng-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--eng-grid) 1px, transparent 1px),
        /* 细网格 —— 每 24px 一根，铺满纸面 */
        linear-gradient(to right,  var(--eng-grid-fine) 1px, transparent 1px),
        linear-gradient(to bottom, var(--eng-grid-fine) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    background-position: -1px -1px;
}

/* Bootstrap 的白底容器默认会盖住网格，这里让它们透出纸面肌理 */
.bg-white {
    background-color: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(2px);
}

/* 深色区块：换成暗底白网格，边界处自然过渡 */
.eng-dark {
    background-color: var(--eng-dark);
    background-image:
        linear-gradient(to right,  var(--eng-dark-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--eng-dark-line) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px;
    position: relative;
}

/* ==========================================================
   2. 制图语言：图框 / 轴线编号 / 尺寸标注
   ========================================================== */

/* —— 图框：页面左右两侧的细边框线，模拟图纸幅面 —— */
.eng-frame {
    position: relative;
}
.eng-frame::before,
.eng-frame::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 0,
        rgba(44, 44, 42, 0.13) 12%,
        rgba(44, 44, 42, 0.13) 88%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}
.eng-frame::before { left: 24px; }
.eng-frame::after  { right: 24px; }

/* —— 轴线编号：容器加上 .eng-axis 后，.eng-card 子项自动编号 01/02/03 —— */
.eng-axis {
    counter-reset: eng-card;
}

/* —— 尺寸标注：一条带端点的细线，图纸上量长度的标准画法 —— */
.eng-dim {
    display: block;
    position: relative;
    height: 1px;
    background: var(--eng-accent);
    opacity: 0.55;
    margin: 0 auto;
}
.eng-dim::before,
.eng-dim::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 1px;
    height: 7px;
    background: var(--eng-accent);
}
.eng-dim::before { left: 0; }
.eng-dim::after  { right: 0; }

/* ==========================================================
   3. 图签栏（Title Block）—— 页脚上方的工程图纸信息条
   ========================================================== */

.eng-titleblock {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 3px;
    display: flex;
    flex-wrap: wrap;
    font-family: var(--eng-mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}
.eng-titleblock > div {
    flex: 1 1 auto;
    min-width: 108px;
    padding: 7px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}
.eng-titleblock > div:last-child {
    border-right: none;
}
.eng-titleblock b {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 12px;
    margin-top: 2px;
    letter-spacing: 0.02em;
}
/* 图纸信息条上的橙色高亮——图号 */
.eng-titleblock .eng-tb-accent b {
    color: var(--eng-accent);
}

/* ==========================================================
   4. 英雄区：深色蓝图 + 节点点阵
   ========================================================== */

.eng-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--eng-dark);
    background-image:
        /* 右上角暖光，避免大块深色发死 */
        radial-gradient(ellipse 70% 90% at 78% 12%, rgba(186, 117, 23, 0.24), transparent 58%),
        /* 图纸网格：5% 太淡，在普通显示器上像纯黑块；提到 9% 左右刚好 */
        linear-gradient(to right,  rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(165deg, #2A2A25 0%, #23231F 50%, #1B1B18 100%);
    background-size: auto, 56px 56px, 56px 56px, auto;
    color: #fff;
}

/* 节点点阵：呼应 Engineer Node，用径向渐变铺一层规整的点 */
.eng-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(186, 117, 23, 0.55) 1.5px, transparent 1.8px);
    background-size: 56px 56px;
    background-position: 28px 28px;
    opacity: 0.55;
    pointer-events: none;
}

/* 底部一条尺寸标注，把 hero 与下方内容"量"在一起 */
.eng-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0,
        rgba(186, 117, 23, 0.7) 15%,
        rgba(186, 117, 23, 0.7) 85%,
        transparent 100%);
}

.eng-hero > .container {
    position: relative;
    z-index: 2;
}

/* —— 主标题：中英对照 —— */
.eng-hero-title {
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}

/* —— 英文名条：等宽字体 + 字距，像图纸上的英文注记 —— */
.eng-hero-en {
    font-family: var(--eng-mono);
    font-size: 0.95rem;
    letter-spacing: 0.42em;
    text-indent: 0.42em;          /* 补偿末字符字距，保持视觉居中 */
    color: var(--eng-accent);
    text-transform: uppercase;
    margin-bottom: 1.15rem;
}
.eng-hero-en .eng-sep {
    color: rgba(255, 255, 255, 0.28);
    margin: 0 0.35em;
}

/* —— hero 上方的图号标签 —— */
.eng-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--eng-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(186, 117, 23, 0.55);
    border-radius: 2px;
    padding: 5px 13px;
    margin-bottom: 1.4rem;
    text-transform: uppercase;
    background: rgba(186, 117, 23, 0.12);
    box-shadow: 0 0 0 1px rgba(186, 117, 23, 0.08), 0 6px 18px rgba(0, 0, 0, 0.28);
}

/* —— LIVE 脉冲点 —— */
.eng-hero-tag .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--eng-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(186, 117, 23, 0.5);
    animation: pulse-live 1.6s ease-in-out infinite;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(186, 117, 23, 0.5); }
    50% { opacity: 0.55; transform: scale(0.82); box-shadow: 0 0 0 5px rgba(186, 117, 23, 0); }
}

/* ==========================================================
   5. 内容卡片工程化
   ========================================================== */

.eng-card {
    position: relative;
    border: 1px solid rgba(44, 44, 42, 0.13) !important;
    border-radius: 3px !important;
    background: rgba(255, 255, 255, 0.94);
}

/* 左上角轴线编号 —— 图纸上每个构件的定位号 */
.eng-card::before {
    counter-increment: eng-card;
    content: counter(eng-card, decimal-leading-zero);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    font-family: var(--eng-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--eng-ink);
    padding: 3px 8px 3px 6px;
    border-bottom-right-radius: 3px;
    opacity: 0.9;
}

/* 卡片右上角的制图定位角标 */
.eng-card::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 9px;
    height: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.9);
    opacity: 0.65;
    pointer-events: none;
}

/* 悬停时出现的尺寸线，暗示"这个条目被量取" */
.eng-card .eng-card-dim {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--eng-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s ease;
    z-index: 4;
}
.eng-card:hover .eng-card-dim {
    transform: scaleX(1);
}

/* 悬停时边框转为赭橙，配合底部尺寸线 */
.eng-card:hover {
    border-color: rgba(186, 117, 23, 0.55) !important;
}

/* ==========================================================
   6. 分区标题：图号 + 粗线（工程目录的写法）
   ========================================================== */

.eng-section-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--eng-ink);
}
.eng-section-head .eng-no {
    font-family: var(--eng-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--eng-accent);
    flex: 0 0 auto;
}
.eng-section-head .eng-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--eng-ink);
    flex: 0 0 auto;
}
.eng-section-head .eng-rule {
    flex: 1 1 auto;
    height: 1px;
    background: repeating-linear-gradient(to right,
        rgba(44, 44, 42, 0.3) 0 5px, transparent 5px 10px);
    margin-bottom: 5px;
}
.eng-section-head .eng-note {
    font-family: var(--eng-mono);
    font-size: 11px;
    color: var(--eng-ink-faint);
    letter-spacing: 0.05em;
    flex: 0 0 auto;
}

/* ==========================================================
   7. 页脚：制图信息区
   ========================================================== */

.eng-footer {
    background-color: var(--eng-dark-2);
    background-image:
        linear-gradient(to right,  rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px;
    color: rgba(255, 255, 255, 0.72);
}

/* 页脚里的技术栈列表：换成等宽 + 前缀短线，像材料表 */
.eng-footer .eng-specs {
    list-style: none;
    padding-left: 0;
    font-family: var(--eng-mono);
    font-size: 12px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.6);
}
.eng-footer .eng-specs li::before {
    content: '— ';
    color: var(--eng-accent);
    opacity: 0.8;
}

/* ==========================================================
   8. 浮动按钮：节点按钮（原为渐变圆）
   ========================================================== */

.eng-node-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--eng-ink);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    z-index: 1000;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.eng-node-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}
/* 外圈虚线环：像节点被套在坐标环上 */
.eng-node-btn::before {
    content: '';
    position: absolute;
    inset: -9px;
    border: 1px dashed rgba(186, 117, 23, 0.55);
    border-radius: 50%;
    animation: eng-spin 18s linear infinite;
}
@keyframes eng-spin {
    to { transform: rotate(360deg); }
}
.eng-node-btn img {
    width: 30px;
    height: 30px;
    border-radius: 5px;
}

/* ==========================================================
   9. 响应式
   ========================================================== */

@media (max-width: 768px) {
    .eng-frame::before,
    .eng-frame::after { display: none; }
    .eng-hero-title { font-size: 2.4rem; }
    .eng-hero-en { font-size: 0.8rem; letter-spacing: 0.3em; }
    .eng-titleblock > div { min-width: 50%; }
    .eng-node-btn { bottom: 20px; left: 20px; width: 50px; height: 50px; }
}

/* 尊重用户的减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .eng-node-btn::before { animation: none; }
    .eng-card .eng-card-dim { transition: none; }
}
