:root {
  --bg: #071019;
  --panel: rgba(13, 27, 39, .86);
  --panel-solid: #0d1b27;
  --line: rgba(154, 190, 209, .14);
  --text: #edf8fb;
  --muted: #86a0ad;
  --accent: #65f2c7;
  --accent-strong: #23d4aa;
  --cyan: #49c9f5;
  --danger: #ff7f88;
  --warning: #ffcb68;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 74% -10%, rgba(41, 199, 179, .12), transparent 36%),
    linear-gradient(150deg, #071019 0%, #091520 50%, #071019 100%);
  font: 15px/1.6 'Segoe UI', 'Microsoft YaHei', sans-serif;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .28; }
.ambient-one { width: 360px; height: 360px; background: #0ad1a0; right: -190px; top: 18%; }
.ambient-two { width: 280px; height: 280px; background: #1574a7; left: -170px; bottom: 8%; }

.site-header {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(101, 242, 199, .42); border-radius: 13px;
  color: var(--accent); background: rgba(101, 242, 199, .08);
  font: 800 12px/1 'Segoe UI', sans-serif; letter-spacing: .08em;
}
.brand strong { display: block; font: 700 16px/1.2 'Segoe UI', sans-serif; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.top-nav { display: flex; align-items: center; gap: 10px; }
.top-nav > a, .text-button { color: #b8cbd3; padding: 9px 13px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; }
.top-nav > a:hover, .text-button:hover { color: white; background: rgba(255,255,255,.05); }
.top-nav .primary-link { color: #05231c; background: var(--accent); font-weight: 700; }
.top-nav form { margin: 0; }

.page-shell { position: relative; z-index: 2; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }
.hero-panel { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font: 700 11px/1.2 'Segoe UI', sans-serif; letter-spacing: .18em; }
h1, h2, h3 { font-family: 'Segoe UI Variable Display', 'Microsoft YaHei', sans-serif; letter-spacing: -.03em; }
h1 { margin: 0; max-width: 760px; font-size: clamp(38px, 6vw, 72px); line-height: 1.02; }
.hero-copy { max-width: 690px; margin: 21px 0 0; color: #9cb2bc; font-size: 17px; }
.button { border: 0; border-radius: 13px; padding: 12px 17px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.button-accent { color: #06231c; background: var(--accent); box-shadow: 0 12px 30px rgba(35, 212, 170, .14); }
.button-accent:hover { background: #83f8d6; transform: translateY(-1px); }
.button-muted { color: #c5d7de; background: rgba(147, 177, 191, .1); border: 1px solid var(--line); }
.button-muted:hover { background: rgba(147, 177, 191, .16); }
.button.full { width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 54px; }
.stats-grid article { padding: 20px 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(12, 25, 36, .58); }
.stats-grid span, .stats-grid small { display: block; color: var(--muted); font-size: 12px; }
.stats-grid strong { display: block; margin: 5px 0 2px; font: 700 29px/1.1 'Segoe UI', sans-serif; }
.status-word { font-size: 21px !important; }
.status-word.online { color: var(--accent); }
.status-word.offline { color: var(--danger); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font-size: 25px; }
.section-heading form { margin: 0; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rule-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.rule-card.paused { opacity: .63; }
.rule-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.chain-pill { padding: 5px 10px; border-radius: 99px; color: #a6c5d2; background: rgba(73, 201, 245, .08); border: 1px solid rgba(73, 201, 245, .16); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.live-state { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 12px; }
.live-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(101, 242, 199, .08); }
.live-state.has-error { color: var(--danger); }
.token-row { display: flex; align-items: center; gap: 13px; }
.token-avatar { flex: 0 0 45px; width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; color: #09241e; background: linear-gradient(145deg, var(--accent), #61c6ee); font: 800 13px 'Segoe UI'; }
.token-row h3 { margin: 0; font-size: 17px; }
.token-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 25px 0 14px; }
.price-row > div { padding: 13px 14px; background: rgba(3, 12, 18, .35); border-radius: 13px; }
.price-row span { display: block; color: var(--muted); font-size: 11px; }
.price-row strong { display: block; margin-top: 3px; font: 700 18px 'Segoe UI', sans-serif; overflow-wrap: anywhere; }
.condition-line { display: flex; align-items: baseline; gap: 7px; color: #c3d4da; font-size: 12px; }
.condition-line b { color: var(--warning); }
.condition-line small { margin-left: auto; color: var(--muted); }
.runtime-note { min-height: 39px; margin: 14px 0 0; color: #78929d; font-size: 11px; overflow-wrap: anywhere; }
.card-actions { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--line); }
.card-actions form { margin: 0; }
.card-actions a, .card-actions button { display: inline-block; border: 0; border-radius: 9px; padding: 7px 9px; color: #9db5bf; background: transparent; cursor: pointer; font-size: 11px; }
.card-actions a:hover, .card-actions button:hover { color: white; background: rgba(255,255,255,.06); }
.card-actions .danger:hover { color: var(--danger); background: rgba(255,127,136,.08); }

.empty-state { padding: 72px 24px; text-align: center; border: 1px dashed rgba(142, 183, 200, .22); border-radius: var(--radius); background: rgba(12,25,36,.38); }
.empty-state h1, .empty-state h2 { margin: 8px 0; }
.empty-state p { max-width: 540px; margin: 8px auto 24px; color: var(--muted); }
.radar-visual { position: relative; width: 82px; height: 82px; margin: 0 auto 20px; border: 1px solid rgba(101,242,199,.26); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 13px, rgba(101,242,199,.08) 14px 15px); }
.radar-visual:before, .radar-visual:after { content: ''; position: absolute; background: rgba(101,242,199,.13); }
.radar-visual:before { left: 50%; top: 7px; width: 1px; height: 68px; }
.radar-visual:after { top: 50%; left: 7px; height: 1px; width: 68px; }
.radar-visual i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); top: 22px; right: 21px; box-shadow: 0 0 16px var(--accent); }

.form-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 56px; align-items: start; }
.form-intro { position: sticky; top: 36px; padding-top: 23px; }
.form-intro h1 { font-size: clamp(37px, 5vw, 58px); }
.form-intro > p:not(.eyebrow) { color: var(--muted); font-size: 16px; }
.form-intro ol { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 18px; }
.form-intro li { display: flex; align-items: center; gap: 13px; color: #b9cbd2; }
.form-intro li span { color: var(--accent); font: 700 11px 'Segoe UI'; }
.form-card, .login-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.form-card form { display: grid; gap: 19px; }
label { display: grid; gap: 7px; color: #d3e0e5; font-size: 13px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; font-size: 11px; }
input, select { width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid rgba(145,178,191,.18); border-radius: 11px; outline: none; color: var(--text); background: rgba(3,11,17,.46); }
input:focus, select:focus { border-color: rgba(101,242,199,.65); box-shadow: 0 0 0 3px rgba(101,242,199,.08); }
select option { color: var(--text); background: var(--panel-solid); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.preview-card { padding: 18px; margin-top: 3px; border: 1px solid rgba(101,242,199,.22); border-radius: 16px; background: rgba(101,242,199,.04); }
.preview-heading { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.preview-heading span { color: var(--accent); font-size: 11px; letter-spacing: .08em; }
.preview-heading strong { font-size: 12px; }
.preview-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 22px; margin: 17px 0 0; }
.preview-card dl div { min-width: 0; }
.preview-card dl .wide { grid-column: 1 / -1; }
.preview-card dt { color: var(--muted); font-size: 10px; }
.preview-card dd { margin: 2px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.form-actions { display: flex; gap: 10px; }
.login-card { width: min(440px, 100%); margin: 60px auto; }
.login-card h1 { font-size: 38px; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-card form { display: grid; gap: 18px; margin-top: 25px; }

.flash-stack { display: grid; gap: 8px; margin: -26px 0 24px; }
.flash { padding: 12px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-solid); }
.flash.success { color: #aaf7df; border-color: rgba(101,242,199,.25); }
.flash.error, .system-warning { color: #ffc0c4; border-color: rgba(255,127,136,.28); }
.system-warning { padding: 13px 16px; margin: -16px 0 24px; border: 1px solid; border-radius: 12px; background: rgba(255,127,136,.07); }

@media (max-width: 820px) {
  .page-shell, .site-header { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 72px; }
  .top-nav > a:not(.primary-link) { display: none; }
  .top-nav .primary-link { padding: 8px 10px; font-size: 12px; }
  .page-shell { padding-top: 38px; }
  .hero-panel { grid-template-columns: 1fr; align-items: start; gap: 24px; }
  .hero-panel .button { justify-self: start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid article:last-child { grid-column: 1 / -1; }
  .rule-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; gap: 25px; }
  .form-intro { position: static; padding: 0; }
  .form-intro ol { display: none; }
}

@media (max-width: 520px) {
  .brand small { display: none; }
  h1 { font-size: 39px; }
  .hero-copy { font-size: 15px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid article:last-child { grid-column: auto; }
  .section-heading { align-items: start; flex-direction: column; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .form-card { padding: 19px; }
  .preview-card dl { grid-template-columns: 1fr; }
  .preview-card dl .wide { grid-column: auto; }
  .form-actions { flex-direction: column; }
  .price-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .rule-card { transition: transform .18s ease, background .18s ease, border-color .18s ease; }
  .rule-card:hover { border-color: rgba(101,242,199,.22); transform: translateY(-2px); }
}
