/* ===== 首页样式 ===== */

:root {
    --brand-1: #3b82f6;
    --brand-2: #2563eb;
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --line: #e6edf5;
    --price: #f97316;
    --bg: #f4f6fa;
}

html, body { overflow-x: clip; }

.home-full {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: var(--bg);
}
.home-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== 轮播（固定高度兜底，全浏览器可用） ===== */
.banner-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
    border: 1px solid var(--line);
    background: #eef2f7;
    margin-bottom: 12px;
    height: 200px;
}

.banner-track {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.banner-slide {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    opacity: 0;
    transition: opacity .45s ease;
    pointer-events: none;
    text-decoration: none;
    background: #eef2f7;
}
.banner-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.banner-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .8s ease;
}
.banner-slide.is-active:hover img { transform: scale(1.02); }

/* 圆点 */
.banner-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
    padding: 4px 8px;
    background: rgba(0, 0, 0, .18);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.banner-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: all .25s ease;
}
.banner-dot:hover { background: rgba(255, 255, 255, .85); }
.banner-dot.is-active {
    background: #fff;
    width: 20px;
    border-radius: 999px;
}

@media (min-width: 640px) {
    .banner-card { height: 320px; }
}

/* ===== 广告格 ===== */
.ad-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    border: 1px solid var(--line);
    transition: all .25s ease;
    background: #fff;
}
.ad-card:hover {
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
    transform: translateY(-2px);
    border-color: #c7dbfa;
}
.ad-card img { transition: transform .35s ease; }
.ad-card:hover img { transform: scale(1.04); }

/* ===== 热搜 ===== */
.hot-bar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.hot-pill {
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: var(--ink-500);
    transition: all .2s ease;
}
.hot-pill:hover {
    color: var(--brand-2);
    border-color: #c7dbfa;
    background: #eff6ff;
    transform: translateY(-1px);
}

/* ===== 发布站 ===== */
.servers-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    border: 1px solid var(--line);
    margin-bottom: 12px;
    overflow: hidden;
}

.servers-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.servers-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.servers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

.servers-table td {
    padding: 12px 14px;
    border-bottom: 1px dashed #eef2f8;
    border-right: 1px solid #eef2f8;
    vertical-align: middle;
    background: transparent;
}
.servers-table td:last-child { border-right: 0; }
.servers-table tbody tr:last-child td { border-bottom: 0; }

.servers-table tbody tr {
    background: var(--row-bg, linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%));
    transition: background .2s ease;
}
.servers-table tbody tr:nth-child(even) {
    background: var(--row-bg, linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%));
}
.servers-table tbody tr:hover {
    background: var(--row-bg-hover, linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%));
}
.servers-table tbody tr > td {
    background-color: transparent;
}

.srv-extra { display: none; }
.srv-extra.is-open { display: table-row; }

.srv-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.srv-ip {
    display: block;
    font-size: 12px;
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.srv-time {
    display: block;
    white-space: nowrap;
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.srv-line {
    display: inline-block;
    font-size: 11px;
    color: var(--brand-2);
    background: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}
.srv-intro {
    display: block;
    font-size: 12px;
    color: var(--ink-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.srv-qq {
    display: block;
    font-size: 12px;
    color: var(--ink-700);
    font-family: ui-monospace, Menlo, monospace;
    white-space: nowrap;
}

.btn-srv-enter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    box-shadow: 0 2px 6px rgba(37, 99, 235, .25);
    transition: all .2s;
    white-space: nowrap;
}
.btn-srv-enter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
    color: #fff;
    background: linear-gradient(135deg, var(--brand-2) 0%, #1d4ed8 100%);
}
.btn-srv-enter.disabled {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: none;
    pointer-events: none;
    cursor: default;
}

.srv-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
    border: 0;
    border-top: 1px solid #eef2f8;
    color: var(--brand-2);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s ease;
    letter-spacing: .3px;
}
.srv-toggle:hover { background: #eff6ff; }
.srv-toggle .toggle-icon {
    display: inline-flex;
    transition: transform .3s ease;
    font-size: 11px;
}
.srv-toggle.is-open .toggle-icon { transform: rotate(180deg); }
.srv-toggle .toggle-count {
    color: var(--ink-400);
    font-weight: 500;
    font-size: 11px;
    margin-left: 2px;
}

/* ===== 筛选卡片 ===== */
.filter-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    border: 1px solid var(--line);
}
.filter-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 26px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--ink-500);
    font-weight: 600;
    flex-shrink: 0;
}
.filter-tag {
    border-radius: 999px;
    padding: 3px 14px;
    line-height: 20px;
    transition: all .2s ease;
}
.filter-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, .12);
    border-color: #c7dbfa !important;
    color: var(--brand-2);
}
.filter-tag.active {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    border-color: transparent !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .3);
}

/* ===== 视图切换栏 ===== */
.view-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.view-stat { font-size: 12px; color: var(--ink-500); }
.view-stat strong { color: var(--brand-2); font-weight: 700; }

.view-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #f1f5f9;
    border-radius: 8px;
}
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    font-size: 12px;
    line-height: 1;
    color: var(--ink-500);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.view-btn:hover { color: var(--brand-2); }
.view-btn.active {
    background: #fff;
    color: var(--brand-2);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .10);
}

/* ===== 列表卡片 ===== */
.list-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    border: 1px solid var(--line);
}
.list-head {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
}
.list-head th {
    border-color: rgba(255, 255, 255, .18) !important;
    letter-spacing: .5px;
    font-weight: 600;
}
tbody tr { transition: background-color .2s ease; }
tbody tr td { border-color: #f1f5f9; }
.row-hover:hover { background-color: #f5f8ff; }
.app-name-link span.truncate { transition: color .2s ease; }
.app-name-link:hover span.truncate { color: var(--brand-2); }

.col-meta {
    color: var(--ink-500);
    font-size: 12px;
    line-height: 1.5;
}

.price-vip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    line-height: 1.5;
    letter-spacing: .3px;
    box-shadow: 0 1px 3px rgba(245, 158, 11, .35);
    white-space: nowrap;
}
.price-vip i { font-size: 10px; }

.price-free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    line-height: 1.5;
    letter-spacing: .3px;
    white-space: nowrap;
}

.dot-normal {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #cbd5e1;
    flex-shrink: 0;
}

.view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    white-space: nowrap;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    box-shadow: 0 2px 6px rgba(37, 99, 235, .25);
    transition: all .2s ease;
}
.view-link:hover {
    background: linear-gradient(135deg, var(--brand-2) 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
    transform: translateY(-1px);
    color: #fff;
}
.view-link.demo-disabled,
.view-link.demo-disabled:hover {
    background: #cbd5e1;
    box-shadow: none;
    transform: none;
    cursor: default;
    pointer-events: none;
    user-select: none;
    color: #fff;
}

.price-uniform { display: inline-flex; align-items: center; justify-content: center; min-width: 5.2em; }

.badge-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.badge-rec {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: .5px;
}

#app-view[data-view="card"] {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
#app-view[data-view="table"] .view-card { display: none; }
#app-view[data-view="card"] .view-table { display: none; }

.app-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    transition: all .22s ease;
    height: 100%;
}
.app-card:hover {
    transform: translateY(-3px);
    border-color: #c7dbfa;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.app-card-cover {
    position: relative;
    display: block;
    width: 100%;
    height: 160px;
    flex-shrink: 0;
    overflow: hidden;
    background: #eef2f7;
}
.app-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .4s ease;
}
.app-card:hover .app-card-cover img { transform: scale(1.06); }

.app-card-marks {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.app-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 10px 10px;
    flex: 1;
}
.app-card-title {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .2s ease;
}
.app-card-title:hover { color: var(--brand-2); }

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: var(--ink-400);
}
.app-card-meta span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-card-meta span:last-child { flex-shrink: 0; }

.app-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 2px;
}
.app-card-foot .price-uniform { justify-content: flex-start; min-width: 0; }

/* ===== 分页 ===== */
.pagination-wrap {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.page-stat {
    font-size: 12px;
    color: var(--ink-500);
}
.page-stat strong { color: var(--brand-2); font-weight: 700; }
.page-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-700);
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all .18s ease;
}
.page-btn:hover {
    color: var(--brand-2);
    border-color: #c7dbfa;
    background: #eff6ff;
}
.page-btn.active {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .3);
    cursor: default;
    pointer-events: none;
}
.page-btn.disabled {
    color: #c0c4cc;
    background: #f3f4f6;
    border-color: var(--line);
    cursor: not-allowed;
}
.page-ellipsis {
    color: var(--ink-400);
    padding: 0 4px;
    font-size: 13px;
    user-select: none;
}

@media (min-width: 1024px) {
    .app-card-cover { height: 170px; }
}
@media (max-width: 1023px) {
    .app-card-cover { height: 145px; }
}

@media (max-width: 640px) {
    .home-wrap { padding: 10px; }
    .filter-card { padding: 10px 12px !important; }
    .filter-label { min-width: 52px; font-size: 11px; height: 24px; }
    .filter-tag { padding: 2px 10px; font-size: 11px; }

    .list-card table { font-size: 11px; }
    .list-head th { font-size: 11px; padding-top: 7px !important; padding-bottom: 7px !important; }
    .col-meta { font-size: 11px; }
    .view-link { padding: 3px 7px; font-size: 10px; }

    .badge-top, .badge-rec { min-width: 16px; height: 16px; font-size: 9px; padding: 0 4px; }
    .price-vip, .price-free { font-size: 10px; padding: 1px 7px; }

    .view-bar { padding: 8px 10px; }
    .view-btn { padding: 4px 10px; font-size: 11px; }
    .app-card-cover { height: 120px; }
    .app-card-body { padding: 8px 8px 9px; gap: 5px; }
    .app-card-title { font-size: 13px; }
    .app-card-meta { font-size: 10px; }

    .pagination-wrap { padding: 10px 12px; }
    .page-stat { width: 100%; text-align: center; }
    .page-list { width: 100%; justify-content: center; }
    .page-btn { min-width: 30px; height: 30px; font-size: 12px; padding: 0 8px; }

    .servers-table td:nth-child(2),
    .servers-table td:nth-child(4),
    .servers-table td:nth-child(5),
    .servers-table td:nth-child(6) { display: none; }
    .servers-table td { padding: 10px 10px; }
    .srv-name { font-size: 13px; }
    .srv-time { font-size: 12px; }
    .btn-srv-enter { padding: 3px 10px; font-size: 11px; }

    .servers-table td:nth-child(3) { border-right: 1px solid #eef2f8; }
}