/**
 * V9体育 - 全局统一样式
 * 所有页面引入此文件保持风格一致
 */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

/* 主题色变量 */
:root {
  --v9-red: #E60012;
  --v9-red-light: #ff4d5a;
  --v9-red-dark: #c4000f;
  --v9-gray: #1E1E1E;
  --v9-gray-light: #8A8A8A;
  --v9-bg: #f5f5f5;
  --v9-card: #ffffff;
  --v9-text: #333333;
  --v9-text-light: #666666;
  --v9-text-muted: #999999;
  --v9-border: #e8e8e8;
  --v9-success: #4CAF50;
  --v9-warning: #FF9800;
  --v9-error: #F44336;
}

/* 通用头部导航 */
.v9-header {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.v9-header-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.v9-header-title {
  font-size: 17px;
  font-weight: 500;
}

.v9-header-right {
  width: 40px;
}

/* 通用卡片样式 */
.v9-card {
  background: white;
  border-radius: 12px;
  margin: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.v9-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.v9-card-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

/* 通用按钮样式 */
.v9-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.v9-btn-primary {
  background: linear-gradient(135deg, #E60012 0%, #c4000f 100%);
  color: white;
}

.v9-btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.v9-btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.v9-btn-outline {
  background: transparent;
  border: 1px solid var(--v9-red);
  color: var(--v9-red);
}

.v9-btn-block {
  width: 100%;
}

.v9-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 通用输入框样式 */
.v9-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.3s;
}

.v9-input:focus {
  outline: none;
  border-color: var(--v9-red);
}

.v9-input::placeholder {
  color: #ccc;
}

/* 通用列表样式 */
.v9-list {
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.v9-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.v9-list-item:last-child {
  border-bottom: none;
}

.v9-list-item:active {
  background: #f9f9f9;
}

.v9-list-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v9-list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 16px;
}

.v9-list-item-title {
  font-size: 14px;
  color: #333;
}

.v9-list-item-desc {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.v9-list-item-arrow {
  color: #ccc;
  font-size: 14px;
}

/* 底部导航 */
.v9-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 20px;
  z-index: 100;
}

.v9-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  color: #999;
  background: none;
  border: none;
  padding: 4px 12px;
}

.v9-nav-item.active {
  color: var(--v9-red);
}

.v9-nav-item .icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.v9-nav-item .text {
  font-size: 10px;
}

/* 空状态 */
.v9-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.v9-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.v9-empty-text {
  font-size: 14px;
}

/* 加载状态 */
.v9-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.v9-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: var(--v9-red);
  border-radius: 50%;
  animation: v9-spin 0.8s linear infinite;
}

@keyframes v9-spin {
  to { transform: rotate(360deg); }
}

/* 标签样式 */
.v9-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.v9-tag-red {
  background: rgba(230, 0, 18, 0.1);
  color: var(--v9-red);
}

.v9-tag-green {
  background: rgba(76, 175, 80, 0.1);
  color: var(--v9-success);
}

.v9-tag-orange {
  background: rgba(255, 152, 0, 0.1);
  color: var(--v9-warning);
}

.v9-tag-gray {
  background: #f0f0f0;
  color: #666;
}

/* 金额显示 */
.v9-amount {
  font-family: 'DIN Alternate', 'Helvetica Neue', sans-serif;
  font-weight: bold;
}

.v9-amount-large {
  font-size: 28px;
}

.v9-amount-positive {
  color: var(--v9-success);
}

.v9-amount-negative {
  color: var(--v9-red);
}

/* 分割线 */
.v9-divider {
  height: 8px;
  background: #f5f5f5;
}

/* 安全区域适配 */
.v9-safe-bottom {
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* 弹窗遮罩 */
.v9-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 弹窗内容 */
.v9-modal {
  background: white;
  border-radius: 12px;
  width: 85%;
  max-width: 320px;
  overflow: hidden;
}

.v9-modal-header {
  padding: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
}

.v9-modal-body {
  padding: 20px 16px;
}

.v9-modal-footer {
  display: flex;
  border-top: 1px solid #f0f0f0;
}

.v9-modal-footer button {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
}

.v9-modal-footer button:first-child {
  border-right: 1px solid #f0f0f0;
  color: #666;
}

.v9-modal-footer button:last-child {
  color: var(--v9-red);
  font-weight: 500;
}

/* Toast提示 */
.v9-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  animation: v9-fadeIn 0.3s;
}

@keyframes v9-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
