/* css/styles.css - 垂直时间轴修复版 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;       /* 核心蓝 */
  --primary-hover: #2563eb;
  --bg-page: #f3f4f6;       /* 页面浅灰底 */
  --bg-card: #ffffff;       /* 卡片白底 */
  --text-main: #111827;     /* 主文字黑 */
  --text-sub: #6b7280;      /* 次要文字灰 */
  --border-color: #e5e7eb;
  --radius: 12px;
}

/* === 全局基础 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
*
* body {
*   font-family: 'Inter', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
*     background-color: var(--bg-page);
*       color: var(--text-main);
*         min-height: 100vh;
*           display: flex;
*             flex-direction: column;
*             }
*
*/* === 导航栏 === */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.nav-tabs { display: flex; gap: 5px; background: #f1f5f9; padding: 3px; border-radius: 8px; }
.nav-item { padding: 6px 14px; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 6px; color: var(--text-sub); transition: all 0.2s; white-space: nowrap; }
.nav-item.active { background: white; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* === 主容器 === */
.main-container {
  max-width: 1100px;
  width: 95%;
  margin: 25px auto;
  flex: 1;
}

/* 视图切换 */
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
 *  * *  电脑端布局 (≥769px) - 左右分栏
 *   * * ========================================================= */
@media (min-width: 769px) {
  .recharge-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
  }
  
  /* 左侧指南卡片 */
  .guide-card { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border-color); }
  .guide-title { font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
  
  .step-list { position: relative; border-left: 2px solid #f3f4f6; margin-left: 10px; padding-left: 20px; }
  .step-item { margin-bottom: 30px; position: relative; }
  
  /* 电脑端圆点 */
  .step-dot {
    position: absolute; left: -27px; top: 0; width: 12px; height: 12px;
    background: #d1d5db; border-radius: 50%; border: 2px solid white;
  }
  .step-item.active .step-dot { background: var(--primary); transform: scale(1.2); }
  .step-item.completed .step-dot { background: #10b981; }
  
  .step-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
  .step-desc { font-size: 12px; color: var(--text-sub); line-height: 1.4; }
  .link-btn { display: inline-block; margin-top: 5px; font-size: 12px; color: var(--primary); background: #eff6ff; padding: 2px 8px; border-radius: 4px; text-decoration: none; }

  /* 右侧操作面板 */
  .action-card { background: #fff; padding: 32px; border-radius: var(--radius); border: 1px solid var(--border-color); min-height: 450px; }
}

/* =========================================================
 *  * *  手机端布局 (<769px) - 垂直时间轴 (复刻PDF样式)
 *   * * ========================================================= */
@media (max-width: 768px) {
  /* 基础重置 */
  body { background-color: #f8fafc; }
  .navbar { padding: 0 15px; height: 50px; }
  .main-container { width: 100%; margin: 0; padding: 0; max-width: none; }
  
  /* 1. 强制垂直排列：指南在上，操作在下 */
  .recharge-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  /* 2. 指南部分 (Guide) - 放在最顶端 */
  .guide-card {
    order: -1; /* 保证在最上面 */
    background: #fff;
    padding: 20px 15px;
    margin-bottom: 10px; /* 与下方卡片隔开 */
    border-bottom: 1px solid #e5e7eb;
    display: block !important; /* 强制显示 */
  }

  .guide-title {
    font-size: 15px; font-weight: 700; margin-bottom: 15px;
    display: flex; align-items: center; gap: 8px;
    color: #111827;
  }

  /* 垂直步骤列表 */
  .step-list {
    position: relative;
    border-left: 2px solid #e5e7eb; /* 左侧灰色竖线 */
    margin-left: 8px;
    padding-left: 20px;
    display: block; /* 恢复垂直块级显示 */
  }

  .step-item {
    margin-bottom: 20px;
    position: relative;
    display: block;
  }
  .step-item:last-child { margin-bottom: 0; }

  /* 圆点 */
  .step-dot {
    position: absolute;
    left: -27px; /* 挂在竖线上 */
    top: 2px;
    width: 12px; height: 12px;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    z-index: 2;
  }
  /* 激活/完成状态颜色 */
  .step-item.active .step-dot { background: var(--primary); border-color: var(--primary); }
  .step-item.completed .step-dot { background: #10b981; border-color: #10b981; }

  /* 必须显示的文字内容 */
  .step-name {
    font-size: 14px; font-weight: 600; color: #374151;
    margin-bottom: 4px; display: block !important;
  }
  
  .step-desc {
    font-size: 13px; color: #6b7280; line-height: 1.5;
    display: block !important; /* 强制显示描述 */
  }
  
  /* 链接按钮样式优化 */
  .link-btn {
    display: inline-block;
    margin-top: 4px;
    color: var(--primary);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
  }

  /* 3. 操作面板 (Action) - 放在指南下方 */
  .action-card {
    background: #fff;
    padding: 25px 20px;
    border-top: 1px solid #e5e7eb;
    min-height: 400px;
  }
  
  .panel-title {
    font-size: 18px; font-weight: 600;
    margin-bottom: 20px;
    justify-content: flex-start;
  }
  
  /* 手机端隐藏操作区标题前面的圆圈数字(因为上面已经有详细步骤了) */
  .action-card .step-number { display: none; }
  
  /* 4. 查询页面适配 */
  .query-container { border: none; border-radius: 0; padding: 20px; margin-top: 10px; background: #fff;}
  .stats-bar { grid-template-columns: 1fr; gap: 10px; }
}

/* === 通用组件 === */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.3s; }

.panel-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.step-number { background: var(--primary); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }

.form-group { margin-bottom: 20px; }
.input-field {
  width: 100%; padding: 14px; border: 1px solid var(--border-color); border-radius: 8px;
  background: #f9fafb; font-size: 14px; outline: none; -webkit-appearance: none; font-family: monospace;
}
.input-field:focus { background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
textarea.input-field { min-height: 120px; }

.btn {
  width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 8px;
  font-weight: 500; font-size: 15px; cursor: pointer; transition: background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-row { display: flex; gap: 10px; }
.btn-secondary { background: white; border: 1px solid #e5e7eb; color: #374151; }

/* 批量查询 */
.query-container { background: #fff; padding: 24px; border-radius: 12px; border: 1px solid #e5e7eb; }
.stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.stat-item { background: #f8fafc; padding: 16px; border-radius: 8px; text-align: center; border: 1px solid #f1f5f9; }
.stat-val { font-size: 20px; font-weight: 700; display: block; }
.stat-label { font-size: 12px; color: #64748b; }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.result-table th { text-align: left; padding: 10px; background: #f9fafb; color: var(--text-sub); }
.result-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }

/* 弹窗与警告 */
.modal-overlay { background: rgba(0,0,0,0.5); position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal { background: white; width: 90%; max-width: 400px; border-radius: 12px; overflow: hidden; }
.alert { padding: 12px; border-radius: 8px; font-size: 13px; margin-top: 15px; display: flex; gap: 8px; }
.alert-error { background: #fef2f2; color: #ef4444; border: 1px solid #fee2e2; }
.alert-success { background: #eff6ff; color: #3b82f6; border: 1px solid #dbeafe; }

/* === 新增：按钮禁用状态样式 === */
.btn:disabled {
  background-color: #9ca3af !important; /* 让蓝色按钮变灰 */
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-secondary:disabled {
  color: #9ca3af;
  background-color: #f3f4f6;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
