/* ═══════════════════════════════════════
   汇合作 FX Rebate — 全局样式
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  --ink:        #0d1117;
  --ink-2:      #1e2d3d;
  --ink-muted:  #556070;
  --ink-faint:  #8a96a3;
  --ink-ghost:  #bcc5ce;
  --gold:       #c9933a;
  --gold-light: #e8b95a;
  --gold-pale:  #fdf4e7;
  --gold-mid:   #f5e0b0;
  --gold-dim:   #92660a;
  --surface:    #f7f9fc;
  --surface-2:  #eef2f7;
  --surface-3:  #e4eaf2;
  --white:      #ffffff;
  --border:     rgba(13,17,23,0.07);
  --border-2:   rgba(13,17,23,0.12);
  --border-3:   rgba(13,17,23,0.20);
  --green:      #16a34a;
  --green-pale: #dcfce7;
  --green-mid:  #bbf7d0;
  --blue:       #1d4ed8;
  --blue-pale:  #dbeafe;
  --red:        #dc2626;
  --red-pale:   #fee2e2;
  --amber:      #d97706;
  --amber-pale: #fef3c7;
  --r:    8px;
  --r-lg: 16px;
  --r-xl: 24px;
  --sh:    0 4px 20px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --sh-lg: 0 20px 56px rgba(0,0,0,0.10), 0 4px 14px rgba(0,0,0,0.05);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── COMMON TAGS ── */
.tag { padding: 2px 9px; border-radius: 100px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.tag-reg   { background: var(--blue-pale);   color: #1e40af; }
.tag-type  { background: var(--surface-3);   color: var(--ink-muted); }
.tag-hot   { background: var(--red-pale);    color: #991b1b; }
.tag-gold  { background: var(--gold-pale);   color: var(--gold-dim); }
.tag-new   { background: var(--green-pale);  color: #166534; }

/* ── COLOR LOGO PATCHES ── */
.c1{background:#0a1628} .c2{background:#14345a} .c3{background:#1e3a22}
.c4{background:#3a1a10} .c5{background:#1a1f3a} .c6{background:#222e22}
.c7{background:#3a2010} .c8{background:#102a3a} .c9{background:#2a1a3a}

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all .18s; white-space: nowrap; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,17,23,.28); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(201,147,58,.4); }
.btn-ghost { background: transparent; color: var(--ink-muted); border: 1px solid var(--border-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--border-3); background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ── FORM ELEMENTS ── */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 14px; border: 1px solid var(--border-2);
  border-radius: var(--r); background: var(--white); font-size: 14px;
  color: var(--ink); outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13,17,23,.06);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: .05em; }
.form-group { margin-bottom: 18px; }

/* ── CARD ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-faint); cursor: pointer; transition: color .14s; }
.breadcrumb a:hover { color: var(--ink-muted); }
.breadcrumb-sep { color: var(--ink-ghost); }
.breadcrumb-cur { color: var(--ink-muted); font-weight: 500; }

/* ── SECTION EYEBROW ── */
.eyebrow { font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.section-title { font-family: 'Noto Serif SC', serif; font-size: 28px; font-weight: 700; color: var(--ink); }

/* ── KV TABLE ── */
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: none; }
.kv-k { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.kv-v { font-size: 13px; color: var(--ink); font-weight: 600; font-family: 'DM Mono', monospace; }
.kv-v.green { color: var(--green); }
.kv-v.gold  { color: var(--gold); }

/* ── BADGE ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--green-pale); color: #166534; }
.badge-gold  { background: var(--gold-pale);  color: var(--gold-dim); }
.badge-blue  { background: var(--blue-pale);  color: #1e40af; }
.badge-red   { background: var(--red-pale);   color: #991b1b; }
.badge-gray  { background: var(--surface-3);  color: var(--ink-muted); }

/* ── CALLOUT ── */
.callout { border-radius: var(--r-lg); padding: 18px 22px; display: flex; gap: 14px; }
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.callout-title { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.callout.info { background: var(--blue-pale); border: 1px solid rgba(29,78,216,.15); }
.callout.info .callout-title { color: #1e40af; }
.callout.info .callout-text  { font-size: 13px; color: #1e3a8a; line-height: 1.7; }
.callout.warn { background: var(--amber-pale); border: 1px solid rgba(217,119,6,.2); }
.callout.warn .callout-title { color: #92400e; }
.callout.warn .callout-text  { font-size: 13px; color: #78350f; line-height: 1.7; }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 24px; border-radius: var(--r); font-size: 14px; font-weight: 500; color: #fff; box-shadow: var(--sh-lg); animation: toastIn .3s ease; white-space: nowrap; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--ink); }
@keyframes toastIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(13,17,23,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal { background: var(--white); border-radius: var(--r-xl); box-shadow: var(--sh-lg); width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto; animation: slideUp .25s ease; }
.modal-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-2); background: transparent; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--ink-faint); cursor: pointer; transition: all .14s; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px 24px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }

/* ── FAB ── */
.fab-group { position: fixed; right: 28px; bottom: 36px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.fab { width: 46px; height: 46px; border-radius: 14px; background: var(--white); border: 1px solid var(--border-2); box-shadow: var(--sh); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: all .2s; }
.fab:hover { transform: scale(1.08); box-shadow: var(--sh-lg); }
.fab.fab-gold { background: var(--gold); border-color: var(--gold); color: #fff; font-size: 13px; font-weight: 700; }

/* ── PAGE WRAPPER ── */
.page-wrap { min-height: calc(100vh - 64px); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE — 全站移动端适配
   断点：768px（平板）/ 480px（手机）
═══════════════════════════════════════ */

/* ── 全局容器 ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .page-wrap { min-height: calc(100vh - 56px); }
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .section-title { font-size: 22px; }
}

/* ── 通用 kv 表格（大屏横排，小屏堆叠） ── */
@media (max-width: 480px) {
  .kv-row { flex-wrap: wrap; gap: 4px; }
  .kv-v { font-size: 12px; }
}

/* ── 全局弹窗 ── */
@media (max-width: 768px) {
  #gmodal-box { border-radius: 16px 16px 0 0; max-height: 92vh; }
  #gmodal-overlay { align-items: flex-end; padding: 0; }
  .gm-header { padding: 20px 20px 0; }
  .gm-body { padding: 16px 20px 24px; }
  .gm-title { font-size: 17px; }
}
