/* ========================================
   WinGoal 基础样式文件
   主题：足球预测（红绿配色）
   ======================================== */

:root {
  /* === 主题色（基于logo） === */
  --primary-green: #10b981;      /* 主绿色 */
  --primary-red: #ef4444;        /* 主红色 */
  --dark-green: #059669;         /* 深绿色 */
  --dark-red: #dc2626;           /* 深红色 */
  --light-green: #34d399;        /* 浅绿色 */
  --light-red: #f87171;          /* 浅红色 */
  
  /* === 中性色 === */
  --dark: #1e293b;               /* 深色背景 */
  --dark-secondary: #334155;     /* 次级深色 */
  --ink: #0f172a;                /* 文字深色 */
  --muted: #64748b;              /* 灰色文字 */
  --border: #e2e8f0;             /* 边框色 */
  --bg-light: #f8fafc;           /* 浅色背景 */
  --bg-white: #ffffff;           /* 白色背景 */
  
  /* === 功能色 === */
  --success: var(--primary-green);
  --danger: var(--primary-red);
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* === 渐变色 === */
  --gradient-primary: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-red) 100%);
  --gradient-green: linear-gradient(135deg, var(--light-green) 0%, var(--dark-green) 100%);
  --gradient-red: linear-gradient(135deg, var(--light-red) 0%, var(--dark-red) 100%);
  
  /* === 阴影 === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* === 布局尺寸 === */
  --header-height: 60px;
  --footer-height: 70px;
  --max-width: 1200px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  
  /* === 动画 === */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ========================================
   全局重置
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  color: var(--ink);
  background: var(--bg-light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   布局容器
   ======================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   顶部导航栏
   ======================================== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: opacity var(--transition-fast);
}

.header-logo:hover {
  opacity: 0.8;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-title {
  flex: 1;
  text-align: right;  /* 改为右对齐 */
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 100px;
}

/* ========================================
   底部导航栏
   ======================================== */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.footer-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  text-decoration: none;
  color: var(--muted);
  transition: all var(--transition-base);
  border-radius: var(--border-radius-sm);
  min-width: 80px;
}

.nav-item:hover {
  background: var(--bg-light);
  color: var(--ink);
}

.nav-item.active {
  color: var(--primary-green);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-icon {
  font-size: 24px;
  transition: transform var(--transition-base);
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
}

/* ========================================
   页面内容区
   ======================================== */
.page-wrapper {
  padding: 30px 0;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.page-header {
  margin-bottom: 30px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--muted);
}

/* ========================================
   通用组件
   ======================================== */

/* 卡片 */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-green);
  color: white;
}

.btn-primary:hover {
  background: var(--dark-green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--primary-red);
  color: white;
}

.btn-danger:hover {
  background: var(--dark-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
}

.btn-outline:hover {
  background: var(--primary-green);
  color: white;
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #dcfce7;
  color: var(--dark-green);
  border: 1px solid var(--primary-green);
}

.badge-danger {
  background: #fee2e2;
  color: var(--dark-red);
  border: 1px solid var(--primary-red);
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid var(--warning);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
  .header-title {
    font-size: 16px;
  }
  
  .nav-item {
    padding: 8px 12px;
    min-width: 70px;
  }
  
  .nav-icon {
    font-size: 22px;
  }
  
  .nav-label {
    font-size: 11px;
  }
  
  .page-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .header-content {
    padding: 0 16px;
  }
  
  .nav-item {
    padding: 8px 8px;
    min-width: 60px;
  }
  
  .page-wrapper {
    padding: 20px 0;
  }
}

/* ========================================
   工具类
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.hidden { display: none; }
.flex { display: flex; }
.grid { display: grid; }
.inline-block { display: inline-block; }