/* ========== IDC服务商首页表格样式 ========== */

/* 主容器调整 */
main.main > .main-inner > .main-inner-content {
    overflow: visible !important;
    padding: 0 !important;
}

/* ========== 表格基础 ========== */
.game-table-wrapper {
    width: 100%;
}

.top-table,
.promo-table,
.normal-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border: 1px solid #444;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    table-layout: fixed;
}

.top-table th,
.promo-table th,
.normal-table th,
.top-table td,
.promo-table td,
.normal-table td {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

/* 表头 */
.top-table th,
.promo-table th,
.normal-table th {
    background: #272525;
    color: #fff;
    padding: 10px 4px;
    font-weight: bold;
    border: 1px solid #444;
}

/* ========== 12列宽度分配 ========== */
.top-table th:nth-child(1),
.promo-table th:nth-child(1),
.normal-table th:nth-child(1) { width: 12%; }  /* 服务商名称 */

.top-table th:nth-child(2),
.promo-table th:nth-child(2),
.normal-table th:nth-child(2) { width: 5%; }   /* 地区 */

.top-table th:nth-child(3),
.promo-table th:nth-child(3),
.normal-table th:nth-child(3) { width: 6%; }   /* 线路 */

.top-table th:nth-child(4),
.promo-table th:nth-child(4),
.normal-table th:nth-child(4) { width: 4%; }   /* 内存 */

.top-table th:nth-child(5),
.promo-table th:nth-child(5),
.normal-table th:nth-child(5) { width: 4%; }   /* CPU */

.top-table th:nth-child(6),
.promo-table th:nth-child(6),
.normal-table th:nth-child(6) { width: 6%; }   /* 硬盘 */

.top-table th:nth-child(7),
.promo-table th:nth-child(7),
.normal-table th:nth-child(7) { width: 6%; }   /* 流量 */

.top-table th:nth-child(8),
.promo-table th:nth-child(8),
.normal-table th:nth-child(8) { width: 6%; }   /* 带宽 */

.top-table th:nth-child(9),
.promo-table th:nth-child(9),
.normal-table th:nth-child(9) { width: 6%; }   /* 价格 */

.top-table th:nth-child(10),
.promo-table th:nth-child(10),
.normal-table th:nth-child(10) { width: 16%; } /* 商品介绍 */

.top-table th:nth-child(11),
.promo-table th:nth-child(11),
.normal-table th:nth-child(11) { width: 5%; }  /* 购买 */

.top-table th:nth-child(12),
.promo-table th:nth-child(12),
.normal-table th:nth-child(12) { width: 4%; }  /* 详情 */

/* ========== 置顶区样式（绿色主题） ========== */
.top-table tr.top td {
    background: #49F18C;
    color: #000;
    border: 1px solid #255033;
    padding: 5px 4px;
}
.top-table tr.top:hover td {
    background: #3cd478;
}

/* ========== 特惠区样式（紫色主题） ========== */
.promo-table tr.promo td {
    background: #1a1030;
    color: #e0d0ff;
    border: 1px solid #3d2a6e;
    padding: 5px 4px;
}
.promo-table tr.promo:hover td {
    background: #241840;
}
.promo-table tr.promo a {
    color: #c084fc;
}
.promo-table tr.promo a:hover {
    color: #a855f7;
}

/* ========== 普通区样式 ========== */
.normal-table tr.normal td {
    background: #e8e0c8;
    color: #222;
    border: 1px solid #c8c0a0;
    padding: 5px 4px;
}
.normal-table tr.normal:hover td {
    background: #ddd5b8;
}

.gap {
    height: 3px;
}

/* ========== 服务商名称列 ========== */
td.idc-name {
    text-align: left !important;
    padding-left: 8px;
}
.idc-name a {
    color: #000;
    text-decoration: none;
    font-weight: normal;
}
.normal-table .idc-name a:hover {
    color: #49F18C;
}
.top-table .idc-name a {
    color: #000;
}
.promo-table .idc-name a {
    color: #e0d0ff;
}
.promo-table .idc-name a:hover {
    color: #c084fc;
}

/* ========== 详情链接 ========== */
a.detail {
    color: #222;
    text-decoration: none;
    display: inline-block;
    padding: 3px 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    font-size: 12px;
}
.top-table a.detail {
    color: #000;
    background: rgba(0,0,0,0.15);
}
.promo-table a.detail {
    color: #c084fc;
    background: rgba(192,132,252,0.15);
}
.normal-table a.detail {
    color: #444;
    background: rgba(0,0,0,0.08);
}
a.detail:hover {
    text-decoration: underline;
}

/* ========== 购买按钮 ========== */
a.buy-btn {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
    transition: all 0.2s ease;
}
a.buy-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245,158,11,0.4);
}
.top-table a.buy-btn {
    background: linear-gradient(135deg, #1a7a3a, #0f5c2a);
    color: #fff !important;
}
.top-table a.buy-btn:hover {
    background: linear-gradient(135deg, #0f5c2a, #0a3f1d);
    box-shadow: 0 2px 6px rgba(26,122,58,0.4);
}
.promo-table a.buy-btn {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: #fff !important;
}
.promo-table a.buy-btn:hover {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    box-shadow: 0 2px 6px rgba(192,132,252,0.4);
}

/* ========== 价格列高亮 ========== */
.price-col {
    font-weight: 700;
    color: #dc2626 !important;
}
.top-table .price-col {
    color: #b91c1c !important;
}
.promo-table .price-col {
    color: #fbbf24 !important;
}

/* ========== 商品介绍列 ========== */
td.idc-desc {
    text-align: left !important;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
    color: #c0c0c0;
    white-space: normal;
    word-break: break-all;
    line-height: 1.4;
    max-width: 0;
}
.top-table td.idc-desc {
    color: #1a1a1a;
}
.promo-table td.idc-desc {
    color: #e0d0ff;
}
.normal-table td.idc-desc {
    color: #444;
}

/* ========== 认证徽章 ========== */
.cert-badge {
    display: inline-block;
    padding: 1px 5px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    margin-right: 3px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.promo-table .cert-badge {
    background: linear-gradient(135deg, #c084fc, #7c3aed);
}
.top-table .cert-badge {
    background: linear-gradient(135deg, #065f46, #047857);
}

/* ========== 标签通用样式 ========== */
.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 3px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-weight: 600;
}

/* ========== 置顶标签（彩虹动画） ========== */
@keyframes glowing {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.tag-top {
    background: #ff0000;
    position: relative;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 18px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.4);
}

.tag-top::after {
    content: '超级置顶';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    background-image: linear-gradient(202deg, #FF0000, #FF7F00, #f9f917, #00FF00, #0000FF, #4B0082, #8B00FF);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glowing 1s linear infinite;
    pointer-events: none;
}

/* ========== 限时特惠标签（红色渐变 - 最突出） ========== */
.tag-promo-flash {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* ========== 新品上线标签（青绿色 - 清新醒目） ========== */
.tag-promo-new {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    font-weight: bold;
    animation: pulse 3s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.4);
}

/* ========== 即将下架标签（橙色 - 警示但不刺眼） ========== */
.tag-ending {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.4);
}

/* ========== 日常在售标签（灰紫色 - 最低调） ========== */
.tag-normal {
    background: #67727f;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== 发布广告按钮 ========== */
.post-ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gt-main-color, #3b82f6);
    font-weight: 500;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.post-ad-btn:hover {
    background: var(--gt-main-color-10, rgba(59, 130, 246, 0.1));
}
.post-ad-btn i {
    font-size: 16px;
}
.post-ad-text {
    font-size: 14px;
}
@media (max-width: 768px) {
    .post-ad-text {
        display: none;
    }
}

/* ========== 首页图片广告位 ========== */
.home-ad-item {
    width: 100%;
    margin-bottom: 3px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home-ad-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.home-ad-link {
    display: block;
    width: 100%;
}
.home-ad-image {
    width: 100%;
    height: auto;
    display: block;
}
.home-ad-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.home-ad-placeholder:hover {
    opacity: 0.9;
}
.home-ad-empty {
    color: #fff;
    text-align: center;
    font-size: 16px;
}
.home-ad-empty i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

/* ========== 广告购买弹窗 ========== */
.home-ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-ad-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.home-ad-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.home-ad-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}
.home-ad-modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}
.home-ad-modal-close:hover {
    background: #f0f0f0;
    color: #666;
}
.home-ad-modal-body {
    padding: 20px;
}
.ad-form-group {
    margin-bottom: 15px;
}
.ad-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}
.ad-form-group input,
.ad-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.ad-form-group input:focus,
.ad-form-group select:focus {
    outline: none;
    border-color: #49F18C;
}
.ad-form-group small {
    display: block;
    margin-top: 4px;
    color: #999;
    font-size: 12px;
}
.ad-cost-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}
.ad-price-per-day {
    color: #666;
    font-size: 14px;
}
.ad-total-cost {
    font-size: 16px;
    color: #333;
}
.ad-total-cost strong {
    color: #e74c3c;
    font-size: 20px;
}
.ad-balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 6px;
}
.ad-balance {
    font-size: 16px;
    color: #2e7d32;
    font-weight: 500;
}
.btn-recharge {
    font-size: 12px;
    color: #49F18C;
    text-decoration: none;
}
.btn-recharge:hover {
    text-decoration: underline;
}
.ad-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.ad-form-actions .btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.3s;
}
.ad-form-actions .btn:hover {
    opacity: 0.9;
}
.ad-form-actions .btn-secondary {
    background: #f0f0f0;
    color: #666;
}
.ad-form-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.ad-login-required {
    text-align: center;
    padding: 30px 20px;
}
.ad-login-required p {
    color: #666;
    margin-bottom: 15px;
}
.ad-login-required .btn {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}
.ad-vip-info {
    margin-top: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

/* ========== 分页导航 ========== */
.page-navigator {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
}
.page-navigator a,
.page-navigator span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}
.page-navigator a:hover {
    background: #49F18C;
    color: #fff;
}
.page-navigator .current {
    background: #1a1a2e;
    color: #fff;
}

/* ========== 手机端响应式 ========== */
@media (max-width: 768px) {
    .game-table-wrapper {
        padding: 0 2px;
        overflow-x: auto;
    }

    /* 手机端隐藏：区域(2)、线路(3)、内存(4)、CPU(5)、硬盘(6)、流量(7)、带宽(8)、详情(12) */
    .top-table th:nth-child(2),
    .top-table th:nth-child(3),
    .top-table th:nth-child(4),
    .top-table th:nth-child(5),
    .top-table th:nth-child(6),
    .top-table th:nth-child(7),
    .top-table th:nth-child(8),
    .top-table th:nth-child(12),
    .top-table td:nth-child(2),
    .top-table td:nth-child(3),
    .top-table td:nth-child(4),
    .top-table td:nth-child(5),
    .top-table td:nth-child(6),
    .top-table td:nth-child(7),
    .top-table td:nth-child(8),
    .top-table td:nth-child(12),
    .promo-table th:nth-child(2),
    .promo-table th:nth-child(3),
    .promo-table th:nth-child(4),
    .promo-table th:nth-child(5),
    .promo-table th:nth-child(6),
    .promo-table th:nth-child(7),
    .promo-table th:nth-child(8),
    .promo-table th:nth-child(12),
    .promo-table td:nth-child(2),
    .promo-table td:nth-child(3),
    .promo-table td:nth-child(4),
    .promo-table td:nth-child(5),
    .promo-table td:nth-child(6),
    .promo-table td:nth-child(7),
    .promo-table td:nth-child(8),
    .promo-table td:nth-child(12),
    .normal-table th:nth-child(2),
    .normal-table th:nth-child(3),
    .normal-table th:nth-child(4),
    .normal-table th:nth-child(5),
    .normal-table th:nth-child(6),
    .normal-table th:nth-child(7),
    .normal-table th:nth-child(8),
    .normal-table th:nth-child(12),
    .normal-table td:nth-child(2),
    .normal-table td:nth-child(3),
    .normal-table td:nth-child(4),
    .normal-table td:nth-child(5),
    .normal-table td:nth-child(6),
    .normal-table td:nth-child(7),
    .normal-table td:nth-child(8),
    .normal-table td:nth-child(12) {
        display: none;
    }

    /* 手机端显示：名称(1)、价格(9)、联系方式(10)、购买(11) */
    .top-table th:nth-child(1),
    .promo-table th:nth-child(1),
    .normal-table th:nth-child(1) { width: 35% !important; }

    .top-table th:nth-child(9),
    .promo-table th:nth-child(9),
    .normal-table th:nth-child(9) { width: 15% !important; }

    .top-table th:nth-child(10),
    .promo-table th:nth-child(10),
    .normal-table th:nth-child(10) { width: 20% !important; }

    .top-table th:nth-child(11),
    .promo-table th:nth-child(11),
    .normal-table th:nth-child(11) { width: 30% !important; }

    .top-table th,
    .promo-table th,
    .normal-table th,
    .top-table td,
    .promo-table td,
    .normal-table td {
        padding: 8px 3px;
        font-size: 12px;
    }

    .tag {
        display: inline-block;
        padding: 1px 4px;
        font-size: 10px;
        margin-right: 2px;
    }

    .tag-top {
        width: 48px;
        height: 16px;
    }
    .tag-top::after {
        font-size: 10px;
    }

    .cert-badge {
        font-size: 10px;
        padding: 0 3px;
    }

    td.idc-name {
        padding-left: 4px;
    }
    .idc-name a {
        word-break: break-all;
        white-space: normal;
    }

    a.detail,
    a.buy-btn {
        display: inline-block;
        padding: 4px 8px;
        font-size: 11px;
        margin: 1px;
    }
}
