/* ============================================
   GoldJudge 全局设计系统
   所有页面共用的基础样式与通用组件
   ============================================ */

/* ---------- 基础变量 ---------- */
:root {
  /* 背景色 */
  --bg-deep: #06060A;
  --bg: #0A0A0F;
  --bg-card: rgba(20, 20, 28, 0.8);
  --bg-card-hover: rgba(28, 28, 38, 0.9);
  --bg-panel: #0D0D14;

  /* 金色系 */
  --gold: #D4AF37;
  --gold-light: #E8CC88;
  --gold-dark: #B8941F;
  --gold-dim: rgba(255, 215, 0, 0.1);
  --gold-border: rgba(255, 215, 0, 0.3);
  --gold-glow: rgba(255, 215, 0, 0.15);

  /* 文字色（从白递减） */
  --text: #FFFFFF;
  --text-2: #E2E8F0;
  --text-3: #B8C5D6;
  --text-4: #8892A4;

  /* 边框 */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* 功能色 */
  --green: #22C55E;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --red-border: rgba(239, 68, 68, 0.3);
  --cyan: #5CE1E6;
  --cyan-dim: rgba(92, 225, 230, 0.1);
  --cyan-border: rgba(92, 225, 230, 0.3);

  /* 等宽字体 */
  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.15);
}

/* ---------- 全局重置 ---------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .2s;
  gap: 6px;
}
.btn:active { transform: scale(0.98); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  color: #1a1400;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.25);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}
.btn-outline:active {
  background: var(--gold-dim);
}
.btn-gold-outline {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.06) 100%);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-weight: 500;
}
.btn-gold-outline:active {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all .2s ease;
}
.card:active {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

/* ---------- 模块标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, var(--gold), rgba(255, 215, 0, 0.3));
  border-radius: 2px;
  flex-shrink: 0;
}
.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.section-title .section-icon {
  font-size: 17px;
}
.section-title .section-sub {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: auto;
}

/* ---------- 标签/徽章 ---------- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.tag-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.tag-green {
  background: var(--green-dim);
  color: var(--green);
}
.tag-red {
  background: var(--red-dim);
  color: var(--red);
}
.tag-gray {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
}

.card-label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.card-label.good {
  background: var(--green-dim);
  color: var(--green);
}
.card-label.average {
  background: var(--gold-dim);
  color: var(--gold);
}
.card-label.poor {
  background: var(--red-dim);
  color: var(--red);
}

/* ---------- 分割线 ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
  margin: 16px 0;
}

/* ---------- 列表项 ---------- */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .label {
  font-size: 17px;
  color: var(--text-3);
}
.list-item .value {
  font-size: 17px;
  color: var(--text);
  font-weight: 500;
  font-family: var(--mono);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-4);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- 迷你弹窗 ---------- */
.mini-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fadeIn .2s ease;
}
.mini-modal-overlay.show { display: flex; }
.mini-modal-box {
  background: rgba(13, 13, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 320px;
  position: relative;
  animation: popIn .25s cubic-bezier(.4,0,.2,1);
}
.mini-modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.mini-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.mini-modal-desc {
  font-size: 17px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 16px;
}
.mini-modal-actions {
  display: flex;
  gap: 10px;
}
.mini-modal-actions .btn { flex: 1; }

/* ---------- 积分弹窗 ---------- */
.points-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fadeIn .2s ease;
}
.points-modal-overlay.show { display: flex; }
.points-modal-box {
  background: rgba(13, 13, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 22px 12px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  position: relative;
  animation: popIn .25s cubic-bezier(.4,0,.2,1);
}
.points-modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.points-modal-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.points-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 6px 0;
}
.points-modal-desc {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 16px 0;
}
.points-cost-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  color: var(--gold);
  font-size: 17px;
  font-weight: 500;
  font-family: var(--mono);
  margin: 16px 0;
}
.points-modal-balance {
  font-size: 17px;
  color: var(--text-3);
  margin: 18px 0;
}
.points-modal-balance b {
  color: var(--gold);
  font-family: var(--mono);
}
.points-modal-actions {
  display: flex;
  gap: 10px;
}
.points-modal-actions .btn {
  flex: 1;
  padding: 11px 16px;
  font-size: 17px;
}
.points-modal-box.not-enough .points-modal-icon {
  background: rgba(255, 71, 87, 0.12);
  border-color: var(--red-border);
}

/* ---------- 通用动画 ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- 工具类 ---------- */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-4 { color: var(--text-4); }
.mono { font-family: var(--mono); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }


/* ============================================
   PC端全局响应式（>500px 内容居中）
   覆盖所有页面的 fixed/sticky 全宽元素
   ============================================ */

/* ---------- 底部导航 ---------- */
@media (min-width: 501px) {
  .bottom-nav {
    max-width: 480px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
  }
}

/* ---------- 底部粘性操作栏（立即复盘/立即评估等） ---------- */
@media (min-width: 501px) {
  .bottom-action-bar {
    max-width: 480px !important;
    width: 480px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
}

/* ---------- AI助手页内容区 ---------- */
@media (min-width: 501px) {
  .monitor-page .app-container,
  .monitor-page .chat-container,
  .monitor-page #chatContainer {
    max-width: 480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ---------- 弹窗/模态框 ---------- */
/* 确保所有 overlay 遮罩全屏，但 box 居中 */
.points-modal-overlay,
.mini-modal-overlay,
.modal-overlay {
  align-items: center !important;
  justify-content: center !important;
}
.points-modal-box,
.mini-modal-box,
.modal-box {
  margin: 0 auto !important;
}
