.meme-trench-page {
  padding-bottom: 24px;
}

.meme-trench-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 260px);
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 180px);
}

.meme-trench-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}

.meme-trench-center {
  display: grid;
  grid-template-rows: auto minmax(340px, 1.35fr) minmax(220px, 1fr);
  gap: 10px;
  min-width: 0;
}

.meme-trench-top-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.meme-trench-module {
  display: flex;
  flex-direction: column;
  min-height: 108px;
  max-height: 220px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 251, 0.98));
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meme-trench-module--alert {
  border-color: rgba(201, 148, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(201, 148, 0, 0.18), 0 8px 24px rgba(201, 148, 0, 0.08);
}

.meme-trench-module--placeholder,
.meme-trench-module--closed {
  opacity: 0.92;
}

.meme-trench-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.meme-trench-module-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.meme-trench-module-select {
  max-width: 118px;
  min-height: 26px;
  padding: 2px 6px;
  font-size: 11px;
}

.meme-trench-module-badge {
  font-size: 11px;
  color: var(--warning);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.meme-trench-module-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px 10px;
}

.meme-trench-module-empty,
.meme-trench-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.meme-trench-feed-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.meme-trench-feed-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meme-trench-feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.meme-trench-feed-symbol {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.meme-trench-feed-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.meme-trench-feed-meta {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.meme-trench-ca {
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.meme-trench-ca:hover {
  text-decoration: underline;
}

.meme-trench-kol-label {
  color: var(--warning);
}

.meme-trench-chain-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

.meme-trench-stage-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  vertical-align: 1px;
}

.meme-trench-stage-tag.is-new {
  color: #b45309;
  background: rgba(245, 158, 11, 0.13);
}

.meme-trench-stage-tag.is-migrated {
  color: #047857;
  background: rgba(16, 185, 129, 0.13);
}

.meme-trench-module--rush {
  max-height: 280px;
}

.meme-trench-module--primary {
  min-height: 180px;
  max-height: 280px;
}

.meme-trench-rush-item {
  padding: 9px 0;
}

.meme-trench-rush-identity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.meme-trench-token-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.meme-trench-token-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  background: #f2f4f7;
}

.meme-trench-risk-line {
  color: #b45309;
}

.meme-trench-social-line a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meme-trench-module--x {
  min-height: 300px;
  max-height: 520px;
}

.meme-trench-module--custom {
  min-height: 300px;
  max-height: 520px;
}

.meme-trench-custom-item {
  padding: 10px 0;
}

.meme-trench-custom-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.meme-trench-custom-wallet strong,
.meme-trench-custom-wallet small {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meme-trench-custom-wallet strong {
  color: var(--text);
  font-size: 12px;
}

.meme-trench-custom-wallet small {
  color: var(--muted);
  font-size: 10px;
}

.meme-trench-custom-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

.meme-trench-custom-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  background: #f2f4f7;
}

.meme-trench-custom-action {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.meme-trench-side-tag {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.meme-trench-side-tag.is-buy {
  color: #047857;
  background: rgba(16, 185, 129, 0.13);
}

.meme-trench-side-tag.is-sell {
  color: #b42318;
  background: rgba(239, 68, 68, 0.12);
}

.meme-trench-custom-tx {
  color: #2563eb;
  text-decoration: none;
}

.meme-trench-custom-tx:hover {
  text-decoration: underline;
}

.meme-trench-x-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.meme-trench-x-item:last-child {
  border-bottom: 0;
}

.meme-trench-x-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.meme-trench-x-author strong,
.meme-trench-x-author small {
  display: block;
}

.meme-trench-x-author strong {
  max-width: 135px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meme-trench-x-author small {
  color: var(--muted);
  font-size: 10px;
}

.meme-trench-x-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

.meme-trench-x-text {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.meme-trench-x-text:hover {
  color: #2563eb;
}

.meme-trench-x-image {
  display: block;
  width: 100%;
  max-height: 140px;
  margin-top: 8px;
  border-radius: 9px;
  object-fit: cover;
}

.meme-trench-ca--active {
  color: var(--accent);
  font-weight: 600;
}

.meme-trench-kline-chart--loading {
  opacity: 0.72;
}

.meme-trench-empty--loading {
  animation: meme-trench-pulse 1.2s ease-in-out infinite;
}

@keyframes meme-trench-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.meme-trench-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.meme-trench-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.meme-trench-panel-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}

.meme-trench-panel-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.meme-trench-kline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meme-trench-kline-chart {
  flex: 1;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.meme-trench-gmgn-iframe,
.meme-trench-api-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.meme-trench-gmgn-iframe--hidden,
.meme-trench-api-chart--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.meme-trench-kline-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.meme-trench-kline-empty--hidden {
  display: none;
}

.meme-trench-api-chart .meme-trench-kline-host {
  position: absolute;
  inset: 0;
}

.meme-trench-kline-host {
  position: absolute;
  inset: 0;
}

.meme-trench-holders-wrap {
  max-height: 280px;
}

@media (max-width: 1280px) {
  .meme-trench-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .meme-trench-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
  }

  .meme-trench-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .meme-trench-top-row,
  .meme-trench-side {
    grid-template-columns: 1fr;
  }
}
