/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 120px;
    height: 100%;
    overflow: hidden;
}

.page {
    display: none;
    height: 100vh;
    padding-bottom: 160px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.page.active {
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

footer {
    padding: 20px;
    padding-bottom: 100px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    position: relative;
    z-index: 1;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

footer a:hover {
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ========== 登录页 ========== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-header {
    text-align: center;
    color: white;
    margin-bottom: 60px;
    animation: slideUp 0.8s ease-out;
}

.login-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-header p {
    font-size: 16px;
    opacity: 0.9;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: float 3s ease-in-out infinite;
}

.login-tip {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 24px;
    font-size: 14px;
    text-align: center;
    line-height: 1.8;
}

.wechat-icon {
    margin-right: 8px;
}

/* ========== 按钮 ========== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-lg {
    padding: 18px 48px;
    font-size: 18px;
    width: 100%;
    max-width: 320px;
    border-radius: 16px;
}

/* ========== 顶部栏 ========== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    line-height: 1;
}

.back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: var(--gray-700);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}

.header-logo {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--gray-50);
    transition: all 0.3s;
}

.header-right:hover {
    background: var(--gray-100);
}

.header-right #userNickname {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.header-right #headerAvatar {
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========== 搜索框 ========== */
.search-bar {
    position: relative;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

#searchInput {
    width: 100%;
    padding: 14px 44px 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    font-size: 15px;
    background: var(--gray-50);
    outline: none;
    transition: all 0.3s;
}

#searchInput:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--gray-300);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.search-clear-btn:hover {
    background: var(--gray-400);
}

/* ========== 分类标签 ========== */
.category-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--gray-100);
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 10px 20px;
    border-radius: 25px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
}

/* ========== 商品列表 ========== */
.product-list {
    list-style: none;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    counter-reset: none;
}

@media (min-width: 480px) {
    .product-list { gap: 18px; }
}

@media (min-width: 768px) {
    .product-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
}

.product-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    counter-reset: none;
    list-style: none;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

/* 隐藏可能的序号或标记 */
.product-card::before,
.product-card::after,
.product-image::before,
.product-image::after {
    content: none !important;
    counter-reset: none !important;
}

.product-card:active {
    transform: scale(0.97);
}

.product-card.out-of-stock {
    opacity: 0.7;
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.product-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    position: relative;
    overflow: hidden;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.product-image:not(.has-image)::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.product-image.has-image {
    color: transparent;
}

.product-category-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    backdrop-filter: blur(10px);
}

.product-sold-out-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}

.product-info {
    padding: 14px;
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-800);
    line-height: 1.4;
}

.product-price {
    color: var(--accent);
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.product-price::before {
    content: '¥';
    font-size: 14px;
    font-weight: 600;
}

.product-stock {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
    font-weight: 500;
}

.product-stock.low-stock {
    color: var(--warning);
    font-weight: 700;
}

/* ========== 订单列表 ========== */
.order-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--gray-100);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.order-tabs::-webkit-scrollbar { display: none; }

.order-list {
    padding: 16px;
    min-height: 200vh; /* 强制内容变高，确保可以滚动 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.order-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
    opacity: 0;
    animation: orderCardFadeIn 0.3s ease forwards;
}

@keyframes orderCardFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.order-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.order-card.status-pending { border-left-color: var(--warning); }
.order-card.status-paid { border-left-color: var(--primary); }
.order-card.status-paying { border-left-color: var(--secondary); }
.order-card.status-completed { border-left-color: var(--success); }
.order-card.status-cancelled { border-left-color: var(--gray-300); }
.order-card.status-refunded { border-left-color: var(--gray-400); opacity: 0.8; }

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 10px;
}

.order-number {
    font-size: 12px;
    color: var(--gray-500);
    font-family: 'SF Mono', 'Monaco', monospace;
    letter-spacing: 0.5px;
}

.order-status {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-pending { background: #fef3c7; color: #d97706; }
.status-paid { background: #ede9fe; color: #7c3aed; }
.status-paying { background: #f3e8ff; color: #9333ea; }
.status-completed { background: #d1fae5; color: #059669; }
.status-cancelled { background: var(--gray-100); color: var(--gray-500); }
.status-refunded { background: var(--gray-100); color: var(--gray-400); }

.order-product {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 14px;
    transition: background 0.3s;
}

.order-product-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.order-product-info {
    flex: 1;
    min-width: 0;
}

.order-product-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--gray-800);
}

.order-product-quantity {
    font-size: 13px;
    color: var(--gray-500);
}

.order-product-remark {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 6px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 12px;
}

.order-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.order-total::before {
    content: '合计:';
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.order-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
}

/* ========== 个人中心 ========== */
.profile-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 40px 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-id {
    font-size: 13px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.menu-list {
    background: rgba(255, 255, 255, 0.98);
    margin-top: 16px;
    border-radius: 20px;
    margin: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all 0.3s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: var(--gray-50);
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.menu-item:active::before {
    transform: scaleY(1);
}

.menu-icon {
    font-size: 22px;
    margin-right: 14px;
}

.menu-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
}

.menu-arrow {
    color: var(--gray-300);
    font-size: 20px;
}

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
    height: 70px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 60px;
    color: var(--gray-400);
}

.nav-item.active {
    color: var(--primary);
    transform: translateY(-4px);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: all 0.3s;
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-item.active .nav-label {
    font-weight: 700;
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-overflow-scrolling: touch;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.close-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.product-detail-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.product-detail-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 16px;
}

.product-detail-desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 24px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 14px;
}

.quantity-selector label {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-200);
    background: white;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-btn:active {
    transform: scale(0.9);
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    outline: none;
}

.quantity-selector input:focus {
    border-color: var(--primary);
}

.remark-input {
    margin-bottom: 20px;
}

.remark-input label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.remark-input input,
.remark-input textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.remark-input input:focus,
.remark-input textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.remark-input textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px 24px;
    border-top: 1px solid var(--gray-100);
}

.modal-footer .btn {
    flex: 1;
}

/* ========== 加载状态 ========== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.skeleton-image {
    height: 150px;
}

.skeleton-content {
    padding: 14px;
}

.skeleton-title {
    height: 18px;
    margin-bottom: 10px;
    width: 80%;
}

.skeleton-price {
    height: 24px;
    margin-bottom: 8px;
    width: 40%;
}

.skeleton-text {
    height: 14px;
    width: 30%;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 15px;
}

.empty-state .btn {
    margin-top: 20px;
}

/* ========== 下拉刷新 ========== */
.pull-refresh {
    text-align: center;
    padding: 12px;
    color: var(--gray-400);
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pull-refresh.visible {
    opacity: 1;
}

.pull-refresh.refreshing {
    color: var(--primary);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 按钮加载状态 ========== */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .product-image {
        height: 130px;
        font-size: 48px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-price {
        font-size: 20px;
    }

    .header {
        padding: 14px 16px;
    }
}

@media (max-width: 375px) {
    .product-list {
        gap: 10px;
        padding: 10px;
    }

    .product-image {
        height: 110px;
        font-size: 42px;
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 13px;
    }
}

/* ========== 安全区域适配 ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ========== 横屏优化 ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        min-height: auto;
        padding: 20px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 32px;
        border-radius: 16px;
    }
}

/* ========== 分类页面侧边栏 ========== */
.category-page {
    display: flex;
    min-height: 100vh;
    padding-bottom: 80px;
}

.category-sidebar {
    width: 88px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.category-sidebar::-webkit-scrollbar {
    width: 3px;
}

.category-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sidebar-item {
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 60px;
    border-left: 3px solid transparent;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 36px;
    background: transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s;
}

.sidebar-item.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    font-weight: 700;
    box-shadow: 2px 0 12px rgba(99, 102, 241, 0.2);
}

.sidebar-item.active::before {
    background: white;
}

.sidebar-item-name {
    font-size: 13px;
    color: #374151;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
    display: block;
    word-break: break-all;
}

.sidebar-item.active .sidebar-item-name {
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-item:active {
    transform: scale(0.96);
}

.category-content {
    flex: 1;
    background: white;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.category-search {
    padding: 12px 16px;
    background: #f8f9fa;
}

.category-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: all 0.3s;
}

.category-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

@media (min-width: 769px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }
}

/* ========== 帮助中心 ========== */
.help-section {
    padding: 16px;
}

.help-section .section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.3s;
}

.faq-item:active {
    transform: scale(0.98);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    font-weight: 500;
    color: var(--gray-800);
}

.faq-arrow {
    font-size: 18px;
    color: var(--gray-400);
    transition: transform 0.3s;
}

.faq-item.expanded .faq-arrow {
    transform: rotate(90deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
    transition: all 0.3s;
}

.faq-item.expanded .faq-answer {
    max-height: 200px;
    padding: 0 16px 16px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: 12px;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.contact-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.contact-image-item {
    padding: 8px;
}

.contact-image-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.contact-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.2s;
}

.contact-image-wrapper:hover .contact-image {
    transform: scale(1.05);
}

.contact-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    padding: 20px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.contact-image-wrapper:hover .contact-image-overlay {
    opacity: 1;
}

.contact-image-hint {
    color: white;
    font-size: 12px;
    text-align: center;
    display: block;
}

.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-upload-container .image-preview {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 200px;
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-upload-container .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-container .image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-container .image-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-preview-overlay .preview-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-preview-overlay .close-preview {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-preview-overlay .close-preview:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.image-preview-overlay .preview-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: center;
}
