/* ═══════════════════════════════════════════════════════════════
   mobile-legacy.css —— 旧版 v3 设计系统（过渡期保留）
   来源：原 Views/Shared/_MobileLayout.cshtml 内联 <style> 块（2026-10-21 抽离）。
   作用：移动端视觉改版（mobile-proto.css 新外壳）落地期间，尚未改写的页面
   仍使用 .mobile-card / .store-* / .btn-*-mobile 等旧类，由此文件兜底。
   注意：view-transition 规则未随迁出 —— 新外壳的 TabBar/主区 morph 规则
   改写在新版 _MobileLayout.cshtml 内联块中（选择器已换成 .tabbar / #main）。
   页面迁移完成后对应规则应从这里删除，最终整文件下线。
   ═══════════════════════════════════════════════════════════════ */
/* ====== v3 设计系统（对齐 tdql.cn 桌面首页 #f7ad00 橙金） ====== */
:root {
    /* 主色：橙金（严格对齐桌面 common.css / home-v2.css） */
    --mobile-primary: #f7ad00;
    --mobile-primary-dark: #dd701e;
    --mobile-primary-light: rgba(247, 173, 0, 0.12);

    /* 子页辅助金 */
    --mobile-accent-gold: #f9b233;
    --mobile-accent-gold-hover: #ffc44d;
    --mobile-accent-gold-deep: #c4791b;

    /* 倒计时特色色（复刻桌面 .counter_con，0.7 透明度） */
    --mobile-countdown-bg: rgba(183, 210, 83, 0.7);
    --mobile-countdown-border: #ffffff;
    --mobile-countdown-ended-bg: rgba(220, 53, 69, 0.85);

    /* 遮罩 */
    --mobile-hero-overlay: linear-gradient(to right,
        rgba(0,0,0,0.6) 0%,
        rgba(0,0,0,0.4) 30%,
        rgba(0,0,0,0.3) 60%,
        rgba(0,0,0,0) 100%);
    --mobile-gallery-overlay: rgba(0, 0, 0, 0.4);
    --mobile-video-overlay: rgba(0, 0, 0, 0.35);

    /* 背景色 */
    --mobile-bg: #f5f5f5;
    --mobile-card-bg: #ffffff;
    --mobile-surface-hover: #fafafa;

    /* 文字色 */
    --mobile-text-primary: #1a1a1a;
    --mobile-text-secondary: #666666;
    --mobile-text-muted: #999999;
    --mobile-text-on-primary: #ffffff;

    /* 边框 */
    --mobile-border: #e5e5e5;
    --mobile-border-light: #f0f0f0;

    /* 圆角阶梯（对齐桌面：偏小、克制） */
    --mobile-radius-xs: 4px;
    --mobile-radius-sm: 6px;
    --mobile-radius-md: 8px;
    --mobile-radius-lg: 12px;
    --mobile-radius-xl: 18px;
    --mobile-radius-full: 9999px;

    /* 阴影 */
    --mobile-shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --mobile-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --mobile-shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --mobile-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* 功能色（对齐 mobile-unified.css 的去饱和覆盖，避免加载顺序导致覆盖失效） */
    --mobile-success: #10B981;
    --mobile-warning: #F59E0B;
    --mobile-danger: #EF4444;
    --mobile-info: #0EA5E9;

    /* TabBar */
    --mobile-tab-bg: #FFFFFF;
    --mobile-tab-height: 56px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--mobile-bg);
    color: var(--mobile-text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: contain;
    font-size: 16px;
    line-height: 1.5;
}

/* 主内容区 */
.main-content {
    padding-bottom: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    background: var(--mobile-bg);
}

/* ====== 底部TabBar ====== */
.mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mobile-tab-bg);
    border-top: 1px solid var(--mobile-border);
    height: var(--mobile-tab-height);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.mobile-tab-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-tab-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--mobile-text-muted);
    transition: all 0.2s ease;
    position: relative;
    padding: 6px 0;
}

.mobile-tab-bar-item .material-symbols-outlined {
    font-size: 22px;
    transition: all 0.2s ease;
}

.mobile-tab-bar-item span:last-child {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

.mobile-tab-bar-item.active {
    color: var(--mobile-primary);
}

.mobile-tab-bar-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

.mobile-tab-bar-item:active {
    background: var(--mobile-primary-light);
}

/* ====== 通用卡片样式 ====== */
.mobile-card {
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-md);
    box-shadow: var(--mobile-shadow-sm);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
}

.mobile-card:active {
    box-shadow: var(--mobile-shadow-xs);
}

.mobile-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #f0f0f0;
}

.mobile-card-body {
    padding: var(--mobile-radius-md);
}

.mobile-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    margin: 0 0 6px 0;
}

.mobile-card-subtitle {
    font-size: 13px;
    color: var(--mobile-text-muted);
    margin: 0;
}

.mobile-card-badge {
    display: inline-block;
    background: var(--mobile-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--mobile-radius-full);
    margin-bottom: 8px;
}

.mobile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--mobile-border-light);
}

/* ====== 通用列表项 ====== */
.mobile-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--mobile-card-bg);
    text-decoration: none;
    border-bottom: 1px solid var(--mobile-border-light);
    transition: background 0.2s ease;
    color: var(--mobile-text-primary);
}

.mobile-list-item:last-child {
    border-bottom: none;
}

.mobile-list-item:active {
    background: var(--mobile-surface-hover);
}

.mobile-list-item-image {
    width: 48px;
    height: 48px;
    border-radius: var(--mobile-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.mobile-list-item-content {
    flex: 1;
    min-width: 0;
}

.mobile-list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-list-item-subtitle {
    font-size: 12px;
    color: var(--mobile-text-muted);
    margin-top: 2px;
}

.mobile-list-item-arrow {
    font-size: 20px;
    color: var(--mobile-text-muted);
    flex-shrink: 0;
}

/* ====== 通用按钮 ====== */
.btn-primary-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mobile-primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--mobile-radius-full);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--mobile-shadow-sm);
}

.btn-primary-mobile:active {
    background: var(--mobile-primary-dark);
    box-shadow: none;
}

.btn-secondary-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mobile-card-bg);
    color: var(--mobile-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--mobile-radius-full);
    text-decoration: none;
    border: 1.5px solid var(--mobile-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-mobile:active {
    background: var(--mobile-primary-light);
}

/* ====== 商城通用 ====== */
.price-symbol {
    font-size: 14px;
    color: var(--mobile-primary);
}
.price-value {
    color: var(--mobile-primary);
    font-weight: 700;
    font-size: 18px;
}

/* 商城卡片 */
.store-product-card {
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-md);
    box-shadow: var(--mobile-shadow-sm);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}
.store-product-card:active {
    box-shadow: var(--mobile-shadow-xs);
}
.store-product-image-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f0f0f0;
}
.store-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.store-product-body {
    padding: 10px 12px 12px;
}
.store-product-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}
.store-product-price {
    color: var(--mobile-primary);
    font-weight: 700;
}

/* 分类卡片 */
.store-category-card {
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-lg);
    box-shadow: var(--mobile-shadow-sm);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}
.store-category-card:active {
    box-shadow: var(--mobile-shadow-xs);
}
.store-category-icon {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.store-category-body {
    padding: 14px;
}
.store-category-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mobile-text-primary);
    margin-bottom: 4px;
}
.store-category-count {
    font-size: 12px;
    color: var(--mobile-text-muted);
}

/* 商品详情 */
.store-detail {
    background: var(--mobile-card-bg);
}
.store-detail-image-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f0f0f0;
}
.store-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.store-detail-content {
    padding: 16px;
}
.store-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    margin-bottom: 10px;
}
.store-detail-price {
    color: var(--mobile-primary);
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 16px;
}
.store-detail-desc {
    font-size: 14px;
    color: var(--mobile-text-secondary);
    line-height: 1.7;
    padding-top: 16px;
    border-top: 1px solid var(--mobile-border-light);
    word-break: break-word;
}
/* 2026-10-07（P0-4）：富文本 reset —— Tailwind preflight 抹平标题/列表/段落结构，
   且去掉 white-space:pre-wrap（会把视图源码缩进渲染成空白行）。
   与 NewsDetail.cshtml 的 .news-content reset 保持同一套规则。 */
.store-detail-desc :is(h1, h2, h3, h4) { margin: 1.2em 0 0.6em; font-weight: 700; font-size: 1em; color: var(--mobile-text-primary); }
.store-detail-desc p { margin: 0.8em 0; }
.store-detail-desc img { max-width: 100%; height: auto; border-radius: var(--mobile-radius-sm); margin: 0.8em 0; }
.store-detail-desc a { color: var(--mobile-primary); text-decoration: underline; word-break: break-all; }
.store-detail-desc ul { list-style: disc; padding-left: 1.5em; margin: 0.8em 0; }
.store-detail-desc ol { list-style: decimal; padding-left: 1.5em; margin: 0.8em 0; }
.store-detail-desc li { margin: 0.3em 0; }
.store-detail-desc blockquote { border-left: 3px solid var(--mobile-primary); padding: 8px 12px; margin: 1em 0; color: var(--mobile-text-secondary); background: var(--mobile-primary-light); border-radius: 0 var(--mobile-radius-sm) var(--mobile-radius-sm) 0; }
.store-detail-desc table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.store-detail-desc th, .store-detail-desc td { border: 1px solid var(--mobile-border); padding: 8px; font-size: 13px; }
.store-detail-desc th { background: var(--mobile-bg); }
.store-detail-desc pre { background: var(--mobile-bg); padding: 12px; border-radius: var(--mobile-radius-sm); overflow-x: auto; font-size: 12px; }
.store-detail-desc hr { border: none; border-top: 1px solid var(--mobile-border); margin: 1.5em 0; }
/* 2026-10-25 QA 修复 P3-12：.store-detail-footer 已删除（旧版商城底栏，全仓零引用）。 */

/* 购物车 */
.store-cart-list {
    padding-bottom: 100px;
}
.store-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--mobile-card-bg);
    border-bottom: 1px solid var(--mobile-border-light);
}
.store-cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: var(--mobile-radius-sm);
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.store-cart-item-info {
    flex: 1;
    min-width: 0;
}
.store-cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.store-cart-item-price {
    color: var(--mobile-primary);
    font-weight: 600;
}
.store-cart-item-qty {
    font-size: 14px;
    color: var(--mobile-text-muted);
    flex-shrink: 0;
}
/* 2026-10-25 QA 修复 P3-12：.store-cart-footer 及其三个子类
   (.store-cart-footer-total / -label / -price) 已删除 —— 旧版商城底栏，全仓零引用。 */

/* 结算页面 */
.store-checkout-list {
    background: var(--mobile-bg);
}
.store-checkout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-md);
    margin-bottom: 10px;
}
.store-checkout-item-image {
    width: 64px;
    height: 64px;
    border-radius: var(--mobile-radius-sm);
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.store-checkout-item-info {
    flex: 1;
    min-width: 0;
}
.store-checkout-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--mobile-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.store-checkout-item-price {
    font-size: 13px;
    color: var(--mobile-primary);
    font-weight: 600;
}
.store-checkout-form {
    background: var(--mobile-card-bg);
}
.store-form-section {
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}
.store-form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mobile-border-light);
}
.store-form-group {
    margin-bottom: 14px;
}
.store-form-group:last-child {
    margin-bottom: 0;
}
.store-form-label {
    display: block;
    font-size: 13px;
    color: var(--mobile-text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.store-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--mobile-border);
    border-radius: var(--mobile-radius-md);
    font-size: 15px;
    color: var(--mobile-text-primary);
    background: var(--mobile-bg);
    transition: border-color 0.2s ease;
}
.store-form-input:focus {
    outline: none;
    border-color: var(--mobile-primary);
}
.store-checkout-summary {
    background: var(--mobile-card-bg);
    border-radius: var(--mobile-radius-lg);
    padding: 16px;
    margin-top: 16px;
}
.store-checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.store-checkout-summary-label {
    font-size: 14px;
    color: var(--mobile-text-secondary);
}
.store-checkout-summary-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--mobile-primary);
}

/* 订单成功 */
.store-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 24px;
    background: var(--mobile-bg);
    text-align: center;
}
.store-success-icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--mobile-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.store-success-icon {
    font-size: 48px;
    color: var(--mobile-primary);
}
.store-success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    margin-bottom: 10px;
}
.store-success-order {
    font-size: 14px;
    color: var(--mobile-text-secondary);
    margin-bottom: 6px;
}
.store-success-desc {
    font-size: 14px;
    color: var(--mobile-text-muted);
    margin-bottom: 32px;
}
.store-success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}

/* 通用商城按钮 */
.store-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mobile-primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: var(--mobile-radius-full);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--mobile-shadow-sm);
}
.store-btn-primary:active {
    background: var(--mobile-primary-dark);
    box-shadow: none;
}
.store-btn-primary .material-symbols-outlined {
    font-size: 20px;
}
.store-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mobile-card-bg);
    color: var(--mobile-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: var(--mobile-radius-full);
    text-decoration: none;
    border: 1.5px solid var(--mobile-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.store-btn-secondary:active {
    background: var(--mobile-primary-light);
}
.store-btn-primary-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mobile-primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--mobile-radius-full);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 商城头部 */
.store-header {
    background: var(--mobile-card-bg);
    padding: 14px 16px;
    border-bottom: 1px solid var(--mobile-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.store-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    margin: 0;
}

/* 空状态 */
.store-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}
.store-empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}
.store-empty-text {
    font-size: 15px;
    color: var(--mobile-text-muted);
    margin-bottom: 20px;
}

/* ====== Section 通用 ====== */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    letter-spacing: -0.01em;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
}

.section-more {
    font-size: 13px;
    color: var(--mobile-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.section-more:active {
    color: var(--mobile-primary);
}

/* ====== 头部导航 ====== */
.mobile-header {
    background: var(--mobile-card-bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--mobile-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mobile-text-primary);
    margin: 0;
}

/* 页面过渡 */
.page-enter {
    animation: fadeIn 0.25s ease;
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ====== 全局 Toast (替代原生 alert) ====== */
.mobile-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-tab-height) + 40px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(8px);
    max-width: calc(100vw - 48px);
    padding: 12px 20px;
    border-radius: var(--mobile-radius-full);
    background: rgba(26, 26, 26, 0.92);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    box-shadow: var(--mobile-shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2000;
}
.mobile-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.mobile-toast.toast-success {
    background: rgba(16, 185, 129, 0.95);
}
.mobile-toast.toast-error {
    background: rgba(239, 68, 68, 0.95);
}

/* ====== 微信浏览器兼容 ====== */
/* 禁用微信浏览器调整字体大小 */
body {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

/* 微信浏览器安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-tab-bar {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}
