/* ==========================================================================
   iTuFM · 全站视觉系统（前台首页 / 播放页 / 后台 共用）
   --------------------------------------------------------------------------
   设计基调：黑 + 白 为主，方形为骨，渐变紫为点缀，灰为过渡
     · 全局直角（--r: 0），仅个别处用 1~2px 微圆角做呼吸感
     · 大面积留白 + 强字重对比，去掉一切装饰性阴影
     · 交互：光标光晕 / 网格感应 / 方块位移 / 方形涟漪

   ★★ 为什么这份文件是「全站视觉系统」而不只是几个 CSS 变量：
     首页模板（app/index/view/index/tpl/*.php）和播放页（app/common/PlayerPage.php）
     都在用下面这些类 —— .it-glow / .it-grid / .it-grid-hot / .it-sq /
     .it-btn / .it-tag / .it-ripple / .it-in。
     模板与视图只负责结构与文案，**样式必须在这里**，否则元素会以浏览器
     默认样式渲染并引发布局事故（真实案例：.it-glow 缺了 position:fixed，
     变成一个占满宽度的普通块，鼠标一移动就把它平移出视口 ⇒ 页面横向滚动）。

     改这里三端一起变，这才叫「风格一致」；别把页面专属样式抄回各自的
     <style> 里，那正是当初样式丢失、页面错乱的原因。
   ========================================================================== */

:root {
    /* —— 骨架色（黑白灰）—— */
    --ink: #0a0a0b;
    --ink-2: #18181b;
    --gray-900: #27272a;
    --gray-700: #3f3f46;
    --gray-500: #71717a;
    --gray-400: #a1a1aa;
    --gray-300: #d4d4d8;
    --gray-200: #e4e4e7;
    --gray-100: #f4f4f5;
    --gray-50: #fafafa;
    --paper: #ffffff;

    /* —— 点缀色（渐变紫）—— */
    --violet: #7c3aed;
    --violet-lt: #a855f7;
    --violet-xs: #c4b5fd;
    --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 52%, #c084fc 100%);
    --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .10), rgba(192, 132, 252, .10));

    /* —— 方形基因 —— */
    --r: 0px;
    --line: 1px solid var(--gray-200);
    --line-dark: 1px solid rgba(255, 255, 255, .10);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

/* --------------------------------------------------------------------------
   ★★ body 不要设 display:flex + 页面级居中
   --------------------------------------------------------------------------
   曾经这里是：
       display: flex; align-items: center; justify-content: center;
   那套是给「单卡片启动页」用的，但后果是：
     · 后台外壳只有 min-height 没有 width ⇒ 作为 flex 子项 shrink-to-fit
       ⇒ 每页宽度都不一样（"后台一会儿大一会儿小"）
     · 首页是通栏多栏布局 ⇒ 被整体居中，导航跑到页面垂直中央
     · 内容高于视口时，flex 居中会把顶部/底部裁掉
   页面级居中请各自用 .lg（登录分屏）/ .boot（启动卡片）自己搞定。

   overflow-x: hidden 是**兜底**：即使某个装饰元素偶发溢出，
   也不会让整页出现横向滚动条。
   -------------------------------------------------------------------------- */
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

::selection {
    background: var(--violet);
    color: #fff;
}

/* --------------------------------------------------------------------------
   全局：光标光晕（三端共用）
   一个 fixed 的紫色径向光斑，用 rAF 平滑跟随鼠标；触摸设备不启用。
   ★ 必须 position: fixed —— 否则它会参与文档流，JS 一改 transform
     就把一个占满宽度的块平移出去，直接撑出横向滚动条。
   -------------------------------------------------------------------------- */
.it-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 520px;
    height: 520px;
    margin: -260px 0 0 -260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, .13) 0%,
    rgba(168, 85, 247, .07) 38%, rgba(168, 85, 247, 0) 68%);
    pointer-events: none;
    z-index: 1;
    will-change: transform;
    transition: opacity .3s ease;
}

/* --------------------------------------------------------------------------
   网格底纹 + 鼠标感应高亮
   .it-grid 铺静态灰网格；.it-grid-hot 是紫色网格，
   用 mask 只让它出现在光标附近 —— 纯 CSS，不产生重排。
   -------------------------------------------------------------------------- */
.it-grid,
.it-grid-hot {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(to right, var(--gray-200) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gray-200) 1px, transparent 1px);
    background-size: 56px 56px;
}

.it-grid {
    opacity: .55;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
}

.it-grid-hot {
    background-image: linear-gradient(to right, rgba(124, 58, 237, .55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124, 58, 237, .55) 1px, transparent 1px);
    -webkit-mask-image: radial-gradient(circle 190px at var(--mx, -999px) var(--my, -999px),
    #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
    mask-image: radial-gradient(circle 190px at var(--mx, -999px) var(--my, -999px),
    #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
    opacity: 0;
    transition: opacity .25s ease;
}

/* 深色底上的网格 */
.it-grid.on-dark {
    background-image: linear-gradient(to right, rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .07) 1px, transparent 1px);
    opacity: 1;
}

.it-grid-hot.on-dark {
    background-image: linear-gradient(to right, rgba(168, 85, 247, .75) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(168, 85, 247, .75) 1px, transparent 1px);
}

/* --------------------------------------------------------------------------
   方格底纹（fixed 版，用于内容较短的页面）
   -------------------------------------------------------------------------- */
.it-grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
    linear-gradient(to right, var(--gray-200) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gray-200) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: .55;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
}

/* --------------------------------------------------------------------------
   通用方块件
   -------------------------------------------------------------------------- */
/* 方形小色块（后台侧栏用，6px） */
.sq {
    display: inline-block;
    width: 6px;
    height: 6px;
    flex: none;
}

.sq.grad {
    background: var(--grad);
}

/* 方形小色块（前台 / 播放页用，8px）
   ★ .sq 与 .it-sq 是两个独立的类，别合并 —— 后台的排版权依赖 .sq 的 6px */
.it-sq {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--ink);
    flex: none;
}

.it-sq.grad {
    background: var(--grad);
}

/* 方形标签 */
.it-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid var(--gray-300);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--gray-700);
    background: var(--paper);
}

.it-tag .it-sq {
    width: 6px;
    height: 6px;
}

/* 主按钮：黑底白字，hover 时紫色从左扫入 */
.it-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 26px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    overflow: hidden;
    transition: color .25s, border-color .25s;
    font-family: var(--font);
}

.it-btn > * {
    position: relative;
    z-index: 1;
}

.it-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grad);
    transform: translateX(-101%);
    transition: transform .38s cubic-bezier(.6, .05, .2, 1);
}

.it-btn:hover::before {
    transform: translateX(0);
}

.it-btn:active {
    transform: translateY(1px);
}

/* 次按钮：白底黑框 */
.it-btn.ghost {
    background: var(--paper);
    color: var(--ink);
}

.it-btn.ghost:hover {
    color: #fff;
    border-color: var(--violet);
}

.it-btn.ghost::before {
    background: var(--grad);
}

/* 反色（深底上用） */
.it-btn.inv {
    background: #fff;
    color: var(--ink);
    border-color: #fff;
}

/* --------------------------------------------------------------------------
   方形涟漪（点击反馈）
   ★ 同样必须 position: fixed，理由与 .it-glow 相同
   -------------------------------------------------------------------------- */
.it-ripple {
    position: fixed;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 1px solid var(--violet);
    background: rgba(124, 58, 237, .14);
    pointer-events: none;
    z-index: 9999;
    animation: itRipple .62s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes itRipple {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: .9;
    }
    100% {
        transform: scale(13) rotate(45deg);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   入场动画（一次性，克制）
   -------------------------------------------------------------------------- */
.it-in {
    opacity: 0;
    transform: translateY(14px);
    animation: itIn .7s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes itIn {
    to {
        opacity: 1;
        transform: none;
    }
}

.it-d1 { animation-delay: .06s; }
.it-d2 { animation-delay: .14s; }
.it-d3 { animation-delay: .22s; }
.it-d4 { animation-delay: .30s; }
.it-d5 { animation-delay: .38s; }

/* --------------------------------------------------------------------------
   启动卡片（.boot）
   ★ 历史遗留：首页已改为模板渲染（app/index/view/index/tpl/），这套类当前
     没有页面在用。保留是因为 body 不再做 flex 居中了，这里自带居中逻辑，
     万一将来有页面复用也不会塌。
   -------------------------------------------------------------------------- */
.boot {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px 24px;
}

.boot-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    color: var(--gray-500);
    margin-bottom: 22px;
}

.boot h1 {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.15;
}

.boot h1 em {
    font-style: normal;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.boot-desc {
    margin-top: 14px;
    font-size: 14px;
    color: var(--gray-500);
}

.boot-meta {
    margin-top: 40px;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--gray-200);
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.boot-meta > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 4px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13.5px;
}

.boot-meta dt {
    color: var(--gray-500);
}

.boot-meta dd {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.boot-meta dd a {
    color: var(--violet);
    border-bottom: 1px solid var(--violet-xs);
}

/* --------------------------------------------------------------------------
   无障碍 / 移动端
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .it-glow, .it-grid-hot {
        display: none !important;
    }

    .it-in {
        opacity: 1;
        transform: none;
    }
}

@media (hover: none) {
    .it-glow {
        display: none;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
