:root {
  --bg: #eaf0fb;
  --bg-deep: #d8e4f7;
  --text: #10172b;
  --text-soft: #5e6881;
  --accent: #4a78ff;
  --accent-deep: #3258c9;
  --accent-soft: rgba(83, 126, 255, 0.14);
  --accent-pop: #20e9ff;
  --accent-warm: #ffd56a;
  --card: rgba(255, 255, 255, 0.58);
  --card-strong: rgba(255, 255, 255, 0.74);
  --stroke: rgba(255, 255, 255, 0.66);
  --shadow: 0 18px 46px rgba(30, 60, 140, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft Yahei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 0% 0%, #f7faff 0%, var(--bg) 36%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(6px);
}

.bg-1 {
  width: 460px;
  height: 460px;
  top: -170px;
  left: -140px;
  border-radius: 62% 38% 47% 53%;
  background: rgba(133, 168, 255, 0.28);
}

.bg-2 {
  width: 410px;
  height: 410px;
  right: -120px;
  top: 140px;
  border-radius: 44% 56% 38% 62%;
  background: rgba(145, 211, 255, 0.24);
}

.bg-3 {
  width: 340px;
  height: 340px;
  right: 22%;
  bottom: -130px;
  border-radius: 50%;
  background: rgba(117, 156, 255, 0.2);
}

.app-shell {
  width: min(1280px, 94vw);
  margin: 18px auto 42px;
  position: relative;
  z-index: 2;
}

.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
}

.glass-soft {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar {
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 12px;
  z-index: 20;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.brand-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #6f8dff, #8ea7ff, #8fd4ff, #5f77f1, #6f8dff);
}

.brand-text h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.liquid-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -1px 0 rgba(93, 116, 199, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.liquid-segment.small {
  padding: 3px;
}

.segment-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 84px;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(215, 227, 255, 0.96));
  box-shadow: 0 7px 16px rgba(63, 94, 192, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1), width 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 0;
}

.main-nav {
  justify-self: stretch;
}

.nav-btn,
.time-btn,
.auth-tab {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.2s ease;
  white-space: nowrap;
}

.time-btn {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.auth-tab {
  padding: 8px 16px;
}

.nav-btn:hover,
.time-btn:hover,
.auth-tab:hover {
  transform: translateY(-1px);
}

.nav-btn.active,
.time-btn.active,
.auth-tab.active {
  color: #17285f;
}

main {
  margin-top: 14px;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: sectionIn 0.34s ease;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.04rem;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #324fbd;
  background: rgba(101, 135, 255, 0.16);
}

.tag {
  font-size: 0.7rem;
}

.hint {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, opacity 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #4d7eff 0%, #3b63e0 60%, #2f56ce 100%);
  box-shadow: 0 10px 20px rgba(58, 87, 185, 0.32);
}

.tag-accent {
  border: 1px solid rgba(88, 125, 255, 0.28);
  position: relative;
  padding-left: 16px;
}

.tag-accent::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--accent-pop) 60%, #64a4ff 100%);
  box-shadow: 0 0 8px rgba(32, 233, 255, 0.7);
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(64, 88, 160, 0.14);
}

.btn.sm {
  padding: 7px 11px;
  font-size: 0.8rem;
}

.top-logout-btn {
  color: #fff;
  background: #d93045;
  border: 1px solid rgba(166, 21, 45, 0.55);
  box-shadow: 0 8px 16px rgba(166, 21, 45, 0.24);
}

.top-logout-btn:hover {
  background: #c7233a;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(153, 18, 40, 0.28);
}

.home-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.home-intro-card {
  background:
    radial-gradient(circle at 84% 18%, rgba(116, 145, 255, 0.24), transparent 44%),
    radial-gradient(circle at 18% 82%, rgba(149, 220, 255, 0.2), transparent 38%),
    var(--card);
}

.home-intro-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.home-intro-head h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.42rem, 2.2vw, 2.06rem);
  line-height: 1.2;
}

.home-intro-head p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.66;
  max-width: 820px;
}

.home-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  min-width: 260px;
}

.home-topic-card {
  padding-top: 14px;
}

.topic-segment {
  margin-top: 2px;
  display: flex;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
}

.home-topic-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.home-topic-btn.active {
  color: #17285f;
}

.topic-meta {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.home-article-list {
  display: grid;
  gap: 10px;
}

.home-article-item {
  border: 1px solid rgba(92, 116, 186, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  padding: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: left;
}

.home-article-item:hover {
  transform: translateY(-1px);
  border-color: rgba(80, 120, 255, 0.38);
  box-shadow: 0 12px 24px rgba(58, 93, 196, 0.14);
}

.article-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.article-item-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.article-topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(88, 125, 255, 0.24);
  background: rgba(93, 126, 255, 0.12);
  color: #3250b3;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.article-topic::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--accent-pop) 60%, #64a4ff 100%);
  box-shadow: 0 0 8px rgba(32, 233, 255, 0.65);
}

.article-item-summary {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.58;
  font-size: 0.88rem;
}

.article-item-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-item-meta span {
  border-radius: 999px;
  border: 1px solid rgba(72, 98, 173, 0.16);
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 9px;
  font-size: 0.74rem;
  color: #3f557d;
}

.article-hot {
  color: #795412 !important;
  background: rgba(255, 222, 143, 0.34) !important;
  border-color: rgba(190, 135, 34, 0.28) !important;
}

.home-article-empty {
  border: 1px dashed rgba(102, 129, 198, 0.28);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.home-article-modal {
  width: min(900px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.article-modal-scroll {
  margin-top: 8px;
  max-height: calc(88vh - 84px);
  overflow: auto;
  padding-right: 2px;
}

.article-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.article-modal-meta span {
  border-radius: 999px;
  border: 1px solid rgba(72, 98, 173, 0.16);
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 9px;
  font-size: 0.76rem;
  color: #3f557d;
}

.article-modal-content {
  border-radius: 14px;
  border: 1px solid rgba(77, 105, 184, 0.16);
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
}

.article-modal-content p {
  margin: 0 0 10px;
  line-height: 1.72;
  color: #24365b;
  font-size: 0.9rem;
}

.article-modal-content p:last-child {
  margin-bottom: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.metric {
  min-height: 104px;
}

.metric span {
  font-size: 0.84rem;
  color: var(--text-soft);
}

.metric strong {
  margin-top: 10px;
  display: block;
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  letter-spacing: 0.01em;
}

.trade-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stats-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-chip {
  border-radius: 12px;
  border: 1px solid rgba(96, 122, 193, 0.18);
  background: rgba(255, 255, 255, 0.62);
  padding: 9px 11px;
}

.stat-chip span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.stat-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.chart-container {
  position: relative;
}

#pnlChart {
  width: 100%;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(238, 243, 255, 0.88));
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: rgba(16, 23, 43, 0.88);
  backdrop-filter: blur(8px);
  color: #f0f4ff;
  font-size: 12px;
  line-height: 1.6;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip .tt-profit {
  color: #2fbf9f;
  font-weight: 600;
}

.chart-tooltip .tt-label {
  color: rgba(240, 244, 255, 0.6);
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 352px;
  overflow: auto;
  padding-right: 2px;
}

.order-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-all-btn {
  border-color: rgba(74, 120, 255, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(234, 241, 255, 0.78));
  color: #2a4bb2;
  font-weight: 700;
}

.view-all-btn:hover {
  box-shadow: 0 8px 16px rgba(74, 120, 255, 0.18);
}

.orders-card .order-list {
  margin-top: 12px;
}

.order-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(90, 117, 187, 0.2);
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
}

.order-item .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-item h4 {
  margin: 0;
  font-size: 0.95rem;
}

.order-item p {
  margin: 7px 0 9px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.order-preview-note p {
  margin: 0;
  font-size: 0.8rem;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #3350b7;
  background: rgba(74, 120, 255, 0.13);
}

.history-card {
  margin-top: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 730px;
}

th,
td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid rgba(72, 103, 186, 0.14);
  font-size: 0.84rem;
}

thead th {
  color: var(--text-soft);
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status.running {
  color: #8f5204;
  background: rgba(255, 186, 72, 0.24);
}

.status.done {
  color: #2f4fb8;
  background: rgba(100, 128, 255, 0.2);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-card,
.records-card,
.reserved-card {
  grid-column: 1 / -1;
}

.account-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-meta > div:nth-child(1) {
  text-align: left;
}

.account-meta > div:nth-child(2) {
  text-align: center;
}

.account-meta > div:nth-child(3) {
  text-align: right;
}

.account-meta span {
  display: block;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.account-meta strong {
  margin-top: 4px;
  display: block;
  font-size: 1.02rem;
}

.label {
  display: block;
  margin: 8px 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.bank-info {
  border-radius: 12px;
  border: 1px solid rgba(80, 105, 180, 0.2);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.bank-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.82rem;
}

.bank-line span:first-child {
  color: var(--text-soft);
}

.bank-line span:last-child {
  font-weight: 700;
  text-align: right;
}

code {
  display: block;
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(80, 105, 180, 0.2);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.field {
  margin-bottom: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(70, 96, 170, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
}

input:focus,
select:focus {
  outline: 0;
  border-color: rgba(74, 120, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(74, 120, 255, 0.18);
}

input[type="file"] {
  padding: 8px 10px;
}

input[type="file"]::file-selector-button {
  border: 1px solid rgba(80, 111, 194, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: #2f478f;
  font-weight: 700;
  padding: 6px 10px;
  margin-right: 10px;
  cursor: pointer;
}

.upload-hint {
  margin-top: 6px;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  border: 1px solid rgba(70, 96, 170, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(232, 239, 255, 0.76));
  color: var(--text);
  padding: 10px 38px 10px 12px;
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:hover {
  border-color: rgba(74, 120, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(74, 120, 255, 0.14);
}

.custom-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid #4f69c7;
  border-bottom: 2px solid #4f69c7;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.custom-select.open .custom-select-arrow {
  transform: translateY(-35%) rotate(-135deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: none;
  border-radius: 12px;
  border: 1px solid rgba(86, 113, 191, 0.22);
  background: rgba(248, 251, 255, 0.95);
  box-shadow: 0 14px 30px rgba(47, 76, 153, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px;
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 10px;
  text-align: left;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.custom-select-option:hover {
  background: rgba(99, 130, 235, 0.12);
}

.custom-select-option.active {
  background: rgba(95, 127, 235, 0.18);
  color: #27419d;
}

.switch-row {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 10px;
}

.switch-row.compact {
  margin: 0;
}

.switch-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text-soft);
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.switch-btn.active {
  color: #24398d;
  background: rgba(115, 146, 255, 0.2);
}

.method-panel {
  display: none;
}

.method-panel.active {
  display: block;
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.records-card .switch-row.compact {
  margin-bottom: 2px;
}

.records-card .record-list {
  margin-top: 14px;
}

.record-item {
  border-radius: 14px;
  border: 1px solid rgba(75, 102, 176, 0.18);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.record-item .line-1 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.record-item .line-2 {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.reserved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reserved-actions .btn[disabled] {
  opacity: 0.64;
  cursor: not-allowed;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 26, 57, 0.36);
  z-index: 90;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  border-radius: 22px;
  padding: 16px;
  width: min(560px, 96vw);
}

.auth-modal {
  width: min(620px, 96vw);
}

.order-modal {
  width: min(520px, 96vw);
}

.products-modal {
  width: min(980px, 96vw);
}

.products-hint {
  margin: 6px 0 12px;
}

.all-products-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 2px;
}

.all-product-item .all-product-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.all-product-item h4 {
  margin: 0;
}

.modal-body {
  margin: 8px 0 10px;
}

.quick-amounts {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 0;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.auth-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.auth-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.auth-head p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.auth-tabs {
  margin-top: 10px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.check-row input {
  width: auto;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #3354be;
  font-weight: 700;
  cursor: pointer;
}

.agreement-modal {
  width: min(760px, 96vw);
}

.agreement-content {
  max-height: 54vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(77, 105, 184, 0.16);
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
  line-height: 1.7;
  color: #2a3859;
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 20px;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  background: rgba(23, 36, 78, 0.92);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 96;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .main-nav {
    justify-self: flex-start;
  }

  .topbar-actions {
    justify-self: flex-start;
  }

  .trade-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .home-intro-head {
    flex-direction: column;
  }

  .home-quick-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-meta {
    grid-template-columns: 1fr;
  }

  .account-meta > div:nth-child(1),
  .account-meta > div:nth-child(2),
  .account-meta > div:nth-child(3) {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: 96vw;
    margin-top: 10px;
  }

  .topbar {
    border-radius: 18px;
    padding: 12px;
  }

  .card {
    border-radius: 18px;
    padding: 14px;
  }

  .metric-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .home-topic-btn {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .all-products-list {
    grid-template-columns: 1fr;
  }

  .address-row {
    flex-direction: column;
    align-items: stretch;
  }
}

#authBtn.profile-icon-btn {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

#authBtn.profile-icon-btn::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(47, 74, 156, 0.95);
  background: rgba(223, 232, 255, 0.95);
}

#authBtn.profile-icon-btn::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 16px;
  height: 8px;
  transform: translateX(-50%);
  border: 2px solid rgba(47, 74, 156, 0.95);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgba(223, 232, 255, 0.9);
}

