:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #172033;
  --muted: #617089;
  --line: #dbe3f0;
  --line-strong: #cdd7e8;
  --primary: #3c63f3;
  --primary-soft: rgba(60, 99, 243, 0.1);
  --teal: #1f9b8f;
  --amber: #b67913;
  --red: #cb4b3f;
  --navy: #23324d;
  --shadow: 0 18px 48px rgba(20, 34, 61, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(93, 124, 255, 0.08), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 122, 84, 0.08), transparent 20%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.panel,
.metric-tile,
.account-card,
.post-card,
.detail-section,
.empty-state {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 420px;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.hero-main,
.hero-stats,
.layout,
.detail-layout,
.detail-stack,
.stack-form,
.account-list,
.post-list,
.detail-grid,
.fact-grid,
.post-meta,
.analysis-grid,
.mode-picker,
.grid-two,
.action-stack {
  display: grid;
  gap: 14px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-tile {
  padding: 18px;
  border-radius: 22px;
}

.metric-tile span,
.panel-tip,
.hero-copy,
.detail-copy,
.micro-copy,
.meta-label,
.field-block span,
.fact-tile span,
.subtle-copy {
  color: var(--muted);
}

.metric-tile strong {
  display: block;
  margin-top: 12px;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}

.hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.hero-copy {
  margin: 0;
  max-width: 62ch;
  line-height: 1.72;
}

.hero-tags,
.chip-group,
.tag-row,
.queue-legend,
.post-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags {
  margin-top: 18px;
}

.hero-tags span,
.legend-pill,
.tiny-tag,
.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.86rem;
}

.ghost-link {
  text-decoration: none;
  color: var(--primary);
}

.layout {
  grid-template-columns: 340px minmax(0, 1fr);
  margin-top: 20px;
  align-items: start;
}

.detail-layout {
  grid-template-columns: 380px minmax(0, 1fr);
  margin-top: 20px;
  align-items: start;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.panel-main {
  min-height: 0;
}

.preview-panel {
  position: sticky;
  top: 20px;
}

.panel-head,
.section-caption,
.config-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel h2,
.section-caption h3 {
  margin: 6px 0 0;
  font-size: 1.34rem;
}

.panel-tip,
.detail-copy,
.account-copy,
.post-summary,
.empty-state,
.micro-copy {
  line-height: 1.7;
}

.section-caption {
  margin-top: 18px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block span {
  font-size: 0.9rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(60, 99, 243, 0.4);
  box-shadow: 0 0 0 4px rgba(60, 99, 243, 0.08);
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.button {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(60, 99, 243, 0.18);
}

.button.secondary {
  background: var(--navy);
  box-shadow: 0 12px 24px rgba(35, 50, 77, 0.16);
}

.button.small,
.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.ghost-button {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

.config-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.config-head strong {
  font-size: 1rem;
}

.config-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.mode-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.mode-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.mode-card strong {
  font-size: 1rem;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 0.9rem;
}

.mode-card:has(input:checked) {
  border-color: rgba(60, 99, 243, 0.38);
  box-shadow: inset 0 0 0 1px rgba(60, 99, 243, 0.22);
  background: linear-gradient(180deg, rgba(60, 99, 243, 0.05), #fff);
}

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

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.account-card,
.post-card,
.detail-section {
  padding: 18px;
  border-radius: 20px;
}

.account-card.active {
  border: 1px solid rgba(60, 99, 243, 0.34);
}

.account-card-head,
.post-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

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

.fact-tile {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.fact-tile span {
  display: block;
  font-size: 0.8rem;
}

.fact-tile strong {
  display: block;
  margin-top: 6px;
}

.account-copy,
.post-summary {
  margin: 12px 0 0;
}

.card-actions {
  margin-top: 12px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}

.link-button.danger,
.error-copy {
  color: var(--red);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #eef3ff;
  color: var(--primary);
}

.chip.subtle {
  background: #f1f4f8;
  color: #43526a;
}

.chip.ok {
  background: rgba(31, 155, 143, 0.12);
  color: var(--teal);
}

.chip.warn {
  background: rgba(182, 121, 19, 0.13);
  color: var(--amber);
}

.chip.bad {
  background: rgba(203, 75, 63, 0.13);
  color: var(--red);
}

.chip.info,
.chip.scheduled {
  background: rgba(60, 99, 243, 0.12);
  color: var(--primary);
}

.tiny-tag {
  padding: 0 12px;
  min-height: 28px;
  background: #fff;
}

.tiny-tag.soft {
  color: #d1634c;
}

.tiny-tag.muted {
  color: var(--muted);
}

.queue-legend {
  margin-bottom: 12px;
}

.legend-pill.immediate {
  color: var(--primary);
}

.legend-pill.scheduled {
  color: var(--amber);
}

.legend-pill.auto {
  color: var(--teal);
}

.post-card {
  display: grid;
  gap: 14px;
}

.post-card-rich {
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: center;
}

.post-main {
  min-width: 0;
}

.post-meta,
.analysis-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-block {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.meta-label {
  display: block;
  font-size: 0.82rem;
}

.meta-value {
  display: block;
  margin-top: 8px;
  line-height: 1.62;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

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

.schedule-inline input {
  min-width: 220px;
}

.detail-stack {
  align-content: start;
}

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

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

.detail-card {
  min-height: 100%;
}

.action-stack {
  align-content: start;
}

.analysis-highlight {
  margin-bottom: 14px;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
}

.post-preview {
  display: flex;
  justify-content: center;
}

.phone-shell {
  width: min(100%, 336px);
  margin: 0 auto;
}

.phone-shell.compact {
  width: 228px;
}

.phone-bezel {
  position: relative;
  padding: 10px;
  border-radius: 34px;
  background: linear-gradient(180deg, #111827, #1f2937);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.24);
}

.phone-camera {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  border-radius: 999px;
  background: #0b1323;
}

.phone-screen {
  overflow: hidden;
  min-height: 646px;
  border-radius: 26px;
  background: #fff;
}

.phone-shell.compact .phone-screen {
  min-height: 480px;
}

.xhs-status-bar,
.xhs-nav,
.xhs-toolbar {
  display: flex;
  align-items: center;
}

.xhs-status-bar {
  justify-content: space-between;
  padding: 16px 16px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-icons {
  display: inline-flex;
  gap: 4px;
}

.status-icons span {
  width: 10px;
  height: 6px;
  border-radius: 3px;
  background: #cdd7e8;
}

.status-icons .battery {
  width: 18px;
}

.xhs-nav {
  justify-content: space-between;
  padding: 0 16px 14px;
}

.xhs-nav-arrow,
.xhs-nav-actions span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eef3ff;
  display: inline-flex;
}

.xhs-nav-arrow::before {
  content: "";
  margin: auto;
  width: 6px;
  height: 6px;
  border-left: 2px solid #1f2937;
  border-bottom: 2px solid #1f2937;
  transform: rotate(45deg);
}

.xhs-nav-actions {
  display: inline-flex;
  gap: 6px;
}

.xhs-cover {
  padding: 0 14px;
}

.cover-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.cover-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 122, 84, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.cover-badge.subtle {
  background: rgba(60, 99, 243, 0.9);
}

.cover-card {
  min-height: 210px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ff7a54, #ff9f84 56%, #ffe1d6);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.phone-shell.compact .cover-card {
  min-height: 154px;
}

.cover-kicker {
  margin-bottom: auto;
  font-size: 0.74rem;
  font-weight: 700;
}

.cover-card strong {
  font-size: 1.18rem;
  line-height: 1.32;
}

.phone-shell.compact .cover-card strong {
  font-size: 0.96rem;
}

.cover-card p {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.preview-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d6ddea;
}

.preview-dot.active {
  width: 18px;
  background: var(--primary);
}

.xhs-content {
  padding: 16px;
}

.xhs-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-bubble {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #6a86ff);
  color: #fff;
  font-weight: 700;
}

.author-copy {
  display: grid;
  gap: 2px;
}

.author-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.xhs-note-title {
  margin-top: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.xhs-note-copy {
  margin-top: 10px;
}

.xhs-note-copy p {
  margin: 0;
  line-height: 1.66;
  color: #2f3d56;
}

.xhs-note-copy p + p {
  margin-top: 8px;
}

.xhs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.xhs-tags span {
  color: var(--primary);
  font-size: 0.8rem;
}

.xhs-toolbar {
  justify-content: space-between;
  padding: 12px 16px 18px;
  border-top: 1px solid #eef2f7;
}

.xhs-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #41526a;
}

.icon-circle {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #eef3ff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 220px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  background: #1d2a44;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.2);
  z-index: 10;
}

.toast[data-type="error"] {
  background: var(--red);
}

.toast.hidden {
  display: none;
}

@media (max-width: 1280px) {
  .hero,
  .layout,
  .detail-layout,
  .post-card-rich,
  .post-meta,
  .analysis-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .post-preview {
    justify-content: start;
  }
}

@media (max-width: 960px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 16px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .hero-stats,
  .mode-picker,
  .grid-two,
  .fact-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .schedule-inline {
    width: 100%;
  }

  .schedule-inline input {
    min-width: 0;
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: calc(100vw - 16px);
  }

  .phone-shell,
  .phone-shell.compact {
    width: min(100%, 320px);
  }

  .phone-screen,
  .phone-shell.compact .phone-screen {
    min-height: 560px;
  }
}
