/* ============================================================
 * PayForShop 全局样式
 * 风格: 白色毛玻璃苹果风格 (White Frosted Glass Apple Style)
 * 配色: 白色 + 蓝色交替
 * ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
    /* 主色 */
    --primary: #007AFF;
    --primary-dark: #0051D5;
    --primary-light: #4DA6FF;
    --primary-bg: #E8F1FF;

    /* 辅助色 */
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --info: #5AC8FA;

    /* 中性色 */
    --bg-page: #F2F4F8;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-solid: #FFFFFF;
    --bg-hover: rgba(0, 122, 255, 0.06);
    --bg-active: rgba(0, 122, 255, 0.12);

    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #AEAEB2;
    --text-inverse: #FFFFFF;

    --border-color: rgba(0, 0, 0, 0.06);
    --border-active: rgba(0, 122, 255, 0.3);

    /* 毛玻璃 */
    --glass-blur: blur(20px) saturate(180%);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.6);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* 过渡 */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ---------- 毛玻璃背景装饰 ---------- */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(90, 200, 250, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ============================================================
 * 登录/激活页样式
 * ============================================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 400px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

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

.auth-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================================
 * 表单元素
 * ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    background: white;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    padding-left: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    padding-left: 4px;
}

/* 输入框组（带按钮） */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-input {
    flex: 1;
}

.input-group-btn {
    padding: 0 16px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* ============================================================
 * 按钮
 * ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.15);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #2BB24C;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #E0301E;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--border-active);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
 * 导航栏
 * ============================================================ */

.navbar {
    height: 56px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 32px;
}

.navbar-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.navbar-menu a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.navbar-menu a.active {
    background: var(--bg-active);
    color: var(--primary);
    font-weight: 600;
}

.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition);
}

.navbar-user:hover {
    background: var(--bg-hover);
}

.navbar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.navbar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
 * 卡片
 * ============================================================ */

.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.card-solid {
    background: var(--bg-card-solid);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
 * 统计卡片
 * ============================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-card.green .stat-icon { background: rgba(52, 199, 89, 0.12); color: var(--success); }
.stat-card.orange .stat-icon { background: rgba(255, 149, 0, 0.12); color: var(--warning); }
.stat-card.red .stat-icon { background: rgba(255, 59, 48, 0.12); color: var(--danger); }

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stat-card .stat-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-left: 4px;
}

/* ============================================================
 * 表格
 * ============================================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data-table thead th {
    background: rgba(0, 122, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

table.data-table tbody tr:nth-child(even) {
    background: rgba(0, 122, 255, 0.02);
}

table.data-table tbody tr:hover {
    background: var(--bg-hover);
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
 * 徽章/标签
 * ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.badge-success { background: rgba(52, 199, 89, 0.12); color: var(--success); }
.badge-warning { background: rgba(255, 149, 0, 0.12); color: var(--warning); }
.badge-danger  { background: rgba(255, 59, 48, 0.12); color: var(--danger); }
.badge-info    { background: rgba(90, 200, 250, 0.15); color: var(--info); }
.badge-default { background: rgba(142, 142, 147, 0.12); color: var(--text-secondary); }

/* ============================================================
 * 模态框
 * ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.modal-lg { max-width: 700px; }
.modal.modal-sm { max-width: 380px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
 * 提示框 (Toast)
 * ============================================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    min-width: 260px;
    max-width: 400px;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--info); }

.toast .toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon   { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon    { color: var(--info); }

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* ============================================================
 * 收银台专用样式
 * ============================================================ */

.cashier-layout {
    display: flex;
    gap: 16px;
    height: calc(100vh - 56px);
    padding: 16px;
    overflow: hidden;
}

.cashier-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.cashier-right {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scan-area {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.scan-input-wrapper {
    position: relative;
}

.scan-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 500;
    background: white;
    transition: var(--transition);
    outline: none;
}

.scan-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.scan-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.scan-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--text-tertiary);
}

/* 搜索结果列表 */
.search-results {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.search-results .results-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item .product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-item .product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-item .product-barcode {
    font-size: 12px;
    color: var(--text-tertiary);
}

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

/* 购物车 */
.cart-area {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    min-height: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    transition: var(--transition);
    animation: slideInRight 0.2s ease;
}

.cart-item.highlight {
    background: var(--primary-bg);
}

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

.cart-item .item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item .item-price {
    font-size: 12px;
    color: var(--text-secondary);
}

.cart-item .qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.qty-input:focus {
    border-color: var(--primary);
}

.cart-item .item-subtotal {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
    text-align: right;
}

.cart-item .item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.cart-item .item-remove:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
}

/* 空购物车 */
.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    gap: 8px;
}

.cart-empty .empty-icon {
    font-size: 48px;
    opacity: 0.4;
}

.cart-empty .empty-text {
    font-size: 14px;
}

/* 合计区域 */
.cart-total {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.total-row .total-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.total-row .total-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.total-row.grand-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.total-row.grand-total .total-label {
    font-size: 16px;
    font-weight: 700;
}

.total-row.grand-total .total-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.cart-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ============================================================
 * 支付码弹窗
 * ============================================================ */

.payment-modal .modal {
    max-width: 420px;
}

.payment-amount {
    text-align: center;
    padding: 20px 0;
}

.payment-amount .amount-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.payment-amount .amount-value {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.payment-amount .amount-unit {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* 支付方式选择 */
.payment-methods {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px 0;
    flex-wrap: wrap;
}

.payment-method-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-width: 90px;
    background: rgba(255, 255, 255, 0.6);
}

.payment-method-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-hover);
}

.payment-method-item.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.payment-method-item .pm-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-method-item .pm-icon.wechat {
    background: #07C160;
}

.payment-method-item .pm-icon.alipay {
    background: #1677FF;
}

.payment-method-item .pm-icon.cash {
    background: #FF9500;
}

.payment-method-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 二维码显示区域 */
.qr-code-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.qr-code-wrapper {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: white;
}

.qr-code-area canvas {
    border-radius: var(--radius-md);
}

.qr-code-area .qr-hint {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-code-area .qr-hint .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 现金支付区域 */
.cash-payment-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
}

.cash-hint {
    text-align: center;
}

.cash-hint .cash-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.cash-hint .cash-text {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 收款二维码上传预览 */
.qrcode-upload-section {
    display: flex;
    flex-direction: column;
}

.qrcode-preview {
    width: 100%;
    aspect-ratio: 1;
    max-width: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(245, 245, 247, 0.5);
}

.qrcode-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-placeholder {
    text-align: center;
    color: var(--text-tertiary);
}

.payment-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.payment-success-overlay.show {
    display: flex;
}

.payment-success-content {
    text-align: center;
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.payment-success-content .success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(52, 199, 89, 0.3);
}

.payment-success-content .success-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.payment-success-content .success-amount {
    font-size: 20px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================================
 * 页面容器
 * ============================================================ */

.page-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

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

/* ============================================================
 * 筛选栏
 * ============================================================ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: auto;
    min-width: 160px;
}

/* ============================================================
 * 分页
 * ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 12px;
}

/* ============================================================
 * 标签页
 * ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================================
 * 加载状态
 * ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-overlay.show {
    display: flex;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
 * 动画
 * ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================
 * 工具类
 * ============================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.font-bold { font-weight: 700; }
.font-lg { font-size: 18px; }
.font-xl { font-size: 24px; }
.font-sm { font-size: 13px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.hidden { display: none; }

/* ============================================================
 * 响应式
 * ============================================================ */

/* 手机端汉堡菜单按钮（PC端默认隐藏） */
.navbar-toggle {
    display: none;
}

/* 手机端下拉菜单 */
.navbar-mobile-menu {
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.navbar-mobile-menu a {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.2s;
}
.navbar-mobile-menu a:hover, .navbar-mobile-menu a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

@media (max-width: 1024px) {
    .cashier-right {
        width: 340px;
    }
}

@media (max-width: 768px) {
    .cashier-layout {
        flex-direction: column;
    }
    .cashier-right {
        width: 100%;
        max-height: 50vh;
    }
    .navbar-menu {
        display: none;
    }
    .navbar-right {
        display: none;
    }
    /* 手机端显示汉堡按钮 */
    .navbar-toggle {
        display: flex;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 8px;
        align-items: center;
        justify-content: center;
    }
    .navbar {
        justify-content: space-between;
        padding: 0 16px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
}
