/* 商城延续米白与墨绿界面；所有规则限定为商城组件。 */
.mall-shell { min-width: 0; padding-bottom: 18px; }
.mall-shell h1, .mall-shell h2, .mall-shell p, .mall-shell dd { overflow-wrap: anywhere; }
.mall-nav { margin-bottom: 22px; }
.mall-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .65fr) auto; align-items: end; gap: 10px; margin: 0 0 20px; }
.mall-filters .field { min-width: 0; }
.mall-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mall-product { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.mall-product-link { display: block; color: var(--ink); }
.mall-cover { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.mall-cover-empty { display: grid; place-items: center; color: var(--accent-line); }
.mall-cover-empty .icon { width: 56px; height: 56px; }
.mall-product-body { display: grid; gap: 6px; padding: 16px; }
.mall-product > .btn { width: calc(100% - 32px); margin: 0 16px 16px; }
.mall-price { color: var(--accent); font-size: 23px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mall-detail-cover { width: 100%; max-height: 420px; object-fit: contain; background: var(--paper-2); border-radius: var(--radius-s); }
.mall-facts { display: grid; gap: 10px; }
.mall-facts > div { display: grid; grid-template-columns: minmax(76px, .3fr) minmax(0, 1fr); gap: 12px; }
.mall-facts dt { color: var(--muted); font-size: 13px; }
.mall-facts dd { font-variant-numeric: tabular-nums; min-width: 0; }
.mall-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mall-actions > * { max-width: 100%; }
.mall-list { display: grid; gap: 12px; }
.mall-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; border-bottom: 1px solid var(--line-2); padding: 14px 0; }
.mall-line:last-child { border-bottom: 0; }
.mall-line > :first-child { min-width: 0; }
.mall-line .mall-price { font-size: 19px; }
.mall-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mall-total strong { color: var(--accent); font-size: 27px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mall-form-note { padding: 14px 16px; background: var(--paper-2); border-radius: var(--radius-s); font-size: 13px; line-height: 1.8; }
.mall-checkout { display: grid; gap: 16px; }
.mall-payment-choice { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.mall-payment-choice input { flex: none; }
.mall-payment-choice.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.mall-payment-choice small { display: block; color: var(--muted); }
.mall-qr { width: 240px; max-width: 100%; height: auto; object-fit: contain; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); margin: 0 auto; }
.mall-qr-actions { text-align: center; }
.mall-qr-actions a { display: inline-flex; min-height: 44px; align-items: center; }
.mall-upload input { max-width: 100%; width: 100%; min-height: 44px; }
.mall-file-result { display: block; overflow-wrap: anywhere; }
.mall-state-line { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.mall-status { display: inline-flex; align-items: center; border-radius: 6px; padding: 3px 9px; background: var(--paper-2); font-size: 13px; color: var(--ink-2); }
.mall-status.is-ok { background: var(--accent-soft); color: var(--accent); }
.mall-status.is-warn { background: var(--warn-soft); color: var(--warn); }
.mall-order-card { display: grid; gap: 9px; }
.mall-order-card h2 a { color: var(--ink); }
.mall-order-id { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mall-order-grid { display: grid; gap: 16px; }
.mall-order-grid > * { min-width: 0; }
.mall-timeline { display: grid; gap: 12px; }
.mall-timeline li { padding: 0 0 12px 14px; border-left: 2px solid var(--accent-line); }
.mall-timeline li:last-child { padding-bottom: 0; }
.mall-receipts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mall-receipts figure { min-width: 0; }
.mall-receipts img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; background: var(--paper-2); }
.mall-receipts a { display: block; min-height: 44px; overflow-wrap: anywhere; }
.mall-receipts figcaption { font-size: 12px; color: var(--muted); }
.mall-private-link { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; width: 100%; }
.mall-claim-secret { border: 2px solid var(--accent-line); }
.mall-claim-secret .cred-list dd { overflow-wrap: anywhere; }
.mall-claim-secret .cred-list code { word-break: break-all; }
.mall-access-form textarea { font-family: var(--mono); font-size: 13px; min-height: 110px; }
.mall-access-status { min-height: 24px; }
.mall-manage-list { display: grid; gap: 12px; }
.mall-manage-product { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
.mall-manage-cover { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.mall-product-info { min-width: 0; display: grid; gap: 6px; }
.mall-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 8px; }
.mall-item-head h2 { flex: 1; min-width: 0; }
.mall-selection-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); margin-bottom: 14px; }
.mall-selection-bar > .btn { margin-left: auto; }
.mall-edit-cover { max-width: 160px; max-height: 160px; object-fit: contain; border-radius: 8px; }
.mall-preview-list { display: grid; gap: 0; }
.mall-preview-list li { padding: 12px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.mall-preview-list li > div { min-width: 0; flex: 1; }
.mall-preview-list li:last-child { border-bottom: 0; }
.mall-category-form { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 12px; align-items: end; }
.mall-payment-grid { display: grid; gap: 16px; }
.mall-progress { display: grid; gap: 8px; }
.mall-order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mall-order-actions a { min-height: 44px; }
@media (max-width: 420px) {
  .mall-filters { grid-template-columns: minmax(0, 1fr) auto; }
  .mall-filters .field:first-child { grid-column: 1 / -1; }
  .mall-category-form { grid-template-columns: minmax(0, 1fr) 80px; }
  .mall-category-form > button { grid-column: 1 / -1; }
  .mall-receipts { grid-template-columns: minmax(0, 1fr); }
  .mall-facts > div { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .mall-actions > .btn { flex: 1 1 auto; }
  .mall-line { gap: 8px; }
}
@media (min-width: 760px) {
  .mall-page .shell { max-width: 960px; }
  .mall-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mall-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mall-order-grid { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .8fr); align-items: start; }
  .mall-detail { max-width: 640px; margin-inline: auto; }
}
/* 团体目录与商城内普通账号登录。 */
.mall-account-bar { position:relative; display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.mall-login-tip { position:static; }
.mall-login-tip summary { display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--line); border-radius:50%; cursor:pointer; font-weight:700; list-style:none; }
.mall-login-tip summary::-webkit-details-marker { display:none; }
.mall-login-tip p { position:absolute; z-index:5; top:36px; left:0; width:min(340px,100%); padding:14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-s); box-shadow:0 5px 18px #0001; font-size:14px; line-height:1.7; }
.mall-login-dialog { width:min(420px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:22px; margin:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--ink); }
.mall-login-dialog::backdrop { background:#162b2480; }
.mall-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.mall-dialog-head h2 { font-size:22px; }
.mall-login-dialog .field { min-width:0; }
.mall-breadcrumbs { margin-bottom:14px; font-size:14px; color:var(--muted); }
.mall-breadcrumbs ol { display:flex; flex-wrap:wrap; gap:6px; }
.mall-breadcrumbs li + li::before { content:' / '; padding-right:6px; }
.mall-search { grid-template-columns:minmax(0,1fr) auto; }
.mall-directory .mall-product-body h2 { font-size:20px; }
.mall-directory:not(:has(.mall-cover)) { border-left:3px solid var(--accent-line); }
.mall-directory-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; }
.mall-directory-row h2 { font-size:19px; }
.mall-directory-row .mall-actions { justify-content:flex-end; }
.mall-category-picker { display:grid; gap:12px; border:1px solid var(--line); padding:14px; border-radius:var(--radius-s); }
.mall-category-picker[hidden] { display:none; }
.mall-category-picked { overflow-wrap:anywhere; }
.mall-category-choice-list { display:grid; gap:8px; max-height:320px; overflow:auto; }
.mall-category-choice-list button { text-align:left; white-space:normal; overflow-wrap:anywhere; }
.mall-category-picker .mall-filters { margin:0; }
.mall-category-count { font-variant-numeric:tabular-nums; }
@media (max-width:420px) {
  .mall-login-dialog { padding:18px; }
  .mall-directory-row { grid-template-columns:minmax(0,1fr); }
  .mall-directory-row .mall-actions { justify-content:flex-start; }
  .mall-search .field:first-child { grid-column:auto; }
}

/* 子文件夹长名称及精确清理清单保持可读。 */
.mall-directory-row h2, .mall-directory .mall-product-body h2, .mall-retirement-row { overflow-wrap:anywhere; }
.mall-retirement-row { min-width:0; padding:12px 0; border-bottom:1px solid var(--line); }
.mall-retirement-row:last-child { border-bottom:0; }

/* ---------- 管理端整理：二级导航、筛选区、商品卡片（2026-10-19） ---------- */
/* 二级导航：一行文字标签，当前项带下划线；放不下时在行内横向滑动，不换行 */
.mall-manage-nav { display: flex; align-items: stretch; gap: 0 18px; margin: 0 0 18px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mall-manage-nav::-webkit-scrollbar { display: none; }
.mall-manage-nav a { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 46px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.mall-manage-nav a:hover { color: var(--accent); }
.mall-manage-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.mall-manage-nav .mall-nav-view { margin-left: auto; padding-left: 4px; font-size: 14px; }
.mall-manage-nav .icon { width: 15px; height: 15px; }

/* 筛选区：小屏两列、搜索与目录通栏；宽屏排成一行。目录筛选自带“当前目录＋选择”一行，不再和其他输入框抢格子 */
.mall-filters-manage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; align-items: end; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.mall-filters-manage > * { min-width: 0; }
.mall-filters-manage .mall-filter-wide { grid-column: 1 / -1; }
.mall-filters-manage select, .mall-filters-manage input[type="date"] { font-size: 15px; }
.mall-filter-reset:empty { display: none; }
.mall-filter-reset .btn { width: 100%; }
.mall-dir-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.mall-dir-quick { display: inline-flex; gap: 2px; margin-right: -6px; }
.mall-dir-quick .btn-link { min-height: 30px; padding: 0 9px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.mall-dir-quick .btn-link:hover { color: var(--accent); }
.mall-dir-quick .btn-link.is-current { background: var(--accent-soft); color: var(--accent); }
.mall-dir-box { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 5px 0 14px; border: 1px solid #ccd4c8; border-radius: 13px; background: var(--surface); }
.mall-dir-box .icon { flex: none; width: 18px; height: 18px; color: var(--muted); }
.mall-dir-box .hint { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.mall-dir-box .btn { flex: none; }

/* 商品卡片：封面固定一列，没有封面时用占位图，标题、状态、价格、操作上下对齐 */
.mall-manage-list { --thumb: 72px; }
.mall-manage-product { grid-template-columns: var(--thumb, 72px) minmax(0, 1fr); align-items: start; }
.mall-manage-thumb { width: var(--thumb, 72px); }
.mall-manage-cover { display: block; width: var(--thumb, 72px); height: var(--thumb, 72px); border-radius: 10px; object-fit: cover; }
.mall-cover-none { display: grid; place-items: center; background: var(--paper-2); color: var(--accent-line); }
.mall-cover-none .icon { width: 30px; height: 30px; }
.mall-product-info .mall-price { font-size: 20px; }
.mall-preview-list li { align-items: flex-start; }

/* 选择图片：把浏览器自带的“Choose File”按钮换成与按钮一致的样式 */
.mall-upload input[type="file"] { padding: 7px 10px; color: var(--muted); font-size: 14px; }
.mall-upload input[type="file"]::file-selector-button { min-height: 34px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--surface); color: var(--accent); font: inherit; font-weight: 650; cursor: pointer; }

@media (max-width: 560px) {
  .mall-manage-nav { gap: 0 8px; }
  .mall-manage-nav a, .mall-manage-nav .mall-nav-view { font-size: 14px; }
  .mall-manage-nav .icon { display: none; }
  .mall-manage-list { --thumb: 60px; }
  .mall-directory-row { grid-template-columns: minmax(0, 1fr); }
  .mall-directory-row .mall-actions { justify-content: flex-start; }
}
@media (max-width: 380px) {
  .mall-manage-nav a, .mall-manage-nav .mall-nav-view { font-size: 13px; }
}
@media (min-width: 760px) {
  .mall-filters-products { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 1.3fr); }
  .mall-filters-products .mall-filter-wide { grid-column: auto; }
  .mall-filters-orders { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mall-filters-orders .search-line { grid-column: span 2; }
  .mall-filters-orders .mall-filter-reset { grid-column: 1 / -1; justify-self: end; }
  .mall-filters-orders .mall-filter-reset .btn { width: auto; }
}

/* 目录沿用商城卡片；操作与图片规则各自限定，避免共享缩略图尺寸失效。 */
.mall-products > .empty-state { grid-column: 1 / -1; }
.mall-products > .mall-product { display: flex; flex-direction: column; }
.mall-products > .mall-product > .mall-product-link { flex: 1; }
.mall-directory-card { gap: 0; align-items: stretch; }
.mall-directory-card .mall-cover { display: block; }
.mall-directory-card .mall-cover-empty { display: grid; }
.mall-directory-card .mall-product-body { padding-bottom: 12px; }
.mall-directory-card .mall-directory-actions { display: grid; gap: 8px; margin-top: auto; padding: 0 16px 16px; }
.mall-directory-actions > a { min-width: 0; min-height: 44px; padding-inline: 10px; white-space: normal; }
.mall-directory-actions > .btn-link { justify-content: center; }
@media (max-width: 759px) {
  .mall-products { gap: 12px 10px; }
  .mall-products .mall-product-body { gap: 5px; padding: 10px; }
  .mall-products .mall-product-body h2 { font-size: 16px; line-height: 1.45; }
  .mall-products .mall-product-body .hint { font-size: 12px; line-height: 1.5; }
  .mall-products .mall-price { font-size: 20px; line-height: 1.4; }
  .mall-products > .mall-product > .btn { min-height: 44px; width: calc(100% - 20px); margin: 0 10px 10px; padding-inline: 6px; font-size: 14px; white-space: normal; line-height: 1.4; }
  .mall-products .mall-cover-empty { font-size: 13px; }
  .mall-products .mall-cover-empty .icon { width: 36px; height: 36px; }
  .mall-directory-card .mall-directory-actions { gap: 6px; padding: 0 10px 10px; }
  .mall-directory-actions > a { font-size: 14px; padding-inline: 6px; line-height: 1.4; }
}

/* Order email fields and bounded state history reuse the existing shop layout. */
.mall-email-address { overflow-wrap:anywhere; }
.mall-email-statuses { list-style:none; padding:0; margin:0; }
.mall-email-statuses > li { padding:12px 0; border-bottom:1px solid var(--line, #ddd); }
.mall-email-statuses > li:last-child { border-bottom:0; }
button.mall-payment-choice { width:100%; text-align:left; font:inherit; color:inherit; }
button.mall-payment-choice:not(.is-selected) { background:var(--surface); }
@media(max-width:430px) { .mall-email-statuses .mall-line { align-items:flex-start; flex-direction:column; gap:4px; } }

/* 选择器内新建目录；窄屏保持名称和操作各占一行。 */
.mall-category-create, .mall-category-create-form { min-width:0; display:grid; gap:10px; }
.mall-category-create[hidden], .mall-category-create-form[hidden], .mall-category-create button[hidden] { display:none; }
.mall-category-create-form { padding:12px; border:1px solid var(--line); border-radius:var(--radius-s); }
.mall-category-create-form .field, .mall-category-create-form input { min-width:0; width:100%; }
.mall-category-picker > *, .mall-category-picked { min-width:0; overflow-wrap:anywhere; }
.mall-category-create .mall-actions { flex-wrap:wrap; }
