:root {
  --text: #242424;
  --muted: #747474;
  --soft: #f6f5f2;
  --panel: #ffffff;
  --line: #e9e6df;
  --accent: #b9412f;
  --accent-dark: #8f2f22;
  --ink: #171717;
  --tag: #f1eee7;
  --shadow: 0 18px 42px rgba(32, 28, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #fbfaf7;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.nav-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr) 180px;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 0 clamp(24px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  width: max-content;
  font-weight: 800;
}

.brand-cn {
  font-size: 24px;
}

.brand-en {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.search {
  justify-self: center;
  position: relative;
  width: min(440px, 100%);
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 18px 0 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  outline: 0;
  background: #f1f0ed;
  color: var(--text);
}

.search input:focus {
  border-color: #d7c7b5;
  background: #fff;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 18px;
  color: var(--muted);
  font-size: 21px;
  transform: translateY(-50%);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #555;
  white-space: nowrap;
}

.header-actions a:hover,
.nav-button:hover,
.site-footer a:hover,
.result-row a:hover {
  color: var(--accent);
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  width: min(1180px, calc(100% - 48px));
  margin: 42px auto 0;
  padding: 42px 0 20px;
  border-bottom: 1px solid var(--line);
}

.intro-copy h1 {
  max-width: 760px;
  margin: 8px 0 16px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-copy p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

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

.intro-panel {
  align-self: end;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.intro-panel span,
.sort-control span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.intro-panel strong {
  display: block;
  margin: 8px 0;
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
}

.intro-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.shop-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 34px auto 0;
}

.shop-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.shop-heading h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.25;
}

.sort-control {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.sort-control select {
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.category-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #565656;
}

.category-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

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

.product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  overflow: hidden;
}

.product-card:hover {
  border-color: #d9cabb;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 24px;
  background: #f7f6f3;
}

.product-card-body {
  padding: 16px 16px 10px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.product-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tag);
  color: #625a50;
  font-size: 12px;
}

.product-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.price {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.detail-link {
  color: var(--ink);
  font-weight: 700;
}

.empty-state {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

.category-block {
  width: min(1180px, calc(100% - 48px));
  margin: 56px auto 0;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.category-block h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

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

.help-grid article,
.content-note {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.help-grid strong,
.content-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
}

.help-grid p,
.content-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 48px));
  margin: 18px auto 0;
  padding: 28px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.detail-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 34px auto 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: start;
}

.media-panel,
.detail-summary,
.detail-section {
  background: #fff;
  border: 1px solid var(--line);
}

.media-panel {
  overflow: hidden;
}

.video-placeholder,
.video-link {
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 28px;
  background: linear-gradient(135deg, #f0eee9, #ffffff);
  color: var(--muted);
  text-align: center;
}

.video-link strong,
.video-placeholder strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 20px;
}

.detail-summary {
  padding: 26px;
}

.detail-summary h1 {
  margin: 10px 0 12px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.18;
}

.detail-summary p {
  color: var(--muted);
  line-height: 1.9;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.buy-button,
.copy-contact,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  font-weight: 800;
}

.buy-button,
.copy-contact {
  background: var(--accent);
  color: #fff;
}

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

.buy-button:hover,
.copy-contact:hover {
  background: var(--accent-dark);
}

.secondary-button:hover {
  border-color: #d8c9ba;
  color: var(--accent);
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  margin-top: 20px;
}

.detail-section {
  padding: 24px;
}

.detail-section + .detail-section {
  margin-top: 20px;
}

.detail-section h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 22px;
}

.detail-section p,
.detail-section li {
  color: var(--muted);
  line-height: 1.9;
}

.detail-section ul,
.detail-section ol {
  margin: 0;
  padding-left: 1.2em;
}

.side-stack {
  display: grid;
  gap: 20px;
}

.fallback {
  padding: 54px 0;
  text-align: center;
}

.fallback h1 {
  margin: 0 0 12px;
}

.fallback a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 12px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 26px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.modal-panel h2 {
  margin: 8px 0 16px;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  background: #f4f2ed;
  border: 1px solid var(--line);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-placeholder {
  width: 136px;
  height: 136px;
  padding: 10px;
  background:
    linear-gradient(90deg, #222 10px, transparent 10px) 0 0 / 34px 34px,
    linear-gradient(#222 10px, transparent 10px) 0 0 / 34px 34px,
    #fff;
  border: 10px solid #fff;
  outline: 1px solid #ded8cf;
}

.modal-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.download-box {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 16px;
  background: #f7f5f0;
  border: 1px solid var(--line);
}

.download-box span {
  color: var(--muted);
  font-size: 12px;
}

.download-box a {
  color: var(--accent);
  font-weight: 800;
  word-break: break-all;
}

.modal-panel p {
  color: var(--muted);
  line-height: 1.8;
}

.copy-status {
  display: block;
  min-height: 18px;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
}

.page-main {
  width: min(900px, calc(100% - 48px));
  margin: 54px auto 0;
  padding-bottom: 24px;
}

.page-main h1 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 36px;
}

.page-main h2,
.page-main h3 {
  margin: 30px 0 12px;
  color: var(--ink);
}

.page-main p,
.page-main li {
  color: var(--muted);
  line-height: 2;
}

.page-main p {
  margin: 0 0 14px;
}

.page-main ul,
.page-main ol {
  padding-left: 1.3em;
}

.page-kicker {
  color: var(--accent);
  font-weight: 800;
}

.support-card {
  margin: 24px 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.support-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.login-shell {
  width: min(980px, calc(100% - 48px));
  margin: 54px auto 0;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.login-panel h1 {
  margin: 10px 0 16px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
}

.login-panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card > strong {
  color: var(--ink);
  font-size: 20px;
}

.login-qr {
  margin: 0 auto;
}

.logto-config {
  text-align: left;
}

.logto-config p {
  margin: 4px 0;
  font-size: 13px;
  word-break: break-all;
}

.admin-body {
  background: #f4f4f1;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 14px clamp(18px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.admin-topbar p,
.editor-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-top-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  width: min(1420px, calc(100% - 32px));
  margin: 18px auto 36px;
}

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

.admin-panel {
  background: #fff;
  border: 1px solid var(--line);
}

.admin-panel-heading,
.editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel,
.form-section {
  padding: 18px;
}

.admin-panel h1,
.admin-panel h2,
.admin-panel h3 {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.25;
}

.admin-panel h1 {
  font-size: 24px;
}

.admin-panel h2 {
  font-size: 22px;
}

.admin-panel h3 {
  margin-bottom: 14px;
  font-size: 17px;
}

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

.admin-filter-grid {
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.admin-field {
  display: grid;
  gap: 6px;
}

.admin-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--text);
}

.admin-field textarea {
  resize: vertical;
  line-height: 1.65;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  border-color: #c9ad95;
  box-shadow: 0 0 0 3px rgba(185, 65, 47, 0.1);
}

.span-2 {
  grid-column: span 2;
}

.resource-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 278px);
  overflow: auto;
}

.resource-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.resource-row.is-active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.resource-row strong {
  color: var(--ink);
  line-height: 1.35;
}

.resource-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip,
.resource-row-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tag);
  color: #61594e;
  font-size: 12px;
}

.status-chip.published {
  background: #e8f4ed;
  color: #267143;
}

.status-chip.draft {
  background: #fff5d8;
  color: #83610e;
}

.status-chip.archived {
  background: #eee;
  color: #686868;
}

.admin-editor {
  min-width: 0;
}

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

.admin-message {
  padding: 12px 14px;
  border: 1px solid #e6c9c4;
  background: #fff6f4;
  color: var(--accent-dark);
  line-height: 1.6;
}

.admin-message.is-success {
  border-color: #c8e3d2;
  background: #f2fbf5;
  color: #276f43;
}

.danger-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #e1beb8;
  border-radius: 4px;
  background: #fff;
  color: #a13325;
  font-weight: 800;
}

.danger-button:hover {
  border-color: #c77c70;
  background: #fff6f4;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand,
  .search,
  .header-actions {
    justify-self: stretch;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .intro-band,
  .login-panel,
  .detail-hero,
  .detail-content {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    align-self: stretch;
  }

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

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

  .admin-topbar,
  .admin-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-top-actions,
  .editor-actions {
    justify-content: flex-start;
  }

  .resource-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .intro-band,
  .shop-shell,
  .category-block,
  .site-footer,
  .detail-shell,
  .login-shell,
  .page-main {
    width: calc(100% - 32px);
  }

  .intro-band {
    margin-top: 24px;
    padding-top: 26px;
  }

  .shop-heading,
  .result-row,
  .detail-buy-row,
  .site-footer {
    display: block;
  }

  .sort-control {
    margin-top: 16px;
  }

  .category-tabs {
    flex-wrap: nowrap;
    margin-right: -16px;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .category-tabs button {
    flex: 0 0 auto;
  }

  .result-row a {
    display: inline-block;
    margin-top: 8px;
  }

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

  .product-card {
    min-height: 330px;
  }

  .product-card img {
    padding: 16px;
  }

  .product-card-body {
    padding: 12px;
  }

  .product-card h3 {
    font-size: 14px;
  }

  .product-card p {
    font-size: 13px;
  }

  .product-card-footer {
    align-items: flex-start;
    display: grid;
    padding: 12px;
  }

  .detail-summary h1 {
    font-size: 28px;
  }

  .detail-buy-row .buy-button {
    width: 100%;
    margin-top: 14px;
  }

  .video-placeholder,
  .video-link {
    min-height: 230px;
  }

  .site-footer nav {
    margin-top: 16px;
  }

  .admin-shell {
    width: calc(100% - 24px);
  }

  .admin-form-grid,
  .span-2 {
    display: grid;
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .admin-panel-heading,
  .editor-heading {
    display: grid;
  }
}

@media (max-width: 440px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .intro-copy h1 {
    font-size: 32px;
  }

  .modal {
    padding: 14px;
  }
}
