/* 极派科技 · 支付服务管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #f4f6fa; color: #1f2329; display: flex; min-height: 100vh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 230px; flex-shrink: 0; background: #10182b; color: #c6cede;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; padding: 22px 18px; border-bottom: 1px solid #1e2a44; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #1677ff, #5aa2ff);
  color: #fff; font-weight: 700; font-size: 20px;
  display: flex; align-items: center; justify-content: center; margin-right: 10px;
}
.brand-text { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.3; }
.brand-text span { display: block; font-size: 11px; font-weight: 400; color: #7a89a8; }
nav { flex: 1; padding: 14px 10px; }
.nav-item {
  display: block; padding: 11px 14px; border-radius: 10px; margin-bottom: 4px;
  color: #aeb9cf; text-decoration: none; font-size: 14px; cursor: pointer;
}
.nav-item:hover { background: #1a2440; color: #fff; }
.nav-item.active { background: #1677ff; color: #fff; }
.sidebar-foot { padding: 16px 18px; font-size: 11px; color: #5c6a88; border-top: 1px solid #1e2a44; }

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 26px 30px 60px; max-width: 1200px; }
h1 { font-size: 22px; margin-bottom: 18px; }
.tab { display: none; }
.tab.active { display: block; }

.panel {
  background: #fff; border-radius: 14px; padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(16, 24, 43, 0.05);
}
.panel h2 { font-size: 15px; margin-bottom: 6px; }
.panel-desc { font-size: 12.5px; color: #7d8698; margin-bottom: 14px; line-height: 1.7; }
.panel-desc code { background: #f0f2f7; padding: 1px 6px; border-radius: 4px; color: #1677ff; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.form-grid label { font-size: 12.5px; color: #4e5969; display: flex; flex-direction: column; gap: 5px; }
input, select, textarea {
  font-size: 13.5px; color: #1f2329; padding: 9px 11px;
  border: 1px solid #d9dee7; border-radius: 9px; outline: none;
  background: #fbfcfe; font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #1677ff; background: #fff; }
textarea { resize: vertical; margin-bottom: 12px; }

.btn-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn {
  font-size: 13.5px; padding: 9px 18px; border-radius: 9px; cursor: pointer;
  border: 1px solid #d9dee7; background: #fff; color: #4e5969;
  text-decoration: none; display: inline-block; font-family: inherit;
}
.btn:hover { border-color: #1677ff; color: #1677ff; }
.btn.primary { background: #1677ff; border-color: #1677ff; color: #fff; }
.btn.primary:hover { background: #0e63d8; }
.inline-hint { font-size: 12.5px; color: #8a919f; }
.count { font-size: 12px; color: #1677ff; background: #e8f3ff; padding: 2px 10px; border-radius: 10px; margin-left: 6px; }

.status-banner {
  padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 18px;
}
.status-banner.ok { background: #e8f8f0; color: #00a05e; border: 1px solid #c2ecd8; }
.status-banner.warn { background: #fff7e8; color: #b26a00; border: 1px solid #ffe3b0; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 8px; color: #7d8698; font-weight: 500;
  border-bottom: 1px solid #eef0f4; white-space: nowrap;
}
.table td { padding: 10px 8px; border-bottom: 1px solid #f4f6fa; word-break: break-all; }
.table .empty { text-align: center; color: #b0b6c0; padding: 26px 0; }
.badge { padding: 2px 10px; border-radius: 10px; font-size: 12px; display: inline-block; }
.badge.paid { background: #e8f8f0; color: #00a05e; }
.badge.created { background: #fff7e8; color: #b26a00; }
.badge.success { background: #e8f8f0; color: #00a05e; }
.badge.other { background: #f0f2f7; color: #7d8698; }
.link-btn {
  color: #1677ff; cursor: pointer; font-size: 13px; background: none; border: none;
  padding: 4px 2px; font-family: inherit;
}
.link-btn.danger { color: #e5484d; }

/* ---------- 二维码区 ---------- */
.qr-layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.qr-box {
  width: 300px; height: 300px; margin: 6px auto 10px; position: relative;
  border: 1px dashed #d9dee7; border-radius: 12px; background: #fbfcfe;
  display: flex; align-items: center; justify-content: center;
}
.qr-box img { max-width: 280px; max-height: 280px; }
.qr-empty { color: #b0b6c0; font-size: 13px; }
.qr-link {
  font-size: 12px; color: #4e5969; word-break: break-all; text-align: center;
  background: #f0f2f7; border-radius: 8px; padding: 8px 10px; margin: 8px 0;
}
.qr-tips { font-size: 12px; color: #8a919f; line-height: 1.8; margin-top: 12px; }
.qr-tips b { color: #b26a00; }

.phone-frame {
  width: 330px; max-width: 100%; margin: 6px auto 0;
  border: 8px solid #10182b; border-radius: 26px; overflow: hidden;
  height: 620px; background: #fff;
}
.phone-frame iframe { width: 100%; height: 100%; border: none; }

.tpl-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tpl-card {
  border: 1px solid #e5e9f0; border-radius: 12px; padding: 14px; font-size: 12.5px;
  color: #7d8698; line-height: 1.7; cursor: pointer; background: #fbfcfe;
}
.tpl-card b { display: block; font-size: 14px; color: #1f2329; margin-bottom: 4px; }
.tpl-card:hover { border-color: #1677ff; }

.auto-refresh { font-size: 13px; color: #4e5969; display: flex; align-items: center; gap: 6px; }
.auto-refresh input { width: auto; }

.debug-box {
  margin-top: 12px; padding: 14px; background: #10182b; color: #9fe870;
  font-size: 12px; line-height: 1.7; border-radius: 10px;
  white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto;
}

.file-pick {
  position: relative; display: inline-block; overflow: hidden;
  font-size: 13px; color: #4e5969; padding: 8px 12px;
  border: 1px solid #d9dee7; border-radius: 9px; background: #fbfcfe; cursor: pointer;
}
.file-pick:hover { border-color: #1677ff; color: #1677ff; }
.file-pick input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 8%; transform: translateX(-50%);
  background: rgba(16, 24, 43, 0.9); color: #fff; font-size: 13px;
  padding: 11px 22px; border-radius: 24px; z-index: 1000; max-width: 70%;
}

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .qr-layout { grid-template-columns: 1fr; }
  .tpl-cards { grid-template-columns: 1fr; }
  .sidebar { width: 64px; }
  .brand-text, .nav-item, .sidebar-foot { display: none; }
}
