* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Segoe UI", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-black);
    font-size: var(--font-size-md);
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* 页面切换动画 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    will-change: transform;
}

.page:not(.active) {
    overflow: hidden;
    content-visibility: auto;
}

.page.active {
    display: block;
    transform: translateX(0);
    z-index: 10;
}

/* 底部安全区 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .page {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 工具类 */
.text-primary { color: var(--color-primary); }
.text-white { color: var(--color-white); }
.text-gray { color: var(--color-gray); }
.text-black { color: var(--color-black); }

.bg-primary { background-color: var(--color-primary); }
.bg-white { background-color: var(--color-white); }
.bg-primary-light { background-color: var(--color-primary-light); }
.bg-gray { background-color: var(--color-gray-light); }
.btn-disabled { background-color: #A0A0A0; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-bold { font-weight: bold; }
.bold { font-weight: bold; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mr-10 { margin-right: 10px; }
.ml-10 { margin-left: 10px; }

.pt-10 { padding-top: 10px; }
.border-t { border-top: 1px solid var(--color-border); }

.w-full { width: 100%; }
.flex-row { display: flex; flex-direction: row; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }

.float-right { float: right; }

.clickable { cursor: pointer; }

/* 通用触摸优化 */
a, button, .clickable, .nav-item, .icon-item, .product-card, .grid-item, .agreement-item {
    -webkit-tap-highlight-color: rgba(230, 33, 42, 0.12);
    touch-action: manipulation;
}

.product-card:active, .grid-item:active { opacity: 0.7; transform: scale(0.97); }

::-webkit-scrollbar { width: 0; height: 0; display: none; }
