:root {
    --brand: #1f7a5c;
    --brand-dark: #166048;
    --brand-2: #2fa47c;
    --brand-light: #e8f4ef;
    --accent: #e8792a;
    --accent-light: #fdf1e7;
    --danger: #c0392b;
    --text: #23272f;
    --muted: #7a8391;
    --border: #e3e8ee;
    --input-border: #8c9aa7;
    --input-border-hover: #657686;
    --input-bg: #ffffff;
    --surface: #ffffff;
    --bg: #f5f7f9;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(23, 42, 58, .06);
    --shadow-lg: 0 12px 32px rgba(23, 42, 58, .12);
}

body.theme-ocean {
    --brand: #1d63b8;
    --brand-dark: #154a88;
    --brand-2: #3b86d5;
    --brand-light: #e9f1fb;
}

body.theme-wine {
    --brand: #9b2c45;
    --brand-dark: #732036;
    --brand-2: #c14c68;
    --brand-light: #f9e9ee;
    --accent: #c98a2e;
    --accent-light: #fbf2e3;
}

body.theme-amber {
    --brand: #b45f16;
    --brand-dark: #8a4710;
    --brand-2: #df8a35;
    --brand-light: #fdf0e2;
    --accent: #1f7a5c;
    --accent-light: #e8f4ef;
}

body.theme-violet {
    --brand: #6b46b8;
    --brand-dark: #51338f;
    --brand-2: #8a68d3;
    --brand-light: #f0ebfb;
}

body.theme-graphite {
    --brand: #334155;
    --brand-dark: #1f2937;
    --brand-2: #516176;
    --brand-light: #eef1f5;
    --accent: #c89b3c;
    --accent-light: #f8f1df;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.3; font-weight: 600; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }

.container { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger { color: var(--danger); }
.center { text-align: center; }
.sep { color: #cfd6de; margin: 0 6px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    background: #eef1f4;
    color: var(--text);
}
.btn:hover { background: #e3e8ed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #fdecea; color: #b03a2e; border-color: #f5c6c0; }
.btn-danger:hover { background: #f8d7d2; color: #8f2d23; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--brand);
    font: inherit;
    cursor: pointer;
}
.link-button:hover { color: var(--brand-dark); text-decoration: underline; }
.link-button.danger { color: var(--danger); }

.inline-form { display: inline; margin: 0; }
.hidden-form { display: none; }

/* Top bar */
.topbar {
    background: #f0f3f6;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar a { color: #556070; }
.topbar a:hover { color: var(--brand); }

/* Header */
.site-header { background: var(--surface); box-shadow: var(--shadow); position: relative; z-index: 20; }
.header-main { display: flex; align-items: center; gap: 24px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand img { height: 44px; width: auto; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.brand-text strong { display: block; font-size: 19px; letter-spacing: .5px; }
.brand-text small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .5px; }

.header-search {
    display: flex;
    flex: 1;
    max-width: 560px;
    border: 2px solid var(--brand);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.header-search input {
    flex: 1;
    border: 0;
    padding: 9px 18px;
    font-size: 14px;
    outline: none;
    background: transparent;
}
.header-search button {
    border: 0;
    background: var(--brand);
    color: #fff;
    padding: 0 24px;
    font-size: 14px;
    cursor: pointer;
}
.header-search button:hover { background: var(--brand-dark); }

.header-cart {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    flex-shrink: 0;
}
.header-cart:hover { border-color: var(--brand); color: var(--brand); }
.cart-icon { font-size: 16px; }
.cart-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main-nav { position: relative; z-index: 40; border-top: 1px solid var(--border); background: #fff; }
.nav-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nav-inner > a {
    padding: 11px 16px;
    color: #444d5a;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav-inner > a:hover { color: var(--brand); }
.nav-inner > a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.nav-inner .nav-home { font-weight: 600; color: var(--brand); }
.nav-category-menu { position: relative; }
.nav-category-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.nav-category-toggle:hover,
.nav-category-menu:focus-within .nav-category-toggle { background: var(--brand-dark); }
.nav-category-caret { font-size: 13px; line-height: 1; transition: transform .18s; }
.nav-category-menu:hover .nav-category-caret,
.nav-category-menu:focus-within .nav-category-caret { transform: rotate(180deg); }
.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    width: min(920px, calc(100vw - 32px));
    max-height: min(70vh, 620px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-category-menu:hover .category-dropdown,
.nav-category-menu:focus-within .category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.category-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px 22px;
}
.category-dropdown-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.category-dropdown-group a { color: var(--muted); font-size: 13px; }
.category-dropdown-group a:hover { color: var(--brand); }
.category-dropdown-title {
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 600;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}
.category-dropdown-foot {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: right;
}
.category-dropdown-foot a { font-size: 13px; color: var(--brand); }

/* Alerts */
.alert {
    margin: 16px 0 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: #e9f7f0; color: #187a52; border-color: #bfe8d5; }
.alert-error { background: #fdecea; color: #b03a2e; border-color: #f5c6c0; }

.site-main { padding: 20px 0 40px; min-height: 50vh; }

/* Hero */
.hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .22), transparent 40%),
        linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-2) 100%);
    color: #fff;
    padding: 54px 48px;
    margin-top: 20px;
}
.hero-with-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
}
.hero-content { max-width: 620px; }
.hero-media {
    position: relative;
    z-index: 1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .24);
    aspect-ratio: 4 / 3;
    background: rgba(255, 255, 255, .12);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 12px; opacity: .85; margin-bottom: 10px; }
.hero h1 { font-size: 40px; margin-bottom: 12px; letter-spacing: 1px; }
.hero-sub { font-size: 16px; opacity: .92; margin-bottom: 24px; }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--brand); }
.hero .btn-primary:hover { background: #f0f7f3; }
.hero-phone { font-size: 14px; opacity: .9; }

/* Home carousel */
.home-carousel { position: relative; margin-top: 20px; border-radius: 16px; overflow: hidden; background: #16232b; box-shadow: var(--shadow-lg); }
.carousel-track { position: relative; aspect-ratio: 1600 / 520; min-height: 260px; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .55s ease; }
.carousel-slide.active { opacity: 1; z-index: 1; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(14, 22, 28, .62) 0%, rgba(14, 22, 28, .18) 48%, rgba(14, 22, 28, 0) 75%);
    pointer-events: none;
}
.carousel-caption {
    position: absolute;
    left: clamp(24px, 5vw, 64px);
    bottom: clamp(28px, 7vw, 72px);
    z-index: 2;
    max-width: 560px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.carousel-caption h2 { font-size: clamp(24px, 3.2vw, 42px); margin-bottom: 8px; letter-spacing: 1px; }
.carousel-caption p { font-size: 15px; opacity: .9; margin-bottom: 18px; }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-light); color: var(--brand-dark); }
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .32);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
    transition: opacity .15s, background .15s;
}
.carousel-arrow:hover { opacity: 1; background: rgba(0, 0, 0, .55); }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }
.carousel-dots { position: absolute; right: 26px; bottom: 22px; z-index: 3; display: flex; gap: 7px; }
.carousel-dots button {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    padding: 0;
    cursor: pointer;
    transition: width .2s, background .2s;
}
.carousel-dots button.active { width: 24px; border-radius: 999px; background: #fff; }

/* Sections */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 22px; position: relative; padding-left: 12px; }
.section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: var(--brand);
}
.section-head a { font-size: 13px; color: var(--muted); }
.section-head a:hover { color: var(--brand); }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-tile {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
}
.category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.category-tile > a { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); }
.category-tile img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; }
.category-glyph {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}
.category-tile strong { font-size: 15px; }
.category-tile-children { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin-top: 10px; }
.category-tile-children a { font-size: 12px; color: var(--muted); }

/* Product grid & card */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: #f2f4f6; overflow: hidden; }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-card-media img { transform: scale(1.04); }
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #fff;
    background: var(--accent);
}
.badge-new { background: #2a9a74; }
.badge-hot { background: var(--accent); }
.badge-out { background: #6b7480; left: auto; right: 10px; }
.product-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.product-card-body h3 { font-size: 14px; font-weight: 500; margin: 0; min-height: 42px; }
.product-card-body h3 a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-body h3 a:hover { color: var(--brand); }
.product-card-brief { font-size: 12px; color: var(--muted); margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.product-card-price strong { color: var(--accent); font-size: 18px; }
.product-card-price del { color: var(--muted); font-size: 12px; }
.product-card-form { margin: 0; }
.product-card-form .btn { width: 100%; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 28px 0 0; flex-wrap: wrap; }
.pagination a {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 4px 0 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* Catalog */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.catalog-sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: sticky;
    top: 16px;
}
.catalog-sidebar h3 { font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.category-tree { list-style: none; margin: 0; padding: 0; }
.category-tree li { margin: 2px 0; }
.category-tree a { display: block; padding: 6px 8px; border-radius: 6px; color: #4a5462; font-size: 13px; }
.category-tree a:hover { background: var(--brand-light); color: var(--brand); }
.category-tree a.active { background: var(--brand); color: #fff; }
.category-tree-child { padding-left: 12px; }
.catalog-main { min-width: 0; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.catalog-head h1 { margin: 0; font-size: 24px; }
.catalog-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.catalog-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.catalog-children { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.catalog-children a {
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 12px;
    color: #556070;
}
.catalog-children a:hover { border-color: var(--brand); color: var(--brand); }
.sort-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 16px;
}
.sort-bar a { padding: 5px 14px; border-radius: 6px; font-size: 13px; color: #556070; }
.sort-bar a:hover { background: var(--brand-light); color: var(--brand); }
.sort-bar a.active { background: var(--brand); color: #fff; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state p { color: var(--muted); margin-bottom: 16px; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 32px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.product-main-image { aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #f2f4f6; touch-action: pan-y; }
.product-main-image img { width: 100%; height: 100%; object-fit: contain; }
.product-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.product-thumb { padding: 0; width: 66px; height: 66px; border: 2px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; flex-shrink: 0; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb.active, .product-thumb:hover { border-color: var(--brand); }
.product-info h1 { font-size: 24px; margin-bottom: 8px; }
.product-brief { color: var(--muted); }
.product-price-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: linear-gradient(90deg, var(--accent-light), transparent);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.product-price { font-size: 30px; font-weight: 700; color: var(--accent); }
.product-price-box del { color: var(--muted); font-size: 13px; }
.product-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; margin: 0 0 20px; font-size: 13px; }
.product-meta div { display: flex; gap: 8px; }
.product-meta dt { color: var(--muted); min-width: 56px; }
.product-meta dd { margin: 0; }
.product-purchase { display: grid; gap: 6px; margin: 20px 0; padding-top: 18px; border-top: 1px dashed var(--border); }
.product-buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-buy label { color: var(--muted); font-size: 13px; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--input-border); border-radius: 6px; overflow: hidden; }
.qty-control button { width: 34px; height: 36px; border: 0; background: #f4f6f8; cursor: pointer; font-size: 16px; }
.qty-control button:hover { background: #e9edf1; }
.qty-control input { width: 54px; height: 36px; border: 0; text-align: center; font-size: 14px; -moz-appearance: textfield; }
.qty-control input::-webkit-outer-spin-button, .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.out-of-stock { color: var(--danger); font-weight: 500; }
.product-attributes { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.product-attributes caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
.product-attributes th, .product-attributes td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.product-attributes th { background: #f7f9fa; color: #556070; font-weight: 500; width: 110px; }
.product-section { margin-top: 26px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.product-description { line-height: 1.8; overflow-wrap: anywhere; }
.product-description img { margin: 10px auto; border-radius: 6px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.comment-stars { color: #f0a020; letter-spacing: 1px; }
.comment-head time { color: var(--muted); margin-left: auto; font-size: 12px; }
.comment-item p { margin: 0; color: #3d4652; }
.comment-reply { margin: 8px 0 0; padding: 8px 10px; background: #f5f7fa; border-left: 3px solid var(--brand); border-radius: 4px; font-size: 13px; color: #3d4652; }
.comment-forms { display: grid; gap: 14px; }
.comment-form { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fbfcfd; }
.comment-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.star-picker { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 2px; font-size: 20px; line-height: 1; }
.star-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-picker .star { color: #cfd6de; cursor: pointer; }
.star-picker input:checked ~ .star,
.star-picker .star:hover,
.star-picker .star:hover ~ .star { color: #f0a020; }
.star-picker input:focus-visible + .star { outline: 2px solid var(--brand); outline-offset: 2px; }
.comment-score { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.comment-content { max-width: 420px; min-width: 220px; font-size: 13px; }
.comment-content small { margin-top: 4px; }
.reply-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.reply-form input[type="text"] { flex: 1; min-width: 120px; }
.filter-narrow { width: 90px; flex: 0 0 90px; }

/* Cart */
.page-title { font-size: 24px; margin: 8px 0 20px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: #f7f9fa; color: #556070; font-weight: 500; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table small { display: block; color: var(--muted); font-size: 11px; }
.cart-product { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cart-product img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; }
.qty-input { width: 70px; height: 34px; border: 1px solid var(--input-border); border-radius: 6px; text-align: center; font-size: 14px; background: var(--input-bg); color: var(--text); }
.qty-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 122, 92, .14); }
.cart-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.cart-total { margin-top: 16px; text-align: right; color: var(--muted); font-size: 13px; }
.cart-total strong { color: var(--accent); font-size: 22px; margin: 0 10px 0 6px; }

/* Auth */
.auth-layout { display: flex; justify-content: center; padding: 30px 0; }
.auth-panel { width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.auth-panel h1 { text-align: center; margin-bottom: 6px; }
.auth-panel > .muted { text-align: center; margin-bottom: 22px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }

/* Forms */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.form-field > span { color: #556070; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.admin-main select, .admin-main textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(23, 42, 58, .04);
    transition: border-color .15s, box-shadow .15s;
}
.form-field input:hover, .form-field select:hover, .form-field textarea:hover,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):hover,
.admin-main select:hover, .admin-main textarea:hover {
    border-color: var(--input-border-hover);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):focus,
.admin-main select:focus, .admin-main textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 122, 92, .14);
}
.form-field input:disabled, .admin-main input:disabled, .admin-main select:disabled, .admin-main textarea:disabled {
    background: #f1f4f7;
    color: var(--muted);
    cursor: not-allowed;
}
.form-field textarea { resize: vertical; }
.form-field input[type="file"], .admin-main input[type="file"] {
    width: 100%;
    padding: 7px;
    border: 1px dashed var(--input-border-hover);
    border-radius: 6px;
    background: #fbfcfd;
    color: var(--text);
}
.form-field input[type="file"]:hover, .admin-main input[type="file"]:hover { border-color: var(--brand); }
.form-field input::placeholder, .admin-main input::placeholder, .admin-main textarea::placeholder { color: #9aa6b2; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-region { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.checkbox-field-box { padding: 8px 0; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #556070; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; margin-bottom: 16px; }
.checkout-summary { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; position: sticky; top: 16px; }
.checkout-summary h2 { font-size: 17px; }
.checkout-items { list-style: none; margin: 0 0 14px; padding: 0; max-height: 320px; overflow-y: auto; }
.checkout-items li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.checkout-items img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.checkout-items div { flex: 1; min-width: 0; }
.checkout-items strong { display: block; font-weight: 500; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.checkout-items span { color: var(--muted); }
.checkout-items em { font-style: normal; color: var(--accent); font-weight: 600; }
.summary-list { margin: 0 0 16px; }
.summary-list div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #556070; }
.summary-list dt { margin: 0; }
.summary-list dd { margin: 0; }
.summary-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px !important; font-size: 15px !important; color: var(--text) !important; }
.summary-total dd { color: var(--accent); font-weight: 700; font-size: 20px; }
.payment-options { display: grid; gap: 10px; }
.payment-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.payment-option:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.payment-option input { accent-color: var(--brand); }
.payment-option strong { display: block; font-size: 14px; }
.payment-option small { color: var(--muted); font-size: 12px; }

/* Account */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.account-nav { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: sticky; top: 16px; }
.account-user { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.account-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.account-user strong { display: block; font-size: 14px; }
.account-user small { color: var(--muted); font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.account-nav > a { display: block; padding: 9px 12px; border-radius: 6px; color: #4a5462; font-size: 13px; margin: 2px 0; }
.account-nav > a:hover { background: var(--brand-light); color: var(--brand); }
.account-nav > a.active { background: var(--brand); color: #fff; }
.account-main { min-width: 0; }
.address-list { display: grid; gap: 12px; }
.address-item { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.address-item.is-default { border-color: var(--brand); }
.address-main { min-width: 0; flex: 1; }
.address-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.address-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-shrink: 0; }
.danger-link { color: #b03a2e; }
.danger-link:hover { color: #922f24; background: #fdecea; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.address-picker { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--border); }
.address-picker .form-field { flex: 1 1 320px; min-width: 0; margin-bottom: 0; }
.address-manage { font-size: 12px; color: var(--brand); white-space: nowrap; padding-bottom: 8px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { min-width: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat-card strong { display: block; font-size: 22px; color: var(--text); overflow-wrap: anywhere; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-cards-wide { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.admin-product-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.admin-product-cell img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f0f2f5; flex-shrink: 0; }
.admin-product-cell small { margin-top: 3px; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inline-actions form { margin: 0; }
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-size: 11px; }
.status-tag.success { background: #e6f6ee; color: #187a52; }
.status-tag.muted { background: #f0f2f5; color: var(--muted); }
.order-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.order-head small { display: block; color: var(--muted); margin-top: 2px; }
.order-status { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.stack-form { display: grid; gap: 12px; margin-top: 16px; max-width: 560px; }
.refund-reason { max-width: 260px; overflow-wrap: anywhere; }
.refund-review-form { display: grid; gap: 6px; min-width: 210px; }
.refund-review-form input[type="text"] { width: 100%; padding: 6px 9px; border: 1px solid var(--input-border); border-radius: 7px; font-size: 12px; }
.detail-list dd { min-width: 0; overflow-wrap: anywhere; }

/* Help / articles */
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.help-sidebar { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: sticky; top: 16px; }
.help-sidebar h3 { font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.help-sidebar a { display: block; padding: 8px 10px; border-radius: 6px; color: #4a5462; font-size: 13px; }
.help-sidebar a:hover { background: var(--brand-light); color: var(--brand); }
.help-sidebar a.active { background: var(--brand); color: #fff; }
.article-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-list li { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.article-list li:last-child { border-bottom: 0; }
.article-list a { font-size: 15px; font-weight: 500; }
.article-list p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.article-list small { color: #9aa3af; font-size: 11px; }
.article { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; }
.article-head { border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 12px; }
.article-head h1 { font-size: 24px; margin-bottom: 6px; }
.article-content { line-height: 1.9; overflow-wrap: anywhere; }
.article-content img { margin: 12px auto; }
.article-content table { max-width: 100%; }

/* Footer */
.site-footer { background: #1d2a33; color: #b9c3cc; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 30px; padding: 36px 0; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-col p, .footer-col a { display: block; color: #9fabb5; font-size: 13px; margin: 0 0 8px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2c3b46; padding: 14px 0; font-size: 12px; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer-bottom a { color: #9fabb5; }

/* ============================================================
   Admin
   ============================================================ */
.admin-body { background: #f1f4f8; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 236px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1e2d38 0%, #16222b 100%);
    color: #c7d1d9;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #101a21;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 17px 16px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .07); min-width: 0; }
.admin-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.admin-brand-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-brand-text small { font-weight: 400; color: #7f94a3; font-size: 11px; letter-spacing: .14em; }
.admin-brand .brand-mark { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 4px 12px rgba(0, 0, 0, .28); }
.admin-brand-logo { height: 34px; width: auto; max-width: 120px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 4px 7px; }
.admin-nav { display: flex; flex-direction: column; align-items: stretch; padding: 10px 12px 16px; gap: 2px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.admin-nav::-webkit-scrollbar-track { background: transparent; }
.admin-nav-group { display: flex; align-items: center; gap: 8px; margin: 11px 4px 5px; font-size: 11px; letter-spacing: .06em; color: #748a99; flex-shrink: 0; }
.admin-nav-group::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .07); }
.admin-nav-group:first-child { margin-top: 2px; }
.admin-nav a { position: relative; padding: 7px 12px 7px 15px; border-radius: 8px; color: #aebdc7; font-size: 13px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; transition: background-color .16s ease, color .16s ease; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.admin-nav a.active::before { content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; border-radius: 2px; background: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 78%, #fff); }
.admin-nav a.danger { color: #e79a92; }
.admin-nav a.danger:hover { background: rgba(176, 58, 46, .22); color: #ffd0cb; }
.admin-nav a.active.danger { background: rgba(176, 58, 46, .26); color: #ffd7d1; }
.admin-nav a.active.danger::before { background: #d0563f; }
.admin-sidebar-foot { padding: 11px 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-foot-user { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.admin-foot-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-2); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.admin-foot-name { color: #dbe3e9; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-sidebar-foot form { margin: 0; flex-shrink: 0; }
.admin-sidebar-foot .link-button { text-align: right; color: #93a4b0; font-size: 12px; padding: 5px 9px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 7px; transition: border-color .16s ease, color .16s ease, background-color .16s ease; }
.admin-sidebar-foot .link-button:hover { color: #fff; text-decoration: none; border-color: rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .05); }
.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; padding: 15px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.admin-topbar h1 { font-size: 18px; margin: 0; }
.admin-topbar span { color: var(--muted); font-size: 13px; }
.admin-topbar-meta { display: flex; align-items: center; gap: 12px; }
.admin-topbar-meta .admin-topbar-shop { color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f2f5f8; border: 1px solid var(--border); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-main { padding: 22px 26px 40px; }
.admin-main > .alert { margin: 0 0 16px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]), .filter-form select {
    width: auto;
    padding: 7px 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(23, 42, 58, .04);
}
.filter-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):focus, .filter-form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 122, 92, .14);
}
.filter-form .checkbox-inline { gap: 6px; }
.admin-table img.admin-thumb, .admin-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: #f0f2f5; }
.admin-table td.actions, .admin-table th:last-child { white-space: nowrap; }
.admin-table td.actions a { margin-right: 8px; }
.row-muted { opacity: .55; }
.tree-indent { color: #c4ccd4; }
.admin-page-head { margin-bottom: 16px; }
.back-link { font-size: 13px; color: var(--muted); }
.back-link:hover { color: var(--brand); }
.admin-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.admin-side-stack { display: flex; flex-direction: column; }
.admin-side-stack .panel { margin-bottom: 18px; }
.admin-form .panel h2, .admin-form-narrow h2 { font-size: 16px; }
.admin-form-narrow { max-width: 720px; }
.admin-settings-form { max-width: 980px; }
.code-textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.code-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; color: var(--muted); word-break: break-all; }
.status-tag.danger { background: #fdecea; color: #b03a2e; }
.status-tag.warn { background: #fff5e5; color: #a0651a; }
.print-error { display: block; margin-top: 4px; color: #b03a2e; font-size: 11px; word-break: break-all; }
.print-help { margin: 4px 0 18px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; background: #fafbfc; }
.print-help summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); }
.print-help .table { margin: 12px 0 8px; font-size: 12px; }
.print-order-box .filter-form { margin: 4px 0 14px; }
.print-jobs-mini { font-size: 12px; margin-top: 6px; }
.receipt-paper { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.55; max-width: calc(var(--receipt-columns, 32) * 1ch); margin: 0 auto; padding: 16px 14px; background: #fff; border: 1px dashed #c9d1d9; border-radius: 4px; box-shadow: var(--shadow); color: #1c1f23; }
.receipt-line { white-space: pre-wrap; }
.receipt-line.is-center { text-align: center; }
.receipt-line.is-big { text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.receipt-line.is-qr { text-align: center; color: var(--muted); font-size: 11px; margin-top: 6px; }
.receipt-line.is-cut { text-align: center; color: #9aa4b0; font-size: 11px; border-top: 1px dashed #d7dee5; margin-top: 8px; padding-top: 6px; }
.receipt-raw { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 460px; overflow: auto; background: #f7f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
.log-detail { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; color: #556070; word-break: break-all; max-width: 520px; }
.filter-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cleanup-list { display: grid; gap: 10px; margin: 6px 0 18px; }
.cleanup-item { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; background: #fff; }
.cleanup-item:hover { border-color: var(--brand); }
.cleanup-item.is-empty { opacity: .6; }
.cleanup-item input { margin-top: 3px; }
.cleanup-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cleanup-main strong { font-size: 14px; }
.cleanup-main small { font-size: 12px; color: var(--muted); }
.cleanup-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.admin-main-image { max-width: 180px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--border); }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.admin-gallery-item { text-align: center; font-size: 11px; }
.admin-gallery-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); margin-bottom: 4px; }
.admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.detail-list { margin: 0; font-size: 13px; }
.detail-list div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); min-width: 74px; }
.detail-list dd { margin: 0; }
.simple-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.simple-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.simple-list li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); margin-left: 4px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline strong { display: block; font-size: 12px; }
.timeline span { color: #556070; display: block; }
.timeline time { color: var(--muted); font-size: 11px; }

/* Banners, reports, settings */
.admin-banner-thumb { width: 96px; height: 38px; object-fit: cover; border-radius: 5px; }
.admin-banner-preview { width: 100%; max-width: 520px; aspect-ratio: 1600 / 520; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 6px; }
.report-filter { margin-bottom: 18px; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.report-tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; color: #556070; font-size: 13px; box-shadow: var(--shadow); }
.report-tabs a.active { background: var(--brand); color: #fff; }
.report-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 240px;
    padding: 18px 4px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}
.report-bar-col { flex: 1 1 0; min-width: 26px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.report-bar-value { font-size: 10px; color: var(--muted); white-space: nowrap; }
.report-bar-track { width: 100%; height: 180px; display: flex; align-items: flex-end; justify-content: center; }
.report-bar { width: 100%; max-width: 42px; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.report-bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; padding: 6px 0 8px; }
.report-chart-empty { min-height: 220px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.theme-options { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.theme-choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; background: #fff; font-size: 13px; }
.theme-choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.theme-choice input { accent-color: var(--brand); }
.theme-swatch { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--swatch, #1f7a5c), var(--swatch-2, #2fa47c)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.theme-swatch.ocean { --swatch: #1d63b8; --swatch-2: #3b86d5; }
.theme-swatch.wine { --swatch: #9b2c45; --swatch-2: #c14c68; }
.theme-swatch.amber { --swatch: #b45f16; --swatch-2: #df8a35; }
.theme-swatch.violet { --swatch: #6b46b8; --swatch-2: #8a68d3; }
.theme-swatch.graphite { --swatch: #334155; --swatch-2: #516176; }
.settings-section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 20px; }
.settings-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.settings-section h2 { display: flex; align-items: center; gap: 8px; }
.payment-box { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; background: #fafcfb; }
.payment-box h3 { font-size: 15px; margin-bottom: 10px; }
.user-balance { font-size: 26px; font-weight: 600; color: var(--accent); }
.about-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; }
.about-card h1 { margin-bottom: 8px; }
.about-intro { color: var(--muted); margin-bottom: 22px; }
.about-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 26px; align-items: start; }
.license-frame { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fafcfb; }
.license-frame img { width: 100%; border-radius: 6px; }
.license-placeholder { min-height: 240px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); background: #fff; }
.about-info { margin: 0; }
.about-info div { padding: 10px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 12px; font-size: 13px; }
.about-info div:last-child { border-bottom: 0; }
.about-info dt { color: var(--muted); min-width: 104px; }
.about-info dd { margin: 0; color: var(--text); }

/* Admin auth */
.admin-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 22% 12%, var(--brand-2) 0%, #1b2831 58%, #16222b 100%);
    padding: 24px;
}
.admin-auth { width: 100%; max-width: 400px; }
.admin-auth .alert { margin: 0 0 14px; }
.admin-login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 30px 22px; border-top: 3px solid var(--brand); }
.admin-login-head { text-align: center; margin-bottom: 22px; }
.admin-login-head .brand-mark { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 24px; border-radius: 15px; }
.admin-login-logo { display: block; margin: 0 auto 12px; max-width: 200px; max-height: 56px; width: auto; height: auto; object-fit: contain; }
.admin-login-head h1 { font-size: 19px; margin-bottom: 4px; letter-spacing: .3px; }
.admin-login-head p { color: var(--muted); font-size: 12px; margin: 0; }
.admin-login-help { text-align: center; font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.admin-auth-foot { text-align: center; font-size: 12px; color: rgba(255, 255, 255, .6); margin: 16px 0 0; }

/* Responsive */
@media (max-width: 1000px) {
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-columns { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
}
@media (max-width: 860px) {
    .header-main { flex-wrap: wrap; }
    .header-search { order: 3; max-width: none; flex-basis: 100%; }
    .header-cart { margin-left: auto; }
    .hero { padding: 36px 24px; }
    .hero h1 { font-size: 28px; }
    .hero-with-media { grid-template-columns: 1fr; }
    .hero-media { width: min(100%, 360px); aspect-ratio: 16 / 10; }
    .category-dropdown { width: min(640px, calc(100vw - 24px)); }
    .product-detail { grid-template-columns: 1fr; }
    .catalog-layout, .help-layout, .account-layout, .about-grid { grid-template-columns: 1fr; }
    .catalog-sidebar, .help-sidebar, .account-nav { position: static; }
    .carousel-caption { left: 20px; right: 20px; bottom: 26px; }
    .carousel-caption p { display: none; }
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-brand { padding: 14px 16px; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; overflow: visible; }
    .admin-nav-group { width: 100%; margin: 8px 2px 0; }
    .admin-nav-group:first-child { margin-top: 0; }
    .admin-nav a { flex: 1 0 auto; padding: 7px 12px; }
    .admin-nav a.active::before { left: 4px; height: 14px; }
    .admin-sidebar-foot .link-button { padding: 5px 8px; }
    .admin-topbar-meta .admin-topbar-shop { display: none; }
}
@media (max-width: 560px) {
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-width: 0; max-width: 100%; }
    body .form-field input, body .form-field select, body .form-field textarea,
    body .admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
    body .admin-main select, body .admin-main textarea,
    body .filter-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
    body .filter-form select, body .header-search input, body .qty-control input, body .qty-input { font-size: 16px; }
    .form-grid, .form-grid-region { grid-template-columns: 1fr; }
    .checkout-main, .checkout-summary, .panel, .form-field, .form-grid > * { min-width: 0; }
    .stat-cards, .stat-cards-wide { grid-template-columns: 1fr; }
    .stat-card { min-width: 0; }
    .stat-card strong { overflow-wrap: anywhere; }
    .report-bar-value { display: none; }
    .report-bar-label { font-size: 9px; }
    body .form-field input[type="file"], body .admin-main input[type="file"] { font-size: 16px; }
    .container { width: calc(100% - 24px); }
    .topbar-left { display: none; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .product-card-body h3 { font-size: 13px; min-height: 38px; }
    .product-card-price strong { font-size: 16px; }
    .form-grid, .form-grid-region { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 26px 0; }
    .article { padding: 20px; }
    .about-card { padding: 20px; }
    .carousel-track { min-height: 210px; }
    .carousel-arrow { display: none; }
    .admin-main { padding: 16px 12px 30px; }
    .admin-topbar { padding: 12px 14px; }
    .product-meta { grid-template-columns: 1fr; }
}

.checkout-virtual-note { margin-bottom: 16px; padding: 14px 16px; border-radius: 10px; background: #f2f7ff; }
.checkout-virtual-note p { margin: 6px 0 0; }
.checkout-tip { margin: 10px 0 0; color: #6b7280; font-size: 13px; text-align: center; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; line-height: 1.6; }
.tag-primary { color: #1d4ed8; background: #e8efff; }
.checkout-success { display: grid; gap: 18px; }
.summary-list { display: grid; gap: 10px; margin: 18px 0 0; }
.summary-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid #f0f1f3; }
.summary-list dt { color: #6b7280; }
.summary-list dd { margin: 0; font-weight: 600; text-align: right; }
.summary-list .summary-total { padding-top: 4px; border-bottom: 0; }
.summary-list .summary-total dd { color: #dc2626; font-size: 20px; }
.detail-list { display: grid; gap: 8px; margin: 12px 0 0; }
.detail-list > div { display: flex; gap: 16px; }
.detail-list dt { min-width: 72px; color: #6b7280; }
.detail-list dd { margin: 0; word-break: break-all; }
.success-header { display: flex; align-items: center; gap: 16px; }
.success-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; background: #16a34a; font-size: 28px; }
.success-icon.pending { background: #f59e0b; }
.success-header h2 { margin: 0 0 4px; }
.success-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.card-list { display: grid; gap: 12px; margin-top: 14px; }
.card-item { padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fafafa; }
.card-row { display: flex; gap: 8px; padding: 4px 0; word-break: break-all; }
.virtual-card-fields { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }

@media (max-width: 560px) {
    .success-header { align-items: flex-start; }
    .success-icon { width: 44px; height: 44px; font-size: 22px; }
    .success-actions .btn { flex: 1 1 100%; }
    .card-row { flex-direction: column; gap: 2px; }
}

/* 后台小程序页 */
.miniapp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 18px; align-items: start; }
.miniapp-col { min-width: 0; }
.miniapp-panel-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.miniapp-panel-title small, .panel h2 small { font-size: 12px; font-weight: 400; color: var(--muted); }
.miniapp-panel-note { font-weight: 400; }
.miniapp-readonly { display: grid; gap: 8px; margin: 16px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.miniapp-readonly > div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.miniapp-readonly span { color: var(--muted); min-width: 116px; }
.miniapp-readonly strong { display: flex; align-items: center; gap: 6px; }
.miniapp-readonly small { color: var(--muted); font-size: 11px; }
.miniapp-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.miniapp-build-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.miniapp-files { margin-top: 14px; }
.miniapp-files summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); }
.miniapp-file-list { columns: 2; gap: 22px; list-style: none; margin: 12px 0 0; padding: 0; font-size: 12px; }
.miniapp-file-list li { padding: 2px 0; break-inside: avoid; }
.miniapp-file-list code { color: #556070; word-break: break-all; }
.miniapp-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; display: grid; gap: 8px; }
.miniapp-steps code { word-break: break-all; }
.miniapp-preview-panel { position: sticky; top: 16px; }
.miniapp-screen-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.miniapp-screen-tab { border: 1px solid var(--border); background: #fff; color: #556070; font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.miniapp-screen-tab:hover { border-color: var(--brand); color: var(--brand); }
.miniapp-screen-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.miniapp-preview-frame { width: 100%; height: 700px; border: 0; background: #eef0f3; border-radius: 10px; }
.miniapp-api-table { font-size: 12px; }
.miniapp-api-table code { word-break: break-all; }
.miniapp-api-note { color: #556070; }
@media (max-width: 1280px) {
    .miniapp-layout { grid-template-columns: 1fr; }
    .miniapp-preview-panel { position: static; }
}
