/* ===== 天穹竞技场 - 共享样式 ===== */
/* 仅供各页面公共部分使用，页面特有样式在各页面独立加载 */

/* ===== CSS 变量 ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-surface: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: #334155;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: all 0.3s ease;
}

/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* ===== 滚动条（全局） ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

.logo-img-nav {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.logo-icon {
  font-size: 28px;
  color: var(--primary-light);
  line-height: 1;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-actions { display: flex; gap: 8px; align-items: center; }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
}

.btn-primary:hover { box-shadow: 0 4px 16px rgba(79,70,229,0.4); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-lg { padding: 12px 28px; font-size: 16px; border-radius: var(--radius); }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

/* ===== 页面容器 ===== */
.page { display: none; padding-top: 64px; min-height: 100vh; }
.page.active { display: block; }

/* ===== 弹窗（Modal） ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body { padding: 24px; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 48px 24px 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 80px;
  padding-bottom: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 180px;
  max-width: 420px;
}
.footer-brand .logo-icon { font-size: 24px; }
.footer-brand .brand-row { display: flex; align-items: center; gap: 8px; }
.footer-brand .brand-row span { font-size: 18px; font-weight: 700; }
.footer-brand p { color: var(--text-muted); font-size: 13px; margin-top: 8px; line-height: 1.7; }

.logo-img-foot {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-links { display: flex; gap: 64px; }

.footer-col { min-width: 100px; }
.footer-col h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== 徽章（Badge） ===== */
.badge-status {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-status.running { background: var(--success); color: white; }
.badge-status.stopped { background: var(--text-muted); color: white; }

/* ===== 日志条目 ===== */
.log-entry { padding: 2px 0; white-space: nowrap; }

.log-entry.log-info { color: var(--info); }
.log-entry.log-success { color: var(--success); }
.log-entry.log-error { color: var(--danger); }
.log-entry.log-warn { color: var(--warning); }

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 360px;
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-hide {
  opacity: 0;
  transform: translateX(100%);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); }

/* ===== 响应式（共享部分） ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions .btn { padding: 6px 12px; font-size: 12px; }
  .mobile-menu-btn { display: block; }
  .footer-content { flex-direction: column; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
}
