/* ============================================================
 * uc-base.css — 零时科技 C 端 · 用户中心基础组件层
 * 来源：自 static/css/admin.css 精确抽取「C 端实际消费」的部分
 *       （全局 reset + 通用组件 + 暗色增强层），变量值 1:1 保留。
 * 目的：F-FE1 统一批（2026-09-11）解除 C 端对后台样式表的耦合 ——
 *       user_center.html 不再 <link admin.css>，后台样式调整不再波及 C 端。
 * 层叠顺序：tokens.base.css → tokens.light.css → uc-base.css → 页面内联 <style>
 * 注：原 admin.css 中 html[data-theme="light"] 分支与后台专属布局类
 *     （topbar / sidebar / trade-* / stat-card …）经核实不在 C 端生效，未收录。
 * ============================================================ */

/* —— 变量（取自 admin.css :root，1:1 保留 —— .panel 等深色面板组件依赖） —— */
:root {
  --brand: #06b6d4;
  --brand-dark: #0891b2;
  --brand-light: rgba(6,182,212,0.12);
  --accent: #f59e0b;
  /* M3 三色体系：前端 Cyan / 后端 Amber / 控制 Purple */
  --front: #06b6d4;
  --front-dark: #0891b2;
  --front-glow: rgba(6,182,212,.35);
  --back: #f59e0b;
  --back-dark: #d97706;
  --back-glow: rgba(245,158,11,.30);
  --ctrl: #8b5cf6;
  --ctrl-dark: #7c3aed;
  --ctrl-glow: rgba(139,92,246,.32);
  --red: #E03131;
  --green: #2F9E44;
  --bg: #0b1120;
  --panel: rgba(17, 24, 39, 0.85);
  --border: rgba(148, 163, 184, 0.15);
  --text: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --sidebar-w: 220px;
  --radius: 10px;
  --shadow: 0 4px 12px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .35);
}



* { margin: 0; padding: 0; box-sizing: border-box; }


html, body { height: 100%; }


body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}

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


button { font-family: inherit; cursor: pointer; }


input, select, textarea { font-family: inherit; font-size: 13px; background: rgba(17, 24, 39, 0.6); color: var(--text); border-color: var(--border); }


input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(6,182,212,.15); }


input::placeholder { color: var(--text-3); }



/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }


::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }


::-webkit-scrollbar-track { background: transparent; }


.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }


.dot.green { background: #37B24D; box-shadow: 0 0 0 3px rgba(55,178,77,.15); }


.dot.gray { background: #ADB5BD; }


@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }



/* ============ 通用组件 ============ */
.panel {
  background: rgba(17, 24, 39, 0.72); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}


.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}


.panel-head h3 { font-size: 15px; font-weight: 600; }


.panel-head .desc { color: var(--text-3); font-size: 12px; }


.panel-head .spacer { flex: 1; }


.panel-body { padding: 16px 18px; }


.panel-body.flush { padding: 0; }



/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text); border-radius: 8px; padding: 7px 14px; font-size: 13px;
  transition: all .15s;
}


.btn:hover { border-color: var(--brand); color: var(--brand); }

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

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


.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }


.btn[disabled] { opacity: .5; cursor: not-allowed; }



/* 表单 */
.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }


.form-row label { color: var(--text-2); font-size: 13px; min-width: 70px; }


.input, .select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; outline: none;
  background: #fff; transition: border .15s; height: 36px;
}


.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(6, 182, 212, .1); }


.input.wide { width: 240px; }


.input.mid { width: 160px; }



/* 标签 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
}


.tag.green { background: var(--brand-light); color: var(--brand); }


.tag.red { background: #FDE8E8; color: var(--red); }


.tag.amber { background: #FDF3E0; color: #B45309; }


.tag.blue { background: #E8F1FD; color: #1D4ED8; }


.tag.gray { background: #F1F3F5; color: var(--text-2); }



/* 空状态 / 加载 */
.empty { text-align: center; color: var(--text-3); padding: 48px 20px; font-size: 13px; }


.loading { text-align: center; color: var(--text-3); padding: 40px; font-size: 13px; }


.loading::before {
  content: ""; display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -4px; margin-right: 8px;
}

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


.metric-box {
  flex: 1; min-width: 140px; background: #F8FAFB; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}


.metric-box .k { font-size: 12px; color: var(--text-2); }


.metric-box .v { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }


.fin-metric { background: linear-gradient(135deg, #F0F7F5, #FAFCFB); border: 1px solid #DCEBE6; border-radius: 10px; padding: 14px; text-align: center; }


.fin-metric .k { font-size: 12px; color: var(--text-2); }


.fin-metric .v { font-size: 20px; font-weight: 700; margin-top: 6px; color: var(--brand); }



/* 持仓/委托行 */
.pos-row { display: flex; align-items: center; gap: 16px; padding: 12px 4px; border-bottom: 1px solid #F1F4F7; flex-wrap: wrap; }


.pos-row:last-child { border-bottom: none; }


.pos-row .stock { font-weight: 600; min-width: 120px; }


.pos-row .stock small { display: block; color: var(--text-3); font-weight: 400; font-size: 11px; }


.pos-row .field { flex: 1; min-width: 90px; }


.pos-row .field .k { font-size: 11px; color: var(--text-3); }


.pos-row .field .v { font-weight: 600; font-variant-numeric: tabular-nums; }




/* ============ 深色科技风增强 ============ */
body { position: relative; }


body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(6,182,212,0.08), transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(139,92,246,0.05), transparent 35%),
    radial-gradient(circle at 50% 100%, rgba(34,211,238,0.03), transparent 40%);
  pointer-events: none;
}



/* 按钮增强 */
.btn {
  transition: all .2s ease !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 2px 8px rgba(6,182,212,0.15);
}


.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6,182,212,0.25);
}


.btn-primary {
  background: linear-gradient(135deg, var(--brand), #8b5cf6) !important;
  box-shadow: 0 4px 14px rgba(6,182,212,0.25);
}



/* 标签/徽章 */
.tag, .badge {
  background: rgba(6,182,212,0.12) !important;
  color: var(--brand-light, #67e8f9) !important;
  border: 1px solid rgba(6,182,212,0.2) !important;
}


.tag.green { background: rgba(55,178,77,0.12) !important; color: #34d399 !important; border-color: rgba(55,178,77,0.25) !important; }


.tag.gray { background: rgba(148,163,184,0.12) !important; color: #94a3b8 !important; border-color: rgba(148,163,184,0.2) !important; }



/* 面板悬浮增强 */
.panel { transition: all .25s ease; }


.panel:hover { border-color: rgba(6,182,212,0.2); }


.tag.back { background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }


.tag.ctrl { background: rgba(139,92,246,.14); color: #c4b5fd; border: 1px solid rgba(139,92,246,.3); }

