:root {
  color: #211a16;
  background: #17120f;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #17120f;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.home-bg,
.brand,
.today,
.vertical-tag,
.home-copy h1,
.home-copy p,
.page-head,
.search-box,
.featured-videos,
.video-feature-card,
.material-section,
.material-card,
.studio-card,
.product-card,
.cart-item,
.order-card,
.profile-panel,
.file-card,
.generated-card,
.generated-actions,
.source-footnotes,
.result-bar,
.empty,
.empty-cart,
.knowledge-card,
.shop-top,
.main-product,
.buy-card,
.artifact-hero-media,
.artifact-back,
.artifact-brand,
.artifact-plaque,
.artifact-body,
.artifact-actions,
.tabbar,
.tab,
.toast,
.auth-mask,
.auth-panel {
  backface-visibility: hidden;
}

.home-bg,
.video-feature-card,
.material-card,
.studio-card,
.product-card,
.cart-item,
.order-card,
.profile-panel,
.file-card,
.generated-card,
.tabbar,
.tab,
.toast,
.auth-panel {
  will-change: transform, opacity;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fbf7ef;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

.screen,
.page {
  min-height: 100vh;
  padding: 24px 18px 92px;
}

.home {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  color: #fffaf3;
  background: #211a16;
}

.home-bg,
.home-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-bg {
  object-fit: cover;
}

.home-wash {
  background: linear-gradient(180deg, rgba(15,21,19,.72), rgba(45,35,24,.16) 42%, rgba(14,24,24,.94));
}

.brand {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 19px;
}

.brand span {
  width: 70px;
  height: 1px;
  background: rgba(255,255,255,.68);
}

.today {
  position: absolute;
  top: 120px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
}

.side-line {
  position: absolute;
  top: 160px;
  bottom: 86px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.72), transparent);
}

.side-line.left { left: 24px; }
.side-line.right { right: 24px; }

.vertical-tag {
  position: absolute;
  top: 174px;
  right: 38px;
  width: 36px;
  min-height: 160px;
  padding: 14px 0;
  border: 1px solid rgba(255,255,255,.48);
  writing-mode: vertical-rl;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.78);
}

.home-copy {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 96px;
  text-align: center;
}

.home-copy h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.22;
  font-weight: 600;
}

.home-copy p {
  margin: 18px 0 0;
  color: rgba(255,250,243,.78);
  font-size: 14px;
  line-height: 1.7;
}

.page-head h1,
.shop-top h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.page-head p,
.shop-top p {
  margin: 8px 0 0;
  color: #8b7f73;
  line-height: 1.55;
  font-size: 14px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
  margin-top: 22px;
}

.search-box input,
.profile-panel input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  padding: 0 16px;
  outline: 0;
  background: #fffaf3;
}

.search-box button {
  height: 48px;
  border-radius: 8px;
  color: #fffaf3;
  background: #a33b25;
  font-weight: 700;
}

.video-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 18px -18px 0;
  padding: 0 18px 12px;
  scrollbar-color: #b96b44 #efe3d2;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.video-row::-webkit-scrollbar {
  height: 6px;
}

.video-row::-webkit-scrollbar-track {
  margin: 0 18px;
  border-radius: 99px;
  background: #efe3d2;
}

.video-row::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: linear-gradient(90deg, #a33b25, #d29352);
}

.video-card {
  position: relative;
  flex: 0 0 178px;
  height: 138px;
  overflow: hidden;
  border-radius: 8px;
  padding: 0;
  color: #fffaf3;
  text-align: left;
  background: #211a16;
  scroll-snap-align: start;
}

.video-card img,
.puppet-card img,
.product-card img,
.journey-card img,
.knowledge-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-videos {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fffaf3;
  box-shadow: 0 10px 28px rgba(64,43,28,.08);
}

.featured-videos h2 {
  margin: 0 0 10px;
  color: #211a16;
  font-size: 19px;
}

.video-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-feature-card {
  position: relative;
  min-height: 136px;
  overflow: hidden;
  border-radius: 8px;
  padding: 0;
  color: #fffaf3;
  text-align: left;
  background: #211a16;
  box-shadow: none;
}

.video-feature-card.primary {
  grid-column: 1 / -1;
  min-height: 210px;
}

.video-feature-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.84));
}

.video-feature-card span,
.video-feature-card b,
.video-feature-card small {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
}

.video-feature-card span {
  top: 12px;
  color: #f7d29d;
  font-size: 12px;
  font-weight: 700;
}

.video-feature-card b {
  bottom: 42px;
  font-size: 16px;
  line-height: 1.25;
}

.video-feature-card.primary b {
  font-size: 22px;
}

.video-feature-card small {
  bottom: 12px;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255,250,243,.8);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.84));
}

.video-card span,
.video-card small {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
}

.video-card span {
  bottom: 42px;
  font-weight: 700;
  line-height: 1.25;
}

.video-card small {
  bottom: 14px;
  color: rgba(255,250,243,.78);
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.block,
.journey-card,
.knowledge-card,
.server-card,
.workflow-card,
.buy-card,
.main-product,
.product-card,
.cart-item,
.section-list article,
.stats article {
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fffaf3;
  box-shadow: 0 10px 28px rgba(64,43,28,.08);
}

.block {
  margin-top: 22px;
  padding: 16px;
}

.block h2,
.section-list h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.chips {
  display: flex;
  gap: 10px;
}

.chip {
  min-width: 62px;
  height: 34px;
  border-radius: 17px;
  color: #766a60;
  background: #f1e8dc;
}

.chip.active {
  color: #fffaf3;
  background: #a33b25;
}

.result-bar {
  margin: 16px 0;
  color: #8b7f73;
  font-size: 13px;
}

.source-panel,
.material-section {
  margin-top: 18px;
}

.material-library-entry {
  margin-top: 14px;
}

.material-library-entry .wide-action {
  margin-top: 0;
}

.source-panel h2,
.material-section h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.source-panel article {
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fffaf3;
}

.source-panel b {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.source-panel p,
.material-section > p {
  margin: 6px 0;
  color: #7d7167;
  font-size: 13px;
  line-height: 1.55;
}

.source-panel a {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.source-footnotes {
  margin: 22px 0 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(122,94,68,.16);
  color: #8b7f73;
  font-size: 11px;
  line-height: 1.6;
}

.source-footnotes b {
  display: block;
  margin-bottom: 4px;
  color: #6d6258;
}

.source-footnotes a {
  display: block;
  color: #8b7f73;
  text-decoration: none;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.material-card {
  overflow: hidden;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  padding: 0;
  text-align: left;
  background: #fffaf3;
  box-shadow: 0 8px 24px rgba(64,43,28,.08);
}

.material-card img,
.material-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #211a16;
}

.material-card div {
  padding: 10px;
}

.material-card span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.material-card h3 {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.35;
}

.material-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #7d7167;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.text-back {
  margin-bottom: 14px;
  padding: 0;
  color: #a33b25;
  background: transparent;
  font-weight: 700;
}

.artifact-page {
  min-height: 100vh;
  padding: 0 0 118px;
  color: #fffaf3;
  background: #1f1f1d;
}

.artifact-shell {
  padding: 0;
  background: #1f1f1d;
}

.artifact-back {
  position: fixed;
  top: 16px;
  left: calc(50% - 197px);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  color: #201f1d;
  background: #f2d6aa;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}

.artifact-brand {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  z-index: 3;
  color: rgba(255,250,243,.9);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.artifact-hero {
  position: relative;
  min-height: 54vh;
  background: #171615;
}

.artifact-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.14) 58%, rgba(31,31,29,.92));
}

.artifact-hero-media {
  display: block;
  width: 100%;
  min-height: 54vh;
  max-height: 70vh;
  object-fit: cover;
  background: #171615;
}

.artifact-plaque {
  position: relative;
  z-index: 2;
  margin: -72px 0 0;
  padding: 34px 28px 30px;
  border-radius: 26px 26px 0 0;
  background: #201f1d;
  text-align: center;
}

.artifact-kicker {
  margin-bottom: 12px;
  color: #d3b178;
  font-size: 12px;
  font-weight: 700;
}

.artifact-plaque h1 {
  margin: 0;
  color: #f2c88b;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
}

.artifact-plaque p {
  max-width: 310px;
  margin: 16px auto 0;
  color: rgba(255,250,243,.86);
  font-size: 15px;
  line-height: 1.65;
}

.artifact-body {
  padding: 4px 26px 8px;
}

.artifact-body p {
  margin: 0 0 18px;
  color: rgba(255,250,243,.84);
  font-size: 14px;
  line-height: 1.85;
}

.artifact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 22px;
  margin-top: 12px;
}

.artifact-actions button {
  height: 42px;
  border: 1px solid rgba(242,200,139,.5);
  border-radius: 21px;
  color: #201f1d;
  background: #f2c88b;
  font-weight: 700;
}

.artifact-actions button:last-child {
  color: #f2c88b;
  background: transparent;
}

.artifact-page .source-footnotes {
  margin: 26px 22px 0;
  border-top-color: rgba(242,200,139,.24);
  color: rgba(255,250,243,.55);
}

.artifact-page .source-footnotes b,
.artifact-page .source-footnotes a {
  color: rgba(255,250,243,.62);
}

@media (max-width: 430px) {
  .artifact-back {
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .home-bg,
  .video-feature-card,
  .material-card,
  .studio-card,
  .product-card,
  .cart-item,
  .order-card,
  .profile-panel,
  .file-card,
  .generated-card,
  .tabbar,
  .tab,
  .toast,
  .auth-panel {
    will-change: auto;
  }
}

.puppet-card {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  text-align: left;
  background: #fffaf3;
  box-shadow: 0 8px 24px rgba(64,43,28,.08);
}

.puppet-card img {
  height: 145px;
}

.puppet-card div,
.product-info {
  padding: 12px;
}

.puppet-card span,
.product-info span,
.main-product span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.puppet-card h3,
.product-info h2,
.cart-item h2 {
  margin: 6px 0;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.puppet-card p,
.product-info p,
.main-product p,
.knowledge-card p,
.journey-card p,
.buy-card p {
  margin: 0;
  color: #7d7167;
  font-size: 13px;
  line-height: 1.55;
}

.puppet-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.journey-card {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  min-height: 390px;
  color: #fffaf3;
}

.journey-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(20,16,14,.88));
}

.journey-card > div {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  bottom: 20px;
}

.journey-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.tag-row {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.tag-row span {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 99px;
  font-size: 12px;
}

.outline-button {
  height: 38px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 19px;
  padding: 0 18px;
  color: #fffaf3;
  background: transparent;
}

.knowledge-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
}

.knowledge-card img {
  height: 112px;
  border-radius: 6px;
}

.knowledge-card h2 {
  margin: 4px 0 8px;
  font-size: 18px;
}

.shop-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cart-pill,
.wide-action,
.checkout-button {
  border-radius: 20px;
  padding: 10px 14px;
  color: #fffaf3;
  background: #a33b25;
}

.cart-pill b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 11px;
  color: #a33b25;
  background: #fffaf3;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.product-card {
  overflow: hidden;
}

.product-card img {
  height: 158px;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.product-bottom b,
.price-line b,
.cart-bottom b,
.settle-bar b {
  color: #c6341e;
  font-size: 20px;
}

del {
  margin-left: 6px;
  color: #b5aaa0;
  font-size: 12px;
}

.product-bottom button {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  color: #fffaf3;
  background: #211a16;
  font-size: 22px;
}

.detail-hero {
  position: relative;
  height: 48vh;
  min-height: 330px;
  overflow: hidden;
  background: #211a16;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.5));
}

.back {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 18px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  color: #fffaf3;
  background: rgba(0,0,0,.36);
  font-size: 34px;
}

.detail-body {
  padding: 0 18px 96px;
  transform: translateY(-28px);
}

.main-product,
.buy-card {
  padding: 18px;
  margin-bottom: 14px;
}

.main-product h1 {
  margin: 8px 0 10px;
  font-size: 23px;
  line-height: 1.35;
}

.buy-row,
.cart-bottom,
.server-card,
.profile-panel,
.order-card,
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty button,
.cart-bottom button {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: #efe4d6;
}

.purchase-bar,
.settle-bar,
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: 100%;
  max-width: 430px;
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,250,243,.96);
  backdrop-filter: blur(16px);
}

.purchase-bar {
  display: grid;
  grid-template-columns: 74px 1fr 1fr;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.purchase-bar button,
.settle-bar > button:last-child {
  min-height: 44px;
  border-radius: 22px;
}

.purchase-bar button:nth-child(2) {
  color: #211a16;
  background: #f0d6aa;
}

.purchase-bar button:last-child,
.settle-bar > button:last-child {
  color: #fffaf3;
  background: #c6341e;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: calc(100% - 36px);
  max-width: 390px;
  min-height: 58px;
  transform: translateX(-50%);
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 29px;
  padding: 6px;
  box-shadow: 0 18px 46px rgba(64,43,28,.22);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  color: #8d847b;
  border-radius: 23px;
  background: transparent;
}

.tab small {
  font-size: 12px;
  font-weight: 700;
}

.tab.active {
  color: #a33b25;
  background: #f4e5d4;
}

.promo-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: #7a4c2c;
  background: #fff1d7;
  font-size: 13px;
}

.promo-bar button {
  color: #a33b25;
  background: transparent;
}

.cart-list {
  padding: 14px 12px 100px;
}

.cart-item {
  display: grid;
  grid-template-columns: 30px 92px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.cart-item img {
  width: 92px;
  height: 92px;
  border-radius: 6px;
  object-fit: cover;
}

.check {
  width: 24px;
  height: 24px;
  border: 1px solid #d2c4b6;
  border-radius: 12px;
  color: #fffaf3;
  background: #fffaf3;
}

.check.checked {
  border-color: #c6341e;
  background: #c6341e;
}

.cart-item p,
.cart-item small {
  display: block;
  color: #8b7f73;
  margin: 0 0 4px;
}

.cart-bottom span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settle-bar {
  display: grid;
  grid-template-columns: 28px 36px 1fr 112px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.settle-bar p {
  margin: 0;
  font-size: 13px;
}

.settle-bar small {
  display: block;
  color: #8b7f73;
  font-size: 11px;
}

.empty-cart,
.empty {
  margin: 88px 18px;
  text-align: center;
  color: #7d7167;
}

.empty-cart button {
  margin-top: 14px;
  border-radius: 20px;
  padding: 10px 18px;
  color: #fffaf3;
  background: #a33b25;
}

.hero-panel {
  padding: 24px 20px;
  border-radius: 8px;
  color: #fffaf3;
  background: linear-gradient(135deg, #19130f, #7d2b1b 62%, #c58a42);
}

.hero-panel h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.hero-panel p {
  margin: 0;
  color: rgba(255,250,243,.82);
  line-height: 1.7;
}

.server-card,
.workflow-card,
.section-list {
  margin-top: 18px;
  padding: 16px;
}

.avatar-dot,
.avatar-large {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fffaf3;
  background: #a33b25;
  font-weight: 800;
}

.avatar-dot {
  width: 54px;
  height: 54px;
  border-radius: 27px;
}

.server-card h2,
.workflow-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.server-card p,
.workflow-card p {
  margin: 0 0 4px;
  color: #8b7f73;
  font-size: 13px;
}

.server-card > span {
  color: #1f8f4d;
  font-size: 13px;
}

.upload-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed #b8a58f;
  border-radius: 8px;
  background: #fff8ed;
}

.upload-picker input {
  display: none;
}

.upload-picker b {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 20px;
  color: #fffaf3;
  background: #a33b25;
  font-size: 25px;
}

.upload-picker small {
  display: block;
  margin-top: 4px;
  color: #8b7f73;
  font-size: 12px;
}

.file-card {
  margin-top: 10px;
  padding: 12px;
}

.file-card p,
.file-card small {
  color: #8b7f73;
}

.profile-panel {
  align-items: center;
  padding: 22px 18px;
  border-radius: 8px;
  color: #fffaf3;
  background: linear-gradient(135deg, #19130f, #7d2b1b 70%, #c58a42);
}

.avatar-large {
  width: 76px;
  height: 76px;
  border-radius: 38px;
  background: rgba(255,255,255,.18);
  font-size: 28px;
}

.profile-panel input {
  height: 42px;
  border-color: rgba(255,255,255,.18);
  color: #fffaf3;
  background: rgba(255,255,255,.12);
}

.profile-panel h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.profile-panel p,
.profile-panel small {
  color: rgba(255,250,243,.78);
}

.wide-action {
  width: 100%;
  margin-top: 16px;
}

.wide-action.ghost {
  color: #a33b25;
  background: #f4e5d4;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.stats article {
  padding: 14px 8px;
  text-align: center;
}

.stats b {
  display: block;
  color: #a33b25;
  font-size: 22px;
}

.stats span {
  color: #8b7f73;
  font-size: 12px;
}

.folder {
  padding: 12px;
  border-radius: 8px;
  color: #7a4c2c;
  background: #fff1d7;
  word-break: break-all;
}

.order-card {
  margin-top: 10px;
  padding: 10px;
}

.order-card img {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
}

.order-card div {
  flex: 1;
}

.order-card p,
.order-card small {
  margin: 4px 0 0;
  color: #8b7f73;
  font-size: 12px;
}

.order-card span {
  color: #a33b25;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fffaf3;
  background: rgba(25,19,15,.88);
  font-size: 14px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.auth-mask {
  position: absolute;
  inset: 0;
  background: rgba(13, 10, 8, 0.56);
}

.auth-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 34px);
  max-width: 370px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  border: 1px solid rgba(122,94,68,.18);
  background: #fffaf3;
  box-shadow: 0 20px 54px rgba(24,19,16,.3);
  padding: 18px;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-head h2 {
  margin: 0;
  font-size: 21px;
}

.auth-head button {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  font-size: 20px;
  color: #6d6258;
  background: #f1e8dc;
}

.auth-panel p {
  margin: 10px 0 14px;
  color: #7d7167;
  font-size: 13px;
}

.auth-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(122,94,68,.16);
  border-radius: 8px;
  padding: 0 14px;
  margin-bottom: 10px;
}

.auth-panel > button {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  color: #fffaf3;
  background: #a33b25;
  font-weight: 700;
}

.auth-panel small {
  display: block;
  margin-top: 8px;
  color: #8b7f73;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.auth-switch button {
  height: 36px;
  border-radius: 18px;
  color: #6d6258;
  background: #f1e8dc;
}

.auth-switch button.active {
  color: #fffaf3;
  background: #a33b25;
}

.studio-page {
  padding-bottom: 110px;
}

.studio-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fffaf3;
  box-shadow: 0 10px 28px rgba(64,43,28,.08);
}

.studio-card h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.studio-subtitle {
  margin: 16px 0 0;
  font-size: 16px;
}

.studio-material-grid {
  grid-template-columns: 1fr;
}

.selected-studio-asset {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fff;
}

.selected-studio-asset img,
.selected-studio-asset video,
.selected-studio-asset .generated-cover-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
}

.selected-studio-asset span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.selected-studio-asset b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.selected-studio-asset p {
  margin: 6px 0 0;
  color: #7d7167;
  font-size: 12px;
  line-height: 1.45;
}

.compact-upload-list {
  margin-top: 10px;
}

.studio-asset-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
}

.studio-asset-chips button {
  flex: 0 0 auto;
  max-width: 148px;
  min-height: 34px;
  border-radius: 17px;
  padding: 0 12px;
  color: #7d7167;
  background: #f1e8dc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-asset-chips button.active {
  color: #fffaf3;
  background: #a33b25;
}

.generate-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.generate-form select,
.generate-form input {
  height: 42px;
  border: 1px solid rgba(122,94,68,.16);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.generate-form button {
  height: 42px;
  border-radius: 8px;
  color: #fffaf3;
  background: #a33b25;
  font-weight: 700;
}

.quick-generate-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.quick-generate-row button {
  min-height: 38px;
  border-radius: 19px;
  color: #a33b25;
  background: #f4e5d4;
  font-size: 13px;
  font-weight: 700;
}

.generated-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.generated-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  background: #fff;
}

.generated-card img,
.generated-card video,
.generated-cover-placeholder {
  width: 86px;
  height: 86px;
  border-radius: 6px;
  object-fit: cover;
  background: #211a16;
}

.generated-cover-placeholder {
  display: grid;
  place-items: center;
  color: #f2c88b;
  font-weight: 800;
}

.generated-card span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.generated-card b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.35;
}

.generated-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: #7d7167;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.studio-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.studio-list article {
  padding: 10px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  background: #fff;
}

.studio-list b {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.studio-list p,
.studio-list small {
  margin: 4px 0 0;
  color: #8b7f73;
  font-size: 12px;
}

.generated-hero-card,
.generation-preview {
  margin-top: 16px;
  border: 1px solid rgba(122,94,68,.14);
  border-radius: 8px;
  overflow: hidden;
  background: #fffaf3;
  box-shadow: 0 10px 28px rgba(64,43,28,.08);
}

.generated-hero-media {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #211a16;
}

.generated-hero-card > div {
  padding: 16px;
}

.generated-hero-card span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.generated-hero-card h2,
.generation-preview h2 {
  margin: 8px 0;
  font-size: 20px;
  line-height: 1.35;
}

.generated-hero-card p,
.generation-preview > p {
  margin: 0;
  color: #6d6258;
  font-size: 14px;
  line-height: 1.65;
}

.generation-preview {
  padding: 16px;
}

.scene-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.scene-list article,
.sticker-grid article {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.scene-list span {
  color: #a33b25;
  font-size: 12px;
  font-weight: 700;
}

.scene-list b,
.sticker-grid b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.scene-list p,
.sticker-grid p {
  margin: 6px 0 0;
  color: #7d7167;
  font-size: 13px;
  line-height: 1.55;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sticker-grid article {
  min-height: 108px;
  border: 1px solid rgba(122,94,68,.12);
  background: #fff8ed;
}

.sticker-grid b {
  color: #a33b25;
  font-size: 18px;
}

.generated-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.generated-actions button {
  height: 42px;
  border-radius: 21px;
  color: #fffaf3;
  background: #a33b25;
  font-weight: 700;
}

.generated-actions button:last-child {
  color: #a33b25;
  background: #f4e5d4;
}

@media (min-width: 900px) {
  body {
    background: #17120f;
  }

  .app {
    max-width: none;
    min-height: 100vh;
    background: #fbf7ef;
    box-shadow: none;
  }

  .screen {
    min-height: 100vh;
    padding: 0 clamp(32px, 5vw, 76px) 118px;
  }

  .screen > .page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 112px 0 124px;
  }

  .home-shell,
  .artifact-shell {
    padding: 0;
  }

  .tabbar {
    top: 22px;
    bottom: auto;
    grid-template-columns: repeat(5, auto);
    gap: 6px;
    width: auto;
    max-width: none;
    min-height: 56px;
    padding: 7px;
    border-radius: 30px;
    background: rgba(255,250,243,.9);
  }

  .tab {
    min-width: 92px;
    padding: 0 22px;
  }

  .tab small {
    font-size: 14px;
  }

  .home {
    min-height: 100vh;
  }

  .brand {
    top: 42px;
    justify-content: flex-start;
    left: clamp(52px, 7vw, 112px);
    right: auto;
  }

  .brand span {
    width: 86px;
  }

  .today {
    top: 44px;
    right: clamp(52px, 7vw, 112px);
    left: auto;
    writing-mode: horizontal-tb;
    letter-spacing: 0;
  }

  .side-line.left {
    left: clamp(34px, 4vw, 72px);
  }

  .side-line.right {
    right: clamp(34px, 4vw, 72px);
  }

  .vertical-tag {
    top: auto;
    right: clamp(54px, 7vw, 116px);
    bottom: 128px;
    left: auto;
    transform: none;
    writing-mode: horizontal-tb;
    letter-spacing: 0;
  }

  .home-copy {
    left: clamp(72px, 10vw, 156px);
    bottom: clamp(88px, 12vh, 140px);
    max-width: 680px;
  }

  .home-copy h1 {
    font-size: clamp(64px, 7vw, 96px);
    line-height: .95;
  }

  .home-copy p {
    max-width: 620px;
    font-size: 18px;
  }

  .page-head,
  .shop-top {
    display: grid;
    grid-template-columns: minmax(260px, .7fr) minmax(320px, .9fr);
    align-items: end;
    gap: 34px;
    margin-bottom: 26px;
  }

  .shop-top {
    grid-template-columns: 1fr auto;
  }

  .page-head h1,
  .shop-top h1 {
    font-size: clamp(38px, 4.2vw, 58px);
    line-height: 1.05;
  }

  .page-head p,
  .shop-top p {
    max-width: 560px;
    margin-top: 0;
    font-size: 16px;
  }

  .search-box {
    max-width: 760px;
    margin-bottom: 26px;
    grid-template-columns: 1fr 128px;
  }

  .featured-videos,
  .material-section,
  .source-panel,
  .studio-card,
  .section-list,
  .generated-hero-card,
  .generation-preview {
    border-radius: 10px;
  }

  .featured-videos,
  .material-section {
    padding: 22px;
  }

  .featured-videos h2,
  .material-section h2 {
    font-size: 24px;
  }

  .video-feature-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 14px;
  }

  .video-feature-card,
  .video-feature-card.primary {
    grid-column: auto;
    min-height: 268px;
  }

  .video-feature-card.primary b {
    font-size: 23px;
  }

  .material-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .material-card img,
  .material-card video {
    aspect-ratio: 4 / 3;
  }

  .material-card div {
    padding: 14px;
  }

  .material-card h3 {
    font-size: 16px;
  }

  .material-library-entry {
    max-width: 460px;
    margin-right: auto;
    margin-left: auto;
  }

  .source-footnotes {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px 22px;
  }

  .source-footnotes a {
    display: inline-block;
    margin-right: 18px;
  }

  .artifact-page {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
    min-height: 100vh;
    padding: 0;
  }

  .artifact-back {
    top: 28px;
    left: 32px;
  }

  .artifact-brand {
    position: fixed;
    top: 38px;
    left: 110px;
    right: auto;
  }

  .artifact-hero {
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1 / span 5;
    height: 100vh;
    min-height: 100vh;
  }

  .artifact-hero-media {
    min-height: 100vh;
    max-height: none;
    height: 100vh;
  }

  .artifact-hero::after {
    background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.18) 72%, rgba(31,31,29,.92));
  }

  .artifact-plaque,
  .artifact-body,
  .artifact-actions,
  .artifact-page .source-footnotes {
    grid-column: 2;
    max-width: 560px;
    margin-right: clamp(38px, 5vw, 84px);
    margin-left: clamp(32px, 4vw, 72px);
  }

  .artifact-plaque {
    margin-top: 124px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
  }

  .artifact-plaque h1 {
    font-size: clamp(42px, 4vw, 64px);
  }

  .artifact-plaque p {
    max-width: none;
    margin-right: 0;
    margin-left: 0;
    font-size: 16px;
  }

  .artifact-body {
    padding: 28px 0 0;
  }

  .artifact-actions {
    padding: 0;
  }

  .artifact-page .source-footnotes {
    display: block;
    margin-top: 30px;
    margin-bottom: 80px;
  }

  .shop-page .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-card img {
    height: 240px;
  }

  .product-info {
    min-height: 152px;
  }

  .product-detail {
    min-height: 100vh;
    padding: 112px clamp(44px, 6vw, 96px) 120px;
    background: #fbf7ef;
  }

  .product-detail {
    display: grid;
    grid-template-columns: minmax(420px, .95fr) minmax(420px, .8fr);
    gap: 36px;
    align-items: start;
  }

  .detail-hero,
  .detail-body {
    max-width: 620px;
  }

  .detail-hero {
    height: min(68vh, 620px);
    min-height: 480px;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(64,43,28,.16);
  }

  .back {
    top: 22px;
    left: 22px;
  }

  .detail-body {
    transform: none;
    padding: 0;
  }

  .main-product,
  .buy-card {
    padding: 24px;
    border-radius: 10px;
  }

  .main-product h1 {
    font-size: 32px;
  }

  .purchase-bar,
  .settle-bar {
    bottom: 22px;
    width: min(980px, calc(100% - 112px));
    max-width: 980px;
    border: 1px solid rgba(122,94,68,.14);
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(64,43,28,.18);
  }

  .cart-page {
    min-height: 100vh;
    padding: 112px clamp(44px, 6vw, 96px) 122px;
    background: #fbf7ef;
  }

  .promo-bar,
  .cart-list,
  .cart-page .empty-cart {
    max-width: 1080px;
    margin-right: auto;
    margin-left: auto;
  }

  .cart-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 22px 0 108px;
  }

  .cart-item {
    margin-bottom: 0;
  }

  .studio-page {
    display: grid;
    grid-template-columns: minmax(330px, .86fr) minmax(420px, 1.14fr);
    gap: 18px;
    align-items: start;
  }

  .studio-page .page-head {
    grid-column: 1 / -1;
  }

  .studio-card {
    margin-top: 0;
    padding: 20px;
  }

  .studio-card:first-of-type {
    position: sticky;
    top: 104px;
  }

  .studio-card:nth-of-type(3) {
    grid-column: 2;
  }

  .selected-studio-asset {
    grid-template-columns: 132px 1fr;
    padding: 12px;
  }

  .selected-studio-asset img,
  .selected-studio-asset video,
  .selected-studio-asset .generated-cover-placeholder {
    width: 132px;
    height: 132px;
  }

  .generate-form {
    grid-template-columns: 1fr 1fr;
  }

  .generate-form input,
  .generate-form button {
    grid-column: 1 / -1;
  }

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

  .generated-card {
    grid-template-columns: 1fr;
  }

  .generated-card img,
  .generated-card video,
  .generated-cover-placeholder {
    width: 100%;
    height: 160px;
  }

  .generated-detail-page {
    display: grid;
    grid-template-columns: minmax(420px, .9fr) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
  }

  .generated-detail-page .text-back,
  .generated-detail-page .page-head,
  .generated-actions {
    grid-column: 1 / -1;
  }

  .generated-hero-card,
  .generation-preview {
    margin-top: 0;
  }

  .generated-hero-media {
    max-height: 460px;
  }

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

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

  .user-page {
    display: grid;
    grid-template-columns: minmax(320px, .75fr) minmax(460px, 1.25fr);
    gap: 20px;
    align-items: start;
  }

  .user-page .profile-panel,
  .user-page > .wide-action {
    grid-column: 1;
  }

  .user-page .section-list {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }

  .profile-panel {
    padding: 26px;
  }

  .order-card {
    padding: 14px;
  }

  .auth-panel {
    max-width: 430px;
    padding: 24px;
  }
}
