:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink: #141a22;
  --muted: #667586;
  --line: rgba(199, 210, 222, 0.74);
  --line-strong: rgba(132, 146, 166, 0.32);
  --accent: #2563eb;
  --accent-dark: #155ee7;
  --accent-soft: rgba(0, 122, 255, 0.1);
  --green: #0f766e;
  --amber: #c47a14;
  --warn: #b54708;
  --off: #7a8494;
  --shadow: 0 14px 38px rgba(31, 42, 68, 0.08);
  --shadow-soft: 0 8px 22px rgba(31, 42, 68, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-optical-sizing: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-body {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 14px auto 14px 14px;
  width: 248px;
  color: #1d2732;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(132, 146, 166, 0.16);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(23, 52, 95, 0.14);
}

.brand strong {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: #334155;
  font-weight: 680;
  touch-action: manipulation;
  transition: background 160ms ease, color 160ms ease, transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms ease;
}

.nav-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #718096;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav a:hover,
.nav a.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  box-shadow: inset 0 0 0 1px rgba(132, 146, 166, 0.12);
}

.nav a.is-active .nav-icon {
  color: var(--accent);
}

.nav a:active {
  transform: scale(0.985);
}

.nav-label {
  margin: 15px 12px 5px;
  color: #7b8998;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.main {
  margin-left: 276px;
  min-height: 100vh;
  padding: 18px 24px 36px 0;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(165%);
  box-shadow: var(--shadow-soft);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 6px 6px 12px;
  border: 1px solid rgba(199, 210, 222, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 18px rgba(31, 42, 68, 0.05);
}

.account form {
  margin: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  font-weight: 820;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(150%);
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.stat strong {
  display: block;
  margin-top: 18px;
  color: #111827;
  font-size: 34px;
  line-height: 1;
  font-weight: 820;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.upload-panel {
  margin-bottom: 18px;
}

.upload-file {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.upload-file strong {
  color: #182230;
  font-size: 13px;
  font-weight: 760;
}

.upload-file span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.upload-progress-cell {
  min-width: 230px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.progress-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(199, 210, 222, 0.58);
  box-shadow: inset 0 1px 2px rgba(31, 42, 68, 0.08);
}

.progress-bar {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2563eb);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  transition: width 180ms ease;
}

.panel {
  overflow: hidden;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.package-groups {
  display: grid;
  gap: 14px;
}

.package-group .panel-head {
  background: rgba(255, 255, 255, 0.64);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(199, 210, 222, 0.58);
  background: rgba(255, 255, 255, 0.54);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(199, 210, 222, 0.52);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  background: rgba(248, 250, 252, 0.64);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.58);
}

.actions {
  position: sticky;
  left: 0;
  text-align: right;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 12px 0 18px rgba(31, 42, 68, 0.04);
  z-index: 1;
}

th.actions {
  background: rgba(248, 250, 252, 0.92);
  z-index: 2;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: #007aff;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2);
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms ease, filter 160ms ease;
}

.button:hover {
  background: #0a84ff;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.24);
}

.button:active {
  transform: scale(0.985);
  box-shadow: 0 6px 14px rgba(0, 122, 255, 0.2);
}

.button:focus-visible,
.mini-button:focus-visible,
.link-button:focus-visible,
.nav a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid rgba(199, 210, 222, 0.72);
  box-shadow: 0 8px 18px rgba(31, 42, 68, 0.06);
}

.button.danger {
  background: var(--warn);
  box-shadow: 0 10px 20px rgba(181, 71, 8, 0.18);
}

.button.danger:hover {
  background: #9a3412;
  box-shadow: 0 12px 24px rgba(181, 71, 8, 0.22);
}

.button.full {
  width: 100%;
}

.icon-link, .link-button {
  color: var(--accent);
  font-weight: 760;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-weight: 780;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), background 160ms ease;
}

.mini-button:hover {
  background: rgba(37, 99, 235, 0.15);
}

.mini-button:active,
.link-button:active {
  transform: scale(0.97);
}

.mini-button + .mini-button {
  margin-left: 6px;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), color 160ms ease;
}

.link-button.danger {
  color: var(--warn);
}

.inline-form {
  display: inline;
  margin-left: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.78);
  color: #435160;
  font-size: 12px;
  font-weight: 760;
}

.pill.ok {
  background: rgba(209, 250, 229, 0.78);
  color: #0f5c4f;
}

.pill.off {
  background: rgba(226, 232, 240, 0.78);
  color: var(--off);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty-panel {
  padding: 26px;
}

.guide-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.guide-nav {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.guide-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #334155;
  font-weight: 760;
}

.guide-nav a:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.guide-stack {
  display: grid;
  gap: 14px;
}

.guide-panel {
  scroll-margin-top: 96px;
}

.guide-content {
  padding: 18px 20px 24px;
}

.guide-content h2,
.guide-content h3,
.guide-content h4,
.guide-content h5 {
  margin: 22px 0 10px;
}

.guide-content h2:first-child,
.guide-content h3:first-child {
  margin-top: 0;
}

.guide-content p,
.guide-content li {
  color: #263241;
}

.guide-content p {
  margin: 10px 0;
}

.guide-content ul,
.guide-content ol {
  margin: 10px 0 14px;
  padding-left: 24px;
}

.guide-content li + li {
  margin-top: 5px;
}

.guide-content blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.32);
  border-radius: 0 8px 8px 0;
  background: rgba(37, 99, 235, 0.06);
  color: var(--muted);
}

.guide-content code {
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(226, 232, 240, 0.72);
  color: #1f2937;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.guide-content pre {
  overflow-x: auto;
  margin: 12px 0 16px;
  padding: 13px 14px;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
}

.guide-content pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.guide-table-wrap {
  overflow-x: auto;
  margin: 12px 0 16px;
}

.guide-table-wrap table {
  min-width: 560px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.message {
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: rgba(232, 246, 244, 0.84);
  color: #0f5c4f;
  font-weight: 650;
}

.message.danger {
  border-color: rgba(181, 71, 8, 0.18);
  background: rgba(255, 240, 232, 0.9);
  color: var(--warn);
}

.modal-open {
  overflow: hidden;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(6px);
}

.confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border: 1px solid rgba(199, 210, 222, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 20px;
}

.confirm-dialog p {
  margin: 10px 0 0;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-panel {
  max-width: 760px;
  padding: 20px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #354052;
  font-size: 13px;
  font-weight: 760;
}

.field small {
  color: var(--muted);
}

.input, input[type="text"], input[type="password"], input[type="file"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(199, 210, 222, 0.84);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="file"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.checkbox {
  width: 18px;
  height: 18px;
}

.mono, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.error {
  color: var(--warn);
  font-weight: 650;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.token-result {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.token-result label {
  display: block;
  margin-bottom: 8px;
  color: #354052;
  font-size: 13px;
  font-weight: 760;
}

.token-meta {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(199, 210, 222, 0.84);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(248, 250, 252, 0.74);
}

.token-box {
  min-height: 116px;
  resize: vertical;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.92), rgba(31, 41, 55, 0.95)),
    #18212b;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 48px;
  width: min(980px, calc(100vw - 32px));
}

.login-copy {
  color: white;
}

.login-copy h1 {
  max-width: 620px;
  font-size: 42px;
  line-height: 1.14;
}

.login-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: #d8edea;
  font-size: 16px;
  line-height: 1.8;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-panel {
  width: 100%;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.login-brand {
  color: var(--ink);
  margin-bottom: 24px;
}

.detail-row pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
}

@media (max-width: 980px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    width: 100%;
    z-index: 8;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 10px 12px;
  }

  .main {
    margin-left: 0;
    padding: 14px;
  }

  .brand {
    min-height: 44px;
    padding: 0 8px 0 0;
    border-bottom: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav {
    display: flex;
    gap: 6px;
    margin-top: 0;
    overflow-x: auto;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
  }

  .nav-label {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 10px;
  }

  .topbar {
    top: 12px;
  }

  .stats, .split {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-copy h1 {
    font-size: 32px;
  }
}

@media (max-width: 720px) {
  .sidebar {
    grid-template-columns: 1fr;
  }

  .brand {
    padding-bottom: 4px;
  }

  .topbar,
  .section-toolbar,
  .guide-layout,
  .panel-head,
  .account,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account form,
  .account .button,
  .form-actions .button,
  .confirm-actions .button {
    width: 100%;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  th, td {
    padding: 12px;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-nav {
    position: static;
  }
}

.raybot-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f5f5f7;
}

.raybot-login {
  width: min(390px, 100%);
}

.raybot-login-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(23, 52, 95, 0.12);
}

.raybot-login-card {
  width: 100%;
  border: 1px solid rgba(199, 210, 222, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 44px rgba(31, 42, 68, 0.1);
  padding: 30px;
}

.raybot-login-card-head {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.raybot-login-card h1 {
  margin: 0;
  color: #141a22;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
}

.raybot-login-error {
  margin-bottom: 18px;
  border: 1px solid rgba(181, 71, 8, 0.18);
}

.raybot-login-field {
  margin-bottom: 18px;
}

.raybot-login-field label {
  display: block;
  margin-bottom: 9px;
  color: #354052;
  font-size: 13px;
  font-weight: 760;
}

.raybot-login-field input {
  height: 46px;
  border: 1px solid rgba(201, 212, 224, 0.9);
  border-radius: 8px;
  padding: 0 14px;
  color: #151f2c;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.raybot-login-field input:focus {
  outline: 0;
  border-color: #2563eb;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.raybot-login-button {
  height: 48px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: #007aff;
  font-size: 15px;
  font-weight: 780;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.22);
  touch-action: manipulation;
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease, filter 180ms ease;
}

.raybot-login-button:hover {
  background: #0a84ff;
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.24);
}

.raybot-login-button:active {
  transform: scale(0.985);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.2);
}

.raybot-login-button:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.16),
    0 16px 28px rgba(37, 99, 235, 0.24);
}

@media (max-width: 520px) {
  .raybot-login-mark {
    width: 48px;
    height: 48px;
  }

  .raybot-login-card {
    padding: 26px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .mini-button,
  .link-button,
  .nav a,
  .input,
  input[type="text"],
  input[type="password"],
  input[type="file"],
  input[type="number"],
  select,
  textarea,
  .raybot-login-button,
  .raybot-login-field input {
    transition: none;
  }

  .button:active,
  .mini-button:active,
  .link-button:active,
  .nav a:active,
  .raybot-login-button:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar,
  .topbar,
  .account,
  .panel,
  .stat,
  .raybot-login-card {
    background: #fff;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .sidebar,
  .topbar,
  .account,
  .panel,
  .stat,
  .button.secondary,
  .input,
  input[type="text"],
  input[type="password"],
  input[type="file"],
  input[type="number"],
  select,
  textarea,
  .raybot-login-card {
    border-color: #1f2937;
  }
}

@media (max-width: 560px) {
  .raybot-login-card {
    padding: 28px 22px 24px;
  }
}
