:root {
  --ink: #142033;
  --muted: #607085;
  --line: #d7e0e8;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --navy: #123b5d;
  --teal: #0e7c86;
  --green: #1f7a55;
  --amber: #b7791f;
  --danger: #9b2c2c;
  --shadow: 0 18px 50px rgba(21, 42, 71, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface-2);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.landing {
  position: relative;
  --mx: 35%;
  --my: 45%;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 64% 56%, rgba(130, 212, 226, 0.26), transparent 24%),
    radial-gradient(circle at 42% 64%, rgba(23, 83, 122, 0.28), transparent 36%),
    radial-gradient(circle at 78% 18%, rgba(31, 122, 85, 0.12), transparent 24%),
    #01050b;
  color: #eef7fb;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.22) 0%, rgba(168, 244, 253, 0.16) 18%, rgba(32, 105, 148, 0.08) 44%, transparent 74%),
    radial-gradient(860px circle at calc(var(--mx) + 12%) calc(var(--my) + 8%), rgba(31, 122, 132, 0.1), transparent 62%);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.landing__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(1, 5, 11, 0.72) 0%, rgba(1, 5, 11, 0.28) 42%, rgba(1, 5, 11, 0.06) 100%),
    linear-gradient(180deg, rgba(1, 5, 11, 0.18) 0%, rgba(1, 5, 11, 0.56) 100%),
    url("./assets/galaxy-flow.jpg") center center / cover no-repeat;
  opacity: 0.58;
  filter: saturate(0.66) hue-rotate(150deg) brightness(0.82) contrast(1.18);
  pointer-events: none;
}

.landing__art::after {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(ellipse at 44% 66%, rgba(1, 5, 11, 0.78) 0%, rgba(1, 5, 11, 0.34) 18%, transparent 36%),
    radial-gradient(ellipse at 66% 48%, rgba(205, 248, 255, 0.22), transparent 28%),
    radial-gradient(ellipse at 18% 56%, rgba(22, 108, 128, 0.2), transparent 34%);
  mix-blend-mode: screen;
  transform: rotate(-4deg);
}

.landing__beam {
  position: absolute;
  inset: -14%;
  z-index: 4;
  background:
    radial-gradient(360px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.34) 0%, rgba(201, 252, 255, 0.22) 16%, rgba(101, 216, 211, 0.1) 38%, rgba(18, 59, 93, 0.04) 62%, transparent 82%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
  transform: translateZ(0);
}

#particleCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.landing__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(1, 5, 11, 0.98) 0%, rgba(1, 5, 11, 0.78) 42%, rgba(1, 5, 11, 0.18) 100%),
    linear-gradient(180deg, rgba(1, 5, 11, 0.08) 0%, rgba(1, 5, 11, 0.76) 100%),
    radial-gradient(ellipse at 42% 61%, rgba(0, 0, 0, 0.72), transparent 23%),
    radial-gradient(circle at 70% 48%, rgba(101, 216, 211, 0.13), transparent 42%);
}

.landing__content {
  position: relative;
  z-index: 3;
  width: min(840px, calc(100% - 48px));
  padding: 18vh 0 0 clamp(24px, 7vw, 108px);
}

.eyebrow {
  margin: 0 0 12px;
  color: #65d8d3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: 1.06;
  font-weight: 850;
  letter-spacing: 0;
}

.glow-title,
.glow-copy {
  --mx: 35%;
  --my: 45%;
  text-shadow: none;
}

.glow-title {
  color: #edf8fb;
  filter: none;
}

.landing__slogan {
  margin: 24px 0 0;
  max-width: 720px;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.4;
  color: #d9f3f2;
}

.landing__description {
  margin: 18px 0 0;
  max-width: 720px;
  color: #b8c8d4;
  font-size: 17px;
  line-height: 1.9;
}

.landing__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
}

.landing__note,
.hint,
.soft-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-panel {
  position: absolute;
  z-index: 5;
  right: clamp(24px, 7vw, 96px);
  top: 50%;
  width: min(360px, calc(100% - 48px));
  padding: 28px;
  transform: translateY(-50%);
  border: 1px solid rgba(157, 220, 226, 0.24);
  border-radius: 8px;
  background: rgba(8, 24, 38, 0.78);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.form-alert {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 190, 120, 0.45);
  border-radius: 6px;
  color: #ffe4bd;
  background: rgba(155, 44, 44, 0.22);
  font-size: 13px;
  line-height: 1.6;
}

.panel__header h2 {
  margin: 0 0 22px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #c8dae4;
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(199, 222, 232, 0.36);
  border-radius: 6px;
  outline: none;
  color: #eef7fb;
  background: rgba(255, 255, 255, 0.08);
}

input:focus,
select:focus {
  border-color: #65d8d3;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 62px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(157, 220, 226, 0.3);
  border-radius: 6px;
  color: #d9f3f2;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-field--light .password-toggle {
  color: var(--navy);
  background: #eef7f8;
  border-color: #c9e5e8;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.button--primary {
  border-color: #0e7c86;
  color: #fff;
  background: linear-gradient(135deg, #0e7c86, #123b5d);
  box-shadow: 0 14px 36px rgba(14, 124, 134, 0.26);
}

.button--quiet {
  color: var(--navy);
  background: #eef7f8;
  border-color: #c9e5e8;
}

.button--danger {
  border-color: #9b2c2c;
  color: #fff;
  background: #9b2c2c;
}

.button--selected {
  box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.16), 0 10px 24px rgba(18, 59, 93, 0.12);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--full {
  width: 100%;
}

.text-button {
  padding: 0;
  border: 0;
  color: #bdd3df;
  background: transparent;
}

.text-button--panel {
  margin-top: 12px;
  color: #65d8d3;
  font-size: 13px;
}

.side-action {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  color: #e7f2f8;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  padding: 20px 16px;
  color: #e7f2f8;
  background: #0d2438;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 24px;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #062333;
  background: #65d8d3;
  font-weight: 800;
}

.brand span,
.sidebar__footer span {
  display: block;
  color: #93aebe;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav__item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #bfd1dd;
  background: transparent;
  text-align: left;
}

.nav__item:hover,
.nav__item.active {
  color: #fff;
  background: rgba(101, 216, 211, 0.14);
}

.sidebar__footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
}

.status-pill--success {
  color: #1f7a55;
  background: #e2f5ec;
}

.view {
  display: none;
  height: calc(100vh - 116px);
  min-height: 0;
  overflow: auto;
}

.active-view {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metrics,
.dashboard-grid,
.candidate-layout,
.report-layout,
.admin-grid {
  min-height: 0;
}

.metric,
.section,
.detail-panel,
.report-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(21, 42, 71, 0.03);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}

.metric--attention {
  border-color: #e4b35d;
  background: #fff9ec;
}

.action-strip {
  display: flex;
  gap: 10px;
  margin: 16px 0 20px;
}

.dashboard-grid,
.admin-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 16px;
  height: calc(100% - 166px);
}

.section {
  padding: 18px;
  min-height: 0;
  overflow: auto;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section__header h3 {
  margin: 0;
  font-size: 17px;
}

.section__header span {
  color: var(--muted);
  font-size: 13px;
}

.compact-list,
.candidate-list,
.selected-list,
.config-list {
  display: grid;
  gap: 10px;
}

.intel-card {
  padding: 14px;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  background: #fff;
}

.intel-card.active {
  border-color: #0e7c86;
  box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.12);
}

.intel-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.intel-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.intel-card p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.score {
  min-width: 54px;
  color: var(--teal);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #245061;
  background: #edf6f7;
  font-size: 12px;
  font-weight: 700;
}

.run-log {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.run-log div {
  padding: 14px;
  border-radius: 8px;
  background: #f4f7fa;
}

.run-log strong,
.run-log span {
  display: block;
}

.run-log strong {
  font-size: 24px;
}

.run-log span {
  color: var(--muted);
  font-size: 12px;
}

.candidate-layout,
.report-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.candidate-list-section,
.selected-section {
  height: 100%;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter,
.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-weight: 700;
}

.filter.active,
.tab.active {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

.detail-panel {
  align-self: start;
  padding: 20px;
  height: 100%;
  overflow: auto;
}

.detail-panel h3 {
  margin: 0 0 8px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.score-block {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 14px;
  border-radius: 8px;
  background: #f4fafb;
}

.score-block strong {
  color: var(--teal);
  font-size: 28px;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.score-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.score-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6ed;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #65d8d3);
}

.link-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  color: #0c6170;
  font-weight: 700;
  text-decoration: none;
}

.link-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.report-preview {
  padding: 18px;
  height: 100%;
  overflow: hidden;
}

.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.report-text {
  height: calc(100% - 104px);
  min-height: 360px;
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 22px;
  border: 1px solid #dbe4ec;
  border-radius: 8px;
  color: #1f2933;
  background: #fbfcfd;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.report-text--modal {
  height: min(70vh, 620px);
}

.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

#newAccountRows {
  display: contents;
}

.table--sources .table__row {
  grid-template-columns: 1.1fr 1.7fr 0.8fr 0.65fr 0.75fr 0.9fr;
}

.table--history .table__row {
  grid-template-columns: 1fr 1.8fr 0.75fr 0.72fr 0.8fr;
}

.table--favorites .table__row {
  grid-template-columns: 0.42fr 1fr 1.7fr 0.72fr 0.8fr;
}

.table--admin .table__row {
  grid-template-columns: 1.1fr 1fr 0.9fr 0.5fr;
}

.table a {
  color: #0c6170;
  word-break: break-all;
  text-decoration: none;
}

.table input,
.table select {
  height: 34px;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.table button {
  min-height: 30px;
  padding: 0 10px;
}

.account-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.account-tools .hint {
  margin: 0;
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-form label {
  color: var(--ink);
}

.profile-form input {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.source-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.table__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.table__row:first-child {
  border-top: 0;
}

.table__head {
  color: var(--muted);
  background: #f4f7fa;
  font-weight: 700;
}

.config-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.config-list span {
  color: var(--muted);
}

.ok {
  color: var(--green);
}

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  z-index: 80;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #123b5d;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 14, 24, 0.54);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal--narrow {
  width: min(460px, 100%);
}

.modal h3 {
  margin: 0 0 12px;
}

.modal h4 {
  margin: 0 0 12px;
}

.modal p {
  color: var(--muted);
  line-height: 1.7;
}

.modal-intro {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 12px;
  border: 1px solid #d8e9ec;
  border-radius: 8px;
  background: #f4fafb;
}

.inline-alert {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  padding: 12px;
  border: 1px solid #c9e5e8;
  border-radius: 8px;
  color: var(--navy);
  background: #f4fafb;
  font-size: 13px;
  line-height: 1.6;
}

.modal label {
  color: var(--ink);
}

.modal input,
.modal select {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid--single {
  grid-template-columns: 1fr;
}

.permission-list {
  display: grid;
  gap: 12px;
}

.permission-card,
.no-access {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.permission-card h4,
.no-access h4 {
  margin: 0 0 8px;
}

.permission-card p,
.no-access p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-grid {
  grid-template-columns: minmax(480px, 1.15fr) minmax(360px, 0.85fr);
  height: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.github-current {
  display: grid;
  gap: 10px;
}

.github-current div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.full-height-section {
  height: 100%;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .candidate-layout,
  .report-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .action-strip,
  .landing__actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .run-log {
    grid-template-columns: 1fr;
  }

  .landing__content {
    padding: 12vh 24px 0;
  }

  .login-panel {
    left: 24px;
    right: 24px;
    top: auto;
    bottom: 24px;
    width: auto;
    transform: none;
  }
}
