/* ========================================
   MT 前台监控页 - 最终完整版（PC + 手机完美适配）
   修复：接口卡片手机端内容右偏问题
   ======================================== */
:root {
    --primary: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e1b4b;
    --card-radius: 16px;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
}

/* ========== 页眉页脚统一宽度 ========== */
.header-card-wrapper,
.footer-card-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}
.header-card-wrapper { padding-top: 20px; }
.footer-card-wrapper { padding-bottom: 20px; }

/* ========== 卡片式页眉 ========== */
.header-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
    z-index: 10;
    overflow: visible;
}
.header-card:hover {
    box-shadow: 0 16px 36px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* ----- 导航按钮 ----- */
.header-nav-btn {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; color: #fff; font-weight: 500; font-size: 0.95rem;
    padding: 10px 22px; border-radius: 40px; cursor: pointer;
    transition: all 0.2s ease; text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.header-nav-btn i { font-size: 0.95rem; }
.header-nav-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.15); color: #fff; }

.header-nav-purple { background: linear-gradient(145deg, #6366f1, #4f46e5); box-shadow: 0 4px 10px rgba(99,102,241,0.3); }
.header-nav-purple:hover { background: linear-gradient(145deg, #4f46e5, #3730a3); }
.header-nav-blue { background: linear-gradient(145deg, #3b82f6, #2563eb); box-shadow: 0 4px 10px rgba(59,130,246,0.3); }
.header-nav-blue:hover { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.header-nav-teal { background: linear-gradient(145deg, #14b8a6, #0d9488); box-shadow: 0 4px 10px rgba(20,184,166,0.3); }
.header-nav-teal:hover { background: linear-gradient(145deg, #0d9488, #0f766e); }
.header-nav-green { background: linear-gradient(145deg, #10b981, #059669); box-shadow: 0 4px 10px rgba(16,185,129,0.3); }
.header-nav-green:hover { background: linear-gradient(145deg, #059669, #047857); }
.header-nav-gold { background: linear-gradient(145deg, #f59e0b, #d97706); box-shadow: 0 4px 10px rgba(245,158,11,0.3); }
.header-nav-gold:hover { background: linear-gradient(145deg, #d97706, #b45309); }

.header-nav-btn.active-nav { box-shadow: 0 6px 14px rgba(0,0,0,0.2); transform: scale(1.03); }
.header-nav-btn.dropdown-toggle::after { margin-left: 4px; font-size: 0.7rem; }

/* 下拉菜单 */
.dropdown-menu-glass {
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
    border: 1px solid rgba(99,102,241,0.15); border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.1); padding: 8px 0;
    min-width: 180px; z-index: 99999 !important;
    position: absolute;
}
.dropdown { position: relative; }
.dropdown-menu-glass .dropdown-item {
    display: flex; align-items: center; color: #3a3a5a; font-weight: 500;
    padding: 10px 20px; transition: all 0.2s; font-size: 0.9rem;
}
.dropdown-menu-glass .dropdown-item i { width: 20px; text-align: center; color: #6366f1; opacity: 0.8; }
.dropdown-menu-glass .dropdown-item:hover { background: rgba(99,102,241,0.07); color: #4f46e5; }

/* ========== 主内容区 ========== */
.main-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* 面板切换 */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ========== 首页标语 ========== */
.home-slogan { margin-bottom: 2.5rem; }
.slogan-line-1 {
    font-size: 3.2rem; font-weight: 800; letter-spacing: 8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f0c040, #f5d060);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.slogan-line-2 {
    font-size: 1.5rem; font-weight: 500;
    color: rgba(30, 27, 75, 0.75); letter-spacing: 3px;
}

/* ========== 首页大卡片 ========== */
.home-hero-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s;
}
.home-hero-card:hover { box-shadow: 0 24px 48px rgba(99, 102, 241, 0.15); }

/* ----- 跳转卡片 ----- */
.blog-jump-card {
    background: linear-gradient(135deg, #667eea, #764ba2, #a855f7);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 16px 35px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}
.blog-jump-card:hover { transform: scale(1.02); box-shadow: 0 20px 45px rgba(99, 102, 241, 0.55); }

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.blog-jump-title { display: flex; justify-content: center; gap: 14px; margin: 0 0 0.5rem; }
.blog-jump-title span {
    display: inline-block;
    font-size: 3.8rem; font-weight: 800;
    text-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: default;
    animation-duration: 0.5s; animation-timing-function: ease; animation-fill-mode: forwards;
}

@keyframes bounceUp {
    0%   { transform: translateY(0); }
    40%  { transform: translateY(-18px); }
    70%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
.bounce-up { animation-name: bounceUp; }

/* ----- 彩色虚线 ----- */
.colorful-dashed {
    height: 3px;
    margin: 2rem auto;
    background: linear-gradient(90deg, #f0c040, #f59e0b, #10b981, #3b82f6, #8b5cf6, #ec4899, #f0c040);
    background-size: 200% auto;
    border-radius: 4px;
    animation: shimmer 6s linear infinite;
    width: 85%;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ========== 介绍区域 ========== */
.intro-row {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    margin-top: 2rem;
}

.intro-label {
    flex: 0 0 150px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s;
}

.router-label {
    background: rgba(67, 56, 202, 0.12);
    border: 1px solid rgba(67, 56, 202, 0.35);
    color: #4338ca;
}
.router-label i { color: #4338ca; }

.service-label {
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: #b45309;
}
.service-label i { color: #b45309; }

.contact-label {
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.35);
    color: #e11d48 !important;
}
.contact-label i { color: #e11d48 !important; }

.intro-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.intro-content:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.15);
}

.intro-content p {
    margin: 0;
    line-height: 1.75;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: justify;
}

.contact-icons i { margin-right: 6px; }
.contact-icons i.fa-phone-alt { color: #10b981; }
.contact-icons i.fa-qq { color: #ff4d4f; }
.contact-icons i.fa-weixin { color: #2b8c5e; }

/* ========== 监控面板样式 ========== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-radius: var(--card-radius); padding: 25px; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.stat-icon {
    width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px; font-size: 24px; color: white;
}
.stat-icon.total { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-icon.online { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-icon.offline { background: linear-gradient(135deg, #ef4444, #f87171); }
.stat-icon.users { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-value { font-size: 36px; font-weight: 700; color: var(--dark); }

.router-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 25px; }
.router-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-radius: var(--card-radius); overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}
.router-header {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white; padding: 20px 25px;
}
.router-header.offline { background: linear-gradient(135deg, #6b7280, #4b5563); }
.router-title { display: flex; justify-content: space-between; align-items: center; }
.router-name { font-size: 20px; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.online { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,0.3); }
.status-dot.offline { background: #ef4444; }
.router-body { padding: 25px; }

.resource-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; }
.resource-card {
    background: #ffffff; border: 1px solid #e9ecef; border-radius: 14px;
    padding: 20px 16px; text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.resource-icon { font-size: 22px; margin-bottom: 4px; }
.resource-label { font-size: 0.85rem; font-weight: 500; color: #6c757d; margin-bottom: 8px; }
.resource-value { font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.progress { height: 6px; border-radius: 3px; background: #e2e8f0; }
.progress-bar.cpu { background: #f59e0b; }
.progress-bar.mem { background: #06b6d4; }

.resource-stats { display: flex; justify-content: space-around; margin-top: 10px; }
.stat-item { text-align: center; }
.stat-title { display: block; font-size: 0.75rem; color: #6c757d; margin-bottom: 4px; }
.stat-num { font-size: 1.2rem; font-weight: 700; color: #333; }

.interface-grid { display: grid; gap: 14px; margin-top: 15px; }
.interface-card {
    background: #ffffff; border: 1px solid #e9ecef; border-radius: 12px;
    padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}
.interface-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.interface-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee;
}
.interface-name { font-weight: 600; color: var(--dark); font-size: 15px; }
.interface-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interface-stat-item {
    background: #f8f9fa; padding: 10px; border-radius: 8px; text-align: center;
}
.upload { color: #10b981; }
.download { color: #3b82f6; }
.small.text-muted { font-size: 11px; color: #adb5bd; margin-top: 2px; }

.empty-state { text-align: center; padding: 60px; color: white; }

/* ========== 卡片式页脚 ========== */
.footer-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* ========== 玻璃面板 ========== */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===================== 手机端汉堡菜单 ===================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #4f46e5;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}
.desktop-nav {
    display: flex;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
    .mobile-menu-toggle {
        display: block;
    }
}

/* 侧边栏 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.mobile-sidebar.open {
    left: 0;
}
.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 1.1rem;
}
.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #666;
    cursor: pointer;
}
.mobile-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}
.mobile-nav-item:hover {
    background: #f0f0ff;
    color: #4f46e5;
}
.mobile-nav-section-title {
    padding: 12px 20px 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.mobile-nav-sub {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.mobile-nav-sub:hover {
    background: #f4f4ff;
    color: #4f46e5;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    display: none;
}
.mobile-sidebar-overlay.show {
    display: block;
}

/* ========================================
   全站内容手机端适配 ( ≤ 768px )
   修复：接口卡片内容不再右偏
   ======================================== */
@media (max-width: 768px) {
    .main-container { padding: 10px; }

    .slogan-line-1 { font-size: 1.8rem; letter-spacing: 2px; }
    .slogan-line-2 { font-size: 0.9rem; }

    .home-hero-card { padding: 1.5rem 1rem; }

    .blog-jump-card { padding: 1.5rem 1rem; }
    .blog-jump-title span { font-size: 2.2rem; }
    .blog-jump-card p { font-size: 0.85rem; }

    .colorful-dashed { margin: 1.5rem auto; width: 90%; }

    .intro-row { flex-direction: column; gap: 0.8rem; }
    .intro-label {
        flex: 0 0 auto; width: 100%; justify-content: flex-start;
        padding: 0.6rem 1rem; white-space: normal; font-size: 1rem;
    }
    .intro-content { padding: 1rem; }
    .intro-content p { font-size: 0.9rem; line-height: 1.6; }
    .contact-icons { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.85rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 8px; }
    .stat-icon { width: 44px; height: 44px; font-size: 18px; margin-bottom: 8px; }
    .stat-value { font-size: 24px; }
    .stat-card div:last-child { font-size: 0.8rem; }

    .router-grid { grid-template-columns: 1fr; gap: 16px; }
    .router-header { padding: 14px 16px; }
    .router-title { flex-direction: column; align-items: flex-start; gap: 6px; }
    .router-name { font-size: 16px; }
    .router-body { padding: 16px; }

    .resource-cards { grid-template-columns: 1fr; gap: 10px; }
    .resource-card {
        display: flex; align-items: center; flex-wrap: wrap;
        padding: 12px; text-align: left; gap: 10px;
    }
    .resource-icon { margin-bottom: 0; font-size: 20px; width: 36px; flex-shrink: 0; }
    .resource-label { margin-bottom: 0; font-size: 0.9rem; flex: 1 1 auto; }
    .resource-value { font-size: 18px; margin-bottom: 0; text-align: right; font-weight: 700; }
    .resource-card .progress { width: 100%; margin-top: 6px; margin-left: 0; }
    .resource-stats { width: 100%; margin-top: 6px; justify-content: space-around; }

    /* 接口网格修复：取消flex可能导致的对齐异常，保持块级布局 */
    .interface-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .interface-card { padding: 12px; }
    .interface-stats { grid-template-columns: 1fr; gap: 8px; }
    .interface-stat-item {
        display: block;            /* 改回块级，避免flex内容右漂 */
        text-align: left;          /* 文字左对齐 */
        padding: 8px 12px;
    }
    /* 让上传/下载的数值依然显眼 */
    .interface-stat-item .fw-bold {
        font-size: 1.1rem;
        margin: 4px 0;
    }
    .interface-name { font-size: 14px; word-break: break-all; }

    .router-body .d-flex.justify-content-between { flex-direction: column; gap: 4px; font-size: 12px; }

    .glass-panel { padding: 1.2rem; }

    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    img, svg, video, canvas { max-width: 100%; height: auto; }
}