/* 金融界 GEO 检测分析系统 · 网页端设计系统
   配色与桌面端 resources/app/styles.css 保持一致：
   深空蓝黑底（#0b1018 + 右上角冷光）+ 琥珀金主色（#ffb453）。
   目标是「客户在网页和桌面软件里看到的是同一套视觉语言」。 */

:root {
  --bg: #0b1018;
  --panel: #111a26;
  --panel-2: #0d151f;
  --panel-3: #0c1622;
  --side: #101721;
  --line: #202b3b;
  --line-2: #253347;
  --line-3: #2d3b50;
  --gold: #ffb453;
  --gold-2: #ffc56b;
  --gold-3: #ffbd68;
  --gold-glow: rgba(255, 180, 83, .14);
  --blue: #5eb0ff;
  --blue-dim: rgba(94, 176, 255, .15);
  --green: #62d39b;
  --green-dim: rgba(98, 211, 155, .14);
  --red: #ff7f70;
  --red-dim: rgba(255, 127, 112, .14);
  --txt: #e8edf5;
  --txt-2: #bdc9d7;
  --txt-3: #8492a7;
  --txt-4: #73849a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 42px rgba(0, 0, 0, .34);
  --font: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--txt);
  background: radial-gradient(circle at 78% -10%, #213653 0, var(--bg) 34%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(255, 180, 83, .28); }

/* 滚动条：与暗色面板融合，不留系统默认的亮条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22303f; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #33465c; background-clip: content-box; }

/* ============ 登录页 ============ */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(160deg, rgba(20, 32, 47, .92), rgba(13, 21, 31, .96));
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 40px 36px 34px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--gold), #ff9f2e);
  color: #151a21;
  display: grid; place-items: center;
  font-weight: 900; font-size: 26px;
  box-shadow: 0 10px 26px rgba(255, 180, 83, .3);
}
.login-brand h1 { font-size: 19px; margin: 0 0 6px; letter-spacing: .02em; }
.login-brand p { margin: 0; color: var(--txt-4); font-size: 12px; letter-spacing: .04em; }

.tabs { display: flex; gap: 6px; background: #0b131d; border: 1px solid var(--line-2); border-radius: 11px; padding: 4px; margin-bottom: 20px; }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--txt-4);
  padding: 9px 0; font-size: 13px; border-radius: 8px; cursor: pointer; transition: all .18s;
}
.tabs button.active { background: var(--gold-glow); color: var(--gold); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 180, 83, .3); }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; color: var(--txt-3); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 14px;
  background: #0b131d; border: 1px solid var(--line-3); border-radius: 9px;
  color: var(--txt); outline: none; transition: all .18s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.field input::placeholder { color: #4d5c70; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-3); background: var(--panel-2); color: var(--txt-2);
  padding: 11px 18px; border-radius: 9px; font-size: 13px; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), #ff9f2e);
  border-color: transparent; color: #171c25; font-weight: 700;
}
.btn.primary:hover { filter: brightness(1.07); color: #171c25; }
.btn.block { width: 100%; padding: 13px; font-size: 14px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #5a3030; color: #d97a6a; }
.btn.danger:hover { border-color: #c4533b; color: var(--red); background: #1a0d0d; }
.btn.sm { padding: 7px 12px; font-size: 12px; }

.form-error {
  margin-top: 14px; padding: 10px 13px; border-radius: 8px; font-size: 12.5px; line-height: 1.6;
  background: var(--red-dim); border: 1px solid rgba(255, 127, 112, .35); color: #ffb3a8;
}
.login-foot { margin-top: 22px; text-align: center; color: #5b6b81; font-size: 11.5px; line-height: 1.9; }

/* ============ 应用骨架 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px;
  padding: 26px 16px;
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 20;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 26px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #ff9f2e);
  color: #151a21; display: grid; place-items: center; font-weight: 900; font-size: 19px;
}
.brand strong { display: block; font-size: 14.5px; letter-spacing: .01em; }
.brand span { display: block; margin-top: 3px; color: var(--txt-4); font-size: 9.5px; letter-spacing: .14em; }

.nav-label { padding: 12px 12px 8px; color: #5d6b7e; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.nav {
  width: 100%; border: 0; background: transparent; color: var(--txt-3);
  text-align: left; padding: 12px 14px; margin: 3px 0; border-radius: 10px;
  font-size: 13.5px; cursor: pointer; transition: all .16s;
  display: flex; align-items: center; gap: 10px;
}
.nav .ico { width: 18px; text-align: center; color: var(--gold); font-size: 14px; flex-shrink: 0; }
.nav:hover { background: #182435; color: var(--txt); }
.nav.active { background: #1c2a3d; color: #f4f7fb; box-shadow: inset 3px 0 var(--gold); font-weight: 600; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 12px 0; }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: #1c2a3d; color: var(--gold); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; border: 1px solid var(--line-2);
}
.side-user .uinfo { min-width: 0; }
.side-user strong { display: block; font-size: 12.5px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user span { display: block; font-size: 10.5px; color: var(--txt-4); margin-top: 2px; }
.tier-pill {
  display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(255, 180, 83, .35);
}
.side-status { display: flex; align-items: center; gap: 8px; color: var(--txt-4); font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.warn { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.dot.bad { background: var(--red); box-shadow: 0 0 10px var(--red); }

.main { margin-left: 244px; flex: 1; padding: 32px 44px 76px; max-width: 1560px; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.eyebrow { font-size: 10px; letter-spacing: .2em; color: var(--txt-4); text-transform: uppercase; margin-bottom: 8px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: .01em; }
.topbar .sub { margin: 8px 0 0; color: var(--txt-3); font-size: 13px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.view { display: none; }
.view.active { display: block; animation: fadeUp .32s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 卡片与网格 ============ */
.card {
  background: linear-gradient(165deg, rgba(19, 30, 45, .72), rgba(13, 21, 31, .82));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0 14px;
  transition: border-color .2s, transform .2s;
  position: relative;
}
.card.hover:hover { border-color: #3a5070; transform: translateY(-2px); }
.card.flat { background: var(--panel-2); }
.card h2 { margin: 0 0 4px; font-size: 15px; letter-spacing: .01em; }
.card .hint { color: var(--txt-4); font-size: 11.5px; margin: 6px 0 0; line-height: 1.7; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--txt); margin: 26px 0 4px; }
.section-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--gold); }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1280px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1040px) { .grid.c3, .grid.c2 { grid-template-columns: 1fr; } }

.metric {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 13px;
  padding: 18px 20px; position: relative; overflow: hidden;
}
.metric::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px;
  border-radius: 50%; background: radial-gradient(circle, var(--gold-glow), transparent 70%);
}
.metric .k { color: var(--txt-4); font-size: 11.5px; letter-spacing: .04em; }
.metric .v { font-size: 26px; font-weight: 700; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: 12px; font-weight: 400; color: var(--txt-4); margin-left: 4px; }
.metric .foot { margin-top: 7px; font-size: 11px; color: var(--txt-4); }
.metric.accent .v { color: var(--gold); }

/* ============ 评分环 ============ */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-cap { font-size: 11.5px; color: var(--txt-4); }

/* ============ 进度条 / 条形 ============ */
.bar { height: 8px; border-radius: 5px; background: #1b2634; overflow: hidden; display: block; width: 100%; }
.bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .5s ease; }
.bar.blue > i { background: linear-gradient(90deg, #3b82f6, var(--blue)); }
.bar.green > i { background: linear-gradient(90deg, #22c55e, var(--green)); }

.rank-row { display: grid; grid-template-columns: 96px 1fr 58px; gap: 12px; align-items: center; padding: 9px 0; }
.rank-row .nm { font-size: 12.5px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .sc { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ 标签 ============ */
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; white-space: nowrap; }
.tag.good { background: var(--green-dim); color: var(--green); border: 1px solid rgba(98, 211, 155, .3); }
.tag.mid { background: rgba(255, 180, 83, .13); color: var(--gold-3); border: 1px solid rgba(255, 180, 83, .3); }
.tag.bad { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255, 127, 112, .3); }
.tag.info { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(94, 176, 255, .3); }
.tag.plain { background: #16202d; color: var(--txt-3); border: 1px solid var(--line-2); }

/* ============ 表格 ============ */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { color: var(--txt-4); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: #131e2c; }
table.data td.num { font-variant-numeric: tabular-nums; }

/* ============ 项目卡 ============ */
.proj-card { cursor: pointer; }
.proj-card .pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.proj-card .pc-name { font-size: 15px; font-weight: 700; }
.proj-card .pc-meta { color: var(--txt-4); font-size: 11.5px; margin-top: 5px; }
.proj-card .pc-score { text-align: right; flex-shrink: 0; }
.proj-card .pc-score .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.proj-card .pc-score .g { font-size: 10.5px; color: var(--txt-4); }
.proj-card .pc-foot { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 报告查看器 ============ */
.report-frame {
  width: 100%; height: 74vh; border: 1px solid var(--line-2); border-radius: 12px;
  background: #fff; display: block;
}
.report-list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 15px 18px; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 12px; margin: 10px 0; transition: border-color .18s;
}
.report-list-item:hover { border-color: #3a5070; }
.report-list-item .r-main { min-width: 0; flex: 1; }
.report-list-item .r-title { font-size: 13.5px; font-weight: 600; }
.report-list-item .r-meta { font-size: 11.5px; color: var(--txt-4); margin-top: 5px; }

/* ============ 文案 ============ */
.content-body {
  background: #0a1119; border: 1px solid var(--line); border-radius: 11px;
  padding: 20px 22px; font-size: 13.5px; line-height: 1.95; color: var(--txt-2);
  white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto;
}
.content-body h1, .content-body h2, .content-body h3 { color: var(--txt); }
.content-card { border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; margin: 12px 0; background: var(--panel-2); }
.content-card .cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.content-card .cc-title { font-size: 14px; font-weight: 700; }
.content-card .cc-meta { font-size: 11.5px; color: var(--txt-4); margin-top: 5px; }
.cc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.collapsed { display: none; }

/* ============ 表单 / 选择 ============ */
select, textarea {
  background: #0b131d; color: var(--txt); border: 1px solid var(--line-3);
  border-radius: 9px; padding: 10px 12px; font-size: 13px; outline: none; font-family: inherit;
}
select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
/* 弹窗表单里的控件要撑满整列，否则 select 会缩成内容宽度、跟输入框不对齐 */
.field select, .field textarea { width: 100%; }
.field textarea { line-height: 1.65; resize: vertical; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; min-width: 190px; }

/* ============ 空态 / 骨架 ============ */
.empty { text-align: center; padding: 56px 20px; color: var(--txt-4); }
.empty .ico { font-size: 34px; opacity: .5; margin-bottom: 14px; }
.empty p { margin: 0 0 6px; font-size: 13.5px; }
.empty small { font-size: 11.5px; color: #5b6b81; line-height: 1.8; display: block; }
.skeleton { background: linear-gradient(90deg, #131d29 25%, #1b2836 37%, #131d29 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============ Toast ============ */
#toastHost { position: fixed; right: 22px; bottom: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  min-width: 220px; max-width: 400px; padding: 12px 16px; border-radius: 11px; font-size: 13px;
  background: #16202e; border: 1px solid var(--line-3); color: var(--txt-2);
  box-shadow: var(--shadow); animation: toastIn .26s ease both; line-height: 1.6;
}
.toast.ok { border-color: rgba(98, 211, 155, .45); }
.toast.err { border-color: rgba(255, 127, 112, .5); color: #ffc0b6; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ 弹层（body 级，避免被 .view 的定位上下文吃掉）============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 8, 14, .72); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 9000; padding: 24px;
}
.modal {
  width: 100%; max-width: 620px; max-height: 86vh; overflow: auto;
  background: linear-gradient(165deg, #16212f, #0e1723);
  border: 1px solid var(--line-3); border-radius: 16px; padding: 26px 28px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal .m-sub { color: var(--txt-4); font-size: 12px; margin: 0 0 18px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 180, 83, .25); border-top-color: var(--gold);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
