/* Element Plus mall theme: layout and page styles (components come from element-plus.css) */
:root {
  --el-color-primary: #2563eb;
  --el-color-primary-light-3: #6690f1;
  --el-color-primary-light-5: #92b1f5;
  --el-color-primary-light-7: #bed0f9;
  --el-color-primary-light-8: #d3e0fb;
  --el-color-primary-light-9: #e9effd;
  --el-color-primary-dark-2: #1e4fbc;
  --el-border-radius-base: 6px;
  --mall-bg: #f5f6f8;
  --mall-text: #1f2937;
  --mall-muted: #6b7280;
  --mall-line: #e5e7eb;
  --mall-price: #dc2626;
  --mall-accent: #0f9f6e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--mall-bg); color: var(--mall-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.6; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
[v-cloak] { display: none !important; }
.mall-shell { width: min(1200px, 100%); margin: 0 auto; padding: 0 16px; }
.mall-page { padding-top: 20px; padding-bottom: 48px; }

/* Header */
.mall-header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--mall-line); }
.mall-header-row { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.mall-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; font-size: 16px; }
.mall-brand-mark { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: var(--el-color-primary); color: #fff; font-size: 16px; }
.mall-brand-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 220px; }
.mall-nav { display: flex; gap: 4px; }
.mall-nav a { padding: 6px 12px; border-radius: 6px; color: #4b5563; white-space: nowrap; }
.mall-nav a:hover { background: #f3f4f6; color: var(--mall-text); }
.mall-nav a.active { background: var(--el-color-primary-light-9); color: var(--el-color-primary); font-weight: 600; }
.mall-search { width: 260px; margin-left: auto; }
.mall-user { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 12px; border: 1px solid var(--mall-line); border-radius: 6px; color: #374151; white-space: nowrap; }
.mall-search + .mall-user { margin-left: 0; }
.mall-user:hover { border-color: var(--el-color-primary-light-5); color: var(--el-color-primary); }
.mall-user span { overflow: hidden; max-width: 140px; text-overflow: ellipsis; }

/* Notice ticker */
.mall-ticker { display: flex; align-items: center; gap: 12px; height: 40px; margin-bottom: 16px; padding: 0 14px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #92400e; overflow: hidden; }
.mall-ticker-label { display: flex; flex: none; align-items: center; gap: 4px; font-weight: 600; }
.mall-ticker-track { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Top area: banner + notices */
.mall-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 20px; }
.mall-banner { overflow: hidden; border-radius: 8px; background: #e5e7eb; }
.mall-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mall-banner-empty { display: flex; flex-direction: column; justify-content: center; height: 100%; min-height: 240px; padding: 32px; background: #1f2937; color: #fff; }
.mall-banner-empty strong { font-size: 24px; }
.mall-banner-empty span { color: #cbd5e1; }
.mall-notice-panel { padding: 16px 18px; border: 1px solid var(--mall-line); border-radius: 8px; background: #fff; }
.mall-notice-panel h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 15px; }
.mall-notice-panel p { margin: 0; padding: 9px 0; border-top: 1px solid #f1f2f4; color: #4b5563; font-size: 13px; }
.mall-notice-panel p:first-of-type { border-top: 0; padding-top: 0; }

/* Categories */
.mall-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mall-categories .el-check-tag { padding: 6px 14px; border: 1px solid var(--mall-line); border-radius: 6px; background: #fff; font-weight: 500; }
.mall-categories .el-check-tag.is-checked { border-color: var(--el-color-primary); background: var(--el-color-primary); color: #fff; }

/* Product grid */
.mall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; min-height: 160px; }
.mall-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--mall-line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.mall-card:hover, .mall-card:focus-visible { border-color: var(--el-color-primary-light-5); box-shadow: 0 6px 18px rgba(31, 41, 55, .08); outline: none; }
.mall-card.is-sold-out { cursor: not-allowed; opacity: .6; }
.mall-card-image { display: grid; aspect-ratio: 16 / 10; place-items: center; overflow: hidden; background: #eef2f7; color: #64748b; font-size: 32px; font-weight: 700; }
.mall-card-image img { width: 100%; height: 100%; object-fit: cover; }
.mall-card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.mall-card-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.mall-card-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--mall-muted); font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mall-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.mall-price { color: var(--mall-price); font-size: 18px; font-weight: 700; white-space: nowrap; }
.mall-price small { color: var(--mall-muted); font-size: 12px; font-weight: 400; }
.mall-empty { grid-column: 1 / -1; }

/* Checkout dialog */
.mall-product-brief { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--mall-line); }
.mall-product-brief-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mall-product-brief h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.mall-product-brief p { margin: 8px 0 0; color: #4b5563; font-size: 13px; white-space: pre-line; max-height: 140px; overflow: auto; }
.mall-course-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mall-course-list { max-height: 320px; overflow: auto; padding: 4px 10px; border: 1px solid var(--mall-line); border-radius: 8px; }
.mall-course-list .el-checkbox { display: flex; height: auto; min-height: 36px; margin-right: 0; padding: 6px 0; border-bottom: 1px solid #f1f2f4; white-space: normal; }
.mall-course-list .el-checkbox:last-child { border-bottom: 0; }
.mall-course-list .el-checkbox__label { line-height: 1.5; overflow-wrap: anywhere; }
.mall-course-total { margin: 12px 0 0; color: #374151; }
.mall-course-total strong { color: var(--mall-price); }
.mall-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mall-full { width: 100%; }

/* Order query results */
.mall-query-tip { margin: 0 0 12px; color: var(--mall-muted); font-size: 13px; }
.mall-query-list { display: grid; gap: 12px; max-height: 420px; margin-top: 16px; overflow: auto; }
.mall-query-card { padding: 12px 14px; border: 1px solid var(--mall-line); border-radius: 8px; }
.mall-query-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mall-query-card-head strong { overflow-wrap: anywhere; }
.mall-query-remark { margin: 8px 0 0; color: #4b5563; font-size: 13px; overflow-wrap: anywhere; }

/* Auth pages */
.mall-auth { display: grid; min-height: 100vh; padding: 24px 16px; place-items: center; }
.mall-auth-card { width: min(400px, 100%); }
.mall-auth-card .mall-brand { justify-content: center; margin-bottom: 8px; }
.mall-auth-card h1 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.mall-auth-hint { margin: 0 0 20px; color: var(--mall-muted); text-align: center; }
.mall-auth-switch { margin: 16px 0 0; color: var(--mall-muted); text-align: center; }
.mall-auth-switch a { color: var(--el-color-primary); }

/* Section headings */
.mall-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mall-heading h1 { margin: 0; font-size: 20px; }
.mall-heading p { margin: 2px 0 0; color: var(--mall-muted); overflow-wrap: anywhere; }

/* Orders */
.mall-order-list { display: grid; gap: 12px; }
.mall-order-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.mall-order-card-head strong { overflow-wrap: anywhere; }
.mall-order-card-head span { color: var(--mall-muted); font-size: 13px; }
.mall-order-card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 10px; }
.mall-order-card-body p { margin: 4px 0 0; color: #4b5563; font-size: 13px; overflow-wrap: anywhere; }
.mall-order-meta { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 6px; }
.mall-order-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.mall-pagination { display: flex; justify-content: center; margin-top: 20px; }
.mall-pay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mall-pay-actions .el-button, .mall-quick-amounts .el-button, .mall-order-foot .el-button { margin-left: 0; }
.mall-page .el-descriptions__label { white-space: nowrap; }

/* Profile */
.mall-profile { width: min(860px, 100%); margin: 0 auto; }
.mall-wallet { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 22px 24px; border-radius: 8px; background: #1f2937; color: #fff; }
.mall-wallet span, .mall-wallet small { display: block; color: #cbd5e1; font-size: 12px; }
.mall-wallet strong { display: block; margin: 4px 0; font-size: 28px; }
.mall-wallet .el-button { border-color: #fff; background: #fff; color: #1f2937; }
.mall-wallet .el-button span { display: inline; color: inherit; font-size: 14px; }
.mall-wallet .el-button:hover { border-color: #dbeafe; background: #dbeafe; color: #1d4ed8; }
.mall-quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mall-section { margin-top: 16px; }

/* Responsive */
@media (max-width: 900px) {
  .mall-top { grid-template-columns: 1fr; }
  .mall-search { width: 200px; }
}
@media (max-width: 720px) {
  .mall-header-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; }
  .mall-brand-name { max-width: 150px; }
  .mall-nav { order: 3; width: 100%; overflow-x: auto; }
  .mall-search { order: 4; width: 100%; margin-left: 0; }
  .mall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mall-card-body { padding: 10px; }
  .mall-price { font-size: 16px; }
  .mall-order-card-body { flex-direction: column; }
  .mall-order-meta { align-items: flex-start; }
  .mall-wallet { flex-direction: column; align-items: flex-start; }
  .mall-heading { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .mall-grid { grid-template-columns: 1fr; }
}

/* Compact storefront template selected from the mall settings page. */
.mall-template-compact { background: #eef2f6; }
.mall-template-compact .mall-header { box-shadow: 0 1px 5px rgba(31, 41, 55, .06); }
.mall-template-compact .mall-page { width: min(1280px, 100%); padding-top: 14px; }
.mall-template-compact .mall-top { grid-template-columns: 1fr; gap: 12px; }
.mall-template-compact .mall-banner { display: none; }
.mall-template-compact .mall-notice-panel { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: start; min-height: 76px; padding: 14px 18px; border-radius: 7px; box-shadow: 0 3px 12px rgba(31, 41, 55, .05); }
.mall-template-compact .mall-notice-panel h2 { margin: 2px 0 0; color: #2563eb; }
.mall-template-compact .mall-notice-panel p { padding: 3px 0; border-top: 0; }
.mall-template-compact .mall-categories { flex-wrap: nowrap; gap: 0; margin: 0 0 12px; padding: 6px; overflow-x: auto; border: 1px solid var(--mall-line); border-radius: 7px; background: #fff; box-shadow: 0 2px 8px rgba(31, 41, 55, .04); }
.mall-template-compact .mall-categories .el-check-tag { flex: none; min-width: 76px; margin-right: 4px; padding: 8px 12px; border: 0; border-radius: 5px; text-align: center; }
.mall-template-compact .mall-grid { display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.mall-template-compact .mall-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 126px; border-radius: 7px; box-shadow: 0 2px 8px rgba(31, 41, 55, .04); }
.mall-template-compact .mall-card-image { width: 112px; height: 112px; margin: 6px; aspect-ratio: auto; border-radius: 6px; }
.mall-template-compact .mall-card-body { min-width: 0; padding: 13px 16px 13px 8px; }
.mall-template-compact .mall-card-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mall-template-compact .mall-card-summary { -webkit-line-clamp: 1; }
.mall-template-compact .mall-card-foot { padding-top: 5px; }
.mall-template-compact .mall-price { font-size: 16px; }
@media (max-width: 720px) {
  .mall-template-compact .mall-notice-panel { grid-template-columns: 86px minmax(0, 1fr); padding: 12px; }
  .mall-template-compact .mall-card { grid-template-columns: 88px minmax(0, 1fr); min-height: 100px; }
  .mall-template-compact .mall-card-image { width: 78px; height: 78px; }
  .mall-template-compact .mall-card-body { padding: 10px 10px 10px 2px; }
}
