/* LooLoo 分销中台 - 公共样式
 * 规范来源：ui-ux-pro-max 无后台/控制台类记录（明确回退），采用命中的
 * "dimensional-layering" 分层规范：中性底 + 单一品牌色 + 4 级阴影分层。
 */
:root {
  --brand: #6d5df6;
  --brand-deep: #5645e0;
  --brand-ink: #1e1b3a;
  --bg: #f5f4fb;
  --card: #ffffff;
  --line: #e7e5f4;
  --muted: #8b88a6;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(30, 27, 58, .05);
  --shadow-2: 0 4px 14px rgba(30, 27, 58, .07);
  --shadow-3: 0 14px 34px rgba(30, 27, 58, .12);
  --shadow-4: 0 24px 60px rgba(30, 27, 58, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--brand-ink);
  -webkit-font-smoothing: antialiased; line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
h1,h2,h3 { margin: 0 0 6px; letter-spacing: .2px; }
p { margin: 4px 0; }

/* ---- 分层卡片 ----
 * 层级说明：背景(F0) -> 卡片(1) -> 强调块/操作条(2) -> 弹层(3/4)
 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px 16px;
}
.card + .card { margin-top: 14px; }
.hero {
  background: linear-gradient(135deg, #6d5df6 0%, #9b6df6 60%, #c26df0 100%);
  color: #fff; border-radius: 0 0 26px 26px; padding: 26px 20px 24px;
  box-shadow: var(--shadow-3); position: relative; overflow: hidden;
}
.hero h1 { font-size: 22px; font-weight: 800; }
.hero p { opacity: .92; font-size: 13px; }
.shell { max-width: 720px; margin: 0 auto; padding: 0 14px 44px; }
.shell.narrow { max-width: 460px; }
.page { min-height: 100vh; padding-bottom: 80px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 600; padding: 11px 16px; cursor: pointer;
  box-shadow: var(--shadow-2); transition: transform .08s ease, box-shadow .15s ease;
  min-height: 44px;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: none; border: 1px solid var(--line); }
.btn.gray { background: #eceaf6; color: var(--brand-ink); box-shadow: none; }
.btn.danger { background: #fdeaea; color: var(--danger); box-shadow: none; }
.btn.sm { font-size: 13px; padding: 7px 11px; min-height: 34px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-size: 15px; background: #fff; color: var(--brand-ink);
  outline: none; transition: border .15s ease, box-shadow .15s ease;
  min-height: 44px; font-family: inherit;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,93,246,.14); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.form { display: flex; flex-direction: column; gap: 2px; }
.muted { color: var(--muted); font-size: 12px; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.tag {
  display: inline-flex; align-items: center; font-size: 12px; border-radius: 999px;
  padding: 2px 9px; background: #eceaf6; color: var(--brand-ink);
}
.tag.ok { background: #e6f6ec; color: var(--ok); }
.tag.warn { background: #fdf1e0; color: var(--warn); }
.tag.danger { background: #fdeaea; color: var(--danger); }
.tag.brand { background: rgba(109,93,246,.12); color: var(--brand-deep); }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money.lg { font-size: 24px; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: #f2f1fa; border-radius: 8px; padding: 8px 10px; word-break: break-all;
  border: 1px solid var(--line);
}
/* 链接/长码在 flex 行里给一个最小宽度：宁可整块换行，也不要被按钮挤成一字一行 */
.code.grow { flex: 1 1 240px; min-width: 200px; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet-cell { background: #faf9ff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.wallet-cell b { display: block; font-size: 18px; margin-top: 2px; }
.wallet-cell span { font-size: 12px; color: var(--muted); }
table tbody tr:hover { background: rgba(109,93,246,.04); }
.rank-me { background: rgba(109,93,246,.08); }
.rank-me td { font-weight: 600; }
.banner {
  border-radius: 12px; padding: 11px 12px; font-size: 13px; line-height: 1.5;
}
.banner.err { background: #fdeaea; color: #b91c1c; }
.banner.info { background: #eef0fe; color: #4338ca; }
.banner.ok { background: #e6f6ec; color: #15803d; }
.hidden { display: none !important; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid #f1f0fa; vertical-align: top; word-break: break-all; }
/* 表格滚动容器：窄屏时表格整体横向滚动，而不是把每一列压成一字一行。
   单元格默认不换行（单号/时间/金额/按钮必须完整显示），需要换行的长文本用 class="wrap"。 */
.t-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-wrap > table { width: auto; min-width: 100%; }
.t-wrap td { white-space: nowrap; }
.t-wrap td.wrap, .t-wrap th.wrap { white-space: normal; min-width: 150px; max-width: 320px; }
/* 末列是「操作」按钮的表格：把操作列吸附在右边，窄屏横向滚动时按钮始终可见 */
.t-wrap.t-sticky th:last-child, .t-wrap.t-sticky td:last-child {
  position: sticky; right: 0; background: var(--card);
  box-shadow: -8px 0 10px -8px rgba(30, 27, 58, .22);
}
.t-wrap.t-sticky tr:hover td:last-child { background: #f7f6ff; }
.t-wrap.t-sticky th:last-child { background: #fff; }
tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 5; }
.tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; color: var(--muted);
  padding: 8px 14px; font-size: 13px; white-space: nowrap; cursor: pointer; font-weight: 600;
}
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 620px) { .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; } }
.dialog-mask {
  position: fixed; inset: 0; background: rgba(20, 18, 46, .5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.dialog {
  background: #fff; width: 100%; max-width: 640px; border-radius: 22px 22px 0 0;
  padding: 22px 18px 30px; box-shadow: var(--shadow-4); max-height: 88vh; overflow: auto;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 10px; }
.app-logo { font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.app-logo b { color: var(--brand-deep); }
.menu-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow-1);
  cursor: pointer; transition: transform .08s ease;
}
.menu-item:active { transform: scale(.985); }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #6d5df6, #c26df0); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}
.loading { text-align: center; padding: 40px 0; color: var(--muted); }
/* ---- 公告 / 教程文档 ---- */
.doc-view { min-width: 0; }
.doc-view .doc-title { font-size: 19px; line-height: 1.45; margin: 10px 0 4px; }
.doc-view .doc-summary {
  color: var(--muted); font-size: 13px; margin: 8px 0 0;
  padding: 8px 10px; background: #f5f4fb; border-radius: 10px;
}
.doc-view .doc-body {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  white-space: pre-wrap; word-break: break-word; line-height: 1.75; font-size: 14px;
}
.doc-card { cursor: pointer; transition: box-shadow .15s ease, transform .08s ease; }
.doc-card:hover { box-shadow: var(--shadow-2); }
.doc-card:active { transform: scale(.995); }
.doc-card h3 { font-size: 16px; margin-top: 8px; }
.doc-card .doc-excerpt {
  margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6;
  white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 620px) {
  .dialog-mask { align-items: center; padding: 20px; }
  .dialog { border-radius: 20px; }
  .wallet-grid { grid-template-columns: repeat(4, 1fr); }
}
