/* internal/api/web/static/style.css */
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0; background: #f5f6f8; color: #222; }
.card { background: #fff; border-radius: 8px; padding: 16px 20px; margin: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
h1 { font-size: 20px; } h2 { font-size: 16px; }
nav { padding: 8px 16px; background: #1f2937; }
nav button { background: transparent; color: #e5e7eb; border: 0; padding: 8px 14px; cursor: pointer; font-size: 14px; }
nav button:hover { background: #374151; border-radius: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
button { padding: 7px 14px; border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; font-size: 14px; }
button:hover { background: #1d4ed8; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #eef0f3; }
th { background: #f9fafb; font-weight: 600; }
pre { background: #111827; color: #d1fae5; padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.err { color: #dc2626; font-size: 13px; }
.ok { color: #059669; font-size: 13px; }
.hint { color: #6b7280; font-size: 13px; margin: 4px 0 12px; }
.hint code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
button.ghost { background: #6b7280; }
button.ghost:hover { background: #4b5563; }

/* a.btn：让链接呈现为按钮样式（购买入口），与 <button> 视觉一致。
   注意 a 默认有下划线与链接色，这里需要显式覆盖。 */
a.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
a.btn:hover { background: #1d4ed8; }
/* 购买入口用醒目的橙色调，与「查询」的蓝色主操作区分开 */
a.btn.buy { background: #ea580c; }
a.btn.buy:hover { background: #c2410c; }
.meter { margin-top: 12px; }
.meter-label { display: flex; justify-content: space-between; font-size: 13px; color: #374151; margin: 6px 0; }
progress { width: 100%; height: 12px; }

/* 概览统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: #f9fafb; border-radius: 8px; border: 1px solid #eef0f3; }
.stat-label { font-size: 12px; color: #6b7280; }
.stat-value { font-size: 18px; font-weight: 600; color: #111827; }
.stat-value.ok { color: #059669; }
.stat-value.warn { color: #d97706; }
h3 { font-size: 14px; margin: 18px 0 8px; color: #374151; }
canvas { width: 100%; max-width: 900px; height: auto; }

/* 在线测试对话区 */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 120px; max-height: 420px; overflow-y: auto; padding: 12px; background: #f9fafb; border: 1px solid #eef0f3; border-radius: 8px; }
.chat:empty::before { content: '还没有对话，发一条消息试试～'; color: #9ca3af; font-size: 13px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 3px; }
.bubble.ai { align-self: flex-start; background: #fff; color: #111827; border: 1px solid #e5e7eb; border-bottom-left-radius: 3px; }
textarea { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; resize: vertical; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* 列表分页条 */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pager:empty { display: none; }
.pager-info { color: #6b7280; font-size: 13px; margin-right: 4px; }
.pager input { width: 70px; padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; text-align: center; }

/* 登录页验证码 */
.captcha-img { width: 120px; height: 40px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; background: #f5f6f8; }
#login-view .row { margin-bottom: 0; }

/* 用户中心顶部 Tab：浅色风格，与后台深色 nav 区分。 */
#user-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 0 16px; background: transparent;
  border-bottom: 1px solid #e5e7eb; margin: 16px 16px 0;
}
#user-tabs button {
  background: transparent; color: #6b7280; border: 0;
  border-bottom: 2px solid transparent; border-radius: 0;
  padding: 10px 16px; font-size: 14px; cursor: pointer;
}
#user-tabs button:hover { background: transparent; color: #111827; }
#user-tabs button.on { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

/* 弹框（生成密钥 / 生成充值码） */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, .45); padding: 16px;
}
.modal {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 10px; padding: 20px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.modal h2 { margin: 0 0 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.field input, .field select { width: 100%; }
.field .row input { width: auto; }
.field .hint { margin: 6px 0 0; }
.req { color: #dc2626; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* 文档页表格里的行内代码 */
#tab-docs td code, #tab-docs .hint code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
#tab-docs h3:first-of-type { margin-top: 8px; }
