/* ========================================
   前端页面增强样式补充
   2026-09 现代化优化
   ======================================== */

/* 搜索模式切换器增强 */
.search-mode-switcher {
    display: flex;
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    padding: 5px;
    margin-bottom: 18px;
    max-width: 480px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
    border: 1px solid var(--line);
}

.mode-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-weight: 600;
}

.mode-item:hover {
    background: var(--surface-hover);
}

.mode-item.active {
    background: var(--surface);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* 商品卡片增强 */
.product-card-code {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-card-price {
    display: block;
    font-size: 15px;
    color: var(--red);
    font-weight: 700;
}

/* 尺码输入增强 */
.size-input {
    width: 100%;
    height: 40px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    font-size: 15px;
    text-align: center;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.size-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.size-input:hover:not(:focus) {
    border-color: var(--line-strong);
}

/* 颜色按钮增强 */
.color-btn-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-btn {
    padding: 10px 18px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
}

.color-btn:hover {
    background: var(--surface-hover);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.color-btn.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

/* 尺码网格增强 */
.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.size-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 门店卡片列表增强 */
.store-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

/* 统计表格增强 */
.stats-table table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.stats-table th {
    background: var(--surface-soft);
    color: var(--text-secondary);
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid var(--line);
    display: table-cell;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stats-table td {
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    display: table-cell;
}

.stats-table tbody tr {
    transition: all var(--transition-fast);
}

.stats-table tbody tr:hover {
    background: var(--surface-soft);
}

/* 按钮增强 */
.btn-hand {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-hand:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-hand:active {
    transform: translateY(0);
}

/* Modal 按钮增强 */
.btn-modal-add {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--green) 0%, var(--green-strong) 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modal-add:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, var(--green) 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-modal-add:active:not(:disabled) {
    transform: translateY(0);
}

.btn-modal-add:disabled {
    background: var(--line-strong);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* 手机端尺码标签 */
.size-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

/* 空状态优化 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    border: 2px dashed var(--line);
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 触觉反馈 */
@media (hover: none) and (pointer: coarse) {
    button:active,
    .clickable:active {
        opacity: 0.7;
    }
}

/* 焦点可见性增强（键盘导航） */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* 禁用状态统一 */
button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选中文本颜色 */
::selection {
    background: var(--primary-bg);
    color: var(--primary-strong);
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
