:root {
  color-scheme: dark;
  --bg: #10100f;
  --sidebar: #151412;
  --surface: #191816;
  --surface-hover: #201e1b;
  --line: #2d2a26;
  --soft: #a6a19a;
  --text: #f4f0ea;
  --accent: #ff874c;
  --accent-bright: #ff985e;
  --accent-bg: #38251d;
  --green: #85d8a7;
  --green-bg: #203029;
  --red: #ff9b91;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; vertical-align: middle; }

.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 27px 17px 19px; background: var(--sidebar); border-right: 1px solid var(--line); z-index: 10;
  overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; width: fit-content; margin: 0 0 37px 9px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); }
.brand-mark > span { position: relative; display: block; width: 17px; height: 17px; border: 1.5px solid #23160f; border-radius: 50%; }
.brand-mark > span::before { content: ""; position: absolute; inset: 2px -5px; border: 1.5px solid #23160f; border-radius: 50%; transform: rotate(-41deg); }
.brand-mark > span::after { content: ""; position: absolute; width: 4px; height: 4px; background: #23160f; border-radius: 50%; right: -3px; top: -2px; }
.brand strong { display: block; font-size: 1.35rem; letter-spacing: -.045em; line-height: 1.05; }
.brand strong span { color: var(--accent); }
.brand small { display: block; color: var(--soft); font-size: .75rem; margin-top: 5px; }
.nav-group + .nav-group { margin-top: 25px; }
.nav-heading { padding: 0 11px; margin: 0 0 8px; color: #918982; font-size: .75rem; font-weight: 600; letter-spacing: .08em; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 43px; margin-bottom: 3px; padding: 8px 11px; color: #bdb6ad; border-radius: 8px; font-size: .9rem; }
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link[aria-current="page"] { color: var(--accent-bright); background: #35251d; font-weight: 650; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; inset: 10px auto 10px 0; width: 2px; background: var(--accent); border-radius: 3px; }
.side-bottom { display: grid; gap: 13px; margin-top: auto; padding-top: 20px; }
.network-status { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: #bfb7af; font-size: .8rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #9c9288; }
.status-dot.online { background: #79cf9c; box-shadow: 0 0 9px #79cf9c50; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 12px; padding: 12px clamp(19px, 3vw, 42px); border-bottom: 1px solid var(--line); }
.breadcrumb, .header-actions { display: flex; align-items: center; gap: 12px; }
.breadcrumb { color: var(--soft); font-size: .88rem; white-space: nowrap; }
.breadcrumb strong { color: var(--text); font-weight: 650; }
.crumb-divider { color: #6e665f; }
.header-actions .button { min-height: 36px; padding: 7px 13px; }
.page { outline: none; width: 100%; max-width: 1540px; margin: 0 auto; padding: 28px clamp(19px, 3vw, 42px) 36px; }
.footer { max-width: 1540px; width: 100%; margin: auto auto 0; padding: 17px clamp(19px, 3vw, 42px); display: flex; justify-content: space-between; gap: 15px; font-size: .78rem; color: var(--soft); }
.footer a:hover, .plain:hover { color: var(--accent-bright); }
.mobile-toggle, .shade { display: none !important; }
.button, .icon-button {
  min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; color: var(--text); background: var(--surface-hover); border: 1px solid #403933;
  border-radius: 8px; font-size: .88rem; font-weight: 650; line-height: 1.25; white-space: nowrap;
}
.button:hover, .icon-button:hover { background: #2a2621; border-color: #65513f; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #20120b; }
.button.primary:hover { background: #ffa574; border-color: #ffa574; }
.button.ghost { background: transparent; border-color: transparent; }
.button.ghost:hover { background: var(--surface-hover); }
.icon-button { width: 38px; min-height: 38px; padding: 7px; }
.plain { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; font-size: .85rem; font-weight: 650; color: var(--soft); }
.avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; font-weight: 650; color: var(--accent-bright); background: var(--accent-bg); }

.hero {
  display: flex; align-items: center; min-height: 305px; padding: clamp(22px, 3.55vw, 53px);
  border: 1px solid #423022; border-radius: 16px; overflow: hidden;
  background: linear-gradient(90deg, #15120f 0%, #15120fec 15%, #15120f38 50%, #15120f00 75%), url("/orbital.webp") 63% center / cover, #1a140f;
}
.hero-content { max-width: 530px; }
.eyebrow { display: inline-flex; gap: 7px; align-items: center; margin-bottom: 17px; color: #ffac7c; font-size: .72rem; font-weight: 650; letter-spacing: .19em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2rem, 3.55vw, 3.65rem); font-weight: 720; line-height: 1.08; letter-spacing: -.072em; }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 340px; color: #c9bdb2; margin-top: 16px; line-height: 1.65; font-size: .94rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.hero-actions .button:not(.primary) { background: #171411d9; }
.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-head h2, .panel h2 { font-size: 1.1rem; font-weight: 680; }
.section-head p { color: var(--soft); margin-top: 6px; font-size: .85rem; }
.page-head { margin: 4px 0 23px; }
.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.04em; }
.page-head p { color: var(--soft); margin-top: 8px; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.stat { padding: 16px 15px 15px; }
.stat-heading { display: flex; align-items: center; gap: 9px; font-size: .84rem; color: #c2b9b0; }
.stat-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--accent); background: var(--accent-bg); border-radius: 8px; }
.stat strong { display: block; margin-top: 12px; font-size: clamp(1.2rem, 1.8vw, 1.6rem); font-weight: 700; overflow-wrap: anywhere; letter-spacing: -.025em; }
.stat small { display: block; margin-top: 5px; color: var(--soft); font-size: .78rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 15px; margin-top: 22px; }
.panel { padding: 18px 19px; }
.panel .section-head { margin-bottom: 15px; }
.node-list, .order-list, .ticket-list { display: grid; gap: 8px; }
.node-row, .record, .quick-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  border-radius: 8px; border: 1px solid var(--line); background: #151412; min-width: 0;
}
.node-info, .quick-link div, .record-main { min-width: 0; flex: 1; }
.node-info strong, .quick-link strong, .record strong { display: block; color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.node-info small, .quick-link small, .record small { display: block; color: var(--soft); margin-top: 4px; font-size: .78rem; overflow-wrap: anywhere; }
.node-code { display: grid; place-items: center; width: 35px; height: 34px; flex: none; border-radius: 7px; color: #ffc7a8; background: #42281c; font-size: .73rem; letter-spacing: .055em; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: #c1b8af; background: #2a2724; border-radius: 999px; white-space: nowrap; font-size: .75rem; font-weight: 600; }
.pill.good { color: var(--green); background: var(--green-bg); }
.pill.warn { color: #ffba85; background: #3d2a1e; }
.pill.bad { color: var(--red); background: #3d2523; }
.pill .status-dot { width: 5px; height: 5px; box-shadow: none; }
.quick-list { display: grid; gap: 8px; }
.quick-link:hover { border-color: #604232; background: var(--surface-hover); }
.quick-link > svg { color: var(--accent); }
.node-caption, .hint, .empty { color: var(--soft); line-height: 1.6; font-size: .9rem; }
.node-caption { margin-top: 12px; font-size: .82rem; }
.empty { padding: 13px 0; }
.empty .button { margin-top: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.plan { display: flex; flex-direction: column; gap: 13px; padding: clamp(15px, 2.4vw, 26px); }
.plan.featured { border-color: #a8633e; background: linear-gradient(155deg, #2b211a, var(--surface) 67%); }
.plan h2 { font-size: 1.2rem; }
.price { font-size: 2rem; font-weight: 700; letter-spacing: -.045em; }
.price small { font-size: .83rem; color: var(--soft); font-weight: 400; letter-spacing: 0; }
.plan ul { display: grid; gap: 8px; padding: 12px 0 0; margin: 0; border-top: 1px solid var(--line); list-style: none; }
.plan li { display: flex; gap: 7px; align-items: center; font-size: .86rem; }
.plan li svg { color: var(--accent); }
.plan .button { margin-top: auto; }
.form { display: grid; gap: 13px; }
.form label:not(.checkbox) { display: grid; gap: 6px; color: #ddd4cb; font-size: .87rem; font-weight: 600; }
input:not([type="checkbox"]), textarea {
  display: block; width: 100%; min-height: 41px; padding: 8px 10px; color: var(--text);
  background: #11100f; border: 1px solid #413a33; border-radius: 7px;
}
textarea { min-height: 100px; resize: vertical; }
.form .button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox { display: flex; align-items: center; gap: 7px; }
.form-error { color: var(--red); font-size: .86rem; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.record { flex-wrap: wrap; }
.record-main { flex-basis: 150px; }
.record form { flex: 1 0 100%; margin-top: 8px; }
.payment-info { white-space: pre-wrap; overflow-wrap: anywhere; }
.payment-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.payment-total strong { font-size: 1.6rem; color: var(--accent); }
.payment-options { margin: 0; padding: 0; border: none; }
.payment-options legend { padding: 0; margin-bottom: 6px; color: var(--soft); font-size: .875rem; }
.form .payment-options label { display: flex; align-items: center; gap: 4px; }
.payment-options > div { display: flex; gap: 20px; flex-wrap: wrap; }
.payment-code { margin: 0; text-align: center; }
.payment-code img { display: block; width: min(100%, 300px); height: auto; margin: auto; border-radius: 8px; }
.payment-code figcaption { margin-top: 6px; color: var(--soft); font-size: .875rem; }
.stack { display: grid; gap: 15px; }
.split { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr); gap: 15px; align-items: start; }
.split > .panel, .stack > .panel { min-width: 0; }
.guide-list { padding-left: 21px; margin: 10px 0 0; line-height: 1.7; color: var(--soft); }
.guide-list li + li { margin-top: 8px; }
.message { padding: 12px; border-radius: 8px; background: #151412; border: 1px solid var(--line); }
.message strong { font-size: .88rem; }
.message small { display: block; color: var(--soft); margin-top: 3px; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin-top: 8px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-header h2 { overflow-wrap: anywhere; }
dialog { width: min(460px, calc(100% - 24px)); padding: 23px; color: var(--text); background: var(--surface); border: 1px solid #4f4035; border-radius: 14px; }
dialog::backdrop { background: #000b; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-head h2 { font-size: 1.27rem; }
.dialog-switch { margin-top: 16px; font-size: .9rem; color: var(--soft); }
.dialog-switch button { color: var(--accent); }
.toast { position: fixed; z-index: 30; bottom: 20px; right: 20px; max-width: min(440px, calc(100% - 40px)); color: var(--text); background: #2b251f; padding: 12px 15px; border: 1px solid #80533c; border-radius: 8px; box-shadow: 0 8px 26px #0008; }
.toast.error { color: var(--red); }
.loading { padding: 28px 0; color: var(--soft); }

@media (max-width: 1050px) {
  .layout { grid-template-columns: 195px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .stat { padding: 12px 10px; }
  .stat-heading { gap: 6px; }
}
@media (max-width: 790px) {
  .layout { display: block; }
  .sidebar { position: fixed; width: min(250px, 83vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .sidebar.open { transform: none; visibility: visible; }
  .mobile-toggle { display: inline-flex !important; }
  .shade:not([hidden]) { display: block !important; position: fixed; inset: 0; z-index: 9; background: #0009; border: none; }
  .topbar { min-height: 61px; }
  .page { padding-top: 20px; }
  .hero { min-height: 265px; }
}
@media (max-width: 565px) {
  .topbar { padding-inline: 13px; }
  .breadcrumb, .header-actions { gap: 7px; }
  .breadcrumb > span { display: none; }
  .header-actions .button { padding-inline: 9px; }
  .header-actions .name { display: none; }
  .page { padding-inline: 13px; }
  .hero { min-height: 270px; padding: 21px 15px; background-position: 61% center; }
  .hero p { max-width: 263px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-grid, .plan-grid, .split { grid-template-columns: 1fr; }
  .panel { padding-inline: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
