* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #1f1f1f;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 1760px;
    margin: 0 auto;
    padding: 0 48px 30px;
    background: #fff;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 16px;
    border-bottom: 1px solid #ebebeb;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: block;
    text-decoration: none;
}

.logo img {
    width: 150px;
    height: auto;
    display: block;
}

/* ===== Search ===== */
.search-wrap {
    flex: 1;
    max-width: 1100px;
}

.search-wrap .input-text {
    min-width: 280px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #ebebeb;
    border-radius: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 48px;
    padding: 0 4px 0 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.search-wrap .input-text:focus-within {
    border-color: #ff5000;
    box-shadow: 0 0 0 4px rgba(255, 80, 0, 0.08);
}

.search-wrap .input-text input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 0;
    background: transparent;
    color: #1f1f1f;
    height: 100%;
    min-width: 60px;
}

.search-wrap .input-text input::placeholder {
    color: #b0b0b0;
    font-weight: 400;
}

.search-btn {
    background: #ff5000;
    border: none;
    border-radius: 24px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 0 28px;
    height: 40px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    margin-left: 8px;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #e04600;
}

.search-btn:active {
    transform: scale(0.97);
}

.search-wrap .tips {
    font-weight: 400;
    font-size: 14px;
    margin-top: 10px;
    margin-left: 20px;
    color: #707070;
}

/* ===== Goods Grid ===== */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px 16px;
    padding: 28px 0 20px;
    min-height: 400px;
}

/* ===== Goods Card ===== */
.goods-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.goods-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.goods-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f7f8fa;
    display: block;
    border-bottom: 1px solid #f2f2f2;
}

.goods-info {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.goods-name {
    font-size: 14px;
    line-height: 1.5;
    color: #1f1f1f;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    margin-bottom: 4px;
}

.goods-subtitle {
    font-size: 13px;
    line-height: 1.4;
    color: #ff5000;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    margin-bottom: 6px;
}

.goods-price {
    font-size: 22px;
    font-weight: 600;
    color: #ff5000;
    letter-spacing: -0.5px;
    margin-top: auto;
    display: flex;
    align-items: baseline;
}

.goods-price .unit {
    font-size: 14px;
    font-weight: 500;
    margin-right: 1px;
}

.goods-price .decimal {
    font-size: 16px;
    font-weight: 500;
    margin-left: 1px;
}

/* ===== Loading & Empty ===== */
.loading-mask {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: #999;
}

.loading-mask .spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #ff5000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
}

.empty-state .empty-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 6px;
}

.empty-state .empty-desc {
    font-size: 13px;
    color: #aaa;
}

.empty-state .retry-btn {
    margin-top: 20px;
    padding: 10px 32px;
    border: 1px solid #ff5000;
    border-radius: 24px;
    background: #fff;
    color: #ff5000;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.empty-state .retry-btn:hover {
    background: #ff5000;
    color: #fff;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 18px 0 6px;
    margin-top: 6px;
    border-top: 1px solid #ebebeb;
}

.pagination button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #1f1f1f;
    font-size: 14px;
    padding: 6px 16px;
    min-width: 44px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.pagination button:hover:not(:disabled):not(.active) {
    border-color: #ff5000;
    color: #ff5000;
    background: #fff5f0;
}

.pagination button.active {
    background: #ff5000;
    border-color: #ff5000;
    color: #fff;
    font-weight: 500;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ebebeb;
}

.pagination .page-info {
    font-size: 14px;
    color: #666;
    padding: 0 8px;
    white-space: nowrap;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid #ebebeb;
    padding: 24px 0 16px;
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: #7a7a7a;
    letter-spacing: 0.3px;
}

.footer a {
    color: #7a7a7a;
    text-decoration: none;
}

.footer a:hover {
    color: #ff5000;
}

.footer .copy {
    margin: 4px 0;
}

/* ============================================================
   RESPONSIVE - Tablet & Mobile
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
    .app {
        padding: 0 24px 24px;
    }

    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px 14px;
    }
}

/* Mobile Large */
@media (max-width: 700px) {
    .app {
        padding: 0 16px 20px;
    }

    .header {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 0 10px;
        gap: 8px;
    }

    .logo-area {
        flex: 0 0 auto;
    }

    .logo img {
        width: 100px;
    }

    .search-wrap {
        flex: 1;
        min-width: 160px;
        max-width: 100%;
    }

    .search-wrap .input-text {
        height: 40px;
        padding: 0 4px 0 12px;
        border-radius: 20px;
        min-width: auto;
    }

    .search-wrap .input-text input {
        font-size: 14px;
        padding: 6px 0;
        min-width: 40px;
    }

    .search-btn {
        height: 34px;
        padding: 0 16px;
        font-size: 14px;
        border-radius: 20px;
        margin-left: 4px;
    }

    .search-wrap .tips {
        font-size: 12px;
        margin-top: 6px;
        margin-left: 12px;
        color: #999;
    }

    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 10px;
        padding: 16px 0 12px;
        min-height: 300px;
    }

    .goods-card {
        border-radius: 8px;
        border: 1px solid #f0f0f0;
    }

    .goods-card:hover {
        transform: none;
        box-shadow: none;
    }

    .goods-info {
        padding: 8px 8px 10px;
    }

    .goods-name {
        font-size: 13px;
        line-height: 1.4;
        -webkit-line-clamp: 1;
        margin-bottom: 2px;
    }

    .goods-subtitle {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .goods-price {
        font-size: 18px;
    }

    .goods-price .unit {
        font-size: 12px;
    }
    .goods-price .decimal {
        font-size: 14px;
    }

    .pagination {
        padding: 12px 0 4px;
        gap: 4px;
    }

    .pagination button {
        font-size: 13px;
        padding: 4px 12px;
        min-width: 36px;
        height: 32px;
        border-radius: 16px;
    }

    .pagination .page-info {
        font-size: 12px;
        padding: 0 4px;
    }

    .footer {
        padding: 16px 0 12px;
        font-size: 12px;
    }

    .loading-mask,
    .empty-state {
        padding: 50px 16px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .app {
        padding: 0 8px 16px;
    }

    .header {
        padding: 8px 0 8px;
        gap: 6px;
    }

    .logo img {
        width: 76px;
    }

    .search-wrap .input-text {
        height: 34px;
        padding: 0 2px 0 10px;
        border-radius: 17px;
        border-width: 1.5px;
    }

    .search-wrap .input-text input {
        font-size: 13px;
        padding: 4px 0;
    }

    .search-btn {
        height: 28px;
        padding: 0 12px;
        font-size: 12px;
        border-radius: 17px;
        margin-left: 3px;
    }

    .search-wrap .tips {
        font-size: 11px;
        margin-top: 4px;
        margin-left: 10px;
        line-height: 1.3;
    }

    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 6px;
        padding: 10px 0 8px;
        min-height: 250px;
    }

    .goods-card {
        border-radius: 6px;
    }

    .goods-info {
        padding: 6px 6px 8px;
    }

    .goods-name {
        font-size: 12px;
        line-height: 1.3;
        -webkit-line-clamp: 1;
        margin-bottom: 1px;
    }

    .goods-subtitle {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .goods-price {
        font-size: 16px;
    }
    .goods-price .unit {
        font-size: 11px;
    }
    .goods-price .decimal {
        font-size: 12px;
    }

    .pagination {
        gap: 3px;
        padding: 10px 0 2px;
    }

    .pagination button {
        font-size: 12px;
        padding: 3px 8px;
        min-width: 30px;
        height: 28px;
        border-radius: 14px;
        border-width: 1px;
    }

    .pagination .page-info {
        font-size: 11px;
        padding: 0 3px;
    }

    .footer {
        font-size: 11px;
        padding: 12px 0 8px;
    }

    .loading-mask .spinner {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }

    .loading-mask,
    .empty-state {
        padding: 40px 12px;
    }

    .empty-state .empty-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
}