:root {
  color-scheme: light;
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #242526;
  --muted: #73706a;
  --line: #dfddd8;
  --accent: #4f655d;
  --accent-strong: #354941;
  --green: #60766d;
  --blue: #5d6978;
  --soft: #eeece7;
  --shadow: 0 1px 2px rgba(30, 28, 24, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 42px);
}

h2 {
  font-size: 18px;
}

.topbar-actions,
.toolbar,
.segmented,
.summary {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px) 48px;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  order: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.profile-panel {
  order: 0;
}

.setup-guide {
  order: 1;
}

.import-panel {
  order: 2;
}

.creator-panel {
  order: 3;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdfa;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdfa;
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(198, 64, 82, 0.16);
}

.primary-button,
.secondary-button,
.chip,
.file-import {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  min-height: 42px;
  color: #fff;
  background: var(--blue);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.creator-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.creator-list-details {
  display: block;
}

.creator-list-details summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
}

.creator-list-inner {
  display: grid;
  gap: 10px;
  max-height: 360px;
  margin-top: 10px;
  overflow: auto;
}

.creator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
}

.creator-item a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.creator-item small {
  color: var(--muted);
}

.creator-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.text-danger {
  min-height: 32px;
  border: 1px solid #e6c8c8;
  border-radius: 6px;
  padding: 0 10px;
  color: #9b3a3a;
  background: #fff8f8;
  font-weight: 800;
}

.muted {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.setup-guide {
  border-color: rgba(79, 101, 93, 0.28);
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.cache-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cache-summary strong,
.cache-summary small {
  display: block;
}

.cache-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.guide-steps {
  display: grid;
  gap: 10px;
}

.guide-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.guide-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fffdfa;
  font-size: 12px;
  font-weight: 800;
}

.guide-step.done > span {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.guide-step strong,
.guide-step small {
  display: block;
}

.guide-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.segmented {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segment {
  flex: 1;
  min-height: 38px;
  border: 0;
  color: var(--muted);
  background: #fffdfa;
}

.segment.active {
  color: #fff;
  background: var(--green);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  padding: 7px 10px;
  color: var(--muted);
  background: #eee8df;
}

.chip.active {
  color: #fff;
  background: var(--accent);
}

.content {
  min-width: 0;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary div {
  min-height: 86px;
  padding: 16px;
  border-radius: 8px;
  color: var(--ink);
  background: #ebe9e4;
  border: 1px solid var(--line);
}

.summary div:nth-child(2) {
  background: #efede8;
}

.summary div:nth-child(3) {
  background: #e7ece8;
}

.summary span {
  display: block;
  font-size: 30px;
  font-weight: 900;
}

.summary small {
  opacity: 0.86;
}

.toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
}

.file-import input {
  display: none;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.cloth-card,
.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cloth-card:hover,
.post-card:hover {
  border-color: #c8c4bb;
}

.cloth-card {
  display: grid;
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e8dfd3;
}

.card-body {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.meta > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta > span:last-child {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: #e4ebe7;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(79, 101, 93, 0.12);
  line-height: 1;
  white-space: nowrap;
}

.badge-new {
  color: #6f4215;
  background: #fff0cf;
  border-color: #e5ba74;
}

.badge-new::before {
  content: "";
  display: inline-block;
  width: 6px;
  flex: 0 0 auto;
  height: 6px;
  margin-right: 5px;
  border-radius: 999px;
  background: #d58a1f;
  vertical-align: 1px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.card-text {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-line {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.link-button,
.plain-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.link-button {
  color: #fff;
  background: var(--accent);
}

.disabled-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f4eee6;
  font-size: 13px;
  font-weight: 800;
}

.plain-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffdfa;
}

.product-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.merge-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

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

.post-card {
  display: grid;
  grid-template-columns: 150px 1fr;
}

.post-card img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
}

.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}

.post-images img {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 6px;
  object-fit: cover;
}

.detail-thumbnail {
  display: block;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 7px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.detail-thumbnail:hover {
  border-color: #aeb9b5;
}

.detail-thumbnail.active {
  border-color: var(--accent);
}

.detail-thumbnail img {
  display: block;
}

.related-posts {
  display: grid;
  gap: 8px;
}

.related-posts a {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fffdfa;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.empty-state {
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.detail-dialog {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.close-button {
  position: sticky;
  top: 10px;
  margin-left: auto;
  display: block;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 22px;
  z-index: 5;
}

.detail {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1fr;
}

.detail img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: cover;
}

.detail > img {
  position: sticky;
  top: 0;
  align-self: start;
}

.detail-copy {
  display: grid;
  gap: 13px;
  align-content: start;
  padding: 26px;
}

.import-modal {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-list {
  display: grid;
  max-height: min(560px, 65vh);
  overflow: auto;
  gap: 8px;
}

.member-item {
  display: grid;
  grid-template-columns: auto 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.member-avatar {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--soft);
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

details {
  display: grid;
  gap: 10px;
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar,
  .layout,
  .toolbar,
  .merge-box,
  .post-card,
  .detail {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .layout {
    display: grid;
  }

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

  .topbar-actions {
    justify-content: space-between;
  }
}
