:root {
    --primary-color: #FF6B6B;
    --primary-dark: #ee5a24;
    --secondary-color: #FECA57;
    --accent-color: #48DBFB;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --border-color: #e5e5e5;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-height: 60px;
    --max-width: 450px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: white;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.status-bar .status-icons {
    display: flex;
    gap: 6px;
    font-size: 12px;
}

/* 主内容 */
.main-content {
    padding-bottom: calc(var(--nav-height) + 20px);
    min-height: calc(100vh - var(--nav-height));
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* 顶部导航 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f0f2f5;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
    background: var(--primary-color);
    color: white;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
}

.search-bar i {
    color: var(--text-light);
    margin-right: 8px;
    font-size: 16px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    color: var(--text-primary);
}

.search-bar input::placeholder {
    color: var(--text-light);
}

/* 轮播图 */
.carousel {
    position: relative;
    margin: 12px 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 16/9;
    background: #e0e0e0;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide .slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: white;
}

.carousel-slide .slide-overlay h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.carousel-slide .slide-overlay p {
    font-size: 13px;
    opacity: 0.9;
}

.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.carousel-indicators span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-indicators span.active {
    width: 24px;
    border-radius: 4px;
    background: white;
}

/* 快捷入口 */
.quick-entry {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: white;
    margin: 0 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.entry-item:active {
    transform: scale(0.95);
}

.entry-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.entry-item span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 区块标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.more-link {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.more-link i {
    font-size: 10px;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 16px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-hover);
}

.product-card .card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: #f0f0f0;
}

.product-card .card-body {
    padding: 12px;
}

.product-card .card-body h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-body p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-card .rebate {
    font-size: 11px;
    color: var(--secondary-color);
    background: #fff8e1;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 发现页 */
.discover-content {
    padding: 0 16px;
}

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

.discover-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.discover-card:active {
    transform: scale(0.98);
}

.discover-card img {
    width: 100%;
    aspect-ratio: 2/1;
    object-fit: cover;
}

.discover-card .card-info {
    padding: 12px;
}

.discover-card .card-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.discover-card .card-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 消息页 */
.messages-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-card {
    display: flex;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.message-card:active {
    transform: scale(0.98);
}

.msg-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

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

.msg-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.msg-info p {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-info .msg-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    display: block;
}

/* 我的页面 */
.profile-header {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    background: white;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 700;
}

.profile-info p {
    font-size: 13px;
    color: var(--text-light);
}

.edit-btn {
    padding: 8px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background: transparent;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn:active {
    background: var(--primary-color);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    margin: 0 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-item {
    background: white;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.profile-menu {
    background: white;
    margin: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

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

.menu-item:active {
    background: #f8f9fa;
}

.menu-item i:first-child {
    width: 24px;
    color: var(--text-light);
    font-size: 18px;
}

.menu-item span {
    flex: 1;
    font-size: 15px;
}

.menu-item .fa-chevron-right {
    color: var(--text-light);
    font-size: 12px;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    min-width: 56px;
    min-height: 44px;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 8px;
}

.nav-item i {
    font-size: 20px;
    transition: all 0.2s;
}

.nav-item span {
    font-size: 10px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.05);
}

.nav-item:active {
    background: #f0f2f5;
}

/* 响应式 */
@media (min-width: 768px) {
    .app-container {
        max-width: 450px;
        min-height: 100vh;
        box-shadow: 0 0 60px rgba(0,0,0,0.15);
        border-radius: 0;
    }
    body {
        background: #e8eaed;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        min-height: 100vh;
        padding: 0;
    }
}

@media (max-width: 374px) {
    .product-grid {
        gap: 8px;
    }
    .quick-entry {
        gap: 4px;
    }
    .entry-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .section-header h2 {
        font-size: 16px;
    }
}