:root {
  --bg: #fff8e6;
  --surface: #ffffff;
  --surface-soft: #fffdf5;
  --line: #eadfca;
  --line-strong: #d8c59d;
  --text: #17202d;
  --muted: #687385;
  --muted-strong: #485568;
  --primary: #d97706;
  --primary-soft: #fff3d4;
  --success: #9a5b00;
  --success-soft: #fff1bd;
  --danger: #b42318;
  --danger-soft: #fff1f1;
  --shadow: 0 12px 32px rgba(18, 30, 50, 0.08);
  --shadow-soft: 0 6px 20px rgba(18, 30, 50, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

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

.app-body:has(.product-bottom-actions) {
  background: #fff;
  padding-bottom: 96px;
}

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

.page-narrow {
  width: min(760px, calc(100vw - 32px));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 8px 0;
  background: rgba(255, 248, 230, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-topbar {
  min-height: 48px;
  background: transparent;
  backdrop-filter: none;
}

.overlay-topbar {
  position: fixed;
  left: 50%;
  top: 10px;
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  background: transparent;
  transform: translateX(-50%);
  pointer-events: none;
}

.overlay-topbar > *,
.overlay-topbar .topbar-actions {
  pointer-events: auto;
}

.icon-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.icon-button:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.overlay-topbar .icon-button {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.38);
}

.overlay-topbar .icon-button:hover {
  color: #fff;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.btn-dark {
  background: #111827;
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-soft {
  background: var(--surface);
  border-color: var(--line);
}

.btn-full {
  width: 100%;
}

.eyebrow {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 13px;
  font-weight: 900;
}

.alert,
.status,
.empty {
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
}

.alert {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  width: min(360px, calc(100vw - 40px));
  margin: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
  text-align: center;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
  transform: translate(-50%, -50%);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.22);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(22, 93, 79, 0.22);
}

.status {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  display: none;
  width: min(360px, calc(100vw - 40px));
  margin: 0;
  padding: 16px 18px;
  border: 1px solid transparent;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
  transform: translate(-50%, -50%);
}

.status.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.status.ok {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(22, 93, 79, 0.14);
}

.status.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.14);
}

.message-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.message-button {
  min-width: 78px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
}

.badge.green {
  background: var(--success-soft);
  color: var(--success);
}

.badge.gray {
  background: #eef1f5;
  color: #566274;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-shell {
  width: min(440px, 100%);
}

.login-topbar {
  margin-bottom: 12px;
}

.login-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  font-size: 24px;
}

.ddango-logo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffe082, #f59e0b);
  color: #4a3000;
  font-size: 22px;
  font-weight: 900;
}

.ddango-logo i {
  position: relative;
  z-index: 1;
  transform: rotate(-10deg);
}

.ddango-logo::before {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
}

.ddango-logo::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 15px;
  height: 8px;
  border-radius: 999px 999px 999px 2px;
  background: #fff7cf;
  transform: rotate(-28deg);
}

.brand-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.social-list {
  display: grid;
  gap: 10px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.auth-links {
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 800;
}

.auth-options {
  display: flex;
  align-items: center;
  gap: 16px;
}

.check-field {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  color: var(--muted-strong) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.check-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--success);
}

.auth-links a {
  color: var(--primary);
}

.inline-field {
  display: flex;
  gap: 8px;
}

.inline-field .input {
  flex: 1;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field .input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.field-message {
  min-height: 18px;
  margin: -8px 0 0;
  font-size: 12px;
  font-weight: 800;
}

.field-message.success {
  color: var(--success);
}

.field-message.error {
  color: var(--danger);
}

.social-button {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.social-button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.social-button.google i {
  color: #4285f4;
}

.social-button.facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}

.social-button.kakao {
  background: #fee500;
  border-color: #fee500;
  color: #191600;
}

.social-button.naver {
  background: #03c75a;
  border-color: #03c75a;
  color: #fff;
}

.social-button.test-login {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.social-button.test-login i {
  color: #8ee6c1;
}

.login-divider {
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.social-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 13px;
  font-weight: 900;
}

.product-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#goodsPage.page-narrow {
  width: min(760px, 100vw);
  padding-top: 0;
}

.product-media {
  position: relative;
  background: #e9eef5;
}

.product-image-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  cursor: zoom-in;
  touch-action: pan-y;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
}

.product-status {
  position: absolute;
  left: 14px;
  top: auto;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.thumbnail-strip {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.thumbnail-button {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  min-width: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef1f5;
  cursor: pointer;
}

.thumbnail-button.active {
  border-color: var(--primary);
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-body {
  padding: 22px;
}

.product-heading {
  margin-bottom: 14px;
}

.product-title {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.25;
}

.product-price {
  color: #111827;
  font-size: 30px;
  font-weight: 900;
}

.product-desc {
  margin: 0 0 18px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
}

.info-grid {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  gap: 10px;
}

.info-grid div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
}

.info-grid dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.info-grid dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.url-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #eef3ff;
  color: #2f3a4a;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.url-box-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.url-box-inline span {
  min-width: 0;
  flex: 1;
}

.url-copy-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.url-copy-button:hover {
  background: rgba(37, 99, 235, 0.1);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.product-bottom-actions {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 100%;
  margin: 0;
  padding: 10px max(16px, calc((100vw - 760px) / 2 + 16px)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  backdrop-filter: blur(16px);
}

.bottom-action {
  min-width: 0;
  min-height: 58px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #202938;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bottom-action i {
  font-size: 20px;
}

.bottom-action-primary {
  color: #e11d48;
}

.bottom-action-primary i {
  display: inline-grid;
  place-items: center;
  color: #e11d48;
  font-size: 22px;
}

.gallery-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(5, 8, 13, 0.92);
}

.gallery-layer.show {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.gallery-topbar {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.gallery-close,
.gallery-nav {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  cursor: pointer;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.gallery-nav {
  color: rgba(255, 255, 255, 0.5);
}

.gallery-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}

.gallery-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-prev {
  left: 16px;
}

.gallery-next {
  right: 16px;
}

.gallery-counter {
  padding: 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.auth-panel {
  display: none;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.auth-panel.show {
  display: block;
}

.auth-panel h2,
.section-title {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.share-section {
  margin-top: 22px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.share-link {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.page-hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.page-hero {
  margin-bottom: 16px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.page-title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.25;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 14px;
}

.meta-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-stat {
  min-width: 130px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--success);
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: right;
}

.hero-stat-label {
  font-size: 13px;
  font-weight: 800;
}

.hero-stat strong {
  font-size: 28px;
  line-height: 1;
}

.panel {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
}

.panel-caption {
  color: var(--muted);
  font-size: 13px;
}

.tree-wrap {
  overflow-x: auto;
}

.promotion-tree,
.promotion-tree ul {
  margin: 0;
  padding-left: 28px;
  list-style: none;
}

.promotion-tree {
  min-width: 680px;
  padding-left: 0;
}

.promotion-node {
  position: relative;
  margin: 16px 0 0;
  padding-left: 26px;
}

.promotion-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  width: 22px;
  border-top: 2px solid #c9d3e0;
}

.promotion-node::after {
  content: "";
  position: absolute;
  left: 0;
  top: -16px;
  bottom: calc(100% - 27px);
  border-left: 2px solid #c9d3e0;
}

.promotion-tree > .promotion-node {
  padding-left: 0;
}

.promotion-tree > .promotion-node::before,
.promotion-tree > .promotion-node::after {
  display: none;
}

.promotion-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(250px, 2fr) minmax(140px, 0.9fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  box-shadow: 0 4px 14px rgba(24, 35, 55, 0.04);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.promotion-card.has-children {
  cursor: pointer;
}

.promotion-card.has-children:hover {
  border-color: var(--line-strong);
  background: #f7fbff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.promotion-node.collapsed > ul {
  display: none;
}

.share-no {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
}

.toggle-mark,
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-mark {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: #e8f1ef;
  color: var(--success);
  font-size: 12px;
}

.share-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--radius);
  background: #eef3f8;
  color: #59687c;
}

.share-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.share-label {
  color: #8a97a8;
  font-size: 11px;
  font-weight: 900;
}

.share-value {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.detail {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.4;
}

.detail-row {
  display: grid;
  grid-template-columns: 20px 78px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.detail-row i {
  color: #7d8a9d;
  line-height: 20px;
  text-align: center;
}

.detail-label {
  color: var(--muted);
  font-weight: 800;
}

.detail-value {
  min-width: 0;
  color: #364153;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.badges {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.mypage {
  display: grid;
  gap: 16px;
}

.mypage-hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hero-action {
  min-width: 150px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
}

.metric-card span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-card i {
  color: var(--success);
}

.metric-card strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

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

.promotion-chart {
  display: grid;
  gap: 12px;
}

.chart-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.5fr) 110px;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.chart-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  display: block;
  background: linear-gradient(90deg, var(--success), var(--primary));
}

.chart-value {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.chart-value strong {
  color: var(--text);
  font-size: 18px;
}

.chart-value em {
  color: var(--success);
  font-style: normal;
  font-weight: 900;
}

.goods-list {
  display: grid;
  gap: 10px;
}

.mini-goods-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mini-goods-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.mini-goods-card img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #e9eef5;
}

.mini-goods-card span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.mini-goods-card strong,
.mini-goods-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-goods-card strong {
  font-size: 14px;
}

.mini-goods-card small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-goods-card em {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.chat-list-card {
  grid-template-columns: 52px minmax(0, 1fr) minmax(94px, auto);
}

.chat-body {
  background: #e8edf3;
}

.chat-page {
  min-height: 100vh;
  display: grid;
  align-content: start;
  padding-bottom: 0;
}

.chat-shell {
  height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f7fa;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-sticky-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
}

.chat-topbar {
  margin: 0;
  padding: 12px;
  border-bottom: 0;
  background: transparent;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.chat-header img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #e9eef5;
}

.chat-header h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.chat-header span {
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-role {
  margin-top: 5px;
  display: inline-flex;
  color: var(--success);
  font-size: 13px;
  font-weight: 900;
}

.chat-window {
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.chat-day {
  align-self: center;
  margin-bottom: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(104, 115, 133, 0.16);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.chat-message {
  max-width: min(78%, 520px);
  display: grid;
  gap: 4px;
}

.chat-message.mine {
  align-self: flex-start;
  justify-items: start;
}

.chat-message.theirs {
  align-self: flex-end;
  justify-items: end;
}

.chat-message strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bubble {
  padding: 11px 13px;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 10px rgba(18, 30, 50, 0.08);
}

.chat-message.mine .bubble {
  background: #3f4651;
  color: #fff;
  border-top-left-radius: 2px;
}

.chat-message.theirs .bubble {
  background: #fee500;
  color: #1f2937;
  border-top-right-radius: 2px;
}

.chat-message time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chat-form {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-form input {
  height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
}

.chat-form input:disabled {
  color: var(--muted);
  background: #eef1f5;
  cursor: not-allowed;
}

.chat-form button:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.chat-empty {
  margin: 18px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.form-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
}

.goods-form {
  display: grid;
  gap: 14px;
}

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

.textarea {
  min-height: 120px;
  padding-top: 12px;
  resize: vertical;
}

.editor-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.rich-editor {
  min-height: 180px;
}

.editor-field .ck-editor__editable {
  min-height: 180px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.editor-field .ck.ck-editor__main > .ck-editor__editable {
  border-color: var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}

.editor-field .ck.ck-toolbar {
  border-color: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

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

.file-input {
  padding: 10px 12px;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.photo-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.photo-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.photo-preview-list.empty {
  grid-template-columns: 1fr;
}

.photo-preview-card {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  display: block;
}

.photo-main-selector {
  display: block;
  cursor: pointer;
}

.goods-form label.photo-main-selector {
  display: block;
  gap: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.photo-main-selector input {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
}

.photo-preview-card img {
  width: 100%;
  height: 96px;
  display: block;
  object-fit: cover;
}

.photo-type-badge {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.photo-preview-card:has(input:checked) {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(22, 93, 79, 0.14);
}

.photo-preview-card:has(input:checked) .photo-type-badge {
  background: var(--success-soft);
  color: var(--success);
}

.photo-delete-button {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.photo-delete-button:hover {
  background: var(--danger-soft);
}

@media (max-width: 760px) {
  .page,
  .page-narrow {
    width: min(100vw - 24px, 100%);
    padding-top: 14px;
  }

  .page-hero,
  .mypage-hero,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .overlay-topbar {
    width: calc(100vw - 20px);
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1;
  }

  .hero-stat {
    text-align: left;
  }

  .metric-grid,
  .dashboard-grid,
  .form-grid,
  .share-grid {
    grid-template-columns: 1fr;
  }

  .product-bottom-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-left: 10px;
    padding-right: 10px;
  }

  .bottom-action {
    font-size: 11px;
  }

  .chart-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chart-value {
    justify-content: flex-start;
  }

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

  .chat-shell {
    height: calc(100vh - 28px);
  }

  .chat-message {
    max-width: 88%;
  }

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

  .product-body {
    padding: 18px;
  }

  .product-title,
  .product-price,
  .page-title {
    font-size: 25px;
  }

  .info-grid div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .promotion-tree {
    min-width: 560px;
  }

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

  .badges {
    justify-content: flex-start;
  }
}

.app-body:not(.login-body) {
  background: #fff;
}

.app-body:not(.login-body) .page,
.app-body:not(.login-body) .page-narrow {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 56px;
}

.app-body:not(.login-body) .topbar {
  margin-bottom: 0;
  padding-left: 16px;
  padding-right: 16px;
}

.app-body:not(.login-body) .page:not(#goodsPage):not(.chat-page) {
  padding-left: 16px;
  padding-right: 16px;
}

.app-body:not(.login-body) .page:not(#goodsPage):not(.chat-page) .topbar {
  padding-left: 0;
  padding-right: 0;
}

.app-body:not(.login-body) .chat-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-body {
  background: #fff;
}

.app-body:not(.login-body) .chat-page {
  width: 100%;
  padding: 0;
}

.app-body:not(.login-body) .chat-shell {
  height: 100vh;
}
