/* ============================================
   百度芝芝 · 精选数字商城 — 设计系统
   ============================================ */

:root {
    /* 主色调：紫粉渐变 */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #ec4899;
    --accent-light: #f472b6;
    --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, #7c3aed10 0%, #ec489910 100%);

    /* 中性色 */
    --bg: #f8f7ff;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-modal: rgba(0, 0, 0, 0.5);
    --text: #1e1b4b;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* 状态色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* 间距 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 4px 20px rgba(124, 58, 237, 0.25);

    --header-height: 68px;
}

/* 重置 & 全局 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 模态框打开时锁定 body 滚动 */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    touch-action: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 移动端隐藏滚动条 */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0px;
        height: 0px;
        display: none;
    }
    
    /* 或者使用更通用的方法 */
    html, body {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
}

/* ============================================
   顶部导航
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: box-shadow 0.3s;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.logo-icon svg {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.3));
    transition: transform 0.3s;
}

.logo-area:hover .logo-icon svg {
    transform: scale(1.08) rotate(-3deg);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 20px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 240px;
    padding: 9px 16px 9px 38px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    transition: all 0.3s;
    outline: none;
}

.search-box input:focus {
    width: 300px;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.btn-order-query {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-glow);
}

@media (hover: hover) {
    .btn-order-query:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
    }
}

/* ============================================
   公告栏
   ============================================ */
.announcement-bar {
    margin-top: var(--header-height);
    background: var(--gradient-subtle);
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    display: block;
}

.announcement-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 24px 12px;
    color: #334155;
    font-size: 13px;
}

.announcement-panel {
    background: #fff;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 12px;
    padding: 10px 12px 10px;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.08);
    width: 100%;
    max-width: 100%;
}

.announcement-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6d28d9;
    margin-bottom: 6px;
}

.announcement-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.announcement-summary {
    margin: 0 0 6px;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
}

.announcement-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 12px;
    line-height: 1.58;
}

.announcement-panel.compact .announcement-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.announcement-toggle {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #6d28d9;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
}

.announcement-toggle:hover {
    background: rgba(124, 58, 237, 0.06);
}

.announcement-list li + li {
    margin-top: 4px;
}

.announcement-list a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: none;
}

.announcement-list a:hover {
    text-decoration: underline;
}

.announcement-list code {
    background: #f6f0ff;
    color: #5b21b6;
    border: 1px solid #e9ddff;
    border-radius: 6px;
    font-size: 11px;
    padding: 1px 5px;
}

.announcement-disclaimer {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 6px 8px;
    list-style: none;
    margin-left: -18px;
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    margin-top: 0;
    min-height: 300px; /* 减小最小高度，避免空白过大 */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 24px;
}

.main-content.has-announcement {
    margin-top: 0;
}

/* ============================================
   店铺布局（分类 + 商品）
   ============================================ */
.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

/* 分类侧栏 */
.category-sidebar {
    background:
        radial-gradient(180px 120px at 0% 0%, rgba(124, 58, 237, 0.08), transparent 70%),
        linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
    border-radius: calc(var(--radius-lg) + 2px);
    padding: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: calc(var(--header-height) + 24px);
    border: 1px solid rgba(124, 58, 237, 0.10);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-group-toggle {
    width: 100%;
    appearance: none;
    text-align: left;
    font: inherit;
}

.category-group-toggle .cat-group-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.category-group-toggle .cat-group-caret {
    width: 14px;
    text-align: center;
    color: #7c3aed;
    transition: transform 0.22s ease;
    flex: 0 0 14px;
}

.category-group.open .cat-group-caret {
    transform: rotate(90deg);
}

.category-group-toggle.has-active {
    border-color: rgba(124, 58, 237, 0.28);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(236, 72, 153, 0.08));
    color: var(--primary);
}

.category-group-children {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding-left: 12px;
    margin-left: 8px;
    border-left: 1px dashed rgba(124, 58, 237, 0.18);
}

.category-group-children.open {
    display: flex;
}

.category-sub-item {
    font-size: 13px;
}

.category-sub-item .cat-name {
    font-weight: 500;
}

.category-empty-hint {
    margin-left: 4px;
    padding: 6px 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.category-item {
    position: relative;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(4px);
}

.category-item:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.06));
    color: var(--primary);
    border-color: rgba(124, 58, 237, 0.24);
    transform: translateY(-1px);
}

.category-item .cat-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item.active {
    background: var(--gradient);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
    border-color: transparent;
    padding-left: 12px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.10),
        0 10px 22px rgba(124, 58, 237, 0.22);
}

.category-item.active::before {
    content: none;
}

.category-item.active .cat-name {
    padding-left: 0;
}

.category-item .cat-count {
    font-size: 12px;
    min-width: 26px;
    text-align: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.24);
    font-weight: 700;
}

.category-item:not(.active) .cat-count {
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.category-group-toggle:not(.active) .cat-count {
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    color: #c2410c;
    border: 1px solid rgba(251, 146, 60, 0.22);
}

/* 商品区域 */
.goods-section {
    min-height: 200px; /* 减小最小高度 */
}

/* 首页已移除顶部商品类型标签栏，强制隐藏以兼容旧缓存 HTML */
.goods-section .type-tabs {
    display: none !important;
}

/* 首页隐藏“全部商品 / 商品数量”这一栏，让商品卡片与分类区域更贴齐 */
#homeView .goods-header {
    display: none !important;
}

#homeView .goods-grid {
    margin-top: 0 !important;
}

.goods-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    margin-bottom: 20px;
}

.goods-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0;
}

.goods-title::before {
    content: none;
}

.goods-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* 排序控件 */
.sort-bar {
    display: none; /* 桌面端默认隐藏 */
    gap: 10px;
    padding: 0 0 8px 0; /* 减少底部padding */
    margin-bottom: 0; /* 移除底部margin */
    flex-wrap: wrap;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 24px;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.05);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.sort-btn .sort-icon {
    transition: transform 0.3s ease;
}

.sort-btn.active .sort-icon {
    stroke: white;
}

/* 商品网格 */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* 商品卡片 */
.goods-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* 移动端/弱动画偏好：跳过 fadeInUp，直接显示 */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .goods-card {
        animation: none;
        opacity: 1;
    }
}

@media (hover: hover) {
    .goods-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-light);
    }
}

.goods-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(135deg, #f6f0ff, #fff, #fde7f3);
    padding: 0;
    display: block;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    transition: transform 0.35s ease;
}

@media (hover: hover) {
    .goods-card:hover .goods-card-img {
        transform: scale(1.02);
    }
}

.goods-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    background: linear-gradient(135deg, #f6f0ff, #fff, #fde7f3);
}

.goods-card-cover-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(180px 140px at 10% 12%, rgba(139, 92, 246, 0.07), transparent 70%),
        radial-gradient(220px 160px at 90% 12%, rgba(236, 72, 153, 0.08), transparent 72%),
        radial-gradient(220px 170px at 12% 92%, rgba(236, 72, 153, 0.06), transparent 72%),
        radial-gradient(220px 170px at 92% 92%, rgba(139, 92, 246, 0.06), transparent 72%);
}

.goods-card-cover-panel {
    position: relative;
    width: min(84%, 280px);
    height: 76%;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(252, 247, 255, 0.98));
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow:
        0 8px 20px rgba(124, 58, 237, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

@media (hover: hover) {
    .goods-card:hover .goods-card-cover-panel {
        transform: translateY(-2px);
        box-shadow:
            0 12px 24px rgba(124, 58, 237, 0.12),
            inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    }
}

.goods-card-cover-paw {
    position: relative;
    width: 58px;
    height: 62px;
}

.goods-card-cover-paw .paw-dot {
    position: absolute;
    width: 13px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6b7dff, #3c49ff);
}

.goods-card-cover-paw .d1 {
    top: 2px;
    left: 10px;
}

.goods-card-cover-paw .d2 {
    top: 0;
    left: 25px;
}

.goods-card-cover-paw .d3 {
    top: 10px;
    left: 0;
}

.goods-card-cover-paw .d4 {
    top: 9px;
    left: 38px;
}

.goods-card-cover-paw .paw-base {
    position: absolute;
    left: 8px;
    bottom: 0;
    width: 42px;
    height: 36px;
    border-radius: 16px 16px 14px 14px;
    background: linear-gradient(135deg, #6b7dff, #3c49ff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.goods-card-cover-title {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    color: #19154f;
    letter-spacing: 0.3px;
}

/* 默认 SVG Logo 样式 */
.goods-card-default-logo {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
}

.goods-card-default-logo svg {
    width: 120px;
    height: 120px;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .goods-card:hover .goods-card-default-logo svg {
        transform: scale(1.05);
    }
}

.goods-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.goods-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}

.goods-card-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    min-height: 28px;
}

.goods-price {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-size: 20px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.goods-price-unit {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

.goods-sales {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.goods-card-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    min-height: 24px;
    align-content: flex-start;
}

.goods-card-tags.empty {
    min-height: 0;
    margin-top: 6px;
}

.goods-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: #f0e7ff;
    color: var(--primary);
    font-weight: 500;
}

.goods-tag.hot {
    background: #fff1f2;
    color: #e11d48;
}

.goods-tag.new {
    background: #ecfdf5;
    color: #059669;
}

/* ============================================
   商品详情模态框
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.25s ease;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

/* 详情内容 */
.detail-header {
    margin-bottom: 24px;
}

.detail-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.detail-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.detail-price-box {
    background: var(--gradient-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-price-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-price-value {
    font-size: 28px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-stock {
    margin-left: auto;
    font-size: 13px;
    color: var(--success);
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.detail-stock.out {
    color: var(--danger);
    background: #fef2f2;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

/* 数量选择器 */
.qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background 0.2s;
}

.qty-btn:hover {
    background: var(--border);
}

.qty-value {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

/* 支付通道 */
.channel-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.channel-item {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.channel-item:hover {
    border-color: var(--primary-light);
}

.channel-item.selected {
    border-color: var(--primary);
    background: var(--gradient-subtle);
    color: var(--primary);
}

.pay-channel-tip {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff6f3;
    border: 1px solid #ffd6cc;
    color: #9a3f2d;
    font-size: 12px;
    line-height: 1.55;
}

/* 按钮 */
.btn-primary {
    width: 100%;
    padding: 13px 24px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-glow);
    margin-top: 8px;
}

@media (hover: hover) {
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
    }
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 12px 24px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border-light);
}

/* ============================================
   订单查询
   ============================================ */
.order-query-container {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}

.order-query-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.order-query-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.order-query-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.order-input-group {
    display: flex;
    gap: 10px;
}

.order-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.order-input:focus {
    border-color: var(--primary);
}

.order-input-group .btn-primary {
    width: auto;
    white-space: nowrap;
    margin-top: 0;
}

.order-result-card {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-label {
    color: var(--text-secondary);
}

.order-info-value {
    font-weight: 500;
}

.order-status-badge {
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.order-status-badge.paid {
    background: #ecfdf5;
    color: var(--success);
}

.order-status-badge.pending {
    background: #fffbeb;
    color: var(--warning);
}

.order-card-info {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--primary-light);
}

.order-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.order-card-info pre {
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
    font-family: inherit;
    line-height: 1.6;
}

/* ============================================
   骨架屏
   ============================================ */
.skeleton-item {
    height: 42px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.skeleton-card {
    height: 260px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-lg);
}

/* ============================================
   加载 & toast
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.loading-spinner p {
    font-size: 14px;
    color: var(--text-secondary);
}

.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.toast.error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.toast.info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

.toast.warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

/* ============================================
   客服联系方式悬浮窗
   ============================================ */
.support-contact-widget {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1400;
    pointer-events: none;
}

.support-contact-widget > * {
    pointer-events: auto;
}

.support-contact-mask {
    display: none;
}

.support-contact-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.18);
    background: rgba(255, 255, 255, 0.95);
    color: #5b21b6;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.support-contact-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.support-contact-widget.open .support-contact-fab {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    border-color: transparent;
}

.support-contact-fab-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.10);
    font-size: 14px;
    line-height: 1;
}

.support-contact-widget.open .support-contact-fab-icon {
    background: rgba(255, 255, 255, 0.18);
}

.support-contact-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 24px));
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,248,255,0.98));
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    padding: 12px;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.support-contact-widget.open .support-contact-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.support-contact-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 2px 2px 8px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.support-contact-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.support-contact-panel-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #fff;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.support-contact-panel-close:hover {
    color: var(--primary);
    border-color: rgba(124, 58, 237, 0.2);
}

.support-contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.86);
}

.support-contact-row + .support-contact-row {
    margin-top: 8px;
}

.support-contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 36px;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.10);
    background: #eef2ff;
}

.support-contact-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.support-contact-label {
    font-size: 12px;
    color: var(--text-muted);
}

.support-contact-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.support-contact-link {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.support-contact-link:hover {
    text-decoration: underline;
}

.support-contact-copy-btn {
    border: 1px solid rgba(124, 58, 237, 0.16);
    background: #fff;
    color: var(--primary);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.support-contact-copy-btn:hover {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.24);
}

.support-contact-row-download {
    align-items: flex-start;
}

.support-contact-row-download .support-contact-meta {
    padding-top: 2px;
}

.support-contact-footnote {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 2px;
}

@media (min-width: 769px) {
    html:not(.force-mobile) .support-contact-widget {
        left: auto;
        right: 16px;
        top: auto;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        transform: none;
        width: auto;
        margin-inline: 0;
    }

    html:not(.force-mobile) .support-contact-fab {
        padding: 15px 22px;
        gap: 11px;
        font-size: 16px;
        border-radius: 999px;
    }

    html:not(.force-mobile) .support-contact-fab-icon {
        width: 26px;
        height: 26px;
        font-size: 17px;
    }

    html:not(.force-mobile) .support-contact-fab-text {
        font-size: 15px;
    }
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* ============================================
   页脚
   ============================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   响应式 - 平板和桌面
   ============================================ */
@media (max-width: 900px) and (min-width: 769px) {
    .shop-layout {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }

    .category-sidebar {
        position: sticky;
    }

    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* ============================================
   商品描述 & 卖家信息
   ============================================ */
.goods-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 1.4em;
}

.goods-card-desc.empty {
    visibility: hidden;
}

.goods-card-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    min-height: 24px;
}

.goods-status-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.goods-status-badge.stock {
    background: #f0e7ff;
    color: #7c3aed;
}

.goods-status-badge.stock.soldout {
    background: #fef2f2;
    color: #ef4444;
}

.goods-status-badge.stock.unknown {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.goods-status-badge.limit {
    margin-left: auto;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid rgba(234, 88, 12, 0.12);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 58%;
}

.goods-status-badge.limit.empty {
    visibility: hidden;
}

.goods-card-seller {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.goods-market-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0;
    min-width: 56px;
    text-align: right;
    line-height: 1.2;
}

.goods-market-price.empty {
    visibility: hidden;
}

/* ============================================
   分页
   ============================================ */
.pagination {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
}

.page-btn {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gradient-subtle);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   限时折扣 & 多件优惠
   ============================================ */
.discount-badge {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    color: #e11d48;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(225, 29, 72, 0.15);
    margin-bottom: 16px;
}

.multi-offer-info {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    color: #1e40af;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(30, 64, 175, 0.12);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* ============================================
   商品详情 - 原价划线
   ============================================ */
.detail-market-price {
    font-size: 16px;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 400;
}

/* ============================================
   购买限制提示
   ============================================ */
.limit-hint {
    font-size: 12px;
    color: var(--warning);
    margin-left: 12px;
}

/* ============================================
   价格计算摘要
   ============================================ */
.detail-total {
    margin-bottom: 16px;
}

.price-summary {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.price-row.discount {
    color: var(--success);
}

.price-row.total {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

/* ============================================
   支付通道图标
   ============================================ */
.channel-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================
   商品类型切换标签
   ============================================ */
.type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.type-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.type-tab-logo {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.type-tab-label {
    display: inline-block;
    line-height: 1;
    font-weight: 700;
}

.type-tab:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.type-tab.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.type-tab.active .type-tab-logo {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.18);
}

/* ============================================
   支付成功弹窗 & 卡密展示区
   ============================================ */
.success-modal {
    max-width: 560px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px;
}

.success-header {
    text-align: center;
    margin-bottom: 24px;
}

.success-icon {
    font-size: 56px;
    margin-bottom: 12px;
    display: block;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.12); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-size: 22px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 4px;
}

.success-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 订单信息行（弹窗内） */
.order-meta-block {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.order-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.order-meta-row:last-child { border-bottom: none; }

.meta-label {
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 72px;
}

.meta-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    flex: 1;
}

.meta-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.meta-value.price {
    color: var(--accent);
    font-size: 16px;
}

/* 卡密发货区块（弹窗） */
.card-delivery-block {
    background: linear-gradient(135deg, #f0e7ff, #fce7f3);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
}

.card-delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}

.card-delivery-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.card-delivery-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

/* 卡密列表（弹窗） */
.card-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: white;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.card-index {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #f0e7ff;
    border-radius: 5px;
    padding: 2px 7px;
    margin-top: 3px;
    line-height: 1.5;
}

.card-content {
    flex: 1;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: #374151;
    font-family: 'Courier New', monospace;
}

.card-copy-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.15s;
    align-self: flex-start;
    margin-top: 2px;
}

.card-copy-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* 无卡密提示 */
.no-card-hint {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
    margin-bottom: 16px;
}

/* 卡密备注 */
.card-note {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: #166534;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* 弹窗底部按钮组 */
.success-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.success-actions > * {
    flex: 1;
    margin-top: 0 !important;
}

/* ============================================
   订单查询页 - 卡密展示区（订单查询结果中）
   ============================================ */
.order-result-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg);
}

.order-card-section {
    background: linear-gradient(135deg, #f0e7ff, #fce7f3);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-top: 16px;
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.card-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.card-section-actions {
    display: flex;
    gap: 8px;
}

.card-action-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.card-action-btn.copy {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.15);
}

.card-action-btn.export {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.card-action-btn:hover {
    transform: translateY(-1px);
}

.card-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: white;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.card-num {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #f0e7ff;
    border-radius: 5px;
    padding: 2px 7px;
    margin-top: 3px;
    line-height: 1.5;
}

.card-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: #374151;
    font-family: 'Courier New', monospace;
}

.card-copy-mini {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 2px 4px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.15s;
    align-self: flex-start;
    margin-top: 2px;
}

.card-copy-mini:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* 内联复制按钮（订单号旁边） */
.inline-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.55;
    transition: opacity 0.2s, transform 0.15s;
    padding: 1px 3px;
}

.inline-copy-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* 订单列表标题 */
.order-list-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

/* mono 字体工具类 */
.mono {
    font-family: 'Courier New', monospace;
    font-size: 12px !important;
}

/* ============================================
   验证码弹窗样式
   ============================================ */
.captcha-modal-box {
    max-width: 380px;
    padding: 28px 24px;
}

.captcha-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.captcha-modal-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
}

.captcha-modal-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.captcha-modal-img-wrap {
    flex-shrink: 0;
    width: 140px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid #e5e7eb;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.captcha-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.captcha-modal-refresh {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-modal-input {
    margin-bottom: 16px;
    font-size: 18px;
    letter-spacing: 4px;
    font-weight: 700;
    text-align: center;
}

.captcha-modal-actions {
    display: flex;
    gap: 10px;
}

.captcha-modal-actions .btn-secondary {
    flex: 1;
}

.captcha-modal-actions .btn-primary {
    flex: 2;
    margin-top: 0;
}

@media (max-width: 768px) {
    .captcha-modal-box {
        max-width: 100%;
        padding: 20px 16px;
    }

    .captcha-modal-title {
        font-size: 16px;
    }

    .captcha-modal-desc {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .captcha-modal-row {
        gap: 8px;
    }

    .captcha-modal-img-wrap {
        width: 120px;
        height: 46px;
    }

    .captcha-modal-input {
        font-size: 16px;
        letter-spacing: 3px;
        margin-bottom: 14px;
    }
}

/* ============================================
   验证码区域
   ============================================ */
.captcha-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-image-wrap {
    flex-shrink: 0;
    width: 130px;
    min-height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.captcha-image-wrap:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.captcha-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.captcha-placeholder {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 6px;
    line-height: 1.4;
}

#captchaCodeInput {
    flex: 1;
    min-width: 0;
    letter-spacing: 2px;
    font-size: 16px;
    font-weight: 600;
}

#refreshCaptchaBtn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.35s;
}

#refreshCaptchaBtn:hover:not(:disabled) {
    background: var(--border-light);
    transform: rotate(180deg);
}

#refreshCaptchaBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.captcha-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* ============================================
   订单查询输入区改进
   ============================================ */
.order-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--text);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
}

.order-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* 弹窗中的订单详情行对齐 */
.order-info-row .order-info-value {
    text-align: right;
    word-break: break-all;
}

/* 订单结果卡片改进 */
.order-result-card {
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* ============================================
   响应式补充
   ============================================ */
@media (max-width: 600px) {
    .success-modal {
        padding: 24px 16px;
    }
    .card-delivery-header,
    .card-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .success-actions {
        flex-direction: column;
    }
    .captcha-group {
        flex-wrap: wrap;
    }
    .captcha-image-wrap {
        width: 110px;
    }
    #captchaCodeInput {
        font-size: 14px;
    }
}

/* ============================================
   Full-Screen Order Query (override)
   ============================================ */
.order-view-page {
    width: 100%;
    min-height: calc(100vh - 120px);
}

.order-view-page .order-query-container {
    width: min(1280px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 14px 0 36px;
    display: block;
}

.order-view-page .order-query-card {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 190px);
    padding: clamp(18px, 2.2vw, 28px);
    border-radius: 20px;
    border: 1px solid rgba(124, 58, 237, 0.10);
    background:
        radial-gradient(1200px 420px at 100% -10%, rgba(236, 72, 153, 0.08), transparent 55%),
        radial-gradient(900px 320px at 0% 0%, rgba(124, 58, 237, 0.10), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
    box-shadow: 0 18px 45px rgba(30, 27, 75, 0.08);
    display: grid;
    gap: 14px;
    align-content: start;
}

.order-view-page .order-query-head {
    display: grid;
    gap: 6px;
}

.order-view-page .order-query-title {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
    color: #1f1147;
    letter-spacing: -0.02em;
}

.order-view-page .order-query-desc {
    margin: 0;
    max-width: 780px;
    line-height: 1.6;
    font-size: 14px;
}

.order-view-page .order-query-input-wrap {
    margin: 0 !important;
}

.order-view-page .order-input {
    min-height: 54px;
    border-radius: 14px;
    border-width: 1.5px;
    font-size: 16px;
    background: rgba(248, 250, 252, 0.96);
}

.order-view-page .order-input::placeholder {
    color: #94a3b8;
}

.order-view-page .order-query-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 0 !important;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.order-view-page .order-result-panel {
    margin-top: 4px;
    min-height: 220px;
}

.order-view-page .order-result-card {
    margin-top: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.order-view-page .no-card-hint {
    border-radius: 14px;
}

@media (min-width: 900px) {
    .order-view-page .order-query-card {
        grid-template-columns: minmax(0, 1fr) 240px;
        grid-template-areas:
            "head head"
            "input button"
            "result result";
        row-gap: 16px;
        column-gap: 14px;
    }

    .order-view-page .order-query-head {
        grid-area: head;
    }

    .order-view-page .order-query-input-wrap {
        grid-area: input;
    }

    .order-view-page .order-query-submit {
        grid-area: button;
    }

    .order-view-page .order-result-panel {
        grid-area: result;
    }
}

@media (max-width: 899px) {
    .order-view-page .order-query-container {
        width: min(100vw, calc(100vw - 12px));
        padding: 8px 0 18px;
    }

    .order-view-page .order-query-card {
        min-height: auto;
        border-radius: 16px;
        padding: 16px 14px;
        gap: 12px;
    }

    .order-view-page .order-query-title {
        font-size: 20px;
    }

    .order-view-page .order-query-submit,
    .order-view-page .order-input {
        min-height: 50px;
        font-size: 15px;
    }

    .order-view-page .order-result-panel {
        min-height: 160px;
    }
}

/* ============================================
   Mobile UX Overrides (Phone)
   ============================================ */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    :root {
        --header-height: 60px;
    }

    .shop-layout {
        grid-template-columns: 1fr;
    }

    /* category-sidebar 样式已移至 mobile-enhancements.css 和 html.force-mobile 规则中 */

    .header {
        height: var(--header-height);
    }

    .header-inner {
        padding: 8px 12px;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .logo-area {
        gap: 8px;
        min-width: 0;
        flex-shrink: 0;
    }

    .logo-icon svg {
        width: 36px;
        height: 36px;
    }

    .logo-title {
        font-size: 16px;
    }

    .logo-subtitle {
        display: none;
    }

    .header-actions {
        display: flex;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .search-box {
        flex: 1;
        min-width: 0;
    }

    .search-box input,
    .search-box input:focus {
        width: 100% !important;
        font-size: 14px;
        padding: 8px 12px 8px 36px;
    }

    .search-icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }

    .btn-order-query {
        min-width: 40px;
        padding: 8px;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-order-query svg {
        width: 16px;
        height: 16px;
    }

    .main-content {
        padding: 10px;
    }

    .announcement-inner {
        padding: 8px 10px 10px;
        gap: 6px;
        font-size: 12px;
        align-items: flex-start;
    }

    .announcement-label {
        font-size: 12px;
    }

    .announcement-panel {
        border-radius: 10px;
        padding: 8px 9px;
    }

    .announcement-title {
        font-size: 13px;
    }

    .announcement-summary {
        font-size: 11px;
        line-height: 1.42;
        margin-bottom: 5px;
    }

    .announcement-list {
        font-size: 11px;
        line-height: 1.5;
        padding-left: 16px;
    }

    .announcement-list li + li {
        margin-top: 3px;
    }

    .announcement-list code {
        font-size: 10px;
        padding: 1px 4px;
    }

    .announcement-disclaimer {
        margin-left: -16px;
        padding: 5px 7px;
    }

    .announcement-toggle {
        font-size: 11px;
        padding: 3px 8px;
    }

    #homeView .shop-layout {
        gap: 4px; /* 减少gap，让商品更靠近顶部 */
    }

    #homeView .category-sidebar {
        padding: 10px;
        border-radius: 12px;
        top: auto;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    #homeView .sidebar-title {
        margin-bottom: 6px;
        padding-bottom: 6px;
        font-size: 13px;
    }

    #homeView .sidebar-title svg {
        width: 16px;
        height: 16px;
    }

    #homeView .category-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        padding-bottom: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    #homeView .category-list::-webkit-scrollbar {
        display: none;
    }

    /* 分类横滚渐变遮罩提示 */
    #homeView .category-sidebar {
        position: relative;
    }

    #homeView .category-sidebar::before,
    #homeView .category-sidebar::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 24px;
        pointer-events: none;
        z-index: 2;
    }

    #homeView .category-sidebar::before {
        left: 0;
        background: linear-gradient(to right, rgba(255,255,255,0.95), transparent);
    }

    #homeView .category-sidebar::after {
        right: 0;
        background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
    }

    #homeView .category-item {
        flex: 0 0 auto;
        min-width: max-content;
        padding: 7px 11px;
        border-radius: 10px;
        font-size: 12px;
        gap: 6px;
    }

    #homeView .category-item .cat-count {
        min-width: 20px;
        padding: 1px 5px;
        font-size: 10px;
    }

    #homeView .goods-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .skeleton-card {
        height: 200px;
    }

    .goods-card {
        border-radius: 12px;
    }

    .goods-card-img,
    .goods-card-cover {
        aspect-ratio: auto;
        height: 110px;
        object-fit: cover;
        object-position: center;
        display: block !important;
        width: 100%;
        background: linear-gradient(135deg, #f6f0ff, #fff, #fde7f3);
    }

    .goods-card-cover {
        display: flex !important;
        position: relative;
    }

    /* 确保商品图片正确显示 */
    .goods-card-img {
        width: 100%;
        height: 110px;
        object-fit: cover;
        display: block;
    }

    /* 图片容器 */
    .goods-card-img-wrapper {
        width: 100%;
        height: 110px;
        overflow: hidden;
        background: linear-gradient(135deg, #f6f0ff, #fff, #fde7f3);
        position: relative;
    }

    .goods-card-cover-panel {
        width: 84%;
        height: 74%;
        gap: 6px;
    }

    .goods-card-cover-paw {
        width: 44px;
        height: 48px;
    }

    .goods-card-cover-paw .paw-dot {
        width: 10px;
        height: 12px;
    }

    .goods-card-cover-paw .d1 { left: 8px; top: 2px; }
    .goods-card-cover-paw .d2 { left: 20px; top: 0; }
    .goods-card-cover-paw .d3 { left: 0; top: 8px; }
    .goods-card-cover-paw .d4 { left: 30px; top: 7px; }

    .goods-card-cover-paw .paw-base {
        left: 6px;
        width: 32px;
        height: 28px;
        font-size: 13px;
    }

    .goods-card-cover-title {
        font-size: 15px;
    }

    .goods-card-body {
        padding: 8px;
    }

    .goods-card-name {
        font-size: 12px;
        margin-bottom: 4px;
        min-height: calc(1.4em * 2);
        line-height: 1.4;
    }

    .goods-card-desc {
        font-size: 10px;
        margin-top: 2px;
        min-height: 1.3em;
        line-height: 1.3;
    }

    .goods-card-status {
        margin-top: 4px;
        gap: 4px;
        min-height: 20px;
    }

    .goods-status-badge {
        padding: 2px 5px;
        font-size: 9px;
        border-radius: 999px;
    }

    .goods-status-badge.limit {
        max-width: 54%;
    }

    .goods-card-tags {
        margin-top: 4px;
        gap: 3px;
        min-height: 18px;
    }

    .goods-card-tags.empty {
        margin-top: 3px;
    }

    .goods-tag {
        font-size: 9px;
        padding: 1px 5px;
    }

    .goods-card-meta {
        min-height: 22px;
        gap: 4px;
        margin-top: 2px;
    }

    .goods-price {
        font-size: 15px;
    }

    .goods-price-unit {
        font-size: 9px;
    }

    .goods-market-price {
        min-width: 38px;
        font-size: 10px;
    }

    .footer {
        margin-top: 16px;
    }

    .footer-inner {
        padding: 12px;
        font-size: 11px;
        line-height: 1.5;
    }

    .toast-container {
        left: 8px;
        right: 8px;
        top: calc(var(--header-height) + 6px);
    }

    .toast {
        min-width: 0;
        width: 100%;
        padding: 8px 10px;
        font-size: 12px;
    }

    .modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-container {
        margin: 0;
        padding: 16px;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        width: 100%;
        max-width: 100%;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .detail-name {
        font-size: 17px;
        line-height: 1.3;
    }

    .detail-desc {
        font-size: 13px;
    }

    .detail-price-box {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .detail-price-value {
        font-size: 24px;
    }

    .detail-stock {
        font-size: 12px;
        padding: 3px 10px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 9px 12px;
        font-size: 14px;
    }

    .channel-list {
        gap: 8px;
    }

    .channel-item {
        padding: 10px;
        font-size: 12px;
    }

    .pay-channel-tip {
        margin-top: 7px;
        padding: 7px 9px;
        font-size: 11px;
        line-height: 1.5;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 15px;
    }

    .btn-secondary {
        padding: 10px 18px;
        font-size: 13px;
    }

    .order-view-page .order-query-container {
        width: 100%;
        padding: 0;
    }

    .order-view-page .order-query-card {
        padding: 16px 12px;
        border-radius: 12px;
        gap: 12px;
        min-height: auto;
    }

    .order-view-page .order-query-title {
        font-size: 18px;
    }

    .order-view-page .order-query-desc {
        font-size: 12px;
        line-height: 1.5;
    }

    .order-view-page .order-input,
    .order-view-page .order-query-submit {
        min-height: 48px;
        font-size: 14px;
        border-radius: 12px;
    }

    .order-view-page .order-result-card,
    .order-result-card {
        padding: 12px;
        border-radius: 12px;
    }

    .order-view-page .order-info-row,
    .order-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 6px 0;
        font-size: 12px;
    }

    .order-view-page .order-info-row .order-info-value,
    .order-info-row .order-info-value {
        text-align: left;
        width: 100%;
    }

    .order-card-section {
        padding: 12px;
        border-radius: 12px;
    }

    .card-delivery-block {
        padding: 12px;
    }

    .card-delivery-header,
    .card-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-delivery-actions,
    .card-section-actions {
        width: 100%;
        gap: 6px;
    }

    .btn-icon,
    .card-action-btn {
        display: inline-flex;
        align-items: center;
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 11px;
    }

    .card-list-item,
    .card-item {
        padding: 8px;
        border-radius: 8px;
        gap: 6px;
    }

    .card-text,
    .card-content {
        font-size: 11px;
        line-height: 1.5;
    }

    .card-index,
    .card-num {
        font-size: 10px;
        padding: 1px 5px;
    }

    .success-modal {
        padding: 20px 14px;
        border-radius: 16px 16px 0 0;
    }

    .success-icon {
        font-size: 48px;
    }

    .success-title {
        font-size: 19px;
    }

    .success-subtitle {
        font-size: 12px;
    }

    .order-meta-block {
        padding: 12px;
    }

    .order-meta-row {
        font-size: 12px;
        padding: 5px 0;
    }

    .meta-label {
        min-width: 60px;
    }

    .card-note {
        padding: 10px 12px;
        font-size: 12px;
    }

    .no-card-hint {
        padding: 12px;
        font-size: 12px;
    }

    .captcha-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .captcha-image-wrap {
        width: 100px;
        min-height: 42px;
    }

    #captchaCodeInput {
        font-size: 14px;
        letter-spacing: 1px;
    }

    #refreshCaptchaBtn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

@media (max-width: 420px) {
    .logo-title {
        font-size: 15px;
    }

    .logo-icon svg {
        width: 32px;
        height: 32px;
    }

    #homeView .goods-grid {
        gap: 6px;
    }

    .goods-card-body {
        padding: 7px;
    }

    .goods-card-name {
        font-size: 11px;
    }

    .goods-card-desc {
        font-size: 9px;
    }

    .goods-price {
        font-size: 14px;
    }

    .goods-status-badge {
        font-size: 8px;
        padding: 2px 4px;
    }

    .goods-status-badge.limit {
        max-width: 50%;
    }

    .goods-tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .search-box input {
        font-size: 13px;
        padding: 7px 10px 7px 32px;
    }

    .btn-order-query {
        padding: 7px;
        min-width: 36px;
    }

    .modal-container {
        padding: 14px;
    }

    .detail-name {
        font-size: 16px;
    }

    .detail-price-value {
        font-size: 22px;
    }

    .form-input,
    .form-select {
        font-size: 13px;
        padding: 8px 10px;
    }

    .btn-primary {
        font-size: 14px;
        padding: 11px 18px;
    }
}

/* ============================================
   Forced Mobile Layout (Desktop mode fallback)
   ============================================ */
html.force-mobile {
    --header-height: 60px;
}

html.force-mobile,
html.force-mobile body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

html.force-mobile .header {
    height: var(--header-height);
}

html.force-mobile .header-inner {
    padding: 8px 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
}

html.force-mobile .logo-area {
    gap: 8px;
    flex-shrink: 0;
}

html.force-mobile .logo-subtitle {
    display: none;
}

html.force-mobile .logo-title {
    font-size: 16px;
}

html.force-mobile .logo-icon svg {
    width: 36px;
    height: 36px;
}

html.force-mobile .header-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

html.force-mobile .search-box {
    flex: 1;
    min-width: 0;
}

html.force-mobile .search-box input,
html.force-mobile .search-box input:focus {
    width: 100% !important;
    font-size: 14px;
    padding: 8px 12px 8px 36px;
}

html.force-mobile .search-icon {
    left: 10px;
    width: 14px;
    height: 14px;
}

html.force-mobile .btn-order-query {
    min-width: 40px;
    padding: 8px;
    justify-content: center;
    flex-shrink: 0;
}

html.force-mobile .btn-order-query svg {
    width: 16px;
    height: 16px;
}

html.force-mobile .main-content {
    padding: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html.force-mobile .shop-layout {
    grid-template-columns: 1fr !important;
    gap: 4px; /* 减少gap */
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

html.force-mobile .goods-section,
html.force-mobile #homeView .goods-section {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden;
}

html.force-mobile .category-sidebar {
    position: fixed !important; /* 确保是fixed */
    top: var(--header-height) !important;
    left: 0 !important;
    transform: translateX(-100%) !important; /* 默认隐藏在左侧 */
    transition: transform 0.3s ease !important;
    order: -1;
    padding: 12px;
    border-radius: 14px;
    width: 280px !important;
    height: calc(100vh - var(--header-height)) !important;
    z-index: 999 !important;
    background: white !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
    overflow-y: auto !important;
}

html.force-mobile .category-sidebar.open {
    transform: translateX(0) !important;
}

html.force-mobile .sidebar-title {
    margin-bottom: 8px;
    padding-bottom: 8px;
    font-size: 14px;
}

html.force-mobile .category-list {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column !important; /* 垂直布局 */
    overflow-x: visible !important;
    overflow-y: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.force-mobile .category-list::-webkit-scrollbar {
    display: none;
}

html.force-mobile .category-item {
    flex: none !important; /* 不伸缩 */
    width: 100% !important; /* 全宽 */
    min-width: auto !important;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    gap: 8px;
}

html.force-mobile .category-item .cat-count {
    min-width: 22px;
    padding: 1px 6px;
    font-size: 11px;
}

html.force-mobile .goods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .goods-section,
    #homeView .goods-section,
    .goods-grid,
    #homeView .goods-grid {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .goods-card {
        min-width: 0;
        max-width: 100%;
    }
}

html.force-mobile .goods-card {
    border-radius: 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

html.force-mobile .goods-card-img,
html.force-mobile .goods-card-cover {
    aspect-ratio: auto !important;
    width: 100%;
    max-width: 100%;
    height: 126px !important;
    object-fit: contain !important;
    object-position: center center;
    background: linear-gradient(135deg, #f6f0ff, #fff, #fde7f3);
}

html.force-mobile .goods-card-cover-panel {
    width: 86%;
    height: 78%;
    border-radius: 12px;
    gap: 8px;
}

html.force-mobile .goods-card-cover-paw {
    width: 48px;
    height: 52px;
}

html.force-mobile .goods-card-cover-paw .paw-dot {
    width: 11px;
    height: 13px;
}

html.force-mobile .goods-card-cover-paw .d1 { left: 8px; top: 2px; }
html.force-mobile .goods-card-cover-paw .d2 { left: 21px; top: 0; }
html.force-mobile .goods-card-cover-paw .d3 { left: 0; top: 9px; }
html.force-mobile .goods-card-cover-paw .d4 { left: 32px; top: 8px; }

html.force-mobile .goods-card-cover-paw .paw-base {
    left: 6px;
    width: 36px;
    height: 30px;
    font-size: 14px;
}

html.force-mobile .goods-card-cover-title {
    font-size: 16px;
}

html.force-mobile .goods-card-body {
    padding: 10px;
}

html.force-mobile .goods-card-name {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 6px;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: calc(1.35em * 2);
}

html.force-mobile .goods-card-desc {
    font-size: 11px;
}

html.force-mobile .goods-card-status {
    gap: 6px;
    margin: 6px 0 8px;
}

html.force-mobile .goods-status-badge {
    font-size: 10px;
    padding: 3px 7px;
}

html.force-mobile .goods-price-row {
    margin-top: auto;
    align-items: flex-end;
}

html.force-mobile .goods-price {
    font-size: 16px;
}

html.force-mobile .goods-market-price {
    font-size: 11px;
}

html.force-mobile .toast {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
}

html.force-mobile .support-contact-widget {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

html.force-mobile .support-contact-fab {
    padding: 9px 12px;
    font-size: 12px;
    gap: 6px;
}

html.force-mobile .support-contact-panel {
    width: min(360px, calc(100vw - 20px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    border-radius: 14px;
}

html.force-mobile .support-contact-row {
    align-items: flex-start;
}

html.force-mobile .support-contact-copy-btn {
    padding: 5px 8px;
    font-size: 11px;
}

@media (max-width: 768px) {
    .support-contact-mask {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.22);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        display: block;
    }

    .support-contact-widget.open .support-contact-mask {
        opacity: 1;
        visibility: visible;
    }

    .support-contact-panel {
        width: min(360px, calc(100vw - 20px));
    }

    .support-contact-fab-text {
        font-size: 12px;
    }
}

html.force-mobile .modal-container {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    max-height: 88vh;
}

html.force-mobile .order-view-page .order-query-container {
    width: calc(100vw - 12px);
    padding: 6px 0 14px;
}

html.force-mobile .order-view-page .order-info-row,
html.force-mobile .order-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

html.force-mobile .card-section-actions {
    width: 100%;
    gap: 6px;
}

html.force-mobile .card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}


/* 桌面端强制隐藏排序控件和分类切换按钮 */
@media (min-width: 769px) {
    .sort-bar {
        display: none !important;
    }
    
    .category-toggle {
        display: none !important;
    }
}
