/* style.css - IPTV 监控面板样式 */
:root {
    --bg: #0a0e17;
    --card-bg: rgba(18, 25, 38, 0.85);
    --border: rgba(0, 255, 255, 0.15);
    --text: #e0f0ff;
    --accent: #00f3ff;
    --accent2: #a855f7;
    --header-bg: rgba(12, 18, 28, 0.9);
    --offline-color: #ff5555;
    --online-color: #00ff88;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    background: radial-gradient(circle at 20% 30%, #121a2f, #080c16);
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 顶部导航，宽度1400px居中 */
.top-nav {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo-img {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}
.nav-links {
    display: flex;
    gap: 0.8rem;
    list-style: none;
    flex-wrap: wrap;
}
.nav-links a {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.nav-links a:hover {
    background: rgba(0,243,255,0.15);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(0,243,255,0.3);
    transform: translateY(-2px);
}

/* 主内容区：1400px宽度居中，加边框 */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem 2rem 1rem;
    background: rgba(18, 25, 38, 0.3);       /* 半透明背景 */
    border: 1px solid var(--border);         /* 边框 */
    border-radius: 16px;                     /* 圆角 */
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
h1 {
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(0,243,255,0.3));
}
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: flex-start;     /* 左对齐，但因为4个刚好填满，视觉居中 */
}
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    /* 自适应宽度：一行4个，减去3个间隙 */
    width: calc((100% - 3 * 1.2rem) / 4);
    min-width: 260px;                 /* 防止过窄 */
    height: 150px;
    padding: 0.8rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    animation: fadeUp 0.6s ease-out both;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(0,243,255,0.25), 0 0 16px rgba(168,85,247,0.2);
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.card:hover::before { transform: scaleX(1); }
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.ip-port {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 6px rgba(0,243,255,0.4);
    word-break: break-all;
    line-height: 1.2;
}
.status-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(0,255,136,0.15);
    color: var(--online-color);
    border: 1px solid var(--online-color);
}
.status-badge.offline {
    background: rgba(255,85,85,0.15);
    color: var(--offline-color);
    border-color: var(--offline-color);
}
.count-box { text-align: right; }
.count-num {
    font-size: 1.7rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00f3ff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.count-label { font-size: 0.7rem; opacity: 0.7; display: block; }
.btn-view {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(0,243,255,0.3);
    color: var(--accent);
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.3s;
    align-self: flex-start;
}
.btn-view:hover {
    background: rgba(0,243,255,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0,243,255,0.4);
    color: #fff;
}
.info-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    opacity: 0.85;
}
.info-row .icon { font-size: 0.75rem; }
.time { font-size: 0.65rem; color: rgba(255,255,255,0.45); }
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    font-size: 1.2rem;
    opacity: 0.5;
}

/* 页脚 */
.footer {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.2rem 1rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.8;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* 动画 */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(n+6) { animation-delay: 0.3s; }

/* 移动端适配 */
@media screen and (max-width: 1024px) {
    .card {
        width: calc((100% - 1.2rem) / 2);   /* 一行2个 */
        min-width: 240px;
    }
}
@media screen and (max-width: 768px) {
    .top-nav { flex-direction: column; gap: 0.8rem; padding: 0.8rem; }
    .nav-links { justify-content: center; }
    .main-content { margin: 1rem; padding: 1.2rem; }
    h1 { font-size: 1.5rem; text-align: center; }
    .card {
        width: 100%;
        max-width: 400px;
        height: auto;
        min-height: 150px;
        margin: 0 auto;
    }
}
/* 通用面板：与主内容区风格一致 */
.panel {
    width: 100%;
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 1.5rem 2rem;
    background: rgba(18, 25, 38, 0.3);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    box-sizing: border-box;
}

/* 统计面板 */
.stats-panel {
    text-align: center;
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    letter-spacing: 0.5px;
}
.stats-panel strong {
    font-weight: 600;
    margin: 0 0.2rem;
}
.stats-panel .online { color: #00ff88; }
.stats-panel .offline { color: #ff5555; }

/* 版权面板 */
.footer-panel {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.8;
}
.footer-panel a { color: var(--accent); text-decoration: none; }
.footer-panel a:hover { text-decoration: underline; }

/* 移除旧的 footer 样式（如果之前有定义，可保留不冲突） */
/* 分页样式 */
.pagination { text-align: center; margin: 1.5rem 0; }
.page-btn {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    color: #cbd5e0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(0,243,255,0.15);
    transition: 0.2s;
    cursor: pointer;
}
.page-btn:hover {
    background: rgba(0,243,255,0.15);
    color: #fff;
    border-color: var(--accent);
}
.page-btn.active {
    background: linear-gradient(135deg, #00f3ff, #a855f7);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* 卡片底部时间行：左右分布 */
.time-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.2rem;
}
.time-left {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
}
.time-right {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 6px rgba(0,243,255,0.4);
}
/* 卡片底部时间行：左右分布 */
.time-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.2rem;
}
.time-left {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
}
.time-right {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff8c00; /* 橙色 */
}
.days-num {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ff4d4d; /* 醒目的红色 */
    margin: 0 0.15rem;
}