/* ===== AMDW 游戏站 前端样式 ===== */
:root {
  --bg: #0f1220;
  --bg-2: #161b30;
  --card: #1a2038;
  --line: #2a3252;
  --text: #e8eaf0;
  --muted: #8b93ad;
  --accent: #4f7cff;
  --accent-2: #7b5cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1200px, 94%); margin: 0 auto; }
main.container { flex: 1; padding: 24px 0 48px; }

/* Header */
.site-header {
  background: rgba(14, 17, 32, .92);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 24px; }
.brand-name { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.main-nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.main-nav a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.main-nav a.active { color: #fff; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.search-form { display: flex; gap: 6px; }
.search-form input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 12px; width: 180px; outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-form button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.user-area { display: flex; align-items: center; gap: 8px; }
.user-name { color: var(--text); font-weight: 600; font-size: 14px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-download {
  background: linear-gradient(90deg, #22c55e, #16a34a); font-size: 16px; padding: 13px 34px; border-radius: 10px;
}
.btn-download:hover { filter: brightness(1.1); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: rgba(52, 211, 153, .12); color: var(--ok); border: 1px solid rgba(52, 211, 153, .3); }
.alert-error, .alert-danger { background: rgba(248, 113, 113, .12); color: var(--err); border: 1px solid rgba(248, 113, 113, .3); }
.alert-warning { background: rgba(251, 191, 36, .12); color: var(--warn); border: 1px solid rgba(251, 191, 36, .3); }

/* Hero */
.hero { background: linear-gradient(120deg, #16203f, #231a45); border-radius: 16px; padding: 42px 32px; margin-bottom: 24px; position: relative; overflow: hidden; }
.hero::after { content: "🎮"; position: absolute; right: 30px; bottom: -18px; font-size: 110px; opacity: .12; transform: rotate(-12deg); }
.hero h1 { font-size: 30px; margin-bottom: 6px; }
.hero p { color: var(--muted); font-size: 15px; }

/* Category tabs */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-tab {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; background: var(--bg-2);
}
.cat-tab:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Game grid */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.45); border-color: var(--accent); text-decoration: none; }
.card-cover { aspect-ratio: 16/10; background: var(--bg-2); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { font-size: 52px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cover-fallback.big { font-size: 120px; height: 100%; }
.badge-top { position: absolute; top: 10px; left: 10px; background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.cat-name { color: var(--accent); font-weight: 600; }
.card-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Pagination */
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 30px; }
.pagination a { background: var(--bg-2); border: 1px solid var(--line); padding: 8px 16px; border-radius: 8px; color: var(--text); font-size: 14px; }
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.page-info { color: var(--muted); font-size: 14px; }

/* Empty state */
.empty-state { text-align: center; padding: 70px 0; color: var(--muted); }
.empty-icon { font-size: 64px; margin-bottom: 12px; }

/* Auth */
.auth-card {
  max-width: 420px; margin: 30px auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 28px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 18px; text-align: center; }
.auth-form label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.auth-form input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; outline: none;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-form .btn { margin-top: 18px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Breadcrumb */
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Game detail */
.game-detail { display: grid; grid-template-columns: 420px 1fr; gap: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.detail-cover { border-radius: 12px; overflow: hidden; background: var(--bg-2); min-height: 260px; display: flex; align-items: center; justify-content: center; }
.detail-cover img { width: 100%; max-height: 460px; object-fit: cover; }
.detail-title { font-size: 26px; margin-bottom: 12px; }
.detail-meta, .detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.detail-desc { color: #c6cbe0; font-size: 14px; margin-bottom: 22px; white-space: pre-line; }
.download-box { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dl-tip { color: var(--muted); font-size: 12px; width: 100%; }
.dl-lock { color: var(--warn); font-size: 14px; font-weight: 600; width: 100%; }
.detail-additional { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-top: 24px; }
.detail-additional h3 { font-size: 16px; margin-bottom: 14px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 12px; width: 130px; }
.info-table td { padding: 8px 12px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; text-align: center; color: var(--muted); font-size: 13px; }
.footer-note { margin-top: 6px; font-size: 12px; opacity: .75; }

@media (max-width: 860px) {
  .header-inner { gap: 10px; }
  .search-form { order: 3; width: 100%; }
  .search-form input { flex: 1; width: auto; }
  .game-detail { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}
