* {
  box-sizing: border-box;
}

:root {
  --bg-main: #0a0f1b;
  --bg-surface: rgba(18, 23, 40, 0.78);
  --bg-card: #141b2d;
  --bg-soft: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --primary: #02b977;
  --primary-soft: rgba(2, 185, 119, 0.14);
  --accent: #f3ba2f;
  --accent-soft: rgba(243, 186, 47, 0.14);
  --danger: #f87171;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  appearance: none;
}

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  min-height: 100vh;
}

.global-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.18;
}

.orb-gold {
  top: -120px;
  right: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(243, 186, 47, 0.68) 0%, transparent 70%);
}

.orb-green {
  bottom: -120px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(2, 185, 119, 0.45) 0%, transparent 68%);
}

.orb-blue {
  top: 30%;
  left: 28%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 72%);
  opacity: 0.08;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 100%);
}

.auth-panel {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-layout {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 440px);
  gap: 22px;
  align-items: stretch;
}

.auth-showcase,
.auth-card,
.panel-surface,
.panel,
.sidebar-inner,
.summary-card,
.list-item,
.strategy-card,
.toast {
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-showcase,
.auth-card {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16, 22, 36, 0.92) 0%, rgba(13, 18, 30, 0.86) 100%);
}

.auth-showcase {
  position: relative;
  padding: 32px;
  overflow: hidden;
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(243, 186, 47, 0.12) 0%, transparent 28%),
    radial-gradient(circle at 78% 82%, rgba(2, 185, 119, 0.12) 0%, transparent 30%);
  pointer-events: none;
}

.brand-chip,
.auth-brand,
.topbar-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-chip {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.showcase-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.showcase-logo,
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0a0f1b;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  box-shadow: 0 16px 40px rgba(2, 185, 119, 0.25);
}

.showcase-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 22px;
}

.showcase-title {
  font-size: 18px;
  font-weight: 700;
}

.showcase-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-showcase h1 {
  max-width: 680px;
  margin: 24px 0 12px;
  font-size: 34px;
  line-height: 1.24;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.auth-desc {
  max-width: 720px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.showcase-notice,
.auth-warning,
.sidebar-note {
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.showcase-notice {
  max-width: 720px;
  margin-top: 20px;
}

.notice-title,
.auth-warning-title,
.sidebar-note-title {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--accent);
}

.showcase-notice p,
.auth-warning p,
.sidebar-note p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
}

.showcase-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.showcase-point {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.showcase-point strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.showcase-point span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-card {
  padding: 28px;
  align-self: center;
}

.auth-brand {
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-card h2 {
  margin: 14px 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.auth-card-desc {
  margin: 0 0 22px;
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 13px;
}

.auth-warning {
  margin-bottom: 18px;
  background: rgba(243, 186, 47, 0.08);
  border-color: rgba(243, 186, 47, 0.18);
}

.auth-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.auth-form label,
.form-grid label {
  display: grid;
  gap: 8px;
}

.auth-form span,
.form-grid span {
  color: #b8c4d8;
  font-size: 12px;
  font-weight: 600;
}

.auth-form input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-grid textarea {
  min-height: 100px;
  resize: vertical;
}

.auth-form input::placeholder,
.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: #6f829b;
}

.auth-form input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(2, 185, 119, 0.38);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 0 0 3px rgba(2, 185, 119, 0.1);
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.primary-btn,
.ghost-btn,
.pill,
.nav-link {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
}

.primary-btn {
  color: #ffffff;
  background: #02b977;
  box-shadow: 0 10px 24px rgba(2, 185, 119, 0.18);
}

.ghost-btn {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.08);
}

.primary-btn:hover,
.ghost-btn:hover,
.pill:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.primary-btn.small,
.ghost-btn.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.auth-tips {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
}

.auth-tips p {
  margin: 0;
}

.console-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
}

.sidebar-inner {
  border-radius: 18px;
  padding: 18px 16px;
  background: linear-gradient(180deg, rgba(18, 23, 40, 0.88) 0%, rgba(13, 18, 30, 0.88) 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
}

.brand-subtitle,
.panel-hint,
.topbar p,
.user-brief-label,
.user-brief #authorUid,
.summary-card-sub,
.summary-card-title,
.list-item-meta,
.strategy-card-meta,
.note-list,
.empty-state {
  color: var(--text-muted);
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
}

.sidebar-caption {
  margin: 2px 0 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  min-height: 40px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 13px;
}

.nav-link.active {
  color: #ffffff;
  background: rgba(2, 185, 119, 0.16);
  border-color: rgba(2, 185, 119, 0.22);
  box-shadow: none;
}

.sidebar-note {
  margin-top: 18px;
}

.content {
  min-width: 0;
  padding: 0 4px 24px 0;
}

.panel-surface,
.panel {
  background: linear-gradient(180deg, rgba(18, 23, 40, 0.84) 0%, rgba(14, 19, 31, 0.86) 100%);
  border-radius: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.topbar-kicker {
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
}

.topbar h2 {
  margin: 8px 0 6px;
  font-size: 26px;
  letter-spacing: -0.025em;
}

.topbar p {
  margin: 0;
  line-height: 1.6;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-brief {
  min-width: 150px;
  padding: 10px 12px;
  text-align: right;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-brief-label {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-brief #authorDisplayName {
  font-weight: 700;
  font-size: 14px;
}

.user-brief #authorUid {
  margin-top: 6px;
  font-size: 12px;
}

.toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 120;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(16, 22, 36, 0.96);
}

.toast.success {
  border-color: rgba(2, 185, 119, 0.28);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.28);
}

.summary-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 14px;
}

.panel-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-grid.strategy-layout {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  align-items: start;
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.panel-hint {
  font-size: 12px;
  line-height: 1.6;
}

.card-list,
.list-stack {
  display: grid;
  gap: 12px;
}

.summary-card,
.list-item,
.strategy-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.summary-card::before,
.strategy-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.summary-card-title {
  font-size: 12px;
}

.summary-card-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.summary-card-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.list-item-title,
.strategy-card-title {
  font-size: 15px;
  font-weight: 700;
}

.list-item-meta,
.strategy-card-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
}

.strategy-card-top,
.strategy-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.strategy-card-bottom {
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tag-row,
.inline-actions,
.filter-pills,
.form-actions,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge,
.type-badge,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

.status-badge.published {
  background: rgba(2, 185, 119, 0.16);
  color: #6ee7b7;
}

.status-badge.paused,
.status-badge.archived {
  background: rgba(243, 186, 47, 0.15);
  color: #fcd34d;
}

.type-badge {
  background: rgba(243, 186, 47, 0.13);
  color: #f8d67c;
}

.tag-pill {
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7f5;
}

.pill {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 12px;
}

.pill.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(243, 186, 47, 0.32);
}

.sub-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.note-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.empty-state {
  padding: 20px 10px;
  text-align: center;
  line-height: 1.8;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .auth-layout,
  .panel-grid.strategy-layout {
    grid-template-columns: 1fr;
  }

  .auth-showcase h1 {
    font-size: 30px;
  }
}

@media (max-width: 1080px) {
  .console-shell,
  .panel-grid.two-columns,
  .form-grid,
  .sub-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .auth-panel,
  .console-shell {
    padding: 16px;
  }

  .auth-showcase,
  .auth-card,
  .sidebar-inner,
  .topbar,
  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .showcase-points {
    grid-template-columns: 1fr;
  }

  .auth-showcase h1,
  .topbar h2 {
    font-size: 24px;
  }

  .topbar,
  .topbar-actions,
  .strategy-card-top,
  .strategy-card-bottom,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-brief {
    width: 100%;
    text-align: left;
  }
}
