:root {
    /* 亮色模式 */
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-sub: #888888;

    --cat-bg: #eee;
    --cat-active-bg: #e4393c;
    --cat-active-color: #fff;

    --search-bg: #fff;
    --border-color: #ddd;
    --tip-color: #999;

    --price-color: #e4393c;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;

    --text-main: #e0e0e0;
    --text-sub: #aaaaaa;

    --cat-bg: #3a3a3a;
    --cat-active-bg: #ff6b6b;
    --cat-active-color: #fff;

    --search-bg: #2d2d2d;
    --border-color: #444;
    --tip-color: #777;

    --price-color: #ff6b6b;
}
* {
    box-sizing: border-box;
}


/* ✅ 锁死滚动，但保留回弹 */
html, body {
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
	  overflow: hidden;   /* ✅ 禁止全局滚动 */
}


        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
			  background-color: var(--bg-color);
            color: var(--text-main);
            line-height: 1.6;
            max-width: 480px;
            margin: 0 auto;
            padding-bottom: 30px;
            position: relative;
            transition: all 0.3s ease;
        }

body::after {
    content: '';
    display: block;
    height: 1px;
}
ul, li, p, form, img {
    margin: 0;
    padding: 0;
    border: 0;
}
li {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--text-main);
}

.page {
 padding: 0px;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@font-face {
    font-family: "yyhyfont";
    src:
        url('/m/res/font/yyhyfont.woff?93') format('woff'),
        url('/m/res/font/yyhyfont.ttf?93') format('truetype');
}

.ico {
    font-family: "yyhyfont" !important;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
}
a .ico {color: #333333;}
.header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

/* 一级分类 */
.cat1 {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 12px;
    white-space: nowrap;
}

.cat1 div {
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--cat-bg);
    font-size: 14px;
    color: var(--text-main);
}

.cat1 .active {
    background: var(--cat-active-bg);
    color: var(--cat-active-color);
}

/* 二级分类 */
.cat2 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    background: var(--card-bg);
}

.cat2 div {
    padding: 4px 10px;
    background: var(--cat-bg);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-main);
}

.cat2 .active {
    background: var(--cat-active-bg);
    color: var(--cat-active-color);
}

.search {
    padding: 8px 10px;
    background: var(--search-bg);
}

.search input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    outline: none;
    background: var(--bg-color);
    color: var(--text-main);
}

.list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}

.item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 10px;
}

.item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
}

.name {
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-main);
}

.price {
    margin-top: 4px;
}

.now {
    color: var(--price-color);
    font-weight: bold;
}

.old {
    color: var(--text-sub);
    text-decoration: line-through;
    font-size: 12px;
    margin-left: 6px;
}

.tip,
.loading {
    text-align: center;
    padding: 12px;
    color: var(--tip-color);
    font-size: 13px;
}

.loading span {
    display: inline-block;
    animation: dot 1.4s infinite;
}

.loading span:nth-child(2) { animation-delay: 0.2s; }
.loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot {
    0%,100%{opacity:.3;}
    50%{opacity:1;}
}

.bottomblank {
    height: 60px;
}

/*
.backtop {
    position: fixed;
    right: 15px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 20;
}
*/

.backtop {
    position: fixed !important;
    right: 14px;
    bottom: 80px;
    z-index: 2147483647 !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(230, 67, 64, 0.95);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transform: translateZ(0);
}


@media screen and (max-width: 320px) { html { font-size: 50%; } }
@media screen and (min-width: 360px) { html { font-size: 60%; } }
@media screen and (min-width: 375px) { html { font-size: 60%; } }
@media screen and (min-width: 414px) { html { font-size: 66.2%; } }
