/* ==========================================================================
   浩宇软件工作室 · 工具站子页面统一主题
   与 gongnengzhan/index.html 保持一致的配色、导航与背景风格
   ========================================================================== */

:root {
    --bg: #0b1020;
    --text: #eef2ff;
    --text-dim: rgba(238, 242, 255, 0.68);
    --text-faint: rgba(238, 242, 255, 0.45);
    --glass: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.10);
    --stroke: rgba(255, 255, 255, 0.14);
    --stroke-strong: rgba(255, 255, 255, 0.24);
    --accent: #60a5fa;
    --accent-2: #22d3ee;
    --accent-3: #a78bfa;
    --on-accent: #04121f;
    --nav-mobile-bg: rgba(11, 16, 32, 0.92);
    --footer-bg: rgba(0, 0, 0, 0.25);
    --radius: 20px;
    --radius-lg: 28px;
    /* 页面左右内边距（供页脚抵消，使页脚铺满整宽） */
    --page-gutter: 0px;
}

/* ===== 浅色主题（默认跟随首页的主题开关，页面里也可自行切换）===== */
[data-theme="light"] {
    --bg: #eef2f9;
    --text: #0f172a;
    --text-dim: rgba(15, 23, 42, 0.72);
    --text-faint: rgba(15, 23, 42, 0.5);
    --glass: rgba(255, 255, 255, 0.55);
    --glass-strong: rgba(255, 255, 255, 0.78);
    --stroke: rgba(15, 23, 42, 0.12);
    --stroke-strong: rgba(15, 23, 42, 0.22);
    --accent: #2563eb;
    --accent-2: #0891b2;
    --accent-3: #7c3aed;
    --on-accent: #ffffff;
    --nav-mobile-bg: rgba(238, 242, 249, 0.96);
    --footer-bg: rgba(255, 255, 255, 0.4);
}

/* 暗场遮罩反过来：浅色主题下压白，保证文字依然可读 */
[data-theme="light"] body::before {
    background: linear-gradient(180deg, rgba(238, 242, 249, 0.6) 0%, rgba(238, 242, 249, 0.38) 45%, rgba(238, 242, 249, 0.66) 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", sans-serif;
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* 纵向弹性布局：内容不足一屏时页脚也贴底 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 内容区撑开剩余空间，把页脚顶到页面底部 */
body > .container,
body > main {
    flex: 1 0 auto;
}

/* 背景变暗遮罩 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(11, 16, 32, 0.55) 0%, rgba(11, 16, 32, 0.35) 45%, rgba(11, 16, 32, 0.6) 100%);
    pointer-events: none;
}

/* 带固定导航栏的页面需加 has-nav，避免内容被胶囊遮挡 */
body.has-nav {
    padding-top: 98px;
}

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

/* ===== 导航栏（悬浮胶囊） ===== */
.navbar {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 1000;
}
.nav-inner {
    width: min(1180px, 92%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 66px;
    padding: 0 8px 0 18px;
    border-radius: 999px;
    background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--stroke);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 34px rgba(0, 0, 0, 0.32);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}
.brand-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex: none;
}
.nav-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    color: var(--text-dim);
    font-size: 0.92rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.nav-home:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
}
/* 主题切换按钮：与首页右上角那颗同款（圆形玻璃），浅色主题下同样要有玻璃感而不是一块死白 */
.theme-toggle {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    color: var(--text);
    font-size: 1.05rem;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.theme-toggle:hover {
    border-color: var(--stroke-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 22px rgba(0, 0, 0, 0.3);
    transform: rotate(25deg);
}
[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .theme-toggle:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 22px rgba(15, 23, 42, 0.16);
}

/* ===== 玻璃卡片 ===== */
.glass {
    background: var(--glass);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 统一页脚（与官网首页保持一致） ===== */
.hy-footer {
    margin-top: 70px;
    padding: 50px 0 36px;
    border-top: 1px solid var(--stroke);
    background: var(--footer-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    /* 抵消页面的左右内边距，页脚始终铺满整宽 */
    align-self: stretch;
    margin-left: calc(-1 * var(--page-gutter));
    margin-right: calc(-1 * var(--page-gutter));
}
.hy-footer-inner {
    width: min(1180px, 92%);
    margin: 0 auto;
}
.hy-footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
.hy-footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hy-footer-logo {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}
.hy-footer-name {
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    padding-left: 14px;
    border-left: 1px solid var(--stroke);
}
.hy-footer-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.hy-footer-links a {
    color: var(--text-faint);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.hy-footer-links a:hover {
    color: var(--text);
}
.hy-footer-bottom {
    border-top: 1px solid var(--stroke);
    padding-top: 24px;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.82rem;
    line-height: 1.9;
}
.hy-footer-bottom p {
    margin: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    body.has-nav {
        padding-top: 92px;
    }
    .nav-inner {
        height: 58px;
        padding: 0 8px 0 14px;
    }
    /* 34px 的横版 Logo（比例 6:1）宽 204px，加上「返回工具站」按钮和内边距约 344px，
       360px 左右的屏幕上会把按钮顶出胶囊、挤出屏幕，这里一起收小 */
    .brand-logo {
        height: 30px;
    }
    .nav-home {
        padding: 7px 12px;
        gap: 6px;
        font-size: 0.82rem;
    }
    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .hy-footer {
        margin-top: 50px;
        padding: 36px 0 26px;
    }
    .hy-footer-grid {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }
    .hy-footer-links {
        gap: 16px;
    }
}

/* 更小的手机（≤380px）：再把 Logo 和返回按钮收一档，320px 的机器也不会横向溢出 */
@media (max-width: 380px) {
    .nav-inner {
        padding: 0 6px 0 12px;
    }
    .brand-logo {
        height: 24px;
    }
    .nav-home {
        padding: 6px 10px;
        gap: 5px;
        font-size: 0.76rem;
    }
    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.88rem;
    }
}
