/* 【学员系统】统一样式：手机优先，蓝白简洁风 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1f2329;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 64px; /* 给底部导航留位置 */
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 15px; color: #1f2329;
  width: 100%; padding: 11px 12px; border: 1px solid #e0e2e6;
  border-radius: 10px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #3b82f6; }
label { display: block; font-size: 13px; color: #6b7280; margin: 12px 0 6px; }

/* 顶部标题栏 */
.topbar {
  background: #fff; padding: 14px 16px; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.topbar .user { font-size: 12px; font-weight: 400; color: #9ca3af; }
.back { font-size: 14px; font-weight: 400; color: #3b82f6; }

/* 卡片 */
.card {
  background: #fff; border-radius: 12px; margin: 12px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

/* 看板数字 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px; }
.stat-box {
  background: #fff; border-radius: 12px; padding: 14px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-box .num { font-size: 24px; font-weight: 700; color: #3b82f6; }
.stat-box .label { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* 列表行 */
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid #f0f1f3;
}
.list-item:active { background: #f8fafc; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-size: 15px; font-weight: 500; }
.list-item .sub { font-size: 12px; color: #9ca3af; margin-top: 3px; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #eff6ff; color: #2563eb; margin-left: 6px;
}
.tag-green { background: #ecfdf5; color: #059669; }
.tag-orange { background: #fff7ed; color: #ea580c; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-gray { background: #f3f4f6; color: #6b7280; }

/* 按钮 */
.btn {
  display: inline-block; text-align: center; font-size: 15px; font-weight: 500;
  padding: 11px 20px; border-radius: 10px; border: none; background: #3b82f6;
  color: #fff; width: auto;
}
.btn:active { opacity: .85; }
.btn-blue { background: #3b82f6; color: #fff; }
.btn-green { background: #10b981; color: #fff; }
.btn-gray { background: #f3f4f6; color: #374151; }
.btn-red { background: #fee2e2; color: #dc2626; }
.btn-outline { background: #f9fafb; color: #6b7280; border: 1px solid #d1d5db; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.form-actions { display: flex; gap: 10px; margin: 20px 0; }
.form-actions .btn { flex: 1; }
.login-page .btn, .btn-block { width: 100%; }

/* 类型切换按钮组（方案C：描边样式，选中蓝底白字，未选中浅灰描边） */
.tab-group { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; font-size: 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid #d1d5db; background: #f9fafb; color: #6b7280;
  white-space: nowrap; width: auto; font-weight: 400;
}
.tab-btn.active {
  background: #3b82f6; color: #fff; border-color: #3b82f6; font-weight: 500;
}

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; display: flex;
  border-top: 1px solid #f0f1f3; z-index: 100;
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 9px 0 7px; font-size: 11px; color: #9ca3af;
}
.bottom-nav a.active { color: #3b82f6; font-weight: 600; }
.bottom-nav .icon { display: block; font-size: 18px; margin-bottom: 2px; }
.brand { display: none; } /* 系统标识：仅电脑端显示 */

/* 搜索框 */
.search-bar { margin: 12px; display: flex; gap: 8px; }
.search-bar input { flex: 1; }

/* 详情信息 */
.detail-row { display: flex; padding: 9px 0; border-bottom: 1px solid #f7f8fa; font-size: 14px; }
.detail-row .k { width: 84px; color: #9ca3af; flex-shrink: 0; }
.detail-row .v { flex: 1; word-break: break-all; }

/* 提示条 */
.notice { background: #eff6ff; color: #2563eb; font-size: 13px; padding: 10px 14px; margin: 12px; border-radius: 10px; }
.error-box { background: #fef2f2; color: #dc2626; font-size: 13px; padding: 10px 14px; margin: 12px; border-radius: 10px; }

/* 进度条 */
.progress { height: 8px; background: #eef0f3; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.progress .bar { height: 100%; background: #3b82f6; border-radius: 10px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #9ca3af; font-weight: 500; padding: 8px; border-bottom: 1px solid #f0f1f3; }
td { padding: 8px; border-bottom: 1px solid #f7f8fa; }

/* 空状态 */
.empty { text-align: center; color: #c0c4cc; font-size: 13px; padding: 40px 0; }

/* 登录页（旧手机版，保留兼容） */
.login-page { background: #fff; min-height: 100vh; padding: 80px 32px 40px; }
.login-page .logo { text-align: center; font-size: 26px; font-weight: 700; color: #3b82f6; margin-bottom: 8px; }
.login-page .slogan { text-align: center; color: #9ca3af; font-size: 14px; margin-bottom: 40px; }

/* 登录页（电脑版：左右分栏） */
.login-body { max-width: none; margin: 0; padding-bottom: 0; }
.login-wrap { display: flex; min-height: 100vh; }
.login-aside {
  flex: 0 0 44%; background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff; display: flex; align-items: center; justify-content: center; padding: 40px;
}
.aside-inner { max-width: 340px; }
.aside-logo { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.aside-slogan { font-size: 15px; opacity: .85; margin-bottom: 32px; }
.aside-points { list-style: none; }
.aside-points li { font-size: 14px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.15); }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; background: #f0f2f5; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08); padding: 36px 32px; }
.login-title { font-size: 22px; font-weight: 700; color: #1f2329; }
.login-sub { font-size: 14px; color: #9ca3af; margin: 8px 0 24px; }
@media (max-width: 767px) {
  .login-wrap { flex-direction: column; }
  .login-aside { flex: none; padding: 30px 24px; }
  .aside-points { display: none; }
  .login-main { min-height: calc(100vh - 132px); }
}

/* ========== 电脑端（宽度≥768px）：专业管理后台布局（深色侧边栏 + 顶栏 + 紧凑内容区） ========== */
@media (min-width: 768px) {
  body { max-width: none; padding-bottom: 0; background: #f0f2f5; }

  /* —— 深色侧边栏 —— */
  .bottom-nav {
    position: fixed; left: 0; top: 0; bottom: 0; width: 220px;
    flex-direction: column; align-items: stretch; transform: none;
    background: #1f2733; padding: 0; z-index: 100;
  }
  .brand {
    display: block; font-size: 16px; font-weight: 700; color: #fff;
    padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .bottom-nav a {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 13px 20px; font-size: 14px; color: #b7c0cd;
    border-bottom: none; border-left: 3px solid transparent;
  }
  .bottom-nav a.active { border-left-color: #3b82f6; color: #fff; background: rgba(59,130,246,.18); font-weight: 600; }
  .bottom-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
  .bottom-nav .icon { display: inline; font-size: 15px; margin: 0; width: 18px; text-align: center; }

  /* —— 顶栏：白底横条，横贯内容区 —— */
  .topbar {
    position: sticky; top: 0; margin-left: 220px; z-index: 50;
    background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: none;
    padding: 0 28px; height: 56px; font-size: 16px; font-weight: 600;
  }
  .topbar .user { font-size: 13px; }

  /* —— 主内容区：侧边栏右侧、留白规整 —— */
  .content { margin-left: 220px; padding: 20px 28px 40px; max-width: 1280px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 16px; }
  .stat-box { border-radius: 8px; border: 1px solid #e5e7eb; box-shadow: none; padding: 18px; }
  .stat-box .num { font-size: 26px; }
  .card, .search-bar, .notice, .error-box { margin: 0 0 16px; }
  .card { border-radius: 8px; border: 1px solid #e5e7eb; box-shadow: none; padding: 18px 20px; }
  .card-title { font-size: 15px; margin-bottom: 12px; }
  .card .btn { max-width: none; }

  /* 列表行：规整数据行（白底细边框，悬停高亮） */
  .list-item {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    margin: 8px 0; padding: 12px 16px;
  }
  .list-item .title { font-size: 14px; }
  .list-item .sub { font-size: 12px; }
  .list-item:hover { border-color: #93c5fd; background: #f8fafc; }
  .list-item:active { background: #f8fafc; }

  /* 表格：后台标准样式（灰底表头、行悬停） */
  table { font-size: 13px; }
  th { background: #f8fafc; color: #6b7280; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
  td { padding: 10px 12px; }
  tr:hover td { background: #f8fafc; }

  /* 按钮/表单：收紧到后台常规尺寸 */
  .btn { width: auto; padding: 8px 18px; font-size: 14px; border-radius: 6px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .form-actions { margin: 20px 0; gap: 12px; }
  input, select, textarea { max-width: 480px; font-size: 14px; padding: 9px 12px; border-radius: 6px; }
  label { font-size: 13px; }
  .search-bar { max-width: none; margin: 0 0 12px; }
  .search-bar input { max-width: 320px; }
  details { max-width: none; }
  details form { max-width: 480px; }

  /* 登录页：居中卡片 */
  .login-page { max-width: 420px; margin: 60px auto 0; border: 1px solid #e5e7eb; border-radius: 10px; }
}

/* ========== 学员端页面：任何设备都保持手机样式（480居中+底部导航） ========== */
body.m-page { max-width: 480px; margin: 0 auto; background: #f5f6f8; padding-bottom: 64px; }
/* 学员端导航：图标和文字同一行横排 */
body.m-page .bottom-nav a {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 0; font-size: 13px; color: #9ca3af;
}
body.m-page .bottom-nav a.active { color: #3b82f6; font-weight: 600; }
body.m-page .bottom-nav .icon { display: inline; font-size: 15px; margin: 0; width: auto; }
@media (min-width: 768px) {
  body.m-page { max-width: 480px; padding-bottom: 64px; }
  body.m-page .bottom-nav {
    position: fixed; left: 50%; transform: translateX(-50%); top: auto; bottom: 0;
    width: 100%; max-width: 480px; flex-direction: row; background: #fff;
    border-right: none; border-top: 1px solid #f0f1f3; padding: 0;
  }
  body.m-page .bottom-nav a {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 12px 0; font-size: 13px; color: #9ca3af; border-left: none;
  }
  body.m-page .bottom-nav a.active { color: #3b82f6; font-weight: 600; background: none; border-left: none; }
  body.m-page .bottom-nav .icon { display: inline; font-size: 15px; margin: 0; width: auto; }
  body.m-page .bottom-nav .brand { display: none; }
  body.m-page .topbar { margin-left: 0; }
  body.m-page .card, body.m-page .stat-grid, body.m-page .list-item,
  body.m-page .search-bar, body.m-page .notice, body.m-page .error-box {
    max-width: none; margin-left: 0; margin-right: 0;
  }
}

/* ========== AI助手聊天界面 ========== */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - 64px); }
body.m-page .chat-page { height: calc(100vh - 64px); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 14px; }
.msg { display: flex; margin-bottom: 14px; }
.msg .bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #3b82f6; color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { justify-content: flex-start; }
.msg.ai .bubble { background: #fff; color: #1f2329; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.msg.ai .avatar { width: 34px; height: 34px; border-radius: 50%; background: #eff6ff; color: #3b82f6; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 8px; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 14px 4px; }
.chips button {
  background: #eff6ff; color: #2563eb; border: none; border-radius: 20px;
  padding: 7px 14px; font-size: 12px;
}
.chat-input { display: flex; gap: 8px; padding: 10px 14px; background: #fff; border-top: 1px solid #f0f1f3; }
.chat-input input { flex: 1; border-radius: 22px; padding: 10px 16px; }
.chat-input button { width: auto; border-radius: 22px; padding: 10px 18px; flex-shrink: 0; }
.typing .bubble::after { content: '…'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

