:root {
  --bg: #f5f8ff;
  --panel: rgba(255, 255, 255, .76);
  --line: rgba(61, 85, 134, .14);
  --muted: #72809a;
  --text: #17233d;
  --blue: #4b6fff;
  --cyan: #68c8ff;
  --danger: #d94b54;
  --shadow: 0 26px 70px rgba(71, 96, 150, .12);
  --shadow-soft: 0 10px 30px rgba(71, 96, 150, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); }
html { background: #f7faff; }
body { position: relative; background: transparent; isolation: isolate; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(rgba(67,104,177,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(67,104,177,.055) 1px, transparent 1px);
  background-size: 88px 88px;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 72% 2%, rgba(90,133,255,.2), transparent 34%), radial-gradient(circle at 13% 72%, rgba(111,202,255,.16), transparent 32%), linear-gradient(180deg, rgba(247,250,255,.82), rgba(242,247,255,.96));
}
button, input, select { font: inherit; }
button {
  border: 1px solid var(--line); background: rgba(255,255,255,.78); color: var(--text); padding: 11px 16px; border-radius: 13px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
button:hover { border-color: rgba(75,111,255,.38); background: #fff; box-shadow: var(--shadow-soft); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.eyebrow, .section-index, .card-kicker { font-size: 10px; letter-spacing: .25em; color: var(--blue); font-weight: 800; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 760; color: var(--text); text-decoration: none; }
.brand-mark, .mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg,#6385ff,#3858cb);
  color: white; font-size: 13px; letter-spacing: .05em; font-weight: 850; box-shadow: 0 10px 24px rgba(63,92,205,.24); position: relative; overflow: hidden;
}
.brand-mark::after, .mark::after { content: ""; position: absolute; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.32); border-radius: 50%; left: -11px; bottom: -11px; }
.brand-name small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .2em; margin-top: 3px; font-weight: 700; }

/* Login */
.login-body { min-height: 100vh; overflow-x: hidden; }
.login-topbar {
  position: fixed; z-index: 5; top: 0; left: 0; right: 0; height: 86px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(24px,6vw,96px); border-bottom: 1px solid rgba(89,111,154,.09); backdrop-filter: blur(18px); background: rgba(249,251,255,.42);
}
.login-brand { width: max-content; }
.privacy-chip { display: flex; align-items: center; gap: 9px; color: #5f6d87; font-size: 12px; padding: 9px 13px; border: 1px solid var(--line); background: rgba(255,255,255,.6); border-radius: 999px; }
.privacy-chip i, .login-card small i { width: 7px; height: 7px; border-radius: 50%; background: #4b78ff; box-shadow: 0 0 0 5px rgba(75,120,255,.11); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.65fr); align-items: center; gap: clamp(48px,8vw,130px); padding: 132px clamp(24px,9vw,150px) 92px; }
.login-copy { max-width: 760px; animation: rise .75s ease both; }
.launch-note { display: inline-flex; align-items: center; gap: 9px; color: #6e7c96; font-size: 13px; margin-bottom: 54px; }
.launch-note span { color: var(--blue); }
.login-copy h1 { font-size: clamp(48px,5.5vw,86px); font-weight: 430; letter-spacing: .08em; line-height: 1.16; margin: 18px 0 26px; color: #1a2742; }
.login-copy h1 span { color: #3e5ebd; }
.login-copy > p { max-width: 650px; color: #6b7891; font-size: 17px; line-height: 1.9; margin: 0; }
.feature-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.feature-row span { padding: 10px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.58); color: #64718a; font-size: 12px; box-shadow: 0 10px 30px rgba(73,101,157,.05); }
.login-card {
  position: relative; background: rgba(255,255,255,.76); border: 1px solid rgba(255,255,255,.9); padding: 38px; border-radius: 26px;
  box-shadow: 0 34px 90px rgba(67,95,154,.17); backdrop-filter: blur(24px); animation: rise .75s .12s ease both;
}
.login-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg,rgba(255,255,255,.95),rgba(85,122,255,.13)); -webkit-mask: linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card-kicker { position: absolute; top: 30px; right: 32px; color: #8d99ae; font-size: 8px; }
.login-card .mark { width: 48px; height: 48px; border-radius: 15px; }
.login-card h2 { font-size: 24px; font-weight: 600; margin: 28px 0 5px; }
.login-hint { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card label, .form-grid label { display: grid; gap: 8px; margin: 14px 0; color: #66738a; font-size: 12px; font-weight: 600; }
.login-card input, input, select { width: 100%; background: rgba(251,253,255,.9); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.login-card input:focus, input:focus, select:focus { border-color: rgba(75,111,255,.65); box-shadow: 0 0 0 4px rgba(75,111,255,.09); background: #fff; }
.primary { background: linear-gradient(135deg,#5479ff,#3c5fd4); color: white; border-color: transparent; font-weight: 750; box-shadow: 0 11px 28px rgba(58,89,207,.2); }
.primary:hover { background: linear-gradient(135deg,#5f82ff,#3555c2); border-color: transparent; color: #fff; box-shadow: 0 16px 32px rgba(58,89,207,.26); }
.primary.alt { background: linear-gradient(135deg,#81d4ff,#55a9ea); color: #143251; }
.login-card button { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-card small { display: flex; align-items: center; gap: 9px; color: #8a95a8; margin-top: 18px; font-size: 11px; }
.error { padding: 11px 13px; background: #fff1f2; border: 1px solid #f4c6cb; color: #b8323d; border-radius: 10px; font-size: 12px; }
.login-footer { position: fixed; bottom: 24px; left: 0; right: 0; text-align: center; color: #96a0b2; font-size: 9px; letter-spacing: .16em; }

/* Main shell */
.sidebar { position: sticky; top: 0; width: 100%; height: 82px; border-bottom: 1px solid rgba(77,99,143,.11); padding: 0 clamp(18px,3.4vw,56px); background: rgba(248,251,255,.72); backdrop-filter: blur(22px); z-index: 10; }
.topbar-inner { max-width: 1560px; height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 28px; }
.sidebar nav { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.nav { display: flex; align-items: center; gap: 6px; background: transparent; border-color: transparent; color: #6e7a91; padding: 10px 11px; font-size: 12px; border-radius: 11px; box-shadow: none; white-space: nowrap; }
.nav span { font-size: 8px; color: #a4aec0; font-variant-numeric: tabular-nums; }
.nav:hover { background: rgba(255,255,255,.7); box-shadow: none; transform: none; }
.nav.active { color: #3155c3; background: #edf3ff; border-color: rgba(75,111,255,.11); font-weight: 750; }
.nav.active span { color: #6280dc; }
.logout { margin: 0 0 0 8px; }
.logout button { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.54); color: #66738a; padding: 9px 11px; border-radius: 999px; font-size: 11px; }
.logout i { width: 7px; height: 7px; border-radius: 50%; background: #5f7ce0; box-shadow: 0 0 0 4px rgba(95,124,224,.1); }
.logout span { color: #9aa3b4; }
.content { max-width: 1560px; margin: 0 auto; padding: 70px clamp(22px,5vw,82px) 80px; min-height: calc(100vh - 82px); }
.page-hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 42px; animation: rise .5s ease both; }
.content h1 { font-size: clamp(38px,4vw,62px); font-weight: 430; letter-spacing: .1em; line-height: 1.1; margin: 12px 0; color: #1b2945; }
.page-hero p { color: #76839a; margin: 0; font-size: 13px; letter-spacing: .02em; }
.status { display: flex; gap: 10px; align-items: center; color: #62718b; background: rgba(255,255,255,.62); border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; font-size: 12px; box-shadow: var(--shadow-soft); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #5f7ce0; box-shadow: 0 0 0 5px rgba(95,124,224,.11); animation: pulse 2.2s infinite; }
.view { display: none; }
.view.active { display: block; animation: viewIn .35s ease both; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }
.metrics article, .panel { position: relative; background: var(--panel); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.metrics article { min-height: 184px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.metrics article::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -65px; bottom: -85px; background: radial-gradient(circle,rgba(90,129,255,.12),transparent 68%); }
.metrics article:hover { transform: translateY(-3px); box-shadow: 0 30px 76px rgba(62,91,150,.16); border-color: rgba(83,116,205,.17); }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics span { font-size: 12px; font-weight: 650; }
.metrics strong { display: block; font-size: 34px; font-weight: 520; letter-spacing: -.03em; margin: 23px 0 18px; color: #253557; }
.metrics small { font-size: 11px; }
.metrics .money { background: linear-gradient(145deg,rgba(54,87,186,.96),rgba(30,55,128,.94)); border-color: rgba(94,133,255,.3); box-shadow: 0 28px 72px rgba(43,72,159,.26); }
.metrics .money span, .metrics .money small { color: rgba(237,243,255,.72); }
.metrics .money strong { color: white; }
.metric-arrow { position: absolute; right: 20px; top: 19px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #8390a8; font-size: 14px; font-weight: 400; }
.money .metric-arrow { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); }
.split { display: grid; grid-template-columns: 1.3fr .7fr; gap: 15px; margin-top: 15px; }
.panel { margin-bottom: 15px; }
.panel h2 { margin: 4px 0 0; font-size: 17px; font-weight: 650; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.soft-badge { padding: 7px 10px; border-radius: 999px; background: #eef4ff; color: #5370c5; font-size: 10px; border: 1px solid rgba(76,112,205,.1); }
.pipeline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pipeline span { flex: 1; display: grid; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: #5e6d87; background: rgba(250,252,255,.65); font-size: 12px; }
.pipeline span i { font-style: normal; font-size: 8px; letter-spacing: .15em; color: #91a0b8; }
.pipeline b { color: #8da0c3; font-weight: 400; }
.stack { display: grid; gap: 5px; }
.stack div { display: flex; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 12px; color: #67758d; }
.stack div:last-child { border-bottom: 0; }
.ok { color: #3f67d3; }
.off { color: #929cac; }
.error-text { color: #c84653; }
.monitor-layout { grid-template-columns: .72fr 1.28fr; align-items: stretch; }
.monitor-layout > .panel { margin-bottom: 0; }
.monitor-settings h2 { margin-bottom: 20px; }
.credential-vault { display: flex; flex-direction: column; }
.credential-form { display: grid; gap: 11px; padding: 18px 0; border-top: 1px solid var(--line); }
.credential-form:first-of-type { border-top: 0; padding-top: 0; }
.credential-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.credential-title strong { font-size: 12px; font-weight: 650; }
.credential-status { font-size: 10px; padding: 6px 9px; border-radius: 999px; background: rgba(241,245,253,.8); white-space: nowrap; }
.credential-input { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.credential-input input { min-width: 0; }
.credential-input button { white-space: nowrap; }
.vault-note { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; margin: auto 0 0; padding-top: 16px; }
.vault-note i { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #5f7ce0; box-shadow: 0 0 0 5px rgba(95,124,224,.1); }
.toolbar, .inline-form { display: flex; gap: 10px; align-items: center; }
.toolbar input { max-width: 340px; margin-left: auto; }
.table-wrap { overflow: auto; padding: 0; background: rgba(255,255,255,.68); }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: #56647e; }
.table-wrap th { color: #8792a7; font-weight: 650; background: rgba(241,246,255,.72); letter-spacing: .02em; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr { transition: background .18s; }
.table-wrap tbody tr:hover { background: rgba(238,244,255,.6); }
.form-grid { display: grid; gap: 4px; }
.form-grid > p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.switch-line { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; }
.switch-line input { width: auto; }
.tool-view { height: calc(100vh - 230px); min-height: 620px; }
.tool-view iframe { width: 100%; height: 100%; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.account-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.account-grid article { border: 1px solid var(--line); background: rgba(249,252,255,.7); border-radius: 14px; padding: 18px; }
.account-grid strong { display: block; font-size: 25px; margin-top: 10px; color: #2f4fb8; }
.account-grid small { color: var(--muted); }
#toast { position: fixed; right: 26px; bottom: 26px; padding: 14px 18px; border-radius: 13px; background: rgba(38,61,126,.94); border: 1px solid rgba(255,255,255,.15); color: white; box-shadow: 0 18px 50px rgba(35,57,118,.28); opacity: 0; transform: translateY(20px); transition: .25s; z-index: 20; font-size: 12px; }
#toast.show { opacity: 1; transform: none; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(95,124,224,.03); } }

@media (max-width:1240px) {
  .sidebar nav { gap: 0; }
  .nav { padding: 9px 7px; }
  .nav span, .brand-name { display: none; }
  .metrics { grid-template-columns: repeat(2,1fr); }
}
@media (max-width:1000px) {
  .split { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; padding-top: 120px; }
  .login-copy { display: none; }
  .login-card { max-width: 480px; margin: 0 auto; width: 100%; }
  .sidebar { height: auto; position: sticky; }
  .topbar-inner { padding: 12px 0; flex-wrap: wrap; }
  .sidebar nav { order: 3; width: 100%; overflow: auto; padding-bottom: 2px; }
  .content { padding-top: 44px; }
  .pipeline { flex-wrap: wrap; }
  .pipeline span { min-width: 40%; }
  .monitor-layout { grid-template-columns: 1fr; }
}
@media (max-width:720px) {
  .login-topbar { height: 72px; }
  .privacy-chip { display: none; }
  .login-shell { padding: 100px 18px 72px; }
  .login-card { padding: 30px 22px; }
  .login-footer { display: none; }
  .sidebar { padding: 0 14px; }
  .topbar-inner { gap: 10px; }
  .sidebar .brand-name { display: block; }
  .logout { margin-left: auto; }
  .logout span { display: none; }
  .nav { padding: 9px 10px; }
  .content { padding: 36px 16px 60px; }
  .page-hero { align-items: flex-start; gap: 20px; }
  .page-hero p { display: none; }
  .content h1 { font-size: 36px; }
  .status { padding: 9px 11px; }
  .status span { max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { min-height: 160px; }
  .toolbar, .inline-form { align-items: stretch; flex-direction: column; }
  .toolbar input { max-width: none; margin: 0; }
  .account-grid { grid-template-columns: 1fr; }
  .pipeline { display: grid; grid-template-columns: 1fr; }
  .pipeline b { display: none; }
  .credential-input { grid-template-columns: 1fr; }
  .tool-view { height: 70vh; min-height: 520px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
