/* 移动端功能模块样式 - 筛选、搜索、分页 */
/* 版本: v1.0 */
/* 说明: 筛选栏、搜索栏、分页、排序等功能组件样式 */

/* 筛选和搜索 */
.m-filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--app-bg-secondary);
    border-bottom: 1px solid var(--app-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
}

.m-filter-bar::-webkit-scrollbar {
    display: none;
}

.m-filter-bar select, .m-filter-bar button {
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-primary);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s;
}

.m-filter-bar button:active {
    transform: scale(.95);
}

.m-filter-bar button.active {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
}

.m-filter-panel {
    padding: 16px;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    margin-top: 8px;
    border-radius: 12px;
}

.m-filter-panel.is-hidden {
    display: none;
}

.m-filter-panel-row {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.m-filter-panel-row:last-of-type {
    margin-bottom: 16px;
}

.m-filter-panel-row label {
    display: block;
    font-size: 12px;
    color: var(--app-text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.m-filter-panel-row input, .m-filter-panel-row select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    background: var(--app-bg-secondary);
    color: var(--app-text-primary);
    font-size: 14px;
    outline: none;
}

.m-filter-panel-row input:focus, .m-filter-panel-row select:focus {
    border-color: var(--app-accent);
}

.m-filter-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.m-search-bar {
    padding: 12px 16px;
    background: var(--app-bg-secondary);
    border-bottom: 1px solid var(--app-border);
    max-width: 100%;
    box-sizing: border-box;
}

.m-search-bar form {
    display: block;
}

.m-search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-primary);
    font-size: 15px;
    outline: none;
    transition: all .2s;
}

.m-search-input:focus {
    border-color: var(--app-accent);
    background: var(--app-surface-hover);
}

.m-search-input::placeholder {
    color: var(--app-text-tertiary);
}

/* 排序栏 */
.m-sort-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--app-bg-primary);
    border-bottom: 1px solid var(--app-border);
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 32px;
    max-width: 100%;
    box-sizing: border-box;
}

.m-sort-bar::after {
    content: '';
    display: block;
    width: 32px;
    min-width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.m-sort-bar::-webkit-scrollbar {
    display: none;
    height: 0;
}

.m-sort-chip {
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--app-text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.m-sort-chip:active {
    transform: scale(.95);
}

.m-sort-chip.active {
    background: var(--app-surface);
    color: var(--app-text-primary);
}

.m-sort-chip i {
    font-size: 12px;
}

/* 分页 */
.m-pagination {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 6px;
    max-width: 100%;
    box-sizing: border-box;
}

.m-page-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.m-page-info {
    font-size: 13px;
    color: var(--app-text-secondary);
    white-space: nowrap;
}

.m-page-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-page-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-primary);
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.m-page-current {
    font-size: 13px;
    color: var(--app-text-primary);
}

.m-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.m-page-size::-webkit-scrollbar {
    display: none;
}

.m-page-size-label {
    font-size: 12px;
    color: var(--app-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.m-page-size-btn {
    height: 28px;
    min-width: 38px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-secondary);
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.m-page-size-btn.active {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
}

/* 购物车和订单 */
.m-cart-summary {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    box-shadow: 0 12px 26px rgba(2,6,23,.28);
    max-width: 100%;
    box-sizing: border-box;
}

.m-cart-summary .m-list-subtitle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.m-cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.m-payment-title {
    margin-top: 8px;
}

.m-inline-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#checkout-content .m-auth-field {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

#checkout-content .m-auth-field label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    font-size: 13px;
    color: var(--app-text-primary);
}

#checkout-content .m-auth-field input[type="radio"] {
    accent-color: var(--app-accent);
}

.checkout-pay-modal {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.65);
    z-index: 1500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.checkout-pay-modal.hidden {
    display: none;
}

.checkout-pay-modal > * {
    width: 100%;
    max-width: 560px;
    border-radius: 14px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
}

.m-card .m-list-title {
    font-size: 15px;
}

.m-library-order {
    padding: 10px;
}

.m-library-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--app-text-secondary);
    font-size: 14px;
}

/* 个人中心和菜单 */
.m-profile-header {
    padding: 24px 16px;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    text-align: center;
}

.m-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid var(--app-border);
}

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

.m-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--app-text-primary);
    margin-bottom: 4px;
}

.m-profile-email {
    font-size: 13px;
    color: var(--app-text-secondary);
}

.m-menu-list {
    padding: 8px 0;
}

.m-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text-primary);
    text-decoration: none;
    transition: background .2s;
}

.m-menu-item:active {
    background: var(--app-surface-hover);
}

.m-menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m-menu-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,59,48,.1);
    color: var(--app-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.m-menu-item-text {
    font-size: 15px;
    font-weight: 500;
}

.m-menu-item-arrow {
    color: var(--app-text-tertiary);
    font-size: 14px;
}

