/* 充值算号器 - 全局样式 */

/* 启动隐藏：<head> 中内联脚本给 <html> 加 boot 类，页面初始化（鉴权+i18n）完成后移除，
   避免未登录时闪现受保护页面、以及 i18n 生效前闪现默认中文 */
html.boot { background: #eef2f7; }
html.boot body { visibility: hidden; }

/* 启动隐藏期间显示加载圈（FRP 等慢网络下鉴权要等几秒，避免误以为白屏） */
html.boot::after {
  content: ''; position: fixed; top: 50%; left: 50%; z-index: 9999;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 4px solid rgba(100,116,139,.25); border-top-color: #2563eb;
  border-radius: 50%; animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  background: #eef2f7;
  color: #1e293b;
}
.muted { color: #64748b; font-size: 15px; }
.error { color: #dc2626; font-size: 15px; margin: 10px 0 0; }

/* 按钮 */
.btn {
  border: none; border-radius: 8px; padding: 10px 20px; font-size: 15px;
  cursor: pointer; background: #e2e8f0; color: #1e293b; transition: background .15s;
}
.btn:hover { background: #cbd5e1; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.full { width: 100%; margin-top: 16px; padding: 12px; font-size: 16px; }

/* 登录页 */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #38bdf8 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px; width: 380px;
  box-shadow: 0 12px 48px rgba(15, 23, 42, .25);
}
.login-card h1 { font-size: 26px; margin: 0 0 6px; text-align: center; }
.login-card .muted { text-align: center; }
.login-card form { margin-top: 24px; }
.login-card label { display: block; margin-bottom: 18px; font-size: 15px; color: #475569; }

/* 输入框 */
input, select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 12px 14px;
  font-size: 17px; outline: none; background: #fff; margin-top: 6px; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px #dbeafe; }
input.mono { font-family: ui-monospace, Consolas, monospace; }

/* 布局 */
.topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
}
.topbar h1 { font-size: 22px; margin: 0; }
.topbar .who {
  font-size: 17px; color: #64748b;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: flex-end;
}
.topbar .who a {
  color: #475569; text-decoration: none; font-size: 17px; white-space: nowrap;
  padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.topbar .who a:hover { background: #f1f5f9; color: #2563eb; text-decoration: none; }
.topbar .who .username {
  background: #f1f5f9; color: #334155; font-weight: 500; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px;
}
.topbar .who .langlabel { white-space: nowrap; }

.container { max-width: 920px; margin: 0 auto; padding: 28px 20px 56px; }
.card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 24px; margin-bottom: 22px; box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.card h2 {
  font-size: 17px; margin: 0 0 16px; color: #334155;
  display: flex; align-items: center; gap: 8px;
}
.card h2::before {
  content: ''; display: inline-block; width: 4px; height: 18px;
  background: #2563eb; border-radius: 2px;
}

.row { display: flex; flex-wrap: wrap; gap: 16px; }
.field { display: block; font-size: 14px; color: #64748b; font-weight: 500; }
.field input { width: auto; min-width: 180px; }

/* 算号页 - 输入区 */
.calc-input { flex: 1; min-width: 240px; }
.calc-input input { width: 100%; font-size: 22px; padding: 14px 16px; letter-spacing: .1em; }
.calc-submit-wrap {
  flex: 1; min-width: 240px; display: flex; align-items: flex-end;
}
.calc-submit-wrap[hidden] { display: none; }
.calc-submit { width: 100%; height: 56px; font-size: 17px; }

/* 结果码卡片 */
.result-card { border-left: 5px solid #2563eb; }
.op-title { font-weight: 600; font-size: 17px; }
.op-desc { font-size: 14px; color: #64748b; margin-top: 4px; }
.op-time { font-size: 14px; color: #94a3b8; margin-top: 4px; }
.code-line {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 10px; padding: 16px 20px; margin-top: 14px;
}
.code-line code {
  flex: 1; text-align: center; color: #4ade80; font-size: 28px; font-weight: 600;
  letter-spacing: .22em; font-family: ui-monospace, Consolas, monospace; user-select: all;
}
.code-line .btn { font-size: 15px; padding: 10px 22px; }
.detail-toggle {
  background: none; border: none; color: #94a3b8; font-size: 14px;
  cursor: pointer; padding: 10px 0 0; text-decoration: underline;
}
.detail-box {
  background: #f8fafc; border-radius: 8px; padding: 14px; margin-top: 10px;
  font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.9; color: #475569;
}
.decode-info {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 14px 18px; margin-top: 16px; font-size: 16px;
  display: flex; flex-wrap: wrap; gap: 10px 32px;
}
.decode-info b { font-family: ui-monospace, Consolas, monospace; font-size: 17px; }
.warn { color: #dc2626; font-weight: 500; }

/* 表格 */
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th {
  text-align: left; font-size: 13px; color: #64748b; padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
}
table.list td { padding: 10px; border-bottom: 1px solid #f1f5f9; }
table.list td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
table.list input { padding: 8px 10px; font-size: 15px; margin-top: 0; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: #fff; border-radius: 14px; padding: 28px; width: 380px; }
.modal h3 { margin: 0 0 20px; font-size: 19px; }
.modal label { display: block; margin-bottom: 14px; font-size: 15px; color: #475569; }
.modal .actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }

/* 页签 */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.tabs button {
  border: none; background: none; padding: 10px 20px; font-size: 16px; cursor: pointer;
  color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs button.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.hint { font-size: 14px; color: #b45309; margin-top: 12px; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; font-size: 14px; color: #64748b; }

/* 移动端适配 */
@media (max-width: 600px) {
  .code-line code { font-size: 21px; letter-spacing: .12em; }
  .container { padding: 16px 12px 40px; }
  .card { padding: 18px; }
}

/* 语言切换（覆盖全局 input/select 的大输入框样式，保持紧凑） */
.langsel {
  width: auto; margin-top: 0; padding: 8px 10px; font-size: 15px; cursor: pointer;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #475569;
}
.langsel:hover { border-color: #cbd5e1; background: #f1f5f9; }
.login-langsel {
  position: fixed; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; color: #475569;
  background: rgba(255,255,255,.9); padding: 4px 8px; border-radius: 8px;
}
