/* 正信票据从业人员培训系统 - 样式 */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --primary: #1a7f37;
  --primary-light: #2d9f4e;
  --primary-bg: #e8f5e9;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-light: #888;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  padding-bottom: 60px;
}

/* 顶部导航 */
#header {
  position: fixed; top:0; left:0; right:0; z-index:100;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; height: 50px;
}
.header-left { min-width: 40px; }
.btn-back { background:none; border:none; color:#fff; font-size:24px; cursor:pointer; padding:0 4px; }
.header-title { font-size: 17px; font-weight: 600; }
.header-right { font-size: 13px; opacity:0.9; display:flex; align-items:center; gap:8px; }
.user-name { max-width: 100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; }

/* 页面容器 */
.page-view { display:none; padding: 60px 16px 80px; }
.page-view.active { display:block; }

/* 加载 */
.loading-overlay {
  position:fixed; top:0; left:0; right:0; bottom:0;
  background:rgba(255,255,255,0.85); z-index:999;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.loading-spinner {
  width:36px; height:36px; 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); } }
.loading-text { margin-top:12px; color:var(--text-light); font-size:14px; }

/* Banner */
.home-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color:#fff; border-radius:var(--radius); padding:20px; margin-bottom:16px;
  display:flex; align-items:center; gap:14px;
}
.banner-icon { font-size:36px; }
.banner-text h2 { font-size:18px; margin-bottom:4px; }
.banner-text p { font-size:13px; opacity:0.85; }

/* 进度卡片 */
.progress-card {
  background:var(--card-bg); border-radius:var(--radius); padding:16px;
  margin-bottom:16px; box-shadow:var(--shadow);
  display:flex; align-items:center; gap:12px;
}
.progress-label { font-size:13px; color:var(--text-light); white-space:nowrap; }
.progress-bar-wrap { flex:1; height:8px; background:#eee; border-radius:4px; overflow:hidden; }
.progress-bar { height:100%; background:var(--primary); border-radius:4px; transition:width 0.4s; }
.progress-num { font-size:14px; font-weight:600; color:var(--primary); white-space:nowrap; }

/* 章节树 */
.section-title { font-size:14px; font-weight:600; color:var(--text-light); margin:16px 0 8px; padding-left:4px; }

/* 知识树分组标题 */
.tree-group-title { font-size:13px; font-weight:600; color:#555; margin:16px 0 6px 0; padding:4px 8px; background:#f5f5f5; border-radius:4px; }
.tree-group-title:first-of-type { margin-top:4px; }

/* 多级目录树 */
.tree-node { display:flex; align-items:center; padding:8px 4px; cursor:pointer; font-size:14px; border-bottom:1px solid #f0f0f0; }
.tree-node:hover { background:#f5f9ff; }
.tree-node.leaf { color:#333; }
.tree-node.dir { color:#1a7f37; font-weight:500; }
.tree-arrow { display:inline-block; width:16px; font-size:10px; color:#999; flex-shrink:0; }
.tree-dot { display:inline-block; width:16px; font-size:12px; color:#bbb; flex-shrink:0; text-align:center; }
.tree-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tree-status { font-size:12px; margin-left:6px; }
.chapter-item {
  background:var(--card-bg); border-radius:var(--radius); padding:14px 16px;
  margin-bottom:8px; box-shadow:var(--shadow); cursor:pointer;
  display:flex; align-items:center; gap:10px;
}
.chapter-item:hover { background:#f9f9f9; }
.chapter-group { font-size:12px; color:var(--text-light); background:#eee; padding:2px 8px; border-radius:4px; }
.chapter-title { flex:1; font-size:14px; }
.chapter-status { font-size:12px; }
.chapter-status.not_started { color:#bbb; }
.chapter-status.learning { color:#f5a623; }
.chapter-status.done { color:var(--primary); }

/* 学习页面 */
.learn-container { max-width:800px; margin:0 auto; }
.learn-chapter-title { font-size:18px; font-weight:600; margin-bottom:12px; }
.learn-content {
  background:var(--card-bg); border-radius:var(--radius); padding:20px;
  box-shadow:var(--shadow); line-height:1.8; font-size:15px;
  min-height:200px; word-wrap:break-word;
}
.learn-content h1 { font-size:20px; margin:16px 0 8px; }
.learn-content h2 { font-size:18px; margin:14px 0 6px; }
.learn-content h3 { font-size:16px; margin:12px 0 4px; }
.learn-content p { margin:8px 0; }
.learn-content ul, .learn-content ol { margin:8px 0; padding-left:20px; }
.learn-content li { margin:4px 0; }
.learn-content table { width:100%; border-collapse:collapse; margin:12px 0; font-size:14px; }
.learn-content th, .learn-content td { border:1px solid #ddd; padding:8px 12px; text-align:left; }
.learn-content th { background:var(--primary-bg); font-weight:600; }
.learn-content code { background:#f0f0f0; padding:2px 6px; border-radius:3px; font-size:13px; font-family:'Menlo','Monaco','Courier New',monospace; }
.learn-content pre { background:#f5f5f5; border:1px solid #e0e0e0; border-radius:8px; padding:16px; margin:12px 0; overflow-x:auto; }
.learn-content pre code { background:none; padding:0; font-size:13px; line-height:1.6; }
.learn-content hr { border:none; border-top:1px solid #e0e0e0; margin:16px 0; }
.learn-content a { color:var(--primary); text-decoration:underline; }
.learn-content blockquote p { margin:0; }
.learn-content blockquote { border-left:3px solid var(--primary); padding:8px 16px; margin:8px 0; background:#f9f9f9; }
.learn-actions { display:flex; gap:8px; margin-top:16px; flex-wrap:wrap; }
.learn-extra { display:flex; gap:12px; margin-top:12px; }

/* 按钮 */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:4px;
  padding:10px 18px; border-radius:8px; font-size:14px; font-weight:500;
  cursor:pointer; border:none; transition:all 0.15s;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-light); }
.btn-secondary { background:#f0f0f0; color:var(--text); }
.btn-secondary:hover { background:#e0e0e0; }
.btn-text { background:none; color:var(--primary); padding:6px 10px; }
.btn-text:hover { background:var(--primary-bg); }
.btn-large { padding:14px 32px; font-size:16px; width:100%; }

/* 管理后台入口 */
.btn-admin { display:inline-block; background:#1a7f37; color:#fff; padding:10px 24px; border-radius:6px; text-decoration:none; font-size:14px; font-weight:500; margin-bottom:12px; }
.btn-admin:hover { background:#2d9f4e; }
.profile-footer { display:flex; flex-direction:column; align-items:center; gap:8px; margin-top:24px; }

/* 自测页面 */
.quiz-intro { text-align:center; padding:40px 20px; }
.quiz-icon { font-size:48px; margin-bottom:12px; }
.quiz-intro h3 { font-size:16px; margin-bottom:4px; }
.quiz-intro p { color:var(--text-light); margin-bottom:24px; }
.quiz-progress-bar-wrap { height:4px; background:#eee; border-radius:2px; margin-bottom:16px; }
.quiz-progress-bar { height:100%; background:var(--primary); border-radius:2px; }
.quiz-question { font-size:16px; margin-bottom:16px; font-weight:500; }
.quiz-option {
  display:block; width:100%; padding:14px 16px; margin-bottom:8px;
  background:var(--card-bg); border:1.5px solid var(--border); border-radius:8px;
  text-align:left; font-size:15px; cursor:pointer; transition:all 0.1s;
}
.quiz-option:hover { border-color:var(--primary-light); }
.quiz-option.selected { border-color:var(--primary); background:var(--primary-bg); }
.quiz-option.correct { border-color:#1a7f37; background:#e8f5e9; }
.quiz-option.wrong { border-color:#d32f2f; background:#ffebee; }
.quiz-nav {
  display:flex; justify-content:space-between; align-items:center; margin-top:16px;
}
.quiz-history { margin-top:24px; }
.quiz-history-item { padding:8px 0; border-bottom:1px solid #eee; font-size:13px; }

/* 结果卡片 */
.result-card { text-align:center; padding:40px 20px; }
.result-score { font-size:64px; font-weight:700; color:var(--primary); }
.result-label { font-size:14px; color:var(--text-light); margin-bottom:16px; }
.result-detail { font-size:14px; color:var(--text); margin-bottom:20px; }

/* 表单 */
.form-group { margin-bottom:14px; }
.form-group label { display:block; font-size:13px; color:var(--text-light); margin-bottom:4px; }
.form-input, .form-select, .form-textarea {
  width:100%; padding:10px 12px; border:1.5px solid var(--border); border-radius:8px;
  font-size:15px; background:var(--card-bg);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline:none; border-color:var(--primary); }
.form-textarea { resize:vertical; }

/* 个人中心 */
.profile-card {
  text-align:center; padding:24px; background:var(--card-bg);
  border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:16px;
}
.profile-avatar { font-size:48px; margin-bottom:8px; }
.profile-name { font-size:18px; font-weight:600; }
.profile-dept { font-size:13px; color:var(--text-light); }
.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:16px; }
.stat-item { background:var(--card-bg); border-radius:var(--radius); padding:16px; text-align:center; box-shadow:var(--shadow); }
.stat-value { font-size:24px; font-weight:700; color:var(--primary); }
.stat-label { font-size:12px; color:var(--text-light); margin-top:2px; }

/* 进度列表 */
.my-progress { background:var(--card-bg); border-radius:var(--radius); padding:12px; box-shadow:var(--shadow); margin-bottom:16px; }
.my-progress-item { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px solid #f0f0f0; font-size:13px; }
.my-progress-item:last-child { border:none; }

/* 错题本 */
.wrong-list { background:var(--card-bg); border-radius:var(--radius); padding:12px; box-shadow:var(--shadow); margin-bottom:16px; }
.wrong-item { padding:10px 0; border-bottom:1px solid #f0f0f0; font-size:13px; }
.wrong-item:last-child { border:none; }
.wrong-question { margin-bottom:4px; }
.wrong-meta { color:var(--text-light); font-size:12px; }
.btn-resolve { color:var(--primary); background:none; border:none; font-size:12px; cursor:pointer; }

/* 我的提问 */
.my-questions { margin-top:20px; }
.my-questions h4 { font-size:14px; color:var(--text-light); margin-bottom:8px; }
.q-item { background:var(--card-bg); border-radius:8px; padding:12px; margin-bottom:8px; box-shadow:var(--shadow); }
.q-title { font-weight:500; font-size:14px; }
.q-meta { font-size:12px; color:var(--text-light); margin-top:4px; }
.q-status { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; }
.q-status.pending { background:#fff3e0; color:#e65100; }
.q-status.answered { background:#e8f5e9; color:#1a7f37; }
.q-status.adopted { background:#e3f2fd; color:#1565c0; }

/* 底部导航 */
.bottom-nav {
  position:fixed; bottom:0; left:0; right:0; z-index:100;
  background:var(--card-bg); border-top:1px solid var(--border);
  display:flex; padding-bottom:var(--safe-bottom);
}
.nav-item {
  flex:1; display:flex; flex-direction:column; align-items:center;
  padding:8px 0 4px; cursor:pointer; color:var(--text-light); font-size:11px;
  transition:color 0.15s;
}
.nav-item.active { color:var(--primary); }
.nav-item .nav-icon { font-size:20px; margin-bottom:2px; }
.nav-item .nav-label { font-size:11px; }

/* 问题列表（在提问页管理后台暂不单独设计） */


/* ====== 收藏列表 ====== */
.collection-container {
  padding: 16px;
}
.collection-container h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
}
.collection-item {
  padding: 14px 16px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s;
}
.collection-item:hover {
  border-color: #07c160;
  box-shadow: 0 2px 8px rgba(7,193,96,0.1);
}
.collection-item:active {
  background: #f5f5f5;
}
.collection-title {
  font-size: 15px;
  color: #333;
  margin-bottom: 4px;
}
.collection-section {
  font-size: 12px;
  color: #999;
}
.collection-list .empty-state {
  padding: 40px 16px;
}
