/* 客户返佣中心 · fanyongxyz — 设计语言对齐参考站 (暗色为主, 支持亮色切换) */
:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #111721;
  --panel2: #151d29;
  --line: #283548;
  --text: #f3f7fc;
  --muted: #91a0b3;
  --green: #16e6b3;
  --blue: #5fa8ff;
  --danger: #ff7b86;
  --amber: #ffcb67;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5fa;
  --panel: #ffffff;
  --panel2: #eef2f8;
  --line: #d8e2ec;
  --text: #17212e;
  --muted: #5c6b7d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 500px at 70% -10%, rgba(22, 230, 179, 0.05), transparent 60%),
    radial-gradient(900px 480px at 12% 108%, rgba(95, 168, 255, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 14px/1.65 -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  min-height: 100vh;
}
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; }
.text-break { word-break: break-all; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; }

/* ---------- 顶栏 ---------- */
.nav {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: rgba(17, 23, 33, 0.55);
}
html[data-theme="light"] .nav { background: rgba(255, 255, 255, 0.8); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 16px; white-space: nowrap;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #12cda0, var(--green));
  color: #032c24; font-weight: 900; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-left-actions { flex: 1; display: flex; justify-content: center; min-width: 0; }
.common-rates-card {
  display: inline-flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 6px 14px;
}
.common-rates-list { display: flex; gap: 14px; }
.common-rate-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.common-rate-symbol { color: var(--muted); font-weight: 750; }
.common-rate-value { font-family: ui-monospace, Menlo, Consolas, monospace; }
.common-rates-updated { color: var(--muted); font-size: 11px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.userid { color: var(--muted); font-size: 13px; font-weight: 700; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 按钮 ---------- */
button { cursor: pointer; font-family: inherit; }
.primary {
  width: 100%; min-height: 45px; margin-top: 16px;
  border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #12cda0, var(--green));
  color: #032c24; font-size: 13px; font-weight: 800; cursor: pointer;
}
.primary:hover { filter: brightness(1.06); }
.primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.ghost-btn, .link-btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 15px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, 0.025); color: #c5d0de;
  font-size: 13px; font-weight: 750; text-decoration: none; cursor: pointer;
}
html[data-theme="light"] .ghost-btn { background: rgba(23, 33, 46, 0.03); color: var(--text); }
.ghost-btn:hover { border-color: var(--muted); }
.ghost-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost-btn.small { min-height: 32px; padding: 0 11px; font-size: 12px; }
.ghost-btn.danger { color: var(--danger); border-color: rgba(255, 123, 134, 0.4); }
.ghost-btn.back-btn { width: 100%; margin-top: 10px; }
.submit-btn { width: auto; padding: 0 22px; margin-top: 0; }
.modal-primary { width: auto; padding: 0 22px; }
.btn-tiny {
  min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 750;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: #c5d0de;
}
.btn-tiny.green { border-color: rgba(22, 230, 179, 0.35); background: rgba(22, 230, 179, 0.1); color: var(--green); }
.btn-tiny.danger { border-color: rgba(255, 123, 134, 0.4); background: rgba(255, 123, 134, 0.08); color: var(--danger); }

/* ---------- 登录卡 ---------- */
.auth-card {
  width: min(520px, calc(100% - 32px));
  margin: 6vh auto 0; padding: 34px;
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(17, 23, 33, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}
html[data-theme="light"] .auth-card { background: rgba(255, 255, 255, 0.97); }
.auth-card[hidden] { display: none; }
.eyebrow { color: var(--green); font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; }
.auth-card h1 { font-size: 30px; margin: 10px 0 8px; letter-spacing: 0.01em; }
.auth-card .lead { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-card label { display: block; font-size: 13px; font-weight: 750; margin: 14px 0 7px; }
.auth-card input:not([type="checkbox"]) {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 14px; outline: none;
}
.auth-card input:focus { border-color: var(--green); }
.login-preferences {
  margin-top: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2); padding: 12px 14px;
}
.remember-login { display: flex; align-items: center; gap: 10px; margin: 0 !important; font-weight: 700 !important; cursor: pointer; }
.remember-login input { width: 16px; height: 16px; accent-color: var(--green); }
.message { min-height: 20px; margin-top: 12px; font-size: 12.5px; color: var(--danger); }

/* ---------- 主框架 ---------- */
.dashboard { flex: 1; }
.portal-layout { display: flex; min-height: calc(100vh - 62px); align-items: stretch; }
.chain-sidebar {
  width: 228px; flex-shrink: 0; padding: 18px 12px;
  border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: 8px;
}
.chain-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 16px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 14px;
}
.chain-sidebar-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #12cda0, var(--green));
  color: #032c24; font-weight: 900; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.chain-menu { display: flex; flex-direction: column; gap: 4px; }
.chain-menu-btn {
  width: 100%; min-height: 44px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: #94a3b6; font-size: 13px; font-weight: 800; text-align: left; cursor: pointer;
}
html[data-theme="light"] .chain-menu-btn { color: var(--muted); }
.chain-menu-btn:hover { color: var(--text); background: var(--panel2); }
.chain-menu-btn.active { border-color: rgba(22, 230, 179, 0.24); background: rgba(22, 230, 179, 0.08); color: var(--green); }
.chain-menu-group { margin-top: 6px; }
.chain-menu-parent {
  width: 100%; min-height: 40px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 800;
}
.chain-menu-parent.static { cursor: default; opacity: 0.7; }
.chain-submenu { display: flex; flex-direction: column; gap: 2px; }
.chain-submenu .chain-menu-btn { min-height: 38px; font-weight: 700; padding-left: 24px; }
.admin-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.portal-content { flex: 1; padding: 22px 26px 40px; max-width: 1120px; min-width: 0; }

/* ---------- 视图通用 ---------- */
.view[hidden] { display: none; }
h2 { font-size: 19px; margin: 2px 0 16px; }
h3 { font-size: 13.5px; margin: 0 0 12px; }
.panel {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); padding: 18px; margin-bottom: 16px;
}
.panel[hidden] { display: none; }
.field-hint { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }
.callout {
  border: 1px solid rgba(255, 203, 103, 0.3); background: rgba(255, 203, 103, 0.07);
  color: var(--amber); border-radius: 12px; padding: 12px 16px;
  font-size: 13px; margin-bottom: 16px;
}
.warn-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  border: 1px solid rgba(255, 203, 103, 0.35); background: rgba(255, 203, 103, 0.08);
  color: var(--amber); border-radius: 12px; padding: 10px 16px; font-size: 13px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid rgba(40, 53, 72, 0.45); word-break: break-all; }
html[data-theme="light"] td { border-bottom-color: rgba(216, 226, 236, 0.8); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.badge-success { background: rgba(22, 230, 179, 0.12); color: var(--green); }
.badge-pending { background: rgba(255, 203, 103, 0.13); color: var(--amber); }
.badge-danger { background: rgba(255, 123, 134, 0.13); color: var(--danger); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input { width: auto; }
input, select {
  min-height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 13.5px; outline: none;
}
input:focus, select:focus { border-color: var(--green); }
.form-row { display: flex; gap: 10px; align-items: center; }
.form-row.wrap { flex-wrap: wrap; }
.form-row input, .form-row select { width: auto; min-width: 140px; }
.form-row .grow { flex: 1; }
.form-col { display: flex; flex-direction: column; gap: 10px; }
.positive { color: var(--green); }

/* ---------- 领取返佣 ---------- */
.claim-total-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid rgba(22, 230, 179, 0.25);
  background: linear-gradient(135deg, rgba(22, 230, 179, 0.07), var(--panel) 55%);
}
.claim-total-info { min-width: 0; }
.claim-field-label { color: var(--muted); font-size: 12px; }
.claim-total-value { font-size: 28px; font-weight: 900; margin-top: 2px; }
.claim-total-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.claim-all-btn { width: auto; padding: 0 30px; margin-top: 0; flex-shrink: 0; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 4px; }
.claim-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); padding: 16px;
}
.claim-brand { display: flex; align-items: center; justify-content: space-between; }
.claim-chain-name { font-weight: 800; font-size: 15px; }
.claim-chain-token { color: var(--muted); font-size: 12px; }
.claim-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px;
}
.claim-fields > .claim-settlement { grid-column: 1 / -1; }
.claim-settlement {
  border: 1px solid rgba(22, 230, 179, 0.22); border-radius: 10px;
  background: rgba(22, 230, 179, 0.05); padding: 10px 12px;
}
.claim-settlement-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.claim-settlement-number { font-size: 21px; font-weight: 900; color: var(--green); }
.claim-settlement-unit { color: var(--muted); font-size: 12px; font-weight: 750; }
.claim-settlement-usdt { color: var(--muted); font-size: 12px; }
.claim-field-value { font-weight: 750; font-size: 13.5px; }
.chain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ---------- 常见问题 ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px 18px; }
.faq-q { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.faq-a { color: var(--muted); font-size: 13px; }

/* ---------- 弹窗 / Toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.62); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 480px; max-width: 100%; max-height: 88vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); padding: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}
.twofa-grid { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; }
.twofa-grid img { border-radius: 10px; background: #fff; padding: 4px; flex-shrink: 0; }
.twofa-grid .grow { flex: 1; min-width: 0; }
.modal-card h3 { font-size: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.cm-rows { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 7px; }
.cm-row {
  display: flex; justify-content: space-between; gap: 14px; font-size: 13px;
  border-bottom: 1px solid rgba(40, 53, 72, 0.5); padding-bottom: 7px;
}
.toast {
  position: fixed; top: 16px; left: 50%; z-index: 99;
  transform: translateX(-50%) translateY(-90px);
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2); color: var(--text);
  padding: 10px 18px; font-size: 13px; max-width: 92vw;
  transition: transform 0.25s;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(22, 230, 179, 0.45); }
.toast.error { border-color: rgba(255, 123, 134, 0.5); color: var(--danger); }

/* ---------- 页脚 ---------- */
.portal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--line); padding: 16px 22px;
  color: var(--muted); font-size: 12.5px;
}
.footer-contact { display: flex; flex-direction: column; gap: 2px; }
.footer-contact-title { font-weight: 800; color: var(--text); }
.footer-safety { text-align: right; }

/* ---------- 主题开关 ---------- */
.theme-switch .theme-switch-meta { display: inline-flex; align-items: center; gap: 8px; }
.theme-switch-state { font-size: 12px; color: var(--muted); }
.theme-switch-control {
  width: 34px; height: 19px; border-radius: 99px; position: relative;
  background: var(--line); transition: background 0.2s; display: inline-block;
}
.theme-switch-control::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; transition: left 0.2s;
}
body.light-on .theme-switch-control { background: var(--green); }
body.light-on .theme-switch-control::after { left: 17px; }
body.authenticated .theme-switch {
  position: fixed; z-index: 130; left: 16px; bottom: 18px; width: 208px;
  min-width: 0; justify-content: space-between;
  border-color: rgba(95, 168, 255, 0.24); background: rgba(17, 23, 33, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
body.authenticated #themeToggle { min-height: 42px; }

@media (max-width: 900px) {
  .portal-layout { flex-direction: column; }
  .chain-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-left-actions { display: none; }
  .portal-content { padding: 16px 14px 40px; }
  .claim-total-panel { flex-direction: column; align-items: stretch; }
  .portal-footer { flex-direction: column; align-items: flex-start; }
  .footer-safety { text-align: left; }
  body.authenticated .theme-switch { width: auto; }
}
