/* AP-006 H5 页面共享样式：零构建、移动优先（375px 起）、无横向滚动。 */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --line: #e4e8f0;
  --text: #182232;
  --muted: #6b7688;
  --brand: #1677ff;
  --brand-dark: #0d5fd6;
  --ok: #0f9d58;
  --warn: #c77700;
  --bad: #d93025;
  --none: #8a94a6;
  --radius: 12px;
  --tap: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
dt {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 12px 88px;
}

/* ── 顶栏 ─────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 12px;
}

.logo {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #52a0ff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.5px;
}

.brand {
  min-width: 0;
  flex: 1;
}

.brand h1 {
  font-size: 17px;
  line-height: 1.3;
}

.brand .sub {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account {
  flex: none;
  max-width: 38%;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-name {
  display: block;
  color: var(--text);
  font-weight: 600;
}

/* ── 通用卡片 ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-head h2,
.card-head h3 {
  font-size: 15px;
  line-height: 1.4;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
  text-align: center;
}

/* ── 状态/徽标 ────────────────────────────────────────── */
.badge {
  display: inline-block;
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 20px;
  background: #eef2f8;
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok {
  background: #e6f6ee;
  color: var(--ok);
}

.badge.warn {
  background: #fff4e0;
  color: var(--warn);
}

.badge.bad {
  background: #fdecea;
  color: var(--bad);
}

.badge.brand {
  background: #e8f1ff;
  color: var(--brand);
}

/* ── 表单 ─────────────────────────────────────────────── */
.field {
  display: block;
  margin-bottom: 12px;
}

.field > .label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .tip {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

input[type="text"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:active {
  background: var(--brand-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.block {
  width: 100%;
}

.btn.small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
}

.btn.danger {
  color: var(--bad);
  border-color: #f3c2be;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row > .grow {
  flex: 1 1 160px;
  min-width: 0;
}

/* ── 提示/错误/加载 ───────────────────────────────────── */
.notice {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.notice.info {
  background: #e8f1ff;
  color: #0b4fae;
}

.notice.warn {
  background: #fff4e0;
  color: #7a4a00;
}

.notice.error {
  background: #fdecea;
  color: #8f1d18;
}

.notice.ok {
  background: #e6f6ee;
  color: #0a6b3d;
}

.notice[hidden] {
  display: none;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid rgb(22 119 255 / 25%);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  height: 12px;
  margin: 8px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fd 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 50%;
  }

  to {
    background-position: 0 50%;
  }
}

/* ── 登录遮罩 ─────────────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(16 24 40 / 45%);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: 100%;
  max-width: 320px;
  padding: 20px 16px;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.gate-card h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.gate-card .hint {
  margin-bottom: 14px;
}

.gate-card .btn {
  width: 100%;
}

/* ── 页脚导航 ─────────────────────────────────────────── */
.footer-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0 12px;
  font-size: 13px;
}

.footer-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  background: #e9eef7;
  color: #33415c;
}

@media (min-width: 520px) {
  .wrap {
    padding: 20px 20px 96px;
  }

  .brand h1 {
    font-size: 19px;
  }
}

