:root {
  --navy-950: #060d18; --navy-900: #0a1628; --navy-800: #0f2036; --navy-700: #16304f;
  --gold: #c9a45c; --gold-bright: #e8c982; --gold-dim: #8a6f3d;
  --text: #eef3fa; --dim: #93a5bd; --line: rgba(201,164,92,.25);
  --green: #34d399; --red: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--navy-950); color: var(--text); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gold-text { color: var(--gold-bright); }
section { padding: 80px 0; position: relative; }
.sec-tag { color: var(--gold); font-size: 13px; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 12px; }
.sec-title { font-size: 34px; font-weight: 700; margin-bottom: 14px; }
.sec-sub { color: var(--dim); max-width: 720px; margin-bottom: 40px; }

/* 导航 */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(6,13,24,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; height: 64px; gap: 28px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--gold-bright); }
.logo small { color: var(--dim); font-size: 10px; letter-spacing: 3px; display: block; line-height: 1; }
nav .links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
nav .links a { color: var(--dim); transition: .2s; }
nav .links a:hover, nav .links a.on { color: var(--gold-bright); }
.nav-user { position: relative; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.addr-chip { display: flex; align-items: center; gap: 8px; background: rgba(201,164,92,.08); border: 1px solid var(--line);
  border-radius: 18px; color: var(--gold-bright); font-family: Consolas, monospace; font-size: 12px; padding: 5px 12px; cursor: pointer; white-space: nowrap; flex: none; }
.addr-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.addr-chip::after { content: "▾"; color: var(--dim); font-size: 10px; }
.addr-menu { display: none; position: absolute; top: calc(100% + 12px); right: 0; z-index: 160; background: var(--navy-800);
  border: 1px solid var(--gold-dim); border-radius: 12px; padding: 8px; min-width: 240px; box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.addr-menu.open { display: block; }
.addr-menu .addr-full { font-family: Consolas, monospace; font-size: 12px; color: var(--dim); word-break: break-all; padding: 8px 10px; border-bottom: 1px solid rgba(147,165,189,.15); margin-bottom: 6px; }
.addr-menu button { width: 100%; background: none; border: 1px solid rgba(248,113,113,.4); color: var(--red); border-radius: 8px; padding: 9px; font-size: 13px; cursor: pointer; }
.addr-menu button:hover { background: rgba(248,113,113,.12); }

/* Hero */
.hero-compact { min-height: 56vh; }
.hero { min-height: 92vh; display: flex; align-items: center; background:
  radial-gradient(ellipse 60% 50% at 70% 30%, rgba(201,164,92,.14), transparent 60%),
  radial-gradient(ellipse 50% 60% at 20% 70%, rgba(22,48,79,.9), transparent 65%),
  var(--navy-950); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(rgba(201,164,92,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(201,164,92,.05) 1px, transparent 1px);
  background-size: 60px 60px; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); }
.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 120px 24px 80px; }
.hero h1 { font-size: 58px; font-weight: 800; line-height: 1.15; margin: 18px 0 22px; }
.hero h1 .gold-text { display: block; }
.hero p { color: var(--dim); font-size: 17px; max-width: 640px; margin-bottom: 36px; }
.btn { display: inline-block; padding: 13px 30px; border-radius: 4px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid var(--gold); transition: .25s; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #a9822f); color: #0a1628; }
.btn-gold:hover { filter: brightness(1.15); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--gold-bright); margin-left: 14px; }
.btn-ghost:hover { background: rgba(201,164,92,.12); }

/* 数据条 */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--navy-900); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 34px 24px; }
.stat b { font-size: 34px; color: var(--gold-bright); font-weight: 800; display: block; }
.stat span { color: var(--dim); font-size: 14px; }

/* 卡片 */
.cards { display: grid; gap: 20px; }
.c4 { grid-template-columns: repeat(4, 1fr); } .c3 { grid-template-columns: repeat(3, 1fr); } .c2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .c4, .c3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .c4, .c3, .c2 { grid-template-columns: 1fr; } }
.card { background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); border: 1px solid rgba(147,165,189,.14); border-radius: 12px; padding: 26px; transition: .3s; }
.card:hover { border-color: var(--gold-dim); transform: translateY(-4px); }
.card .ic { font-size: 26px; margin-bottom: 14px; color: var(--gold-bright); }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--dim); font-size: 13.5px; }
.card .flag { color: var(--gold); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }

/* 等级表 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid rgba(147,165,189,.12); }
th { color: var(--gold); font-weight: 600; background: rgba(201,164,92,.06); }
tr:hover td { background: rgba(201,164,92,.04); }

/* 用户中心 */
.dash { background: linear-gradient(160deg, var(--navy-800), var(--navy-950)); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv .k { color: var(--dim); } .kv .v { font-family: Consolas, monospace; word-break: break-all; }
select, input { background: var(--navy-950); border: 1px solid rgba(147,165,189,.3); color: var(--text); border-radius: 6px; padding: 10px 12px; font-size: 14px; font-family: Consolas, monospace; outline: none; width: 100%; }
select:focus, input:focus { border-color: var(--gold); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.row label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); flex: 1; min-width: 140px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { padding: 4px 12px; border-radius: 14px; font-size: 12px; border: 1px solid rgba(147,165,189,.3); color: var(--dim); }
.chip.on { background: rgba(201,164,92,.15); border-color: var(--gold); color: var(--gold-bright); }
.notice { font-size: 12px; color: var(--dim); border-left: 2px solid var(--gold-dim); padding: 4px 12px; margin-top: 16px; line-height: 1.8; }

/* 收益中心 */
.fin-hero { text-align: center; background: linear-gradient(160deg, var(--navy-700), var(--navy-900)); border: 1px solid var(--line); border-radius: 14px; padding: 30px 20px; margin-bottom: 20px; }
.fin-hero b { font-size: 52px; color: var(--gold-bright); font-weight: 800; letter-spacing: 1px; }
.fin-hero small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 8px; }
.fin-total { font-size: 26px; color: var(--gold-bright); font-weight: 700; margin: 6px 0 10px; }
.fin-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed rgba(147,165,189,.15); }
.fin-kv span:last-child { font-family: Consolas, monospace; color: var(--text); }
.fin-kv span:first-child { color: var(--dim); }
.calc-line { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.calc-line .dim2 { color: var(--dim); }
.calc-res { margin-top: 10px; background: rgba(201,164,92,.1); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.calc-res b { color: var(--gold-bright); font-size: 18px; }

/* 客服浮窗 */
.cs-btn { position: fixed; right: 26px; bottom: 26px; z-index: 200; width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #a9822f); color: #0a1628; font-size: 26px; box-shadow: 0 8px 30px rgba(201,164,92,.4); transition: .25s; }
.cs-btn:hover { transform: scale(1.08); }
.cs-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; display: none; }
.cs-panel { position: fixed; right: 26px; bottom: 100px; z-index: 200; width: 380px; max-width: calc(100vw - 40px); height: 540px; max-height: calc(100vh - 140px);
  background: var(--navy-800); border: 1px solid var(--gold-dim); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: none; flex-direction: column; overflow: hidden; }
.cs-panel.open { display: flex; }
.cs-head { padding: 14px 18px; background: linear-gradient(135deg, var(--navy-700), var(--navy-800)); border-bottom: 1px solid var(--gold-dim); display: flex; align-items: center; gap: 10px; }
.cs-head b { font-size: 15px; } .cs-head .st { font-size: 11px; color: var(--dim); }
.cs-head .st .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; }
.cs-close { margin-left: auto; background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; }
.cs-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, #a9822f, var(--gold)); color: #0a1628; border-bottom-right-radius: 3px; }
.msg.agent { align-self: flex-start; background: var(--navy-700); border: 1px solid rgba(147,165,189,.2); border-bottom-left-radius: 3px; }
.msg.bot { align-self: flex-start; background: rgba(22,48,79,.6); border: 1px dashed rgba(147,165,189,.3); color: var(--dim); border-bottom-left-radius: 3px; }
.msg .meta { font-size: 10px; opacity: .7; margin-top: 4px; }
.cs-form { padding: 14px 18px; border-top: 1px solid var(--gold-dim); background: var(--navy-900); }
.cs-form .row { margin-bottom: 10px; }
.cs-input { display: flex; gap: 8px; }
.cs-input input { flex: 1; }
.cs-input button { padding: 10px 18px; }
.cs-tip { font-size: 11px; color: var(--dim); margin-top: 8px; text-align: center; }

/* 客服专页：聊天面板内嵌为页面主体（不再是浮窗） */
.cs-section { padding-top: 76px; }
.cs-section .cs-panel { position: relative; inset: auto; display: flex; width: 100%; max-width: 820px;
  height: 62vh; max-height: 660px; margin: 0 auto; }

footer { border-top: 1px solid var(--line); background: var(--navy-950); padding: 44px 0 30px; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer .risk { color: #64748b; font-size: 11.5px; max-width: 900px; margin-top: 24px; line-height: 1.8; }
.toast { position: fixed; top: 76px; right: 26px; z-index: 300; background: var(--navy-800); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 12px 18px; font-size: 13px; display: none; box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 420px; }
.toast.err { border-color: var(--red); color: #ffb4b4; }

/* ============ 底部标签栏（手机端主导航） ============ */
#tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: rgba(6,13,24,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0); }
#tabbar .tabs { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 640px; margin: 0 auto; }
#tabbar a { text-align: center; padding: 7px 0 6px; color: var(--dim); font-size: 11px; position: relative; }
#tabbar a .ic { font-size: 19px; display: block; line-height: 1.25; }
#tabbar a.on { color: var(--gold-bright); }
#tabbar a.on::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 2px; background: var(--gold-bright); border-radius: 2px; }

/* ============ 登录页 ============ */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background:
  radial-gradient(ellipse 60% 50% at 70% 20%, rgba(201,164,92,.14), transparent 60%),
  radial-gradient(ellipse 55% 60% at 15% 80%, rgba(22,48,79,.9), transparent 65%),
  var(--navy-950); position: relative; overflow: hidden; }
.login-bg::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(rgba(201,164,92,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(201,164,92,.05) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 78%); }
.login-box { position: relative; width: min(430px, 100%); background: linear-gradient(165deg, var(--navy-800), var(--navy-950));
  border: 1px solid var(--gold-dim); border-radius: 18px; padding: 38px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.55); text-align: center; }
.login-box .logo { font-size: 30px; }
.login-box h1 { font-size: 21px; margin: 18px 0 8px; }
.login-box .sub { color: var(--dim); font-size: 13px; margin-bottom: 26px; }
.login-box .btn { width: 100%; text-align: center; padding: 14px; font-size: 15px; }
.login-box .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.login-note { margin-top: 18px; font-size: 11.5px; color: var(--dim); line-height: 1.9; text-align: left; border-top: 1px dashed var(--line); padding-top: 14px; }
.login-note b { color: var(--gold-bright); }
.login-status { min-height: 20px; font-size: 12.5px; margin-top: 14px; color: var(--dim); }
.login-status.err { color: var(--red); }
.login-status.ok { color: var(--green); }
.login-accs { display: none; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; max-height: 210px; overflow-y: auto; text-align: left; }
.login-accs.show { display: grid; }
.login-accs button { background: var(--navy-950); border: 1px solid rgba(147,165,189,.3); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-size: 12px; font-family: Consolas, monospace; cursor: pointer; text-align: left; }
.login-accs button:hover { border-color: var(--gold); }
.login-accs button.on { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,164,92,.1); }

/* ============ 手机端适配 ============ */
@media (max-width: 860px) {
  nav .links { display: none; }              /* 顶部链接隐藏，导航交给底部标签栏 */
  .nav-user { margin-left: auto; }
  #tabbar { display: block; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .toast { left: 16px; right: 16px; top: 70px; max-width: none; }
}
@media (max-width: 640px) {
  * { -webkit-tap-highlight-color: transparent; }
  section { padding: 44px 0; }
  .wrap { padding: 0 16px; }
  .sec-tag { font-size: 11px; letter-spacing: 3px; }
  .sec-title { font-size: 23px; margin-bottom: 10px; }
  .sec-sub { font-size: 13.5px; margin-bottom: 26px; }

  /* 顶栏收紧 */
  nav .wrap { height: 54px; gap: 16px; }
  .logo { font-size: 18px; }
  .btn-exit { padding: 5px 12px; }

  /* Hero 改为紧凑横幅，不再占满整屏 */
  .hero, .hero-compact { min-height: 0; }
  .hero-inner { padding: 84px 16px 44px; }
  .hero h1 { font-size: 30px; margin: 12px 0 14px; }
  .hero p { font-size: 14px; margin-bottom: 22px; }
  .hero .btn { display: block; width: 100%; text-align: center; margin: 0 0 12px; }

  /* 数据条 */
  .stats .wrap { grid-template-columns: 1fr 1fr; padding: 20px 16px; gap: 14px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 12px; }

  /* 卡片：两列排布 + 图标与标题同行，紧凑省空间 */
  .cards { gap: 10px; }
  .card { padding: 13px 13px 14px; border-radius: 10px; }
  .card .ic { display: inline-block; font-size: 13px; margin: 0 8px 0 0; }
  .card h3 { display: inline; font-size: 14px; }
  .card p { font-size: 12.5px; margin-top: 7px; line-height: 1.6; }
  .c4 { grid-template-columns: 1fr 1fr; }

  /* 短文卡片组（监管/平台/VIP）：两列紧凑，标签与标题同行 */
  .compact { grid-template-columns: 1fr 1fr; }
  .compact .flag { display: inline-block; margin: 0 8px 0 0; }
  .compact h3 { display: inline; font-size: 13.5px; }

  /* 表格 */
  th, td { padding: 10px 8px; font-size: 12.5px; }

  /* 账户中心：操作按钮改为整行大按钮，触控友好 */
  .dash { padding: 16px 14px; border-radius: 12px; }
  .kv { grid-template-columns: 88px 1fr; font-size: 13px; gap: 6px 10px; }
  .dash .row { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 8px; }
  .dash .btn { width: 100%; text-align: center; padding: 12px; font-size: 14px; }
  .row label.f { min-width: 0; width: 100%; }

  /* 输入控件 16px：防止 iOS 聚焦时页面自动放大 */
  input, select { font-size: 16px; padding: 11px 12px; }

  .chip { padding: 5px 11px; font-size: 12px; }
  .notice { font-size: 11.5px; margin-top: 12px; }

  /* 收益中心 */
  .fin-hero { padding: 20px 14px; border-radius: 12px; }
  .fin-hero b { font-size: 34px; }
  .fin-total { font-size: 19px; }
  .fin-kv { font-size: 12.5px; }
  .calc-res { font-size: 13px; }
  .calc-res b { font-size: 16px; }

  /* 客服专页：聊天面板拉高填满视口 */
  .cs-section { padding-top: 70px; }
  .cs-section .cs-panel { height: 56vh; max-height: none; }
  .cs-body { -webkit-overflow-scrolling: touch; }
  .cs-form { padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .msg { max-width: 88%; font-size: 13px; }

  /* 底部标签栏加高，图标更醒目 */
  #tabbar a { padding: 8px 0 8px; font-size: 11.5px; }
  #tabbar a .ic { font-size: 21px; }

  .toast { top: 60px; font-size: 13px; padding: 11px 14px; }

  footer { padding: 32px 0 26px; }
  footer .wrap { flex-direction: column; gap: 16px; }
  footer div[style*="text-align:right"] { text-align: left !important; }

  /* 登录页 */
  .login-box { padding: 26px 18px; border-radius: 14px; }
  .login-box h1 { font-size: 19px; }
  .login-accs { max-height: 180px; }
  .addr-menu { min-width: 220px; top: calc(100% + 10px); }
}
