:root {
  color-scheme: dark;
  --ink: #0b0e0d;
  --panel: #121715;
  --panel-raised: #18201d;
  --line: rgba(226, 235, 228, 0.12);
  --muted: #8e9d95;
  --text: #edf3ef;
  --signal: #c7ff4a;
  --signal-dark: #7da61d;
  --ember: #ff7849;
  --cream: #f0eadb;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 1100px;
  min-height: 100vh;
  overflow-x: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--ink);
  background-size: 44px 44px;
  color: var(--text);
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.1;
  pointer-events: none;
}
.ambient-one { top: -220px; right: 18%; background: var(--signal); }
.ambient-two { bottom: -280px; left: 8%; background: var(--ember); }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line);
  background: rgba(9, 12, 11, 0.88);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(199, 255, 74, 0.4);
  border-radius: 13px 5px 13px 5px;
  background: var(--signal);
  box-shadow: 0 0 35px rgba(199, 255, 74, 0.12);
  color: #11180b;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}
.brand strong { display: block; font-family: Georgia, "Microsoft YaHei", serif; font-size: 19px; letter-spacing: 0.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }

.nav { display: grid; gap: 7px; margin-top: 58px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  transition: 150ms ease;
}
.nav-item span { color: #526058; font-family: Consolas, monospace; font-size: 11px; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.active { border-color: var(--line); background: var(--panel); color: var(--text); box-shadow: inset 3px 0 var(--signal); }
.nav-item.active span { color: var(--signal); }

.sidebar-foot { display: grid; gap: 14px; margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.sidebar-foot small { color: #536159; font-family: Consolas, monospace; font-size: 10px; }
.runtime-dot { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.runtime-dot i { width: 7px; height: 7px; border-radius: 50%; background: #77847d; box-shadow: 0 0 0 5px rgba(119, 132, 125, 0.08); }
.runtime-dot.online i { background: var(--signal); box-shadow: 0 0 0 5px rgba(199, 255, 74, 0.1); }

.main { width: min(1440px, calc(100vw - 248px)); margin: 0 auto; padding: 38px 44px 80px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 12px; color: var(--signal); font-family: Consolas, monospace; font-size: 10px; letter-spacing: 0.17em; }
.topbar h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: clamp(35px, 4vw, 58px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.topbar h1 em { color: #7f9086; font-style: italic; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 22px;
  cursor: pointer;
}
.icon-button:hover { border-color: rgba(199, 255, 74, 0.4); color: var(--signal); }
.account { display: flex; align-items: center; gap: 11px; min-width: 176px; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--cream); color: #1e2421; font-size: 12px; font-weight: 700; }
.account strong, .account small { display: block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account strong { font-size: 13px; }
.account small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 38px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 120, 73, 0.28);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 120, 73, 0.09), rgba(255, 120, 73, 0.02));
}
.notice[hidden] { display: none; }
.notice strong { margin-left: 12px; font-size: 13px; font-weight: 500; }
.notice-tag { padding: 5px 7px; border-radius: 5px; background: var(--ember); color: #24100a; font-family: Consolas, monospace; font-size: 9px; font-weight: 700; }

.section { margin-top: 56px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 27px; font-weight: 400; }
.section-heading p { margin: 0; color: #627067; font-family: Consolas, monospace; font-size: 10px; }
.section-heading.compact { margin-bottom: 17px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(28, 36, 32, 0.9), rgba(14, 18, 16, 0.96));
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.14);
}
.metric::after { position: absolute; top: 0; right: 0; width: 42px; height: 42px; border-top: 1px solid rgba(199, 255, 74, 0.2); border-right: 1px solid rgba(199, 255, 74, 0.2); content: ""; }
.metric-featured { border-color: rgba(199, 255, 74, 0.34); background: linear-gradient(145deg, rgba(48, 61, 24, 0.78), rgba(17, 22, 14, 0.97)); }
.metric-label { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.metric strong { display: block; margin-top: 15px; font-family: Georgia, serif; font-size: 47px; font-weight: 400; line-height: 1; }
.metric strong.metric-word { margin-top: 25px; color: var(--signal); font-family: Bahnschrift, sans-serif; font-size: 24px; text-transform: uppercase; }
.metric p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.metric p span { color: var(--text); }
.metric-stamp { position: absolute; right: 17px; bottom: 17px; padding: 5px 7px; border-radius: 4px; background: var(--signal); color: #17200d; font-family: Consolas, monospace; font-size: 8px; font-weight: 700; }
.metric-stamp.outline { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.bar { position: absolute; right: 22px; bottom: 24px; left: 22px; height: 3px; overflow: hidden; background: #28302c; }
.bar i { display: block; width: 0; height: 100%; background: var(--ember); transition: width 500ms ease; }
.spark { position: absolute; right: 19px; bottom: 20px; display: flex; align-items: end; gap: 3px; height: 31px; }
.spark i { width: 4px; border-radius: 2px 2px 0 0; background: var(--signal); opacity: 0.55; animation: rise 650ms ease both; }
.spark i:nth-child(1) { height: 9px; }.spark i:nth-child(2) { height: 15px; }.spark i:nth-child(3) { height: 12px; }.spark i:nth-child(4) { height: 24px; }.spark i:nth-child(5) { height: 18px; }.spark i:nth-child(6) { height: 28px; }.spark i:nth-child(7) { height: 31px; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } }

.grid-section { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.connector-list { display: grid; gap: 9px; }
.connector {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 23, 21, 0.82);
}
.connector-icon { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: #202923; font-family: Georgia, serif; font-size: 18px; }
.connector strong { display: block; font-size: 14px; }
.connector p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.connector-status { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 10px; justify-content: flex-end; }
.connector-status i { width: 6px; height: 6px; border-radius: 50%; background: #66716b; }
.connector-status.available i, .connector-status.connected i { background: var(--signal); }
.connector-status.oauth_pending i { background: #f7c64c; }
.connector-action { min-width: 88px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 10px; cursor: pointer; }
.connector-action:hover:not(:disabled) { border-color: var(--signal); color: var(--signal); }
.connector-action:disabled { cursor: default; opacity: 0.45; }
.skeleton-card { height: 88px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(90deg, #111614 25%, #18201c 50%, #111614 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.plan-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(199, 255, 74, 0.3);
  border-radius: 19px;
  background: var(--cream);
  box-shadow: var(--shadow);
  color: #17201a;
}
.plan-card::before { position: absolute; top: -70px; right: -70px; width: 160px; height: 160px; border: 28px solid rgba(23, 32, 26, 0.06); border-radius: 50%; content: ""; }
.plan-card .eyebrow { color: #65714e; }
.plan-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-title h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 30px; font-weight: 400; }
.plan-title span { font-family: Consolas, monospace; font-size: 12px; }
.plan-card > p:not(.eyebrow) { min-height: 42px; color: #647067; font-size: 12px; line-height: 1.55; }
.plan-card dl { margin: 24px 0; border-top: 1px solid rgba(23, 32, 26, 0.14); }
.plan-card dl div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(23, 32, 26, 0.11); }
.plan-card dt { color: #657067; font-size: 11px; }
.plan-card dd { margin: 0; font-family: Consolas, monospace; font-size: 11px; font-weight: 700; }
.plan-card small { display: block; margin-top: 12px; color: #7a847d; font-size: 9px; text-align: center; }

.button { min-height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; cursor: pointer; transition: 140ms ease; }
.button:hover { transform: translateY(-1px); }
.button-accent { background: var(--signal); color: #17200d; }
.button-light { background: var(--cream); color: #202620; }
.button-ghost { border-color: var(--line); background: transparent; }
.plan-card .button { width: 100%; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; text-align: left; }
.text-button:hover { color: var(--signal); }

.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(15, 20, 18, 0.78); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: rgba(255, 255, 255, 0.018); color: #6e7d74; font-family: Consolas, monospace; font-size: 9px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
td { color: #bbc5bf; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.job-type { display: inline-flex; min-width: 54px; justify-content: center; padding: 5px 7px; border-radius: 6px; background: rgba(199, 255, 74, 0.08); color: var(--signal); font-size: 9px; }
.job-title { display: block; max-width: 420px; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); content: ""; }
.status-pill.failed::before { background: var(--ember); }
.source-link { color: #829087; text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 40px; color: #5d6962; text-align: center; }

dialog { width: min(500px, calc(100vw - 40px)); padding: 0; border: 0; border-radius: 20px; background: transparent; color: var(--text); }
dialog::backdrop { background: rgba(3, 5, 4, 0.78); backdrop-filter: blur(8px); }
.dialog-card { padding: 28px; border: 1px solid rgba(199, 255, 74, 0.24); border-radius: 20px; background: #121815; box-shadow: var(--shadow); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 29px; font-weight: 400; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.dialog-card > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.dialog-card label { display: grid; gap: 8px; margin-top: 17px; }
.dialog-card label span { color: #a8b2ac; font-size: 11px; }
.dialog-card input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0b100e; color: var(--text); }
.dialog-card input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(199, 255, 74, 0.07); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.form-error { min-height: 18px; margin-bottom: 0; color: #ff8a65 !important; }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 20; max-width: 360px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); box-shadow: var(--shadow); color: #1b231e; font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1220px) {
  .main { padding-inline: 28px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
