:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-accent: #fffaf4;
  --surface: rgba(255, 252, 247, 0.8);
  --surface-strong: #fffdf9;
  --text: #1f1a17;
  --muted: #6d6259;
  --line: rgba(70, 42, 20, 0.12);
  --brand: #c85c2f;
  --brand-strong: #9f3f1d;
  --brand-soft: rgba(200, 92, 47, 0.12);
  --success: #2d8a56;
  --shadow: 0 18px 60px rgba(85, 52, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1080px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 205, 146, 0.55), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 167, 118, 0.3), transparent 24%),
    linear-gradient(180deg, #f8f4ed 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand-strong);
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 16px;
  background:
    linear-gradient(180deg, rgba(248, 244, 237, 0.98) 0%, rgba(248, 244, 237, 0.93) 76%, rgba(248, 244, 237, 0.24) 92%, rgba(248, 244, 237, 0) 100%);
  backdrop-filter: blur(3px);
}

.hero {
  padding: 16px 20px 12px;
}

.hero__inner,
.page {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.hero__inner {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 249, 240, 0.92)),
    rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero__eyebrow,
.search-modal__eyebrow {
  margin: 0 0 10px;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

.hero__row,
.panel__header,
.search-form,
.search-modal__header,
.copy-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero h1,
.search-modal h2,
.copy-modal h2,
.panel__header h2 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(36px, 7vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.panel__header p,
.hero__hint,
.empty-state,
.search-modal__summary {
  color: var(--muted);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.hero__statusline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ghost-button--icon {
  min-width: 42px;
  padding: 0;
  font-size: 18px;
}

.text-button--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.ghost-button,
.primary-button,
.search-trigger,
.text-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.ghost-button,
.primary-button,
.search-trigger,
.text-button,
.icon-button {
  min-height: 46px;
}

.ghost-button,
.text-button {
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: var(--text);
}

.primary-button {
  padding: 0 22px;
  background: linear-gradient(135deg, var(--brand), #e17a46);
  color: #fff;
  box-shadow: 0 14px 30px rgba(200, 92, 47, 0.22);
}

.icon-button {
  width: 46px;
  padding: 0;
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--line);
}

.ghost-button:hover,
.primary-button:hover,
.search-trigger:hover,
.text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.page {
  padding-bottom: 40px;
}

.page--content {
  padding-top: 4px;
}

.search-trigger {
  flex: 1 1 280px;
  justify-content: flex-start;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: rgba(255, 252, 247, 0.74);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.search-trigger__icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.tabs-section {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: rgba(255, 251, 246, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel {
  margin-top: 0;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.new-deals-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(200, 92, 47, 0.12);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.error-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(200, 92, 47, 0.15);
  border-radius: 16px;
  background: rgba(255, 248, 242, 0.95);
  color: var(--muted);
}

.error-state--modal {
  margin: 18px 0 0;
}

.panel__header p {
  margin: 8px 0 0;
}

.feed-list {
  display: grid;
  gap: 16px;
}

.feed-loading {
  padding: 18px 8px 6px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.feed-list--compact {
  max-height: min(58vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.feed-card {
  overflow: hidden;
  border: 1px solid rgba(200, 92, 47, 0.1);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 242, 0.92));
  box-shadow: 0 14px 36px rgba(84, 49, 20, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.feed-card.is-unread {
  border-color: rgba(200, 92, 47, 0.24);
  box-shadow: 0 18px 44px rgba(200, 92, 47, 0.1);
}

.feed-card.is-new {
  transform: translateY(-1px);
}

.feed-card.is-unread .feed-card__time {
  background: rgba(200, 92, 47, 0.18);
}

.feed-card:not(.is-unread) {
  opacity: 0.94;
}

.feed-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
  flex-wrap: wrap;
}

.feed-card__time {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.feed-card__channel {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.feed-card__channel--tb {
  background: rgba(45, 138, 86, 0.12);
  color: #207145;
}

.feed-card__channel--jd {
  background: rgba(56, 122, 233, 0.12);
  color: #245ec4;
}

.feed-card__channel--pdd {
  background: rgba(141, 81, 214, 0.14);
  color: #6c3baf;
}

.feed-card__media {
  aspect-ratio: 16 / 10;
  margin: 14px 18px 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(241, 226, 209, 0.92), rgba(252, 246, 239, 0.96));
}

.feed-card__media.is-fallback {
  display: grid;
  place-items: center;
  cursor: default;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(135deg, rgba(240, 225, 207, 0.96), rgba(252, 245, 236, 0.98));
  color: var(--muted);
}

.feed-card__media.is-fallback::before {
  content: "暂无商品图片";
  padding-top: 46px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background:
    radial-gradient(circle, rgba(200, 92, 47, 0.14) 0 38%, transparent 40%) top center / 44px 44px no-repeat;
}

.feed-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-card__content {
  padding: 16px 18px 18px;
  font-size: 16px;
  line-height: 1.8;
  word-break: break-word;
}

.feed-card__richtext {
  display: grid;
  gap: 10px;
}

.feed-card__content > div,
.feed-card__content > span {
  margin: 0;
}

.feed-card__content a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 6px 8px 6px 0;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(56, 122, 233, 0.1);
  box-shadow: inset 0 0 0 1px rgba(56, 122, 233, 0.08);
  font-weight: 700;
  text-decoration: none;
}

.feed-card__content a::after {
  content: "↗";
  font-size: 12px;
}

.feed-card__content .platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.platform-tag--tb {
  background: rgba(45, 138, 86, 0.12);
  color: #207145;
}

.platform-tag--jd {
  background: rgba(56, 122, 233, 0.12);
  color: #245ec4;
}

.platform-tag--pdd {
  background: rgba(141, 81, 214, 0.14);
  color: #6c3baf;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 8px 6px 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(200, 92, 47, 0.12);
  color: var(--brand-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(200, 92, 47, 0.05);
}

.copy-chip[data-copy-type="url"] {
  background: rgba(56, 122, 233, 0.12);
  color: #245ec4;
}

.copy-chip[data-copy-type="token"] {
  background: linear-gradient(135deg, rgba(200, 92, 47, 0.16), rgba(227, 125, 69, 0.16));
}

.inline-highlight {
  padding: 0 0.2em;
  border-radius: 0.35em;
  background: rgba(255, 220, 118, 0.75);
  color: inherit;
}

.empty-state {
  padding: 28px 20px;
  border: 1px dashed rgba(109, 98, 89, 0.3);
  border-radius: var(--radius-lg);
  text-align: center;
}

.search-modal,
.copy-modal {
  width: min(calc(100% - 24px), 920px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
}

.copy-modal {
  width: min(calc(100% - 24px), 560px);
}

.search-modal::backdrop,
.copy-modal::backdrop {
  background: rgba(32, 18, 10, 0.34);
  backdrop-filter: blur(6px);
}

.search-modal__panel,
.copy-modal__panel {
  margin: 0;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(180deg, #fffdf8, #fff8f0);
  box-shadow: 0 26px 80px rgba(41, 23, 12, 0.24);
}

.search-field {
  flex: 1;
}

.search-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(98, 73, 55, 0.16);
  border-radius: 18px;
  background: #fff;
  outline: none;
}

.search-field input:focus {
  border-color: rgba(200, 92, 47, 0.5);
  box-shadow: 0 0 0 4px rgba(200, 92, 47, 0.1);
}

.search-modal__summary {
  margin: 18px 0;
}

.search-recent {
  margin-top: 18px;
}

.search-recent__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.search-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(98, 73, 55, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  color: var(--text);
}

.copy-modal__text {
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(200, 92, 47, 0.08);
  line-height: 1.7;
  word-break: break-all;
}

.image-viewer {
  width: min(calc(100% - 12px), 960px);
  padding: 0;
  border: 0;
  background: transparent;
}

.image-viewer::backdrop {
  background: rgba(20, 12, 8, 0.84);
  backdrop-filter: blur(8px);
}

.image-viewer__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(88vh, 900px);
}

.image-viewer__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
}

.image-viewer__image {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  object-fit: contain;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31, 26, 23, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast[data-tone="error"] {
  background: rgba(180, 35, 24, 0.92);
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .panel__header,
  .error-state,
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-section {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding-top: 6px;
    background:
      linear-gradient(180deg, rgba(248, 244, 237, 0.99) 0%, rgba(248, 244, 237, 0.97) 84%, rgba(248, 244, 237, 0.32) 96%, rgba(248, 244, 237, 0) 100%);
    backdrop-filter: blur(1.5px);
  }

  .hero {
    padding: 6px 8px 8px;
  }

  .hero__inner,
  .page {
    width: min(calc(100% - 16px), var(--container));
  }

  .hero__inner {
    padding: 14px 14px 12px;
    border-radius: 22px;
  }

  .hero__row {
    align-items: flex-start;
    gap: 10px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero__eyebrow {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .hero__meta {
    margin-top: 10px;
    align-items: stretch;
  }

  .hero__statusline {
    gap: 8px;
  }

  .hero__hint {
    font-size: 13px;
  }

  .ghost-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }

  .ghost-button--icon {
    min-width: 36px;
    padding: 0;
    font-size: 16px;
  }

  .search-trigger {
    gap: 10px;
    padding: 0 14px;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(85, 52, 24, 0.08);
    width: 100%;
  }

  .search-trigger__icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .feed-card__content {
    font-size: 15px;
  }

  .feed-card__meta {
    gap: 8px;
    padding: 12px 14px 0;
  }

  .feed-card__media {
    margin: 12px 14px 0;
    aspect-ratio: 4 / 3;
  }

  .feed-card__content {
    padding: 14px 14px 16px;
  }

  .search-recent__header {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .search-chip {
    min-height: 34px;
    padding: 0 12px;
    font-size: 14px;
  }

  .search-modal__panel,
  .copy-modal__panel {
    padding: 18px;
    border-radius: 24px;
  }

  .new-deals-badge {
    align-self: flex-start;
  }

  .image-viewer {
    width: min(calc(100% - 8px), 960px);
  }

  .image-viewer__close {
    top: 0;
    right: 0;
  }

  .image-viewer__image {
    max-height: 82vh;
    border-radius: 14px;
  }
}
