:root {
    --ink: #16202a;
    --ink-soft: #354352;
    --muted: #6b7683;
    --line: #dbe3ea;
    --panel: #ffffff;
    --bg: #f5f7f9;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --sky: #2563eb;
    --amber: #b45309;
    --red: #b42318;
    --green: #067647;
    --shadow: 0 18px 50px rgba(30, 41, 59, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

button,
.button {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    min-height: 40px;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

button:hover,
.button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

button:disabled { opacity: .55; cursor: not-allowed; }

.ghost {
    background: #fff;
    color: var(--brand);
}

.ghost:hover {
    background: #eef8f7;
    color: var(--brand-strong);
}

.light {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.72);
}

.danger {
    background: var(--red);
    border-color: var(--red);
}

.storefront-body {
    background:
        linear-gradient(#f7fafb, #eef3f5 420px, #f5f7f9 421px);
}

.store-announcement {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 8px 16px;
    background: #102a2a;
    color: #e6fffb;
    font-size: 13px;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 28px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 900;
    color: var(--brand-strong);
}

.brand-mark,
.login-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.store-search {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    gap: 8px;
}

.store-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-nav a {
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--ink-soft);
    font-weight: 700;
}

.store-nav a:hover { background: #eef3f5; }

.active-lang {
    background: #e6f7f5;
    color: var(--brand-strong) !important;
}

.cart-link {
    background: #102a2a;
    color: #fff !important;
}

.cart-link strong {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    color: #102a2a;
    padding: 0 6px;
}

.store-main {
    width: min(1160px, calc(100% - 32px));
    margin: 26px auto 44px;
    min-width: 0;
}

.sidebar-user {
    display: grid;
    gap: 2px;
    margin: -8px 0 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    background: rgba(255,255,255,.06);
}

.admin-user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-role {
    color: #9fb4cc;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-account-links {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.hero {
    min-height: 390px;
    display: grid;
    align-items: end;
    padding: 42px;
    color: #fff;
    background:
        linear-gradient(0deg, rgba(9, 21, 30, .72), rgba(9, 21, 30, .18)),
        url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1800&q=82") center/cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(34px, 6vw, 64px);
    margin: 0 0 18px;
    line-height: 1.02;
    letter-spacing: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.eyebrow,
.admin-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--amber);
    font-weight: 900;
    font-size: 12px;
}

.service-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--line);
}

.service-strip div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fff 0%, #f8fbfb 100%);
}

.service-strip strong {
    flex: 0 0 auto;
    margin: 0;
    color: var(--brand-strong);
    font-size: 13px;
    line-height: 1.2;
}

.service-strip span {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.categories {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    margin: -10px 0 18px;
    padding: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(16, 42, 42, .05);
}

.categories::-webkit-scrollbar { display: none; }

.categories a {
    flex: 0 0 auto;
    padding: 10px 15px;
    border-radius: 6px;
    color: var(--ink-soft);
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.categories a:hover,
.categories a:focus-visible {
    background: #eef7f6;
    color: var(--brand-strong);
}

.brand-logo-mark {
    display: block;
    width: 62px;
    height: auto;
    flex: 0 0 auto;
}

.categories .active {
    background: var(--brand);
    box-shadow: 0 2px 8px rgba(15, 118, 110, .2);
    color: #fff;
}

.categories .active:hover,
.categories .active:focus-visible {
    background: var(--brand-strong);
    color: #fff;
}

.result-bar,
.empty-state {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.section-head,
.page-title,
.cart-summary,
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 28px 0 16px;
}

.section-head h2,
.page-title h1 {
    margin: 0;
    font-size: 28px;
}

.section-head span,
.admin-toolbar span {
    color: var(--muted);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.product-card,
.panel,
.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(30, 41, 59, .05);
}

.product-card {
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card-hitarea,
.mobile-bottom-nav { display: none; }

.product-image {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.stock-chip {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.product-body {
    display: grid;
    gap: 6px;
    padding: 12px;
    align-content: start;
    flex: 1;
}

.product-body h3 {
    font-size: 18px;
    line-height: 1.3;
    margin: 0;
}

.product-body p {
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
}

.product-meta strong {
    color: var(--brand-strong);
}

.product-price {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1;
}

.price-value {
    font-size: 30px;
    font-weight: 900;
}

.product-meta > span {
    color: var(--muted);
    font-size: 12px;
}

.price-currency {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}

.delivery-badge-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.product-body > .delivery-badge-row {
    margin-block: -3px;
}

.delivery-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--delivery-bg, #f97316);
    color: var(--delivery-color, #fff);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-delivery {
    margin: -4px 0 14px;
}

.detail-delivery .delivery-badge {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 13px;
}

.delivery-settings input[type="color"] {
    width: 100%;
    min-height: 44px;
    padding: 4px;
    cursor: pointer;
}

.card-buy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 2px;
}

.detail {
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(300px, 1.05fr);
    gap: 28px;
    align-items: start;
}

.detail-media img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.detail-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.detail-panel h1 {
    font-size: clamp(30px, 4vw, 48px);
    margin: 0 0 12px;
    line-height: 1.06;
}

.price {
    font-size: 26px;
    font-weight: 900;
    color: var(--brand-strong);
}

.inventory-line {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.inventory-line span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef8f7;
    color: var(--brand-strong);
    font-weight: 800;
    font-size: 13px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    color: var(--ink);
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd8e1;
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 118, 110, .16);
    border-color: var(--brand);
}

textarea { min-height: 92px; resize: vertical; }

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form label { min-width: 150px; }

.checkout {
    display: grid;
    grid-template-columns: minmax(300px, 1.2fr) minmax(260px, .8fr);
    gap: 20px;
    align-items: start;
}

.panel { padding: 18px; }
.summary-panel { position: sticky; top: 96px; }

.success {
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.success-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #e6f7f0;
    color: var(--green);
    font-weight: 900;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    background: #f8fafb;
}

.flash {
    width: min(1160px, calc(100% - 32px));
    margin: 16px auto;
    padding: 12px 14px;
    border-radius: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.store-footer {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.store-footer strong { color: var(--ink); }

.store-footer p { margin: 4px 0 0; }

.admin-auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #eef3f5;
}

.admin-login {
    width: min(430px, calc(100% - 32px));
}

.login-card {
    display: grid;
    gap: 14px;
    padding: 26px;
}

.login-card h1,
.login-card p { margin: 0; }

.login-card p { color: var(--muted); }

.login-logo {
    display: block;
    width: min(210px, 70vw);
    height: auto;
    margin: 0 auto 4px;
}

.login-mark {
    width: 52px;
    height: 52px;
}

.admin-body {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    min-height: 100vh;
    background: #eef2f6;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    background: #102033;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-brand {
    color: #fff;
    margin-bottom: 18px;
}

.admin-brand .brand-logo-mark {
    width: 64px;
    padding: 3px;
    border-radius: 8px;
    background: #fff;
}

.sidebar a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #dbeafe;
    font-weight: 800;
}

.sidebar a:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.admin-main {
    width: auto;
    margin: 0;
    padding: 24px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-head h1 {
    margin: 0;
    font-size: 30px;
}

.admin-user {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--ink-soft);
    font-weight: 800;
}

.password-panel {
    width: min(560px, 100%);
}

.password-panel-head h2 { margin: 0 0 6px; }
.password-panel-head p { margin: 0 0 18px; color: var(--muted); }
.password-form { display: grid; gap: 14px; }
.password-form button { justify-self: start; min-width: 150px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat {
    padding: 18px;
    display: grid;
    gap: 4px;
}

.stat span,
.stat small {
    color: var(--muted);
}

.stat strong {
    font-size: 28px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.3fr) minmax(260px, .7fr);
    gap: 16px;
}

.workflow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow span {
    padding: 8px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: #1f3b57;
    font-size: 12px;
    font-weight: 900;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.import-panel {
    margin-bottom: 16px;
}

.import-panel h2,
.product-form h2 {
    margin: 0 0 12px;
}

.product-form {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.three-textareas {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-toolbar {
    margin-top: 0;
    align-items: center;
}

.admin-toolbar strong {
    display: block;
}

.admin-table {
    padding: 0;
}

.admin-table table {
    min-width: 780px;
}

.import-panel {
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
}

.import-panel summary {
    padding: 14px 18px;
    cursor: pointer;
    color: var(--ink-soft);
    font-weight: 900;
    list-style-position: inside;
}

.import-panel[open] summary { border-bottom: 1px solid var(--line); }
.import-panel-body { padding: 16px 18px 18px; }
.import-panel-body p { margin-top: 0; color: var(--muted); }

.admin-product-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.admin-product-cell > div { display: grid; gap: 3px; }
.admin-product-cell strong { line-height: 1.35; }
.admin-product-cell small { color: var(--muted); font-size: 12px; }

.stock-summary {
    display: grid;
    gap: 3px;
    min-width: 130px;
    color: var(--muted);
    font-size: 12px;
}

.stock-summary span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stock-summary strong { color: var(--ink); }

.product-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 230px;
}

.product-row-actions .button,
.product-row-actions button {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
}

.delete-product-form .danger {
    background: #b42318;
    border-color: #b42318;
}

.delete-product-form .danger:hover {
    background: #912018;
    border-color: #912018;
}

.badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8eef5;
    color: #334155;
    font-weight: 900;
    font-size: 12px;
}

.status-pending_confirm { background: #fff7ed; color: #9a3412; }
.status-confirmed { background: #eff6ff; color: #1d4ed8; }
.status-picking { background: #f5f3ff; color: #6d28d9; }
.status-delivering { background: #ecfeff; color: #0e7490; }
.status-completed { background: #ecfdf3; color: #067647; }
.status-cancelled { background: #fef3f2; color: #b42318; }

.actions form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.actions input {
    max-width: 240px;
}

.mini-form {
    display: inline-flex;
    margin: 0;
}

.mini-form button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.small-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
    margin-right: 6px;
}

.error-list {
    margin: 0;
    padding-left: 20px;
    color: var(--red);
}

.rtl {
    font-family: "Cairo", "Tahoma", "Segoe UI", Arial, sans-serif;
}

/* 前台 RTL */
.rtl .store-header,
.rtl .section-head,
.rtl .page-title,
.rtl .cart-summary,
.rtl .store-footer,
.rtl .product-meta,
.rtl .admin-toolbar {
    direction: rtl;
}

.rtl .store-nav,
.rtl .categories,
.rtl .hero-actions,
.rtl .inventory-line,
.rtl .inline-form,
.rtl .card-buy,
.rtl .form-actions,
.rtl .toolbar-actions,
.rtl .quick-actions,
.rtl .gallery-items,
.rtl .gallery-upload,
.rtl .media-upload,
.rtl .admin-head-right,
.rtl .lang-switch {
    direction: rtl;
}

.rtl th,
.rtl td {
    text-align: right;
}

.rtl .stock-chip {
    right: auto;
    left: 10px;
}

/* 后台整体布局镜像：侧边栏移至右侧 */
[dir="rtl"] .admin-body {
    grid-template-columns: minmax(0, 1fr) 244px;
}

[dir="rtl"] .sidebar {
    order: 2;
}

[dir="rtl"] .admin-main {
    order: 1;
}

[dir="rtl"] .sidebar a,
[dir="rtl"] .sidebar .admin-brand {
    text-align: right;
}

[dir="rtl"] .admin-head,
[dir="rtl"] .admin-toolbar,
[dir="rtl"] .section-head {
    flex-direction: row-reverse;
}

[dir="rtl"] label {
    text-align: right;
}

[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
    text-align: right;
}

[dir="rtl"] .actions,
[dir="rtl"] .mini-form {
    direction: rtl;
}

/* 不翻转：图片、Logo、视频、数字、代码保持 LTR */
[dir="rtl"] .gallery-item img,
[dir="rtl"] .gallery-item video,
[dir="rtl"] .media-preview img,
[dir="rtl"] .row-thumb,
[dir="rtl"] .brand-mark,
[dir="rtl"] .login-mark,
[dir="rtl"] code,
[dir="rtl"] .badge {
    direction: ltr;
}

/* 按钮箭头镜像（返回/下一页等） */
[dir="rtl"] .arrow-flip {
    display: inline-block;
    transform: scaleX(-1);
}

@media (max-width: 900px) {
    .store-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .store-nav {
        justify-content: space-between;
    }

    .service-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .detail,
    .checkout,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .summary-panel { position: static; }
}

@media (max-width: 760px) {
    .storefront-body {
        padding-bottom: 62px;
        background: #f5f7f9;
    }

    .store-main {
        width: min(100% - 16px, 1160px);
        margin-top: 12px;
        margin-bottom: 20px;
    }

    .categories {
        justify-content: flex-start;
        scroll-snap-type: inline proximity;
        touch-action: pan-x;
        margin: -4px 0 10px;
        padding: 3px;
    }

    .categories a {
        scroll-snap-align: center;
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 5px;
    }

    .service-strip {
        display: flex;
        grid-template-columns: none;
        gap: 1px;
        overflow-x: auto;
        overflow-y: hidden;
        direction: rtl;
        scroll-snap-type: inline proximity;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    .service-strip::-webkit-scrollbar { display: none; }

    .service-strip div {
        flex: 0 0 min(48vw, 180px);
        min-width: 0;
        gap: 7px;
        padding: 7px 9px;
        direction: ltr;
        scroll-snap-align: start;
    }

    [dir="rtl"] .service-strip div {
        direction: rtl;
    }

    .service-strip span {
        font-size: 10.5px;
        line-height: 1.3;
    }

    .service-strip strong { font-size: 12px; }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .store-announcement {
        min-height: 26px;
        padding: 5px 8px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
    }

    .store-announcement span + span { display: none; }

    .store-header {
        position: sticky;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "brand nav" "search search";
        gap: 8px;
        padding: 9px 8px;
    }

    .store-header .brand { grid-area: brand; }
    .store-header .store-search { grid-area: search; }
    .store-header .store-nav { grid-area: nav; }

    .brand {
        gap: 7px;
        font-size: 18px;
    }

    .brand-logo-mark { width: 52px; }

    .brand-mark {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .store-nav {
        justify-content: flex-end;
        gap: 4px;
    }

    .store-nav .nav-store,
    .store-nav .nav-track,
    .store-nav .nav-support,
    .store-nav .cart-link { display: none; }

    .store-nav a {
        padding: 6px 8px;
        font-size: 12px;
    }

    .hero {
        min-height: 220px;
        padding: 16px;
        border-radius: 7px;
    }

    .hero h1 {
        max-width: 90%;
        margin-bottom: 12px;
        font-size: 30px;
    }

    .hero-actions { gap: 8px; }
    .hero-actions .button { min-height: 38px; padding: 8px 12px; }

    .service-strip { margin: 8px 0; }

    .section-head {
        margin: 16px 0 9px;
    }

    .section-head h2 { font-size: 20px; }
    .section-head .eyebrow { margin-bottom: 3px; }
    .section-head > span { font-size: 12px; }

    .product-card {
        border-radius: 7px;
        box-shadow: 0 4px 14px rgba(30, 41, 59, .05);
    }

    .product-card-hitarea {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 5;
        border-radius: inherit;
    }

    .product-image img {
        aspect-ratio: 1 / 1;
    }

    .stock-chip {
        right: 6px;
        bottom: 6px;
        padding: 3px 6px;
        font-size: 10px;
    }

    [dir="rtl"] .stock-chip {
        right: auto;
        left: 6px;
    }

    .product-body {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px;
        padding: 8px;
    }

    .product-meta {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
    }

    .product-body > a:not(.product-card-hitarea) {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .product-body > p {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .delivery-badge-row {
        grid-column: 1;
        grid-row: 3;
    }

    .product-body > .delivery-badge-row {
        margin-block: -2px;
    }

    .product-meta > span { display: none; }

    .product-meta strong,
    .product-price {
        font-size: 19px;
        line-height: 1.15;
    }

    .price-value { font-size: 19px; }
    .price-currency { font-size: 11px; }

    .product-body h3 {
        display: -webkit-box;
        overflow: hidden;
        margin: 0;
        font-size: 14px;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .product-body p {
        font-size: 11px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }

    .delivery-badge {
        min-height: 18px;
        padding: 2px 5px;
        font-size: 10px;
    }

    .card-buy { display: none; }

    .detail {
        gap: 10px;
    }

    .carousel-viewport,
    .detail-media img {
        border-radius: 7px;
    }

    .detail-panel {
        padding: 12px;
        border-radius: 7px;
    }

    .detail-panel h1 {
        margin-bottom: 8px;
        font-size: 16px;
        line-height: 1.35;
    }

    .detail-panel .price {
        margin: 7px 0;
        font-size: 20px;
    }

    .inventory-line { margin: 8px 0; gap: 6px; }
    .inventory-line span { padding: 5px 8px; font-size: 11px; }
    .detail-delivery { margin: 0 0 8px; }

    .detail-panel .inline-form {
        position: fixed;
        z-index: 30;
        right: 0;
        bottom: 56px;
        left: 0;
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr) auto;
        align-items: end;
        gap: 6px;
        padding: 8px;
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--line);
        box-shadow: 0 -6px 18px rgba(15, 23, 42, .08);
        backdrop-filter: blur(12px);
    }

    .detail-panel .inline-form label { min-width: 0; font-size: 11px; }
    .detail-panel .inline-form input { min-height: 40px; padding: 7px 8px; }
    .detail-panel .inline-form button,
    .detail-panel .inline-form .button { min-height: 40px; padding: 9px 10px; border-radius: 6px; font-size: 12px; }

    .product-highlights-card,
    .product-detail-card { margin-top: 10px; padding: 12px; }

    .product-detail-card .card-title,
    .product-highlights-card .card-title { margin-bottom: 10px; padding-bottom: 8px; font-size: 16px; }

    .product-description,
    .product-highlights { font-size: 13px; line-height: 1.65; }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 25;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        min-height: 56px;
        background: rgba(255,255,255,.98);
        border-top: 1px solid var(--line);
        box-shadow: 0 -4px 14px rgba(15, 23, 42, .07);
        backdrop-filter: blur(12px);
    }

    .mobile-bottom-nav a {
        position: relative;
        display: grid;
        place-items: center;
        padding: 8px 4px;
        color: var(--ink-soft);
        font-size: 12px;
        font-weight: 800;
    }

    .mobile-bottom-nav a:hover,
    .mobile-bottom-nav a:focus-visible { color: var(--brand); background: #eef8f7; }

    .mobile-cart-link strong {
        position: absolute;
        top: 5px;
        left: calc(50% + 22px);
        display: grid;
        place-items: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--red);
        color: #fff;
        font-size: 10px;
    }

    .storefront-body:has(.detail-panel .inline-form) { padding-bottom: 128px; }

    .section-head,
    .page-title,
    .cart-summary,
    .admin-toolbar,
    .store-footer,
    .admin-head {
        display: block;
    }

    .admin-body {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .admin-main {
        padding: 16px;
    }
}

/* ===== 语言切换 ===== */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; }
.lang-globe { font-size: 16px; }
.lang-switch a { padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); border: 1px solid transparent; }
.lang-switch a:hover { background: #eef3f5; }
.lang-switch-center { justify-content: center; padding: 10px; }
.admin-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===== 媒体上传 ===== */
.media-gallery { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; background: #fbfcfd; }
.gallery-items { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; min-height: 40px; }
.gallery-item { position: relative; width: 120px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: grab; }
.gallery-item.is-main { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 118, 110, .18); }
.gallery-item img, .gallery-item video { width: 100%; height: 100px; object-fit: cover; display: block; direction: ltr; }
.gallery-item.dragging { opacity: .5; }
.gallery-actions { display: flex; gap: 4px; padding: 4px; }
.gallery-actions button { flex: 1; min-height: 28px; padding: 4px; font-size: 11px; }
.gallery-upload { display: flex; gap: 10px; align-items: center; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

/* ===== 商品详情富文本（Quill） ===== */
.detail-tabs { display: flex; gap: 4px; margin-bottom: 0; }
.detail-tab, .short-tab { padding: 8px 16px; border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; background: #f5f8fa; cursor: pointer; font-size: 13px; color: var(--muted); }
.detail-tab.active, .short-tab.active { background: #fff; color: var(--brand); font-weight: 600; position: relative; z-index: 1; }
.short-source { display: none; }
.quill-wrap { border: 1px solid var(--line); border-radius: 0 8px 8px 8px; background: #fff; overflow: hidden; }
.quill-wrap .ql-toolbar { border: none; border-bottom: 1px solid var(--line); }
.quill-wrap .ql-container { border: none; min-height: 240px; max-height: 560px; font-size: 14px; }
.quill-wrap .ql-editor img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; display: block; }
.quill-wrap .ql-editor { min-height: 240px; line-height: 1.75; padding: 12px 14px; }
.quill-wrap .ql-editor img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; }
.quill-wrap .ql-editor.ql-blank::before { color: #aab4bd; font-style: normal; }
/* 源码切换按钮（</> HTML）：点击进入源码模式，粘贴 HTML 后再点退出即可渲染为富文本 */
.quill-wrap .ql-toolbar button.ql-source { width: auto !important; padding: 4px 10px !important; margin-left: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 12px; background: #1f2937; color: #fff; border: 1px solid #1f2937; border-radius: 5px; line-height: 1; }
.quill-wrap .ql-toolbar button.ql-source:hover { background: #374151; border-color: #374151; }
.quill-wrap .ql-toolbar button.ql-source::before { content: '</> HTML'; }
.quill-wrap .ql-source-area { width: 100%; min-height: 240px; max-height: 560px; box-sizing: border-box; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: 12px 14px; border: none; border-top: 1px solid var(--line); background: #fbfdff; color: #334155; resize: vertical; outline: none; line-height: 1.6; }
.quill-wrap.source-active .ql-toolbar button:not(.ql-source) { opacity: .35; pointer-events: none; }
.quill-wrap.source-active .ql-toolbar button.ql-source { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }

/* ===== 前台商品详情卡片 ===== */
.product-detail-card, .product-highlights-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; margin-top: 28px; box-shadow: var(--shadow); }
.product-detail-card .card-title, .product-highlights-card .card-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--brand-strong); }
.product-detail-card .product-description { max-width: 780px; }
.product-highlights ul { margin: 0; padding-left: 1.2em; }
.product-highlights li { margin: 4px 0; line-height: 1.6; }

/* ===== 前台商品详情（富文本） ===== */
.product-description { font-size: 15px; line-height: 1.85; color: #334155; }
.product-description:empty { display: none; }
.product-description img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; display: block; }
.product-detail-image-stack { display: grid; justify-items: center; gap: 12px; margin-top: 16px; }
.product-detail-image-stack img { display: block; width: min(100%, 790px); height: auto; margin: 0; border-radius: 8px; background: #f8fafc; }
.product-description h2 { font-size: 20px; margin: 20px 0 8px; }
.product-description h3 { font-size: 17px; margin: 16px 0 6px; }
.product-description p { margin: 8px 0; }
.product-description ul, .product-description ol { margin: 8px 0; padding-left: 24px; }
.product-description blockquote { border-left: 3px solid var(--brand); margin: 12px 0; padding: 6px 14px; color: var(--muted); background: #f7fafa; border-radius: 0 6px 6px 0; }
.product-description a { color: var(--brand); text-decoration: underline; }
.product-description .ql-align-center { text-align: center; }
.product-description .ql-align-right { text-align: right; }
.product-description .ql-align-justify { text-align: justify; }
[dir="rtl"] .product-description ul, [dir="rtl"] .product-description ol { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .product-description blockquote { border-left: none; border-right: 3px solid var(--brand); border-radius: 6px 0 0 6px; }

.media-upload { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.media-preview { width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef3f5; display: flex; align-items: center; justify-content: center; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }

.row-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); direction: ltr; }

/* ===== 前台商品 gallery 与视频 ===== */
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main { width: 100%; border-radius: 8px; aspect-ratio: 1 / 1; object-fit: cover; box-shadow: var(--shadow); direction: ltr; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid var(--line); cursor: pointer; direction: ltr; }
.gallery-thumbs img:hover { border-color: var(--brand); }
.product-video { display: flex; flex-direction: column; gap: 10px; }
.product-video video { width: 100%; border-radius: 8px; max-height: 420px; background: #000; direction: ltr; }

/* ===== 详情媒体轮播（视频优先 + 图片左右切换） ===== */
.media-carousel { position: relative; direction: ltr; }
.carousel-viewport { overflow: hidden; border-radius: 8px; background: #000; aspect-ratio: 1 / 1; box-shadow: var(--shadow); }
.carousel-track { display: flex; height: 100%; transition: transform .3s ease; }
.carousel-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; direction: ltr; box-shadow: none; border-radius: 0; }
.carousel-slide video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; direction: ltr; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: none; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.carousel-nav:hover { background: rgba(0,0,0,.7); }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; }

/* Customer account center */
.account-shell { width: min(1040px, 100%); margin: 0 auto; display: grid; gap: 16px; }
.account-auth { min-height: 52vh; place-items: center; }
.account-card, .address-card, .account-order, .account-tile { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(18, 63, 60, .06); }
.account-card { padding: 20px; }
.account-auth .account-card { width: min(460px, 100%); }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-heading h1, .account-card h1, .account-card h2 { margin: 0; }
.account-muted { color: var(--muted); margin: 6px 0 14px; }
.account-form { display: grid; gap: 12px; }
.account-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.account-form input, .account-form select, .account-form textarea, .filter-bar input, .filter-bar select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: #fff; color: var(--ink); }
.account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-inline-form { margin-top: 8px; }
.check-row { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px !important; }
.check-row input { width: auto; }
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.account-tile { padding: 20px; color: inherit; display: grid; gap: 5px; text-decoration: none; }
.account-tile strong { color: var(--brand); font-size: 28px; }
.address-list, .account-order-list { display: grid; gap: 10px; }
.address-card, .account-order { padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.address-card p { margin: 3px 0 0; color: var(--muted); }
.account-order { text-decoration: none; color: inherit; }
.account-order > div { display: grid; gap: 4px; }
.account-order > div:last-child { justify-items: end; }
.account-order span { font-size: 12px; color: var(--muted); }
.account-order b { color: var(--brand-strong); font-size: 18px; }
.account-order small, .order-summary-compact small, .account-items small { font-size: 11px; }
.order-summary-compact p, .account-items > div { display: flex; justify-content: space-between; gap: 14px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.order-summary-compact p:last-child, .account-items > div:last-child { border-bottom: 0; }
.order-summary-compact span { color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 8px; margin-bottom: 12px; }
.admin-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 16px; margin-bottom: 14px; }
.admin-card h2 { margin: 0 0 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack-form { display: grid; gap: 9px; }
.stack-form select, .stack-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.promotion-budget-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; }
.promotion-budget-summary div { display: grid; gap: 2px; min-width: 0; }
.promotion-budget-summary span, .promotion-budget-summary small { color: var(--muted); font-size: 12px; }
.promotion-budget-summary strong { color: #9a3412; font-size: 14px; }
.promotion-budget-summary small { grid-column: 1 / -1; }

@media (max-width: 700px) {
    .account-shell { gap: 10px; }
    .account-card { padding: 14px; }
    .account-heading h1, .account-card h1 { font-size: 20px; }
    .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .account-tile { padding: 12px 8px; text-align: center; }
    .account-tile strong { font-size: 22px; }
    .account-tile span { font-size: 12px; }
    .account-form-grid, .detail-grid { grid-template-columns: 1fr; }
    .promotion-budget-summary { grid-template-columns: 1fr; }
    .promotion-budget-summary small { grid-column: auto; }
    .address-card, .account-order { padding: 11px; }
    .filter-bar { grid-template-columns: 1fr; }
    .mobile-bottom-nav { grid-template-columns: repeat(4, 1fr); }
}
.carousel-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dot.is-active { background: #fff; }


/* POST-only action links introduced by the security foundation. */
.sidebar-logout-form { margin: 0; }
.sidebar-link-button,
.link-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.sidebar-link-button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: inherit;
    border-radius: 8px;
}
.sidebar-link-button:hover { background: rgba(255, 255, 255, 0.08); }
.link-button { color: var(--brand, #f97316); padding: 0; text-decoration: underline; }

/* Mobile-first Deals and promotion pages */
.deals-shell, .promotion-shell { width: min(1180px, 100%); margin: 0 auto; }
.deals-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.deals-heading h1, .promotion-hero h1 { margin: 2px 0; }
.deals-kicker { color: var(--brand); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.deal-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: #edf5f4; }
.deal-tabs a { padding: 8px 13px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.deal-tabs a.active { background: #fff; color: var(--brand-strong); box-shadow: 0 2px 8px rgba(18,63,60,.1); }
.deal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.deal-card, .promotion-product { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(18,63,60,.06); }
.deal-card-link { position: absolute; inset: 0; z-index: 2; }
.deal-image-wrap, .promotion-product-image { position: relative; display: block; aspect-ratio: 1 / 1; background: #f4f7f7; overflow: hidden; }
.deal-image-wrap img, .promotion-product-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.deal-state { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border-radius: 999px; background: #fff3e8; color: #b54708; font-size: 11px; font-weight: 900; }
.deal-image-wrap .deal-state { position: absolute; top: 8px; inset-inline-start: 8px; }
.deal-card-body, .promotion-product-body { display: grid; gap: 4px; padding: 10px; }
.deal-card-body h2, .promotion-product-body h2 { margin: 0; font-size: 16px; line-height: 1.25; }
.deal-card-body p, .promotion-product-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.deal-price { display: flex; align-items: baseline; gap: 5px; color: var(--brand-strong); }
.deal-price strong { font-size: 24px; line-height: 1; }
.deal-price small { font-size: 12px; font-weight: 900; }
.deal-price del { margin-inline-start: 3px; color: #899; font-size: 11px; }
.deal-countdown { color: #b54708; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 900; }
.deal-empty { padding: 28px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.promotion-hero { padding: 16px; margin-bottom: 12px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--brand-strong), #f97316); }
.promotion-hero .deals-kicker, .promotion-hero .deal-countdown { color: #fff; }
.promotion-hero p { margin: 5px 0; }
.promotion-back { display: inline-block; margin-bottom: 8px; color: #fff; text-decoration: none; }
.promotion-status-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.promotion-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.promotion-product { display: grid; grid-template-columns: minmax(180px, 42%) 1fr; }
.promotion-product-image { aspect-ratio: 1 / 1; }
.promotion-buy-form { margin-top: 6px; }
.promotion-buy-form button { width: 100%; min-height: 42px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 900; }
.promotion-buy-form button:disabled { background: #bac5c4; cursor: not-allowed; }
.promotion-stock { color: var(--muted); }

@media (max-width: 700px) {
    .deals-heading { display: grid; gap: 8px; margin-bottom: 9px; }
    .deal-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
    .deal-tabs::-webkit-scrollbar { display: none; }
    .deal-tabs a { flex: 1 0 auto; text-align: center; }
    .deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .deal-card, .promotion-product { border-radius: 10px; }
    .deal-card-body { padding: 7px; }
    .deal-price strong { font-size: 20px; }
    .deal-card-body h2, .promotion-product-body h2 { font-size: 14px; }
    .deal-card-body p, .promotion-product-body p { font-size: 11px; }
    .promotion-hero { padding: 12px; margin-bottom: 8px; }
    .promotion-product-grid { grid-template-columns: 1fr; gap: 8px; }
    .promotion-product { grid-template-columns: minmax(130px, 45%) 1fr; }
    .promotion-product-body { padding: 8px; }
    .mobile-bottom-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

/* ===== 运营数据看板 ===== */
.ops-dashboard {
    display: grid;
    gap: 18px;
    min-width: 0;
}

/* The admin navigation is taller than a desktop viewport. Keep the menu inside
   the dark rail instead of letting its last links spill onto the page. */
.sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(219,234,254,.34) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(219,234,254,.34); }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.ops-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: center;
    gap: 28px;
    min-height: 220px;
    padding: 30px 32px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #102a43 0%, #124b5a 54%, #0f766e 100%);
    box-shadow: 0 18px 45px rgba(16, 42, 67, .18);
}

.ops-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -90px;
    inset-block-start: -150px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 56px rgba(255,255,255,.025);
    pointer-events: none;
}

.ops-hero-copy,
.ops-hero-side { position: relative; z-index: 1; }
.ops-eyebrow,
.ops-section-kicker {
    color: #f3c26b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ops-welcome { margin: 8px 0 2px; color: rgba(255,255,255,.78); font-size: 13px; }
.ops-hero h2 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; letter-spacing: -.03em; }
.ops-hero-description { max-width: 650px; margin: 14px 0 16px; color: rgba(255,255,255,.82); font-size: 15px; }
.ops-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; color: rgba(255,255,255,.82); font-size: 12px; }
.ops-hero-meta span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); }
.ops-hero-meta b { color: #fff; }
.ops-hero-side { display: grid; justify-items: stretch; gap: 11px; }
.ops-role-badge { justify-self: end; padding: 6px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #fff; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 900; }
.ops-health-state,
.ops-store-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.09);
}
.ops-health-state:hover,
.ops-store-link:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.16); }
.ops-health-state > i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #56d69d; box-shadow: 0 0 0 4px rgba(86,214,157,.15); }
.ops-health-state > span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ops-health-state b { font-size: 13px; }
.ops-health-state small { color: rgba(255,255,255,.7); font-size: 11px; }
.ops-health-state svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ops-store-link { justify-content: center; min-height: 42px; font-size: 12px; font-weight: 900; }
.ops-store-link span { font-size: 16px; }

.ops-main-grid,
.ops-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; min-width: 0; }
.ops-main-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.ops-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(30,41,59,.06); }
.ops-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ops-card-header h3 { margin: 4px 0 0; color: var(--ink); font-size: 19px; line-height: 1.25; }
.ops-card-header > strong,
.ops-task-count { color: var(--ink); font-size: 28px; line-height: 1; }
.ops-header-note { align-self: center; color: var(--muted); font-size: 12px; text-align: end; }
.ops-chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.ops-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ops-chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ops-chart-legend .sales i { background: #0f766e; }
.ops-chart-legend .orders i { background: #f59e0b; }
.ops-chart { min-height: 220px; }
.ops-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ops-empty-state { display: grid; min-height: 168px; place-items: center; padding: 24px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: #fbfcfd; text-align: center; }

.ops-business-card { padding-bottom: 20px; }
.ops-business-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ops-business-unit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ops-business-unit:hover { transform: translateY(-2px); border-color: #b8cfcc; box-shadow: 0 8px 20px rgba(18,63,60,.09); }
.ops-business-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 12px; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.ops-business-unit > div { display: grid; min-width: 0; gap: 2px; }
.ops-business-unit strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ops-business-unit small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ops-business-unit > b { color: var(--ink); font-size: 20px; }
.ops-card-arrow { color: var(--muted); font-size: 16px; }
.ops-tone-violet .ops-business-icon { background: #7c3aed; }
.ops-tone-orange .ops-business-icon { background: #ea580c; }
.ops-tone-cyan .ops-business-icon { background: #0891b2; }
.ops-tone-blue .ops-business-icon { background: #2563eb; }
.ops-tone-rose .ops-business-icon { background: #e11d48; }
.ops-tone-green .ops-business-icon { background: #059669; }

.ops-alert-list,
.ops-task-list { display: grid; gap: 10px; }
.ops-success-state { display: flex; align-items: flex-start; gap: 12px; min-height: 74px; padding: 15px; border: 1px solid #c8ebdc; border-radius: 14px; color: #14532d; background: #f0fdf6; }
.ops-success-state > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #16a34a; font-weight: 900; }
.ops-success-state b { display: block; margin: 2px 0 3px; font-size: 13px; }
.ops-success-state p { margin: 0; color: #4b8062; font-size: 12px; line-height: 1.45; }

@media (max-width: 1100px) {
    .ops-hero { grid-template-columns: minmax(0, 1fr) 220px; padding: 26px; }
    .ops-business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .ops-dashboard { gap: 12px; }
    .ops-hero { grid-template-columns: 1fr; gap: 20px; min-height: 0; padding: 24px 20px; border-radius: 16px; }
    .ops-hero-side { grid-template-columns: 1fr 1fr; align-items: center; }
    .ops-role-badge { grid-column: 1 / -1; justify-self: start; }
    .ops-health-state { min-width: 0; }
    .ops-store-link { min-height: 52px; }
    .ops-main-grid, .ops-action-grid { grid-template-columns: 1fr; gap: 12px; }
    .ops-card { padding: 16px; border-radius: 14px; }
    .ops-card-header { display: grid; gap: 8px; }
    .ops-header-note { justify-self: start; text-align: start; }
    .ops-business-grid { grid-template-columns: 1fr; }
    .sidebar { overflow: visible; }
}
