:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  --ink: #1d332c;
  --muted: #546b61;
  --green: #185747;
  --pale: #e9f2ed;
  --line: #d8e4dd;
  --store-brand: #185747;
  --store-accent: #aa4c32;
  background: #f3f7f4;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
h2 { font-size: 1rem; }
a { color: var(--green); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid #278675; outline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, .page-actions a, .action-row a {
  min-height: 34px; color: var(--ink); background: white; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
button:hover, .page-actions a:hover, .action-row a:hover { background: var(--pale); }
button:disabled { opacity: .6; cursor: progress; }
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: #104437; }
.quiet { background: #f3f7f4; }
.danger { color: #9b3f37; }
button.current, .list-entry.current { background: var(--pale); border-color: #a0b9ac; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  padding: 7px 8px; border: 1px solid #b8cbc1; border-radius: 6px; width: 100%; min-width: 0;
  min-height: 35px; background: white; color: var(--ink);
}
input[type=color] { min-width: 47px; max-width: 85px; }
input[type=file] { max-width: 100%; }
input[type=checkbox] { accent-color: var(--green); }
img, video { display: block; max-width: 100%; }
.sidebar {
  position: sticky; top: 0; min-height: 100vh; align-self: start; background: #183d32; color: white;
  display: flex; flex-direction: column; padding: 25px 14px; gap: 26px;
}
.admin { display: grid; grid-template-columns: 155px minmax(0, 1fr); }
.brand { color: #fff; text-decoration: none; font-weight: 750; font-size: 1.02rem; margin-left: 8px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav button { text-align: left; color: #dbece4; background: transparent; border: 1px solid transparent; }
.sidebar nav button:hover, .sidebar nav button[aria-current] { color: white; background: #2d5d4c; }
.sidebar-link { margin: auto 8px 0; color: #e3f0e9; }
.dashboard { max-width: 1680px; width: 100%; padding: 28px clamp(14px, 2.5vw, 36px); }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.section-label { color: var(--muted); font-size: .77rem; margin-bottom: 3px; }
.status { padding: 10px 0; min-height: 38px; color: #256650; }
.status.error { color: #a43b32; }
.muted, .summary { color: var(--muted); font-size: .88rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.panel { min-width: 0; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.panel > h2, .panel > .button-stack { margin-bottom: 12px; }
.panel > button:not(.list-entry), .panel > fieldset { margin-top: 8px; }
.workbench { display: grid; grid-template-columns: minmax(145px, 200px) minmax(255px, 1fr) minmax(220px, 318px); gap: 12px; align-items: start; }
.canvas-space { min-width: 0; }
.page-actions { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.page-actions h2, .secondary-actions { margin: 7px 0; }
.secondary-actions a { display: inline-flex; align-items: center; }
.phone { max-width: 390px; margin: 15px auto 0; background: #fff; border: 5px solid #29453c; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 36px #283e3117; }
.phone-title { color: #fff; padding: 13px; text-align: center; font-weight: 650; }
.phone-content { min-height: 355px; height: min(60vh, 540px); overflow: auto; padding: 5px 0 18px; }
.store-nav { display: grid; grid-template-columns: repeat(var(--columns, 4), 1fr); border-top: 1px solid var(--line); background: #fff; padding: 10px 2px; }
.store-nav a { text-align: center; text-decoration: none; font-size: .86rem; font-weight: 600; }
.store-nav a[aria-current] { text-decoration: underline; }
.store-nav img { width: 24px; height: 24px; object-fit: contain; margin: 0 auto 3px; }
.list-entry { width: 100%; text-align: left; margin-top: 7px; }
.list-entry small { display: block; color: var(--muted); margin-top: 3px; }
.palette-title { margin-top: 19px; }
.palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.palette button { font-size: .78rem; min-height: 40px; padding: 4px; }
.properties { max-height: 78vh; overflow: auto; }
.properties > .row { margin-bottom: 9px; }
.field-list, .field-columns { display: grid; gap: 10px; }
.region-picker { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,125px),1fr)); gap: 8px; }
.freight-regions { gap: 6px; }
.field-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .83rem; margin: 6px 0; min-width: 0; }
.field:has(input[type=checkbox]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
.field-with-button { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
.field-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.field-group legend, .details-group summary { color: var(--muted); font-weight: 650; }
.details-group { border: 1px solid var(--line); padding: 8px; border-radius: 7px; margin: 6px 0; }
.details-group summary { cursor: pointer; }
.details-group .row { margin-top: 7px; }
.product-picker .row { justify-content: space-between; }
.split { display: grid; grid-template-columns: minmax(215px, 270px) minmax(0, 1fr); gap: 12px; align-items: start; }
.poster-workbench { grid-template-columns: minmax(245px, 0.8fr) minmax(260px, 1.1fr); }
.theme-workbench { grid-template-columns: minmax(180px, .65fr) minmax(0, 1fr); }
.poster-stage { position: relative; width: min(100%, 299px); overflow: hidden; border-radius: 7px; }
.poster-canvas { display: block; width: min(100%, 330px); margin: auto; height: auto; background: var(--green); border-radius: 7px; }
.poster-stage .poster-canvas { width: 100%; }
.admin button.poster-handle {
  position: absolute; transform: translate(-50%, -50%); touch-action: none; cursor: grab; user-select: none;
  min-width: 26px; min-height: 22px; padding: 0; border: 1px dashed #ffffffab; border-radius: 4px;
  background: transparent; box-shadow: 0 0 0 1px #133f35a6;
}
.admin button.poster-handle:hover, .admin button.poster-handle[aria-pressed="true"] {
  border-style: solid; border-color: #8fecdb; box-shadow: 0 0 0 1px #113b31; z-index: 1;
}
.admin button.poster-handle:focus-visible { outline: 2px solid #8fecdb; outline-offset: 2px; }
.admin button.poster-handle.is-dragging { cursor: grabbing; z-index: 2; }
.poster-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.poster-thumbs button { max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
.poster-thumbs img { width: 65px; height: 72px; object-fit: cover; margin: auto auto 4px; }
.poster-public-actions { justify-content: center; margin: 15px; }
.theme-sample { overflow: hidden; border-radius: 9px; padding: 0 0 14px; margin: 12px 0; max-width: 350px; }
.theme-sample h2 { color: white; padding: 16px; }
.theme-sample p { margin: 16px; font-weight: 750; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(110px,1fr)); gap: 10px; margin: 10px 0; }
.material { text-overflow: ellipsis; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; padding: 6px; overflow-wrap: anywhere; }
.material img, .material video { height: 90px; width: 100%; object-fit: contain; background: var(--pale); margin-bottom: 5px; }
.material button { margin-top: 4px; }
dialog { max-width: min(650px, 94vw); width: 100%; max-height: 92vh; overflow: auto; border: 1px solid var(--line); border-radius: 13px; padding: 17px; color: var(--ink); }
dialog h2 { margin-bottom: 14px; }
dialog::backdrop { background: #112d26a8; }
.preview-width { width: min(100%, 390px); margin: auto; }
.rich-surface, .source-editor { min-height: 250px; width: 100%; padding: 12px; border: 1px solid var(--line); border-top: 0; overflow: auto; }
.rich-surface img, .rich-surface video, .rich-content img, .rich-content video { max-width: 100%; height: auto; margin-block: 8px; }
.rich-surface p, .rich-content p { margin-block: .5em; }
.action-row { margin-top: 12px; }
.customer { min-height: 100vh; display: flex; justify-content: center; }
.shop-shell { display: flex; flex-direction: column; width: min(100%, 520px); background: white; min-height: 100vh; }
.shop-shell > .status { padding: 8px 14px; min-height: 0; }
.shop-shell > .status:empty { display: none; }
#shop { flex: 1; min-height: 200px; padding-bottom: 15px; }
#shop > .poster-canvas { margin-top: 12px; }
#shop-nav { position: sticky; bottom: 0; }
.store-empty, .rich-content { margin: 14px; padding: 10px; overflow-wrap: anywhere; }
.store-block { overflow: hidden; margin-block: 5px; }
.store-block hr { border: 0; border-top: 1px solid; }
.store-block video { width: 100%; max-height: 64vh; background: #172b25; }
.designer-block { cursor: grab; outline: 1px dashed transparent; outline-offset: -2px; }
.designer-block:hover, .selected-block { outline: 2px dashed #318c77; }
.search-widget { display: flex; padding: 6px; gap: 5px; margin-inline: 12px; border: 1px solid var(--line); }
.search-widget.round { border-radius: 22px; }
.search-widget input[type=search] { border: 0; background: transparent; }
.search-widget button { background: var(--store-brand); color: white; border: 0; border-radius: 18px; }
.empty-image { display: grid; place-items: center; min-height: 110px; height: 100%; background: #dfebe4; color: #47665a; }
.visual-tile { display: block; min-width: 0; }
.visual-tile > img { width: 100%; height: 100%; object-fit: cover; }
.carousel { position: relative; }
.carousel .visual-tile { height: 100%; }
.carousel-controls { position: absolute; bottom: 6px; left: 8px; right: 8px; display: flex; gap: 5px; justify-content: center; }
.carousel-controls button { min-height: 26px; padding: 3px 8px; }
.carousel-controls button.current-dot { background: var(--store-brand); color: white; }
.tile-grid, .icon-grid, .product-grid, .asset-grid { display: grid; gap: 8px; }
.tile-grid.grid4, .tile-grid.two-row, .product-grid.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile-grid.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.icon-grid { grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr)); text-align: center; padding: 7px; }
.icon-grid.horizontal { grid-auto-flow: column; grid-auto-columns: 24%; grid-template-columns: none; overflow: auto; }
.icon-grid img, .icon-fallback { display: grid; width: 38px; aspect-ratio: 1; place-items: center; background: #dcebe3; margin: auto auto 5px; object-fit: cover; }
.circle, .member-avatar { border-radius: 50%; }
.icon-grid span, .icon-grid a { min-width: 0; font-size: .77rem; overflow-wrap: anywhere; }
.store-title { padding: 5px 12px; }
.store-title p { color: var(--muted); font-size: .8rem; }
.center, .centered { text-align: center; }
.notice-widget { display: flex; align-items: center; padding: 8px; gap: 4px; overflow: hidden; min-height: 37px; }
.notice-widget img { width: 22px; }
.notice-widget.horizontal span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goods-widget h2 { margin: 5px 9px; }
.product-grid { padding: 7px; }
.product-grid.scroll { grid-auto-flow: column; grid-auto-columns: 42%; overflow: auto; }
.product-card { background: white; border: 1px solid var(--line); border-radius: 8px; min-width: 0; padding: 8px; overflow-wrap: anywhere; }
.product-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; margin-bottom: 5px; }
.price-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
.price { color: var(--store-accent); }
.member-widget, .mine-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 9px; }
.member-widget { color: white; }
.member-widget img:not(.widget-background), .member-avatar { border-radius: 50%; display: grid; width: 44px; aspect-ratio: 1; place-items: center; color: #20493b; background: var(--pale); }
.member-widget a { color: white; }
.widget-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.widget-background ~ * { z-index: 1; }
.mine-card { background: white; }
.asset-grid { display: flex; flex-direction: row; justify-content: space-around; }
.asset-grid div { display: grid; text-align: center; }
.login { width: min(90%, 420px); margin: 13vh auto; }
.shop-shell .commerce-card, .shop-shell .commerce-links { margin: 12px; }
.shop-shell .commerce-card .commerce-links { margin: 9px 0; }
.commerce-card { margin-bottom: 10px; }
.commerce-card > .field-list { margin-top: 10px; }
.commerce-card > .field-list > button { justify-self: start; }
.commerce-line { display: flex; justify-content: space-between; gap: 9px; align-items: start; font-size: .88rem; padding: 7px 0; border-bottom: 1px solid var(--line); }
.commerce-line + .commerce-line { margin-top: 2px; }
.commerce-line > * { min-width: 0; overflow-wrap: anywhere; }
.commerce-line strong { text-align: right; }
.commerce-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.metric { font-size: 1.6rem; }
.commerce-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--pale); text-decoration: none; }
.commerce-links a:hover { background: #dcebe3; }
.commerce-product { min-height: 165px; }
.catalog-filters { padding: 8px 12px 0; }
.catalog-search { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.marketplace-grid { padding: 8px 12px; }
.product-name { margin-top: 10px; font-size: 1.2rem; }
.product-price { display: inline-block; margin: 9px 3px 9px 0; font-size: 1.45rem; }
.product-description { white-space: pre-wrap; margin: 9px 0; }
.cart-quantity { grid-template-columns: minmax(0, 160px) auto; align-items: end; }
.cart-quantity .field { margin-bottom: 0; }
.order-entry { display: block; padding: 6px 0; text-decoration: none; }
.order-entry:hover { background: var(--pale); }
.address-row { margin: 8px 0; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.address-row p { margin: 6px 0; }
.address-row button { margin-right: 4px; }
.member-summary > img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; margin-bottom: 8px; }
.order-workspace > .panel .panel { border: 0; padding-inline: 0; }
@media (max-width: 1000px) {
  .sidebar { padding-inline: 9px; }
  .admin { grid-template-columns: 111px minmax(0,1fr); }
  .dashboard { padding-inline: 12px; }
  .workbench { grid-template-columns: minmax(120px, .65fr) minmax(225px, 1fr) minmax(168px, .75fr); gap: 7px; }
  .panel { padding: 9px; }
}
@media (max-width: 730px) {
  .admin { display: block; }
  .sidebar { min-height: 0; position: static; gap: 7px; padding: 9px; }
  .sidebar nav { display: flex; gap: 2px; flex-wrap: wrap; }
  .sidebar nav button { font-size: .8rem; padding-inline: 5px; }
  .sidebar-link { margin: 0 8px; }
  .workbench, .split, .poster-workbench { display: flex; flex-direction: column; align-items: stretch; }
  .workbench .canvas-space { order: 1; }
  .workbench .properties { order: 2; max-height: none; }
  .workbench .rail { order: 0; }
  .palette { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .commerce-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.support-note { white-space: pre-line; overflow-wrap: anywhere; }
