/* ============================================================
   深色科技风 · 完整主题
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
    --primary: #38bdf8;
    --primary-dark: #2563eb;
    --bg: #0f172a;
    --card: #1e293b;
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.05);
    --text: #cbd5e1;
    --text-strong: #f8fafc;
    --muted: #94a3b8;
    --danger: #f87171;
    --radius: 10px;
}

/* ---------- 全局 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    background: var(--bg);
}
.nav-right span {
    color: #ffffff;
}
.nav-right {
    margin-left: 10px;
}
body {
    color: #2a2a2a;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    padding-top: 70px;
    padding-bottom: 80px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: #7dd3fc; }

/* ============================================================
   顶部导航栏（header.php）
   ============================================================ */
.topbar,nav.admin-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 32px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex: none;
    text-decoration: none;
}

.topbar-logo img { display: none; }

.topbar-logo::before {
    content: "H";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #38bdf8 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    font-family: "Arial Black", "PingFang SC", sans-serif;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.45);
    flex: none;
}

.topbar-logo::after {
    content: "HUIY 云服务";
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.topbar-nav a {
    color: #cbd5e1;
    font-size: 14px;
    padding: 6px 4px;
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.2s;
}
.topbar-nav a:hover { color: var(--primary); }

.topbar-nav a.btn-login {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    padding: 8px 22px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
    transition: all 0.2s;
}
.topbar-nav a.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.5);
    color: #fff;
}

.topbar-nav a.btn-member {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.4);
    transition: all 0.2s;
}
.topbar-nav a.btn-member:hover {
    background: var(--primary);
    color: #fff;
}

.topbar-user {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 14px;
}

.topbar-nav a.topbar-link-muted {
    color: var(--muted);
    font-size: 13px;
}
.topbar-nav a.topbar-link-muted:hover { color: var(--danger); }

/* ============================================================
   服务器横幅：全宽，与导航底部平滑衔接
   ============================================================ */
.server-banner {
    position: relative;
    width: 100%;
    height: 350px;
    margin: 0;
    overflow: hidden;

    /* 从导航底部色 #1e293b 渐变到页面底色 #0f172a —— 无缝衔接 */
    background: linear-gradient(180deg,
        #1e293b 0%,
        #1a2436 35%,
        #131d30 70%,
        #0f172a 100%
    );

    /* 只保留底部的细分割线，两侧不留任何边框 */
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* 网格层：用 CSS 铺满整宽，保证 1200px 之外也有网格 */
.server-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* 中心柔和光晕 */
.server-banner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -120px;
    width: 900px;
    height: 400px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center,
        rgba(56, 189, 248, 0.22) 0%,
        rgba(56, 189, 248, 0.08) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.server-banner svg {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* 灯珠呼吸动画 */
@keyframes serverBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
.server-banner .light {
    animation: serverBlink 2s ease-in-out infinite;
}
.server-banner .light.delay1 { animation-delay: 0.4s; }
.server-banner .light.delay2 { animation-delay: 0.8s; }
.server-banner .light.delay3 { animation-delay: 1.2s; }

/* ============================================================
   页面主体
   ============================================================ */
.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 24px;
}

h1.page-title {
    font-size: 22px;
    margin: 0 0 20px;
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: -0.5px;
}

/* ---------- 大分类导航 ---------- */
.nav {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
    background-clip: padding-box;
}

.nav a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.nav a.active {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

/* ---------- 分类主标题 ---------- */
.cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-strong);
    padding-left: 11px;
    border-left: 4px solid var(--primary);
    margin: 22px 0 12px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

/* ---------- 小分类导航 ---------- */
.subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.subnav::before {
    content: "小分类：";
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
}

.subnav a {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.subnav a:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
}
.subnav a.active {
    background: rgba(56, 189, 248, 0.18);
    color: var(--primary);
    font-weight: 700;
}
.wrap {
    margin-top: 20px;
}
.btn-outline.gd{
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #4a90e2;
    color: #4a90e2!important;
    font-size: 14px;
}


/* ---------- 面包屑 ---------- */
.crumb {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.crumb a {
    color: var(--primary);
    font-weight: 500;
    transition: color 0.2s;
}
.crumb a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}
.crumb span {
    color: var(--text-strong);
    font-weight: 600;
}

/* ---------- 分类区块卡片 ---------- */
.block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
color: var(--text);
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.block-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-strong);
    display: flex;
    align-items: center;
}

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 9px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1.6;
}

.more {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    padding: 5px 13px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.1);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.more:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------- 数据表格 ---------- */
.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    background: transparent;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    vertical-align: middle;
}

th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background 0.2s;
}
tbody tr:hover td {
    background: rgba(56, 189, 248, 0.06);
}
tbody tr:last-child td {
    border-bottom: none;
}

td.id {
    font-weight: 700;
    color: var(--text-strong);
    font-family: "SF Mono", "Monaco", "Consolas", monospace;
    font-size: 13px;
}

td.price {
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

td.buy {
    text-align: center;
}

/* ---------- 购买按钮 ---------- */
.buy a {
    display: inline-block;
    padding: 6px 18px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
.buy a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.5);
    color: #fff;
}

/* ---------- 空状态 ---------- */
.empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ============================================================
   底部固定条（yd.php）
   ============================================================ */
.server-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.server-bar__text { flex: 1; min-width: 0; }

.server-bar__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-bar__desc {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-bar__btn {
    flex: none;
    display: inline-block;
    padding: 9px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}
.server-bar__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.45);
    color: #fff;
}

.server-bar__close {
    flex: none;
    width: 28px;
    height: 28px;
    line-height: 1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 16px;
    transition: all 0.2s;
}
.server-bar__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================================
   滚动条
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .topbar {
        height: 60px;
        padding: 0 16px;
    }
    .topbar-logo::before {
        width: 32px;
        height: 32px;
        font-size: 17px;
        border-radius: 8px;
    }
    .topbar-logo::after { font-size: 16px; }
    .topbar-nav { gap: 14px; }
    .topbar-nav a { font-size: 13px; }
    .topbar-nav a.btn-login,
    .topbar-nav a.btn-member { padding: 6px 16px; font-size: 13px; }
    body { padding-top: 60px; }

    .server-banner { height: 220px; }

    .page { padding: 16px 14px; }
    .cat-title { font-size: 15px; margin: 18px 0 10px; }
    .block-head { padding: 10px 14px; }
    .block-head h2 { font-size: 13px; }

    th, td { padding: 8px 10px; font-size: 12px; }
    td.price { font-size: 13px; }
    .buy a { padding: 5px 14px; font-size: 11px; }
}

@media (max-width: 560px) {
    body { padding-bottom: 110px; }
    .server-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    }
    .server-bar__title { font-size: 14px; }
    .server-bar__desc { font-size: 11px; }
    .server-bar__btn {
        flex: 1 1 100%;
        text-align: center;
        padding: 10px 0;
        order: 3;
    }
}