/* style.css — 牛果备考 PC网页版
   商业产品级UI，干净专业 */

* { margin:0; padding:0; box-sizing:border-box; }

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-light: #dcfce7;
  --error: #dc2626;
  --error-light: #fee2e2;
  --warning: #d97706;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text2: #64748b;
  --text3: #94a3b8;
  --border: #e2e8f0;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* 顶栏 */
.topbar {
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.logo { font-size: 18px; font-weight: 700; color: var(--primary); }
.topbar-badge { font-size: 12px; color: var(--text3); background: var(--primary-light); padding: 2px 8px; border-radius: 10px; }
.pay-status { font-size: 12px; padding: 4px 12px; border-radius: 6px; font-weight: 600; }
.pay-status.free { background: var(--bg); color: var(--text2); }
.pay-status.paid { background: var(--success-light); color: var(--success); }

/* 布局 */
.layout { display: flex; min-height: calc(100vh - 56px); }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.nav { flex: 1; padding: 12px 8px; }
.nav-section { margin-bottom: 20px; }
.nav-section-title { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; padding: 4px 12px; margin-bottom: 4px; }
.nav-item {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item-highlight { color: var(--primary); }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-contact { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.sidebar-beian { font-size: 11px; line-height: 1.8; }
.sidebar-beian a { color: var(--text3); text-decoration: none; }
.sidebar-beian a:hover { color: var(--primary); }

/* 主内容 */
.content { flex: 1; padding: 24px; max-width: 960px; margin: 0 auto; width: 100%; }

/* 通用卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* 首页 */
.home-hero {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius);
  padding: 32px;
  color: #fff;
  margin-bottom: 20px;
}
.home-hero h1 { font-size: 24px; margin-bottom: 8px; }
.home-hero p { font-size: 14px; opacity: 0.9; line-height: 1.6; }

.home-stats { display: flex; gap: 12px; margin-bottom: 20px; }
.home-stat { flex: 1; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.home-stat-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.home-stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.feature-card.locked { opacity: 0.6; }
.feature-card-icon { font-size: 32px; margin-bottom: 8px; }
.feature-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.feature-card-desc { font-size: 12px; color: var(--text2); }
.feature-card-tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-top: 6px; }
.tag-free { background: var(--success-light); color: var(--success); }
.tag-paid { background: var(--error-light); color: var(--error); }

/* 答题界面 */
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.quiz-progress { font-size: 14px; color: var(--text2); }
.quiz-type-badge { font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.quiz-type-single { background: var(--primary-light); color: var(--primary); }
.quiz-type-multiple { background: #fef3c7; color: #92400e; }
.quiz-type-judgment { background: var(--success-light); color: var(--success); }

.question-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px; }
.question-text { font-size: 16px; line-height: 1.8; margin-bottom: 20px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.option:hover { border-color: var(--primary-light); background: #f8faff; }
.option.selected { border-color: var(--primary); background: var(--primary-light); }
.option.correct { border-color: var(--success); background: var(--success-light); }
.option.wrong { border-color: var(--error); background: var(--error-light); }
.option-marker {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.option.selected .option-marker { border-color: var(--primary); background: var(--primary); color: #fff; }
.option.correct .option-marker { border-color: var(--success); background: var(--success); color: #fff; }
.option.wrong .option-marker { border-color: var(--error); background: var(--error); color: #fff; }
.option-text { flex: 1; font-size: 14px; line-height: 1.5; }

.answer-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 12px;
  border-left: 4px solid var(--success);
  display: none;
}
.answer-box.show { display: block; }
.answer-box.wrong { border-left-color: var(--error); }
.answer-label { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.answer-label.correct { color: var(--success); }
.answer-label.wrong { color: var(--error); }
.answer-text { font-size: 14px; color: var(--text2); line-height: 1.6; }

.quiz-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--text3); cursor: not-allowed; }
.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }

/* 模考 */
.mock-setup { max-width: 500px; margin: 0 auto; }
.mock-setup-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 20px; }
.mock-option { margin-bottom: 16px; }
.mock-option-label { font-size: 14px; color: var(--text2); margin-bottom: 6px; }
.mock-option select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--card); cursor: pointer;
}

.mock-timer {
  position: fixed; top: 56px; right: 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 16px; font-weight: 700; color: var(--primary);
  z-index: 50; box-shadow: var(--shadow);
}
.mock-timer.warning { color: var(--error); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.mock-result { text-align: center; }
.mock-result-score { font-size: 48px; font-weight: 700; margin: 20px 0; }
.mock-result-score.pass { color: var(--success); }
.mock-result-score.fail { color: var(--error); }
.mock-result-detail { display: flex; gap: 20px; justify-content: center; margin-bottom: 20px; }
.mock-result-stat { text-align: center; }
.mock-result-stat-num { font-size: 24px; font-weight: 700; }
.mock-result-stat-label { font-size: 12px; color: var(--text2); }

/* 速记 */
.memo-section { margin-bottom: 24px; }
.memo-section-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.memo-item { font-size: 14px; line-height: 1.8; padding: 4px 0; padding-left: 16px; position: relative; }
.memo-item::before { content: ""; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* 查补贴 */
.subsidy-card { margin-bottom: 12px; }
.subsidy-city { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.subsidy-amount { font-size: 24px; font-weight: 700; color: var(--error); margin-bottom: 8px; }
.subsidy-detail { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* 实操 */
.practice-card { margin-bottom: 16px; }
.practice-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.practice-code {
  background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: var(--radius-sm);
  font-family: "Fira Code", "Consolas", monospace; font-size: 13px; line-height: 1.6;
  overflow-x: auto; margin: 8px 0; white-space: pre;
}
.practice-blank {
  display: inline-block; min-width: 80px; border-bottom: 2px solid #f59e0b;
  background: rgba(245,158,11,0.15); padding: 0 8px; margin: 0 2px;
  color: #f59e0b;
}
.practice-answer-toggle { font-size: 13px; color: var(--primary); cursor: pointer; margin-top: 8px; }

/* 分润中心 */
.rebate-wallet {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius); padding: 24px; color: #fff; margin-bottom: 16px;
}
.rebate-balance { font-size: 36px; font-weight: 700; }
.rebate-balance-label { font-size: 13px; opacity: 0.8; margin-bottom: 4px; }
.rebate-stats { display: flex; gap: 24px; margin-top: 16px; }
.rebate-stat { }
.rebate-stat-num { font-size: 18px; font-weight: 600; }
.rebate-stat-label { font-size: 12px; opacity: 0.8; }

.rebate-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.rebate-tab { padding: 8px 16px; font-size: 14px; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.rebate-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.rebate-record { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rebate-record-info { }
.rebate-record-title { font-size: 14px; }
.rebate-record-time { font-size: 12px; color: var(--text3); }
.rebate-record-amount { font-size: 16px; font-weight: 600; }
.rebate-record-amount.income { color: var(--success); }
.rebate-record-amount.expense { color: var(--error); }

/* 弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal { background: var(--card); border-radius: var(--radius); width: 90%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text3); }
.modal-body { padding: 20px; }

/* 支付二维码 */
.pay-qrcode { text-align: center; }
.pay-qrcode-img { width: 240px; height: 240px; margin: 16px auto; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.pay-amount { font-size: 28px; font-weight: 700; color: var(--error); }
.pay-tip { font-size: 13px; color: var(--text2); margin-top: 8px; }
.pay-waiting { font-size: 14px; color: var(--text2); text-align: center; padding: 20px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--text2); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; }
.form-input:focus { border-color: var(--primary); outline: none; }

/* 响应式 */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; top: 56px; left: -100%;
    width: 240px; transition: left 0.3s; z-index: 99;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .content { padding: 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .home-stats { flex-direction: column; }
  .mock-timer { right: 8px; font-size: 14px; padding: 6px 12px; }
  .topbar-badge { display: none; }
}

/* 加载动画 */
.loading { text-align: center; padding: 40px; color: var(--text3); }
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
