/* 游服通 · Material 3 × Soft UI 设计系统 (PHP 版) */

:root {
  --radius: 0.75rem;
  --background: #F4F6FB;
  --foreground: #1E2130;
  --card: #FFFFFF;
  --primary: #5C6BC0;
  --primary-foreground: #FFFFFF;
  --secondary: #7986CB;
  --secondary-foreground: #FFFFFF;
  --muted: #E4E8F0;
  --muted-foreground: #6B7180;
  --accent: #26C6DA;
  --accent-foreground: #0E3A40;
  --destructive: #D8433A;
  --destructive-foreground: #FFFFFF;
  --border: #C7CEDB;
  --input: #D2D8E4;
  --ring: #5C6BC0;
  --chart-1: #5C6BC0;
  --chart-2: #1FB6C9;
  --chart-3: #E0568E;
  --chart-4: #E89A2B;
  --chart-5: #9B7AD0;
  --sidebar-bg: #F7F8FC;
  --sidebar-fg: #2A2D40;
  --sidebar-border: #D2D8E4;
  --gradient-primary: linear-gradient(135deg, #5C6BC0, #9B7AD0, #26C6DA);
  --state-hover: rgba(92, 107, 192, 0.08);
  --state-active: rgba(92, 107, 192, 0.16);
  --shadow-sm: 0 1px 3px rgba(30, 33, 48, 0.08);
  --shadow-md: 0 6px 20px rgba(30, 33, 48, 0.10);
  --shadow-lg: 0 16px 40px rgba(30, 33, 48, 0.14);
}

[data-theme="dark"] {
  --background: #1B1E2A;
  --foreground: #DDE1EC;
  --card: #232636;
  --primary: #8C99E0;
  --primary-foreground: #1B1E2A;
  --secondary: #6E78B0;
  --secondary-foreground: #FFFFFF;
  --muted: #2E3142;
  --muted-foreground: #9AA0B4;
  --accent: #3FD4E6;
  --accent-foreground: #0E2A30;
  --destructive: #E06A60;
  --destructive-foreground: #FFFFFF;
  --border: #34374A;
  --input: #2E3142;
  --ring: #8C99E0;
  --sidebar-bg: #20232F;
  --sidebar-fg: #DDE1EC;
  --sidebar-border: #34374A;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 760px; }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header { background: rgba(35, 38, 54, 0.85); }
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; color: var(--foreground);
  white-space: nowrap;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.nav-links {
  display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0;
  overflow-x: auto;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 8px 12px; border-radius: 8px;
  color: var(--muted-foreground); font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: all 0.15s ease;
}
.nav-link:hover { background: var(--state-hover); color: var(--foreground); }
.nav-link.active { color: var(--primary); background: var(--state-active); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 10px; cursor: pointer; color: var(--foreground);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--muted); color: var(--foreground); }
.btn-secondary:hover { background: var(--state-active); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--state-hover); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--state-hover); color: var(--foreground); }
.btn-danger { background: var(--destructive); color: var(--destructive-foreground); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.glass-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-md);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
}
.section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: var(--gradient-primary);
}
.muted { color: var(--muted-foreground); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

/* ===== 层级徽章 ===== */
.level-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; border: 1px solid;
  white-space: nowrap;
}
.badge-top { background: rgba(92,107,192,.18); color: var(--primary); border-color: rgba(92,107,192,.4); }
.badge-boutique { background: rgba(224,86,142,.18); color: var(--chart-3); border-color: rgba(224,86,142,.4); }
.badge-gem { background: rgba(232,154,43,.18); color: var(--chart-4); border-color: rgba(232,154,43,.4); }
.badge-free { background: rgba(31,182,201,.18); color: var(--chart-2); border-color: rgba(31,182,201,.4); }
.badge-unverified { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
.verified-mark {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--chart-2);
}

/* ===== 开服信息行 ===== */
.game-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  transition: all 0.15s ease;
}
.game-row:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.game-row.row-top { background: rgba(92,107,192,.06); }
.game-row.row-boutique { background: rgba(224,86,142,.05); }
.game-row.row-gem { background: rgba(232,154,43,.05); }
.game-row-main {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.game-name {
  font-weight: 600; color: var(--foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.game-name:hover { color: var(--primary); }
.game-row-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted-foreground);
  white-space: nowrap;
}
.meta-countdown { color: var(--chart-4); font-weight: 600; }
.game-link {
  padding: 6px 14px; border-radius: 8px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all 0.15s ease;
}
.game-link:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 14px; font-weight: 500; color: var(--foreground);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--input); border-radius: 10px;
  background: var(--card); color: var(--foreground);
  font-size: 14px; font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(92,107,192,.18);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  min-width: 600px;
}
.data-table th, .data-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px; white-space: nowrap;
}
.data-table th {
  background: var(--muted); color: var(--muted-foreground);
  font-weight: 600; font-size: 12px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--state-hover); }

/* ===== 网格 ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== 提示消息 ===== */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; margin-bottom: 16px;
  border: 1px solid;
}
.alert-success { background: rgba(31,182,201,.1); color: var(--chart-2); border-color: rgba(31,182,201,.3); }
.alert-error { background: rgba(216,67,58,.1); color: var(--destructive); border-color: rgba(216,67,58,.3); }
.alert-info { background: var(--state-hover); color: var(--primary); border-color: rgba(92,107,192,.3); }

/* ===== 页脚 ===== */
.site-footer {
  margin-top: 48px; padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground); font-size: 13px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

/* ===== 悬浮组件 ===== */
.float-widget {
  position: fixed; bottom: 24px; right: 16px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.float-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted-foreground);
  box-shadow: var(--shadow-md); transition: all 0.15s ease;
}
.float-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-lg); }
.float-btn svg { width: 20px; height: 20px; }
.float-panel {
  margin-bottom: 4px; width: 288px; max-height: 384px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.float-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.float-panel-body { flex: 1; overflow-y: auto; }
.float-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.float-item:hover { background: var(--state-hover); }
.float-item:last-child { border-bottom: none; }
.float-rank {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--muted); color: var(--muted-foreground);
}
.float-rank.r1 { background: var(--chart-4); color: #fff; }
.float-rank.r2 { background: var(--muted-foreground); color: #fff; }
.float-rank.r3 { background: var(--chart-3); color: #fff; }

/* ===== 后台布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
}
.admin-sidebar .logo { padding: 0 8px 16px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--sidebar-fg); font-size: 14px; font-weight: 500;
  transition: all 0.15s ease;
}
.admin-nav-item:hover { background: var(--state-hover); }
.admin-nav-item.active { background: var(--primary); color: var(--primary-foreground); }
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-content {
  flex: 1; min-width: 0; padding: 24px;
  overflow-x: hidden;
}
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.admin-title { font-size: 22px; font-weight: 800; }
.admin-mobile-toggle {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 10px; cursor: pointer;
}

/* ===== 统计卡片 ===== */
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--muted-foreground); }

/* ===== Hero ===== */
.hero {
  background: var(--gradient-primary);
  border-radius: var(--radius);
  padding: 32px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.hero p { font-size: 14px; opacity: 0.9; max-width: 600px; }
.hero-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); }

/* ===== 广告条 ===== */
.ad-banner {
  display: block; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  background: var(--card); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}
.ad-banner:hover { box-shadow: var(--shadow-md); }
.ad-banner img { width: 100%; height: 100%; object-fit: cover; }
.ad-banner-text {
  padding: 12px 16px; font-size: 13px; color: var(--muted-foreground);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center; padding: 48px 16px;
  color: var(--muted-foreground);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.5; }

/* ===== 动画 ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up { animation: slideUp 0.4s ease-out both; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links.mobile-open {
    display: flex; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 8px; gap: 4px; box-shadow: var(--shadow-md);
  }
  .nav-links.mobile-open .nav-link { padding: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .game-row { flex-wrap: wrap; }
  .game-row-meta { order: 3; width: 100%; padding-top: 4px; }
  .game-link { order: 2; }
  .admin-sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; z-index: 60;
    transition: left 0.2s ease;
  }
  .admin-sidebar.mobile-open { left: 0; }
  .admin-mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .admin-content { padding: 16px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 20px; }
  .float-widget { right: 12px; bottom: 16px; }
  .float-panel { width: calc(100vw - 32px); max-width: 320px; }
}