@font-face {
  font-family: "HuiYan GuDianSong";
  src:
    url("/fonts/AaGuDianKeBenSong-2.woff2?v=20260601-ui11") format("woff2"),
    url("/fonts/AaGuDianKeBenSong-ui9.ttf?v=20260601-ui11") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #07090d;
  --bg-2: #0d1118;
  --panel: rgba(15, 19, 27, 0.84);
  --panel-strong: rgba(18, 23, 32, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(207, 222, 239, 0.13);
  --line-strong: rgba(92, 214, 255, 0.46);
  --text: #f2f7fb;
  --muted: #92a2b3;
  --cyan: #54d7ff;
  --cyan-soft: rgba(84, 215, 255, 0.13);
  --green: #65e8a4;
  --red: #ff6b86;
  --amber: #f3c969;
  --violet: #a68cff;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --font-ui: "HuiYan GuDianSong", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

body {
  color: var(--text);
  font-family: var(--font-ui);
  background:
    linear-gradient(115deg, rgba(84, 215, 255, 0.1), transparent 26%),
    linear-gradient(245deg, rgba(166, 140, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #07090d 0%, #0b1018 46%, #080a0f 100%);
  overflow: hidden;
}

.noise-layer,
.surface-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise-layer {
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}

.surface-grid {
  opacity: 0.24;
  background:
    linear-gradient(120deg, transparent 0 28%, rgba(84, 215, 255, 0.12) 28.2%, transparent 28.8% 58%, rgba(101, 232, 164, 0.08) 58.2%, transparent 58.8%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.04));
  mix-blend-mode: screen;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 14px;
  position: relative;
  z-index: 1;
}

.topbar,
.hero-panel,
.control-panel,
.metric-card,
.gate-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(118%);
}

.topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 11px 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, var(--shadow);
}

.kicker,
.hero-tag,
.panel-kicker,
.gate-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar h1,
.hero-panel h2,
.control-panel h3,
.gate-card h2 {
  margin: 0;
  font-family: var(--font-ui);
  letter-spacing: 0;
  font-weight: 750;
  text-wrap: balance;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.2;
}

.hidden {
  display: none !important;
}

.gate-notice {
  margin-top: 18px;
}

.gate-card {
  border-radius: var(--radius);
  padding: 36px 30px;
  background: var(--panel-strong);
}

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

.dashboard {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.page-tabs {
  flex-shrink: 0;
  position: sticky;
  top: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 14, 21, 0.84);
  backdrop-filter: blur(16px);
}

.tab-btn {
  min-height: 42px;
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-size: 14px;
}

.tab-btn.active {
  color: #071016;
  background: linear-gradient(135deg, #c5f5ff, var(--cyan));
  box-shadow: 0 10px 26px rgba(84, 215, 255, 0.22);
}

.pager {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  padding-bottom: 0;
}

.pager::-webkit-scrollbar {
  display: none;
}

.page-slide {
  display: grid;
  gap: 12px;
  min-width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-align: start;
  align-content: start;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 215, 255, 0.35) transparent;
}

.page-slide::-webkit-scrollbar {
  width: 8px;
}

.page-slide::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(84, 215, 255, 0.26);
}

.hero-panel {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(84, 215, 255, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, var(--shadow);
}

.hero-copy {
  max-width: 680px;
  min-width: 0;
  flex: 1;
}

.hero-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
  justify-content: flex-start;
}

button {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  color: #061015;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #d7f9ff, var(--cyan));
  box-shadow: 0 12px 28px rgba(84, 215, 255, 0.22);
}

button.ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

button.danger {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #ff6b86, #d94f6b);
  box-shadow: 0 12px 28px rgba(255, 107, 134, 0.2);
}

.wide-btn {
  width: 100%;
}

.account-create-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

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

.metric-card {
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 22, 39, 0.9), rgba(5, 12, 22, 0.84));
}

.metric-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  display: block;
  font-size: 28px;
  letter-spacing: 0.04em;
}

.metric-detail {
  display: block;
  margin-top: 12px;
  color: var(--cyan);
  opacity: 0.88;
}

.content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.95fr);
}

.lower-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.side-column {
  display: grid;
  gap: 18px;
}

.control-panel {
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    var(--panel);
}

.control-panel.compact {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(207, 222, 239, 0.08);
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(53, 215, 255, 0.22);
  color: var(--cyan);
  background: rgba(53, 215, 255, 0.08);
  font-size: 12px;
}

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

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(119, 177, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    rgba(8, 12, 18, 0.72);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.account-row:hover {
  transform: translateY(-1px);
  border-color: rgba(84, 215, 255, 0.28);
}

.account-row.selected {
  border-color: rgba(84, 215, 255, 0.48);
  background:
    linear-gradient(90deg, rgba(84, 215, 255, 0.14), rgba(255, 255, 255, 0.026)),
    rgba(8, 12, 18, 0.78);
}

.account-row.running {
  border-color: rgba(101, 232, 164, 0.34);
}

.account-row strong {
  display: block;
  margin-bottom: 6px;
  word-break: break-word;
}

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

.account-row small {
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  justify-self: end;
  min-width: 86px;
  padding: 7px 10px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid rgba(207, 222, 239, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-weight: 700;
}

.status-pill.running {
  color: var(--green);
  border-color: rgba(101, 232, 164, 0.34);
  background: rgba(101, 232, 164, 0.08);
}

.status-pill.ready {
  color: var(--cyan);
  border-color: rgba(84, 215, 255, 0.3);
  background: rgba(84, 215, 255, 0.07);
}

.status-pill.disabled {
  color: var(--red);
  border-color: rgba(255, 107, 134, 0.3);
  background: rgba(255, 107, 134, 0.07);
}

.account-row .status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px rgba(255, 94, 136, 0.34);
}

.account-row .status-dot.running {
  background: var(--green);
  box-shadow: 0 0 18px rgba(84, 240, 164, 0.34);
}

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

.inline-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(119, 177, 255, 0.1);
  background: var(--panel-soft);
}

.inline-toggle span {
  color: var(--text);
}

.inline-toggle input {
  width: 22px;
  height: 22px;
}

.settings-drawer {
  grid-column: 1 / -1;
  border: 1px solid rgba(119, 177, 255, 0.1);
  border-radius: var(--radius);
  background: var(--panel-soft);
  overflow: hidden;
}

.settings-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
}

.settings-drawer summary::-webkit-details-marker {
  display: none;
}

.settings-drawer summary::after {
  content: ">";
  color: var(--cyan);
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.settings-drawer[open] summary::after {
  transform: rotate(-90deg);
}

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

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

.field,
.toggle-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(119, 177, 255, 0.1);
  background: var(--panel-soft);
}

.field span,
.toggle-card span {
  color: var(--muted);
  font-size: 13px;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(119, 177, 255, 0.14);
  border-radius: 6px;
  padding: 11px 13px;
  background: rgba(5, 8, 13, 0.86);
  color: var(--text);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.01));
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

select option {
  color: var(--text);
  background: #111722;
}

textarea {
  resize: vertical;
  min-height: 118px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(207, 222, 239, 0.24);
  background-color: rgba(7, 11, 17, 0.92);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(84, 215, 255, 0.09);
}

input[type="checkbox"] {
  accent-color: var(--cyan);
}

.toggle-card {
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
}

.toggle-card input {
  width: 22px;
  height: 22px;
}

.credential-list,
.cookie-stack,
.event-timeline {
  display: grid;
  gap: 12px;
}

.credential-form {
  margin-top: 14px;
}

.credential-item,
.cookie-node,
.event-entry {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid rgba(119, 177, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.016)),
    rgba(6, 10, 16, 0.72);
}

.credential-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
}

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

.credential-item strong {
  word-break: break-all;
}

.cookie-node {
  padding: 16px 18px;
}

.cookie-node.active {
  border-color: rgba(84, 215, 255, 0.46);
  box-shadow: inset 0 0 0 1px rgba(84, 215, 255, 0.14), 0 16px 36px rgba(84, 215, 255, 0.06);
}

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

.cookie-node-head span {
  color: var(--cyan);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(84, 215, 255, 0.08);
  border: 1px solid rgba(84, 215, 255, 0.18);
}

.cookie-node-grid {
  display: grid;
  gap: 10px;
}

.cookie-node-grid p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cookie-node-grid span {
  color: var(--muted);
  font-size: 12px;
}

.cookie-node-grid strong {
  font-size: 13px;
  word-break: break-all;
}

.event-entry {
  overflow: hidden;
}

.event-glow {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
}

.event-content {
  padding: 16px 18px 16px 22px;
}

.event-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.event-topline span,
.event-content small,
.empty {
  color: var(--muted);
}

.event-content p {
  margin: 10px 0 8px;
  line-height: 1.58;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(12, 16, 23, 0.96);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow);
}

.toast.success {
  border-color: rgba(84, 240, 164, 0.3);
  color: var(--green);
}

.toast.warn {
  border-color: rgba(255, 211, 109, 0.3);
  color: var(--amber);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(120deg, rgba(84, 215, 255, 0.08), transparent 34%),
    rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(18px) saturate(125%);
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(760px, calc(100dvh - 28px));
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(207, 222, 239, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.026)),
    var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.modal-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.modal-card .form-grid {
  margin-top: 18px;
}

.modal-card p:not(.panel-kicker) {
  margin: 14px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .metrics-grid,
  .content-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 10px 10px;
  }

  .topbar {
    padding: 9px 11px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .page-tabs {
    top: 6px;
    gap: 6px;
    padding: 6px;
    border-radius: var(--radius);
  }

  .tab-btn {
    min-height: 38px;
    font-size: 13px;
  }

  .topbar,
  .hero-panel {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-panel {
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 26px;
    line-height: 1.18;
  }

  .hero-copy p:last-child {
    font-size: 13px;
    max-width: 100%;
  }

  .form-grid,
  .account-create-panel {
    grid-template-columns: 1fr;
  }

  .split-actions,
  .drawer-grid,
  .account-row {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-value {
    font-size: 24px;
  }
}
