/* ==========================================================
   CIALLOGAMES.COM — 公共样式
   机能风：浅灰底 + 坐标网格 + 发丝线 + 角标 + 等宽元数据
   品牌色沿用官网：Ciallo Blue #0066FF / Signal Lime #D4FF3A
   ========================================================== */

@font-face {
    font-family: "Space Grotesk";
    src: url("/assets/fonts/space-grotesk.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
}

:root {
    --bg: #eceee9;
    --bg-2: #e2e5df;
    --panel: #f6f7f3;
    --fg: #101214;
    --fg-2: rgba(16, 18, 20, 0.64);
    --fg-3: rgba(16, 18, 20, 0.4);
    --line: rgba(16, 18, 20, 0.18);
    --line-2: rgba(16, 18, 20, 0.07);
    --inv: #f6f7f3;
    --blue: #0066ff;
    --signal: #d4ff3a;
    --ink: #101214; /* 信号绿上的字，永远深色 */

    --f-sans: "Space Grotesk", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io: cubic-bezier(0.77, 0, 0.18, 1);
    --nav-h: 56px;
    --pad: clamp(16px, 3.6vw, 56px);
    --grid: 48px;
    color-scheme: light;
}
[data-theme="dark"] {
    --bg: #0b0c0e;
    --bg-2: #121417;
    --panel: #15171a;
    --fg: #e8eae4;
    --fg-2: rgba(232, 234, 228, 0.66);
    --fg-3: rgba(232, 234, 228, 0.4);
    --line: rgba(232, 234, 228, 0.2);
    --line-2: rgba(232, 234, 228, 0.06);
    --inv: #0b0c0e;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100svh;
    background-color: var(--bg);
    /* 坐标网格 */
    background-image:
        linear-gradient(var(--line-2) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
    background-size: var(--grid) var(--grid);
    background-position: -1px -1px;
    color: var(--fg);
    font-family: var(--f-sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s, color 0.4s;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 原子 ---------- */
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.4; }
.dim { color: var(--fg-3); }

.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 7px 2px;
    font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.3;
    background: var(--fg); color: var(--inv);
}
.tag.sig { background: var(--signal); color: var(--ink); }
.tag.line { background: none; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }

/* 状态灯 */
.lamp { display: inline-block; width: 7px; height: 7px; background: var(--signal); box-shadow: 0 0 0 2px rgba(212, 255, 58, 0.25); animation: lamp 1.6s steps(2, end) infinite; }
.lamp.off { background: var(--fg-3); box-shadow: none; animation: none; }
@keyframes lamp { 50% { opacity: 0.25; } }

/* 四角角标：给任意块加 .brk */
.brk {
    --c: var(--fg); --s: 12px; --w: 1.5px;
    background:
        linear-gradient(var(--c), var(--c)) top left / var(--s) var(--w),
        linear-gradient(var(--c), var(--c)) top left / var(--w) var(--s),
        linear-gradient(var(--c), var(--c)) top right / var(--s) var(--w),
        linear-gradient(var(--c), var(--c)) top right / var(--w) var(--s),
        linear-gradient(var(--c), var(--c)) bottom left / var(--s) var(--w),
        linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--s),
        linear-gradient(var(--c), var(--c)) bottom right / var(--s) var(--w),
        linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--s);
    background-repeat: no-repeat;
}

/* 警示斜纹 */
.hazard { background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, var(--ink) 10px 20px); }

/* 条码 */
.barcode {
    display: inline-block; width: 92px; height: 22px;
    background: repeating-linear-gradient(90deg,
        var(--fg) 0 2px, transparent 2px 3px, var(--fg) 3px 4px, transparent 4px 7px,
        var(--fg) 7px 10px, transparent 10px 11px, var(--fg) 11px 12px, transparent 12px 15px,
        var(--fg) 15px 16px, transparent 16px 18px, var(--fg) 18px 21px, transparent 21px 23px);
    opacity: 0.85;
}

/* ---------- 按钮：直角 + 切角，不用胶囊 ---------- */
.btn {
    --cut: 10px;
    position: relative;
    display: inline-flex; align-items: center; gap: 14px;
    height: 48px; padding: 0 22px 0 20px;
    font-family: var(--f-sans); font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
    background: var(--fg); color: var(--inv);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    transition: background-color 0.25s, color 0.25s;
    white-space: nowrap;
}
.btn small { font-family: var(--f-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; opacity: 0.6; }
.btn .arr { font-family: var(--f-mono); transition: transform 0.35s var(--ease); }
.btn:hover { background: var(--blue); color: #fff; }
.btn:hover .arr { transform: translateX(4px); }
.btn.sig { background: var(--signal); color: var(--ink); }
.btn.sig:hover { background: var(--fg); color: var(--inv); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); clip-path: none; }
.btn.ghost:hover { background: var(--fg); color: var(--inv); }
.btn.lg { height: 58px; padding: 0 28px 0 24px; font-size: 17px; }

/* ---------- 顶栏 ---------- */
.top-nav {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    height: var(--nav-h);
    display: flex; align-items: center; gap: 24px;
    padding: 0 var(--pad);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; height: 100%; }
.brand img { height: 18px; width: auto; }
.brand .wm-d { display: none; }
[data-theme="dark"] .brand .wm-d { display: block; }
[data-theme="dark"] .brand .wm-l { display: none; }
.brand-games {
    display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
    font-family: var(--f-mono); font-size: 11px; font-weight: 800; letter-spacing: 0.24em;
    background: var(--fg); color: var(--inv);
}
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: 28px; }
.nav-links a {
    position: relative; font-size: 14px; font-weight: 600; padding: 4px 0;
}
.nav-links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a .ext { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); margin-left: 3px; }
.nav-extras { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-sys { display: flex; align-items: center; gap: 8px; color: var(--fg-2); }
.theme-toggle {
    width: 34px; height: 34px; display: grid; place-items: center;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: background-color 0.25s;
}
.theme-toggle:hover { background: var(--fg); color: var(--inv); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.nav-toggle { display: none; width: 34px; height: 34px; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--fg); transition: transform 0.3s, opacity 0.3s; }
.nav-toggle span:nth-child(1) { top: 12px; }
.nav-toggle span:nth-child(2) { top: 16.5px; }
.nav-toggle span:nth-child(3) { top: 21px; }
.menu-open .nav-toggle span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-sys { display: none; }
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed; top: var(--nav-h); left: 0; right: 0; margin: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--line);
        transform: translateY(-8px); opacity: 0; pointer-events: none;
        transition: transform 0.3s var(--ease), opacity 0.3s;
    }
    .nav-links a { padding: 16px var(--pad); border-top: 1px solid var(--line-2); font-size: 16px; }
    .nav-links a::after { display: none; }
    .menu-open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
}

/* ---------- 弹窗（联系我们） ---------- */
.modal {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center; padding: 20px;
    background: rgba(8, 9, 10, 0.5);
    opacity: 0; transition: opacity 0.3s;
}
.modal.active { opacity: 1; }
.modal[hidden] { display: none; }
.modal-panel {
    position: relative; width: min(560px, 100%);
    padding: 34px 30px 26px;
    background: var(--panel); color: var(--fg);
    transform: translateY(14px); transition: transform 0.4s var(--ease);
}
.modal.active .modal-panel { transform: none; }
.modal-panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; font-size: 22px; line-height: 1; }
.modal-close:hover { background: var(--fg); color: var(--inv); }
.modal-title { margin: 6px 0 18px; font-size: 26px; font-weight: 800; }

.ct-list { list-style: none; margin: 0; padding: 0; }
.ct-item {
    width: 100%; display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px;
    padding: 13px 4px; text-align: left; border-top: 1px solid var(--line);
    transition: background-color 0.2s, padding 0.3s var(--ease);
}
.ct-list li:last-child .ct-item { border-bottom: 1px solid var(--line); }
.ct-item:hover { background: var(--fg); color: var(--inv); padding-left: 12px; }
.ct-en { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; opacity: 0.55; }
.ct-value { font-weight: 600; }
.ct-value small { font-weight: 400; opacity: 0.6; margin-left: 6px; }
.ct-arrow { font-family: var(--f-mono); opacity: 0.6; }

/* ---------- 页脚 ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); background: var(--bg-2); }
.ft-band { height: 8px; }
.ft-grid {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 40px;
    padding: 56px var(--pad) 44px;
}
.ft-grid h3 { margin: 0 0 14px; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; color: var(--fg-3); }
.ft-grid ul { list-style: none; margin: 0; padding: 0; }
.ft-links a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 14px; }
.ft-links a span:last-child { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); font-weight: 400; }
.ft-links a:hover { color: var(--blue); }
.ft-about p { margin: 0 0 18px; color: var(--fg-2); font-size: 14px; }
.ft-mark { font-family: var(--f-sans); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; line-height: 1; margin-bottom: 14px; }
.ft-mark b { display: inline-block; padding: 2px 6px; margin-left: 6px; background: var(--fg); color: var(--inv); font-family: var(--f-mono); font-size: 14px; letter-spacing: 0.24em; vertical-align: middle; }
.ft-contacts .ct-item { padding: 9px 2px; grid-template-columns: 84px 1fr auto; font-size: 14px; }
.ft-bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px var(--pad); border-top: 1px solid var(--line);
    font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-3);
}
.ft-bottom a:hover { color: var(--fg); }
@media (max-width: 960px) {
    .ft-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .ft-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 96px; z-index: 120;
    padding: 10px 16px; background: var(--fg); color: var(--inv);
    font-size: 14px; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
    .reveal { opacity: 1; transform: none; }
}
