:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "SF Pro Display", "PingFang TC", system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 500;
  color: #e2e8f0;
  background:
    radial-gradient(circle at 18% 14%, rgba(59, 130, 246, 0.24), transparent 38%),
    radial-gradient(circle at 86% 86%, rgba(16, 185, 129, 0.17), transparent 32%),
    linear-gradient(160deg, #020617 0%, #0f172a 50%, #111827 100%);
}

.app-shell,
.page-card,
.panel,
.nav-glass {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  padding: 1.2rem;
}

.nav-wrap {
  position: sticky;
  top: 1rem;
  z-index: 30;
  margin: 0 auto;
  max-width: 1200px;
}

.nav-glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.48);
}

.brand {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f8fafc;
  text-decoration: none;
  white-space: nowrap;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-identity {
  color: #d1fae5;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.15);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.brand-identity:hover {
  color: #ecfdf5;
  border-color: rgba(134, 239, 172, 0.65);
}

.nav-center,
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.52);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.persona {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  box-shadow:
    0 10px 22px rgba(2, 6, 23, 0.25),
    0 0 0 1px rgba(148, 163, 184, 0.08) inset;
  color: #e2e8f0;
  white-space: nowrap;
}

.persona-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #052e16;
  background: radial-gradient(circle at 30% 25%, rgba(134, 239, 172, 0.95), rgba(16, 185, 129, 0.65));
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.55), 0 0 20px rgba(74, 222, 128, 0.18);
}

.persona-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.persona-name {
  font-size: 0.9rem;
  font-weight: 750;
  color: #f8fafc;
}

.persona-name-link {
  text-decoration: none;
  cursor: pointer;
}

.persona-name-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.persona-tier {
  font-size: 0.78rem;
  font-weight: 650;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.member-badge.pro {
  border-color: rgba(74, 222, 128, 0.85);
  background: rgba(34, 197, 94, 0.18);
  color: #d1fae5;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35) inset, 0 0 16px rgba(74, 222, 128, 0.22);
}

.member-badge.starter {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.38);
  color: rgba(226, 232, 240, 0.65);
}

.member-badge.admin {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

.nav-item:hover {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.74);
  background: rgba(51, 65, 85, 0.65);
  transform: translateY(-1px);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.18) inset;
}

.nav-item.active {
  border-color: rgba(110, 231, 183, 0.78);
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35) inset;
}

.page-card {
  width: min(980px, 100%);
  margin: 1.15rem auto 0;
  padding: 2.4rem clamp(1.2rem, 2.5vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 48px rgba(2, 6, 23, 0.45);
}

.page-title {
  margin: 0 0 0.95rem;
  font-size: 2.5rem;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f8fafc;
}

.page-desc {
  margin: 0 0 1.2rem;
  max-width: 72ch;
  color: #cbd5e1;
  font-size: 1.1rem;
  line-height: 1.6;
}

.section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f1f5f9;
}

.section-subtitle {
  margin: 0.45rem 0 0;
  color: #94a3b8;
  font-size: 0.92rem;
}

.grid-2 {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
}

.metric-value {
  margin-top: 0.45rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #e2e8f0;
}

.metric-note {
  margin-top: 0.25rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.table-wrap {
  margin-top: 1.75rem;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
}

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

th,
td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.28);
  text-align: left;
  font-size: 1rem;
  color: #cbd5e1;
}

th {
  color: #e2e8f0;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.52);
}

tr:last-child td {
  border-bottom: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag.pro {
  border-color: rgba(110, 231, 183, 0.55);
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
}

.form-wrap {
  margin-top: 1.75rem;
  width: min(560px, 100%);
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
}

.field {
  margin-bottom: 0.95rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.65);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.92rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.7);
  cursor: pointer;
  transform: translateZ(0);
  will-change: transform, box-shadow;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px) scale(1.035);
  border-color: rgba(148, 163, 184, 0.78);
  background: rgba(51, 65, 85, 0.72);
  box-shadow:
    0 14px 30px rgba(2, 6, 23, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.12) inset;
}

.btn:active {
  transform: translateY(0) scale(0.995);
}

.btn-primary {
  border-color: rgba(59, 130, 246, 0.72);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.65), rgba(29, 78, 216, 0.85));
}

.btn-primary:hover {
  border-color: rgba(96, 165, 250, 0.86);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.72), rgba(29, 78, 216, 0.9));
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav-item {
    transition: none !important;
  }
  .btn:hover,
  .btn:active,
  .nav-item:hover {
    transform: none !important;
  }
}

.hint {
  margin-top: 0.7rem;
  color: #94a3b8;
  font-size: 0.92rem;
}

.signals-layout {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 680px;
  padding: 1rem;
}

.signal-list-card,
.chart-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(10px);
}

.signal-list-card {
  padding: 1rem;
}

.symbol-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.symbol-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(100, 116, 139, 0.52);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(30, 41, 59, 0.58);
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.symbol-item:hover {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.72);
  background: rgba(51, 65, 85, 0.65);
}

.symbol-item.active {
  border-color: rgba(110, 231, 183, 0.75);
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
}

.chart-card {
  padding: 0;
  overflow: hidden;
  min-height: 640px;
}

.tv-chart-container {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border-radius: 18px;
}

.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: min(420px, calc(100vw - 2.5rem));
  padding: 1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(110, 231, 183, 0.38);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 70px rgba(2, 6, 23, 0.62),
    0 0 26px rgba(74, 222, 128, 0.16);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 850;
  color: #dcfce7;
  letter-spacing: 0.01em;
}

.toast-body {
  margin: 0;
  color: #e2e8f0;
  line-height: 1.55;
}

.toast-progress {
  margin-top: 0.75rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.toast-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.9), rgba(59, 130, 246, 0.85));
  transform-origin: left center;
  transform: scaleX(1);
}

.toast.show .toast-progress > span {
  animation: toastProgress 2s linear forwards;
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.pro-glow {
  position: relative;
}

.pro-glow::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow:
    0 0 0 1px rgba(134, 239, 172, 0.32) inset,
    0 0 22px rgba(74, 222, 128, 0.22);
  pointer-events: none;
  opacity: 0.55;
  animation: proBreathe 2.6s ease-in-out infinite;
}

@keyframes proBreathe {
  0% {
    opacity: 0.45;
    box-shadow:
      0 0 0 1px rgba(134, 239, 172, 0.28) inset,
      0 0 16px rgba(74, 222, 128, 0.18);
  }
  50% {
    opacity: 0.9;
    box-shadow:
      0 0 0 1px rgba(134, 239, 172, 0.5) inset,
      0 0 28px rgba(74, 222, 128, 0.38);
  }
  100% {
    opacity: 0.45;
    box-shadow:
      0 0 0 1px rgba(134, 239, 172, 0.28) inset,
      0 0 16px rgba(74, 222, 128, 0.18);
  }
}

.popular-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.55);
  background: rgba(34, 197, 94, 0.14);
  color: #dcfce7;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

@media (max-width: 960px) {
  .nav-glass {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-center,
  .nav-right {
    width: 100%;
  }

  .signals-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .chart-card,
  .tv-chart-container {
    min-height: 520px;
  }
}
