/* 矿业AI知识库 前台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Roboto', 'PingFang SC', 'Segoe UI', Arial, sans-serif;
  background: #F4F3EE; color: #1A1B1C; font-size: 14px; line-height: 1.6;
}
a { color: #2563EB; text-decoration: none; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid #E4E3DD;
  padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap;
}
.logo { font-size: 17px; font-weight: 700; color: #1E3A8A; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; color: #374151; font-size: 14px; }
.nav a:hover, .nav a.active { background: #EFF6FF; color: #1D4ED8; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box .nickname { font-weight: 600; color: #1E3A8A; }
.user-box a { font-size: 13px; color: #6B7280; }

/* 按钮 */
.btn {
  display: inline-block; border: none; cursor: pointer; border-radius: 8px;
  padding: 8px 18px; font-size: 14px; transition: all .15s;
}
.btn-primary { background: #2563EB; color: #fff; }
.btn-primary:hover { background: #1D4ED8; }
.btn-outline { background: #fff; color: #2563EB; border: 1px solid #2563EB; }
.btn-outline:hover { background: #EFF6FF; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px; }
.view { display: none; }
.view.active { display: block; }

/* 首页 */
.hero { text-align: center; padding: 48px 16px 32px; }
.hero h1 { font-size: 28px; color: #1E3A8A; margin-bottom: 12px; }
.hero p { color: #6B7280; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features {
  display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0;
}
.feature-card {
  flex: 1 1 220px; min-width: 0; background: #fff; border-radius: 14px;
  padding: 20px; border: 1px solid #E4E3DD;
}
.feature-title { font-weight: 700; color: #1E3A8A; margin-bottom: 6px; }
.feature-desc { color: #6B7280; font-size: 13px; }
.example-box {
  background: #fff; border: 1px solid #E4E3DD; border-radius: 14px; padding: 20px;
}
.example-title { font-weight: 700; margin-bottom: 12px; }
.example-item { margin-bottom: 14px; }
.example-item .q { font-weight: 600; margin-bottom: 4px; }
.example-item .a { color: #374151; }
.example-item .source {
  display: inline-block; margin-top: 6px; font-size: 12px; color: #2563EB;
  background: #EFF6FF; padding: 2px 8px; border-radius: 6px;
}

/* 认证卡片 */
.auth-card {
  max-width: 400px; margin: 40px auto; background: #fff;
  border-radius: 14px; border: 1px solid #E4E3DD; padding: 24px;
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs .tab {
  cursor: pointer; padding: 6px 16px; border-radius: 8px; color: #6B7280;
}
.auth-tabs .tab.active { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-item input {
  width: 100%; padding: 10px 12px; border: 1px solid #D1D5DB; border-radius: 8px;
  font-size: 14px; outline: none;
}
.form-item input:focus { border-color: #2563EB; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }

/* 问答页 */
.qa-layout { display: flex; gap: 16px; align-items: flex-start; }
.qa-history {
  flex: 0 0 220px; min-width: 0; background: #fff; border-radius: 12px;
  border: 1px solid #E4E3DD; padding: 12px; max-height: 600px; overflow: auto;
}
.qa-history .item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; color: #374151;
  font-size: 13px; margin-bottom: 4px;
}
.qa-history .item:hover { background: #EFF6FF; }
.qa-main { flex: 1; min-width: 0; }
.qa-quota { font-size: 13px; color: #6B7280; margin-bottom: 10px; text-align: right; }
.qa-chat {
  background: #fff; border: 1px solid #E4E3DD; border-radius: 12px;
  min-height: 380px; padding: 16px; overflow: auto;
}
.chat-empty { color: #9CA3AF; text-align: center; margin-top: 140px; }
.chat-msg { margin-bottom: 14px; }
.chat-msg .role { font-size: 12px; color: #6B7280; margin-bottom: 4px; }
.chat-msg.user .role { color: #2563EB; }
.chat-msg .content {
  background: #F8FAFC; border-radius: 10px; padding: 10px 12px; white-space: pre-wrap;
}
.chat-msg.user .content { background: #EFF6FF; }
.chat-msg .sources { margin-top: 8px; }
.chat-msg .source-tag {
  display: inline-block; font-size: 12px; color: #2563EB; background: #EFF6FF;
  padding: 3px 8px; border-radius: 6px; margin: 2px 4px 2px 0; cursor: pointer;
}
.qa-input { display: flex; gap: 10px; margin-top: 12px; }
.qa-input textarea {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #D1D5DB;
  border-radius: 10px; font-size: 14px; resize: none; outline: none; font-family: inherit;
}
.qa-input textarea:focus { border-color: #2563EB; }

/* 会员 */
.member-status {
  background: #fff; border: 1px solid #E4E3DD; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px; display: flex; gap: 24px; flex-wrap: wrap;
}
.member-status .m-item { font-size: 14px; }
.member-status .m-item b { color: #1E3A8A; }
.plan-list { display: flex; gap: 16px; flex-wrap: wrap; }
.plan-card {
  flex: 1 1 260px; min-width: 0; background: #fff; border: 2px solid #E4E3DD;
  border-radius: 14px; padding: 24px; text-align: center;
}
.plan-card.hot { border-color: #2563EB; }
.plan-card .p-name { font-size: 17px; font-weight: 700; }
.plan-card .p-price { font-size: 30px; color: #1E3A8A; margin: 10px 0 4px; }
.plan-card .p-price small { font-size: 14px; color: #6B7280; }
.plan-card .p-desc { color: #6B7280; font-size: 13px; margin-bottom: 16px; }
.pay-type { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.pay-type span {
  padding: 6px 14px; border: 1px solid #D1D5DB; border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.pay-type span.active { border-color: #2563EB; color: #2563EB; background: #EFF6FF; }

/* 历史 */
.panel-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  background: #fff; border: 1px solid #E4E3DD; border-radius: 12px; padding: 14px 16px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.history-item .hq { font-weight: 600; }
.history-item .ht { color: #9CA3AF; font-size: 12px; }

/* 个人中心 */
.profile-card {
  background: #fff; border: 1px solid #E4E3DD; border-radius: 12px; padding: 20px;
  max-width: 480px;
}
.profile-card .row { display: flex; padding: 8px 0; border-bottom: 1px dashed #E4E3DD; }
.profile-card .row .k { width: 90px; color: #6B7280; }

/* 弹层 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 380px; padding: 20px;
}
.modal-title { font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; }
.modal-close { cursor: pointer; color: #9CA3AF; font-size: 20px; }
.modal-body { text-align: center; }
#qrBox { display: flex; justify-content: center; margin: 12px 0; }
.pay-url {
  font-size: 12px; color: #6B7280; word-break: break-all; background: #F8FAFC;
  border-radius: 8px; padding: 8px; margin-top: 8px;
}
.pay-status { color: #6B7280; font-size: 13px; margin-top: 10px; }

/* 页脚 */
.footer { text-align: center; color: #9CA3AF; font-size: 12px; padding: 24px 0 32px; }

/* 移动端 */
@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .nav { order: 3; width: 100%; justify-content: center; padding: 6px 0; }
  .hero h1 { font-size: 22px; }
  .qa-layout { flex-direction: column; }
  .qa-history { flex: none; width: 100%; max-height: 160px; }
}
