/* ========================================
   server.html 专用样式
   ======================================== */

@font-face {
    font-family: 'Minecraft';
    src: url('minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

#serverList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 24px 24px 60px;
    max-width: 920px;
    margin: 0 auto;
}

/* ---------- 卡片顶端刷新行 ---------- */
.card-top-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    font-size: 12px; color: var(--text-secondary);
}
.refresh-btn-small {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 14px;
    transition: background .2s;
}
.refresh-btn-small:hover { background: var(--border-color); }

/* ---------- 服务器卡片 ---------- */
.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    animation: slideUp .45s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp {
    from { opacity:0; transform:translateY(24px) }
    to   { opacity:1; transform:translateY(0) }
}

/* ---------- 卡片头部 ---------- */
.card-header {
    display: flex; align-items: center; gap: 14px;
    padding: 22px 24px;
}
.card-header-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: grid; place-items: center;
    image-rendering: pixelated;
    overflow: hidden;
}
.card-header-icon img { width:100%; height:100%; object-fit:cover }
.card-header-body { flex:1; min-width:0 }
.card-header-host {
    font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-header-motd {
    font-size: 13px; color: var(--text-secondary);
    margin-top: 1px;
    white-space: normal;
    line-height: 1.5;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
    text-shadow: 0 1px 2px rgb(0, 0, 0);
}

/* ---------- 状态胶囊 ---------- */
.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    padding: 4px 12px; border-radius: 16px;
    flex-shrink: 0; white-space: nowrap;
}
.pill-online  { background: rgba(74,222,128,.1); color: #4ade80 }
.pill-offline { background: rgba(248,113,113,.1); color: #f87171 }
.pill-loading { background: rgba(0,212,255,.1);  color: var(--accent) }
.pill-dot { width:6px; height:6px; border-radius:50% }
.pill-online .pill-dot  { background:#4ade80; box-shadow:0 0 8px #4ade80; animation:pulse 2s infinite }
.pill-offline .pill-dot { background:#f87171 }
.pill-loading .pill-dot { background:var(--accent); animation:pulse .9s infinite }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ---------- 卡片行 ---------- */
.card-row { padding: 20px 24px }
.card-row + .card-row { border-top: 1px solid var(--border-color) }
.row-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-secondary); margin-bottom: 10px;
}

/* ---------- 在线人数 ---------- */
.players-num {
    font-size: 28px; font-weight: 800; line-height: 1;
    color: var(--accent);
}
.players-num .slash { color: var(--text-secondary); font-size: 18px; font-weight: 400; margin: 0 2px }
.player-bar-bg {
    height: 6px; border-radius: 3px;
    background: var(--bg-secondary); overflow: hidden;
    margin-top: 12px;
}
.player-bar-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #38bdf8);
    transition: width .6s cubic-bezier(.16,1,.3,1);
}

/* ---------- 版本 ---------- */
.version-tag {
    display: inline-flex; align-items: center;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 6px 14px; font-size: 14px;
    color: var(--text-primary); font-weight: 500;
}

/* ---------- 玩家列表 ---------- */
.player-tags { display:flex; flex-wrap:wrap; gap:8px }
.p-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px; padding: 5px 14px;
    font-size: 13px; color: var(--text-primary);
    transition: border-color .2s, color .2s;
}
.p-tag:hover { border-color: var(--accent); color: var(--accent) }

/* ---------- 服务器介绍 ---------- */
.server-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ---------- 顶部刷新行 ---------- */
.page-wrap .refresh-row {
    padding: 16px 24px 0;
    max-width: 920px;
    margin: 80px auto 0;
    display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; font-size: 12px; color: var(--text-secondary);
}
.refresh-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 8px 18px;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    cursor: pointer; font-family: inherit;
    transition: border-color .25s, color .25s;
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent) }

/* ---------- 响应式 ---------- */
@media (max-width:768px) {
    .page-wrap .refresh-row {
        padding: 16px 24px 0;
        max-width: 100%;
    }
    .refresh-row .last-update { display: none }
    #serverList {
        grid-template-columns: 1fr;
        padding: 40px 24px 60px;
        gap: 12px;
    }
    .card-header { padding: 16px; gap: 10px }
    .card-header-host { font-size: 15px }
    .card-row { padding: 16px }
    .players-num { font-size: 24px }
    .card-header-icon { width:40px; height:40px }
}
