/* 送货登记系统 - 前台样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 移除点击高亮,提升移动端体验 */
    -webkit-tap-highlight-color: transparent;
    /* 优化触摸响应,禁用双击缩放 */
    touch-action: manipulation;
}

html {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8ef5;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background: transparent;
    min-height: calc(100vh - 70px);
}

/* 头部 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 20px 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

.header h1 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.header p {
    font-size: 14px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* 页面内容 */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* 首页 */
.quick-action {
    padding: 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    position: relative;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 20px 25px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.action-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.recent-records {
    padding: 0 20px 20px;
    background: white;
    min-height: calc(100vh - 280px);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-800);
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.record-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.record-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.record-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.record-card:hover::before {
    opacity: 1;
}

.record-card:active {
    transform: translateY(-2px);
}

.record-card .name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
    line-height: 1.4;
}

.record-card .info {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.record-card .info::before {
    content: '•';
    margin-right: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

.record-card .time {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
}

.record-card .time::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cpolyline points='12 6 12 12 16 14'%3e%3c/polyline%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

/* 卡片标题 */
.record-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    line-height: 1.4;
}

/* 卡片主体区域 - 两栏布局 */
.record-card .card-body {
    display: flex;
    gap: 12px;
}

/* 左侧缩略图 */
.record-card .card-thumbnail {
    width: 90px;
    height: 75px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-100);
}

.record-card .card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.record-card:hover .card-thumbnail img {
    transform: scale(1.1);
}

.record-card .card-thumbnail .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
}

/* 右侧信息栏 */
.record-card .card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.record-card .card-info .info-item {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.4;
}

.record-card .card-info .info-item strong {
    color: var(--gray-800);
    font-weight: 600;
    margin-right: 4px;
}

/* 操作按钮区域 */
.record-card .record-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

/* 记录列表 */
.records-list {
    padding: 15px 20px 20px;
    background: white;
    min-height: calc(100vh - 260px);
    border-radius: 0 0 0 0;
}

/* 统计区域 */
.stats-section {
    padding: 20px;
    background: white;
    margin-top: -10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

/* 添加记录按钮区域 */
.add-record-section {
    padding: 15px 20px;
    background: white;
}

.add-record-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.add-record-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

.add-record-btn svg {
    flex-shrink: 0;
}

/* 日期筛选器 */
.date-filter {
    padding: 20px;
    background: white;
    margin-bottom: 2px;
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    box-shadow: var(--shadow-sm);
}

.date-filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: center;
}

.date-filter-row label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.date-filter-row input[type="date"],
.date-filter-row select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.date-filter-row input[type="date"]:focus,
.date-filter-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 美化客户搜索输入框 */
.customer-search {
    flex: 1;
    position: relative;
    padding: 10px 14px 10px 38px !important;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%) !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cpath d='m21 21-4.35-4.35'%3e%3c/path%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    background-size: 18px !important;
}

.customer-search:hover {
    border-color: var(--primary-light) !important;
    background: linear-gradient(135deg, #f0f3ff 0%, #fff 100%) !important;
}

.customer-search:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    background: white !important;
    transform: translateY(-1px) !important;
}

.customer-search::placeholder {
    color: var(--gray-400);
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    gap: 12px;
}

.filter-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.filter-btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.filter-btn.secondary:hover {
    background: var(--gray-200);
}

.filter-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
    font-size: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 16px;
    margin: 20px 0;
    border: 2px dashed var(--gray-200);
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    opacity: 0.4;
}

/* 我的页面 */
.profile-section {
    padding: 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    min-height: calc(100vh - 140px);
    padding-bottom: 100px;
}

.profile-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.profile-card .avatar {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.25);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    position: relative;
}

.profile-card .name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.profile-card .phone {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
}

.menu-list {
    background: var(--gray-50);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.menu-item {
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--gray-50);
}

.menu-item:active {
    background: var(--gray-100);
}

.menu-item span:first-child {
    color: var(--gray-600);
    font-size: 15px;
}

.menu-item span:last-child {
    color: var(--gray-800);
    font-weight: 600;
    font-size: 15px;
}

.logout-btn {
    margin-top: 25px;
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
    padding: 16px;
    border-radius: 14px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

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

/* 个人页面统计区域 */
.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.profile-stat-card {
    border-radius: 20px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 今日送货卡片 - 橙黄色系 */
.profile-stat-card:first-child {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
}

.profile-stat-card:first-child::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

/* 本月送货卡片 - 蓝紫色系 */
.profile-stat-card:last-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-stat-card:last-child::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.profile-stat-card:hover {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.profile-stat-card:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(-2px);
}

.profile-stat-card .stat-icon {
    font-size: 42px;
    line-height: 1;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.profile-stat-card .stat-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.profile-stat-card .stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.5s ease-out;
}

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

/* 个人页面添加记录按钮 */
.profile-add-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.profile-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.profile-add-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

.profile-add-btn svg {
    flex-shrink: 0;
}


/* 登录注册表单 */
.auth-form {
    padding: 30px 20px 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    min-height: calc(100vh - 200px);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--gray-300);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 45px;
    cursor: pointer;
}

.form-group select option {
    padding: 12px;
    background-color: #fff;
    color: var(--gray-800);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #fff;
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

/* 文件上传按钮组样式 */
.file-upload-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.file-upload-buttons button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-upload-buttons button:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-upload-buttons button:active {
    transform: translateY(0);
}

.file-upload-buttons .btn-camera {
    border-color: #4CAF50;
    color: #4CAF50;
}

.file-upload-buttons .btn-camera:hover {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.file-upload-buttons .btn-gallery {
    border-color: #2196F3;
    color: #2196F3;
}

.file-upload-buttons .btn-gallery:hover {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

/* 文件预览样式 */
.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.file-preview p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: var(--primary-color);
}

.file-preview .file-name {
    display: block;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: white;
    border-radius: 4px;
    color: var(--text-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* 提示文字样式 */
.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.4;
}

/* ==================== 统一按钮样式 ==================== */

/* 提交按钮 */
.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== 送货信息流程按钮样式 ==================== */

/* 商品属性选择按钮 */
.btn-goods-type {
    flex: 1;
    padding: 20px;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-goods-type:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.15);
}

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

.btn-goods-type div:first-child {
    font-size: 48px;
    margin-bottom: 10px;
}

.btn-goods-type div:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

/* 商品属性徽章 */
.goods-type-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 图片上传按钮组 */
.file-upload-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.file-upload-buttons button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-upload-buttons button:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-upload-buttons button:active {
    transform: translateY(0);
}

.file-upload-buttons .btn-camera {
    border-color: #4CAF50;
    color: #4CAF50;
}

.file-upload-buttons .btn-camera:hover {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.file-upload-buttons .btn-gallery {
    border-color: #2196F3;
    color: #2196F3;
}

.file-upload-buttons .btn-gallery:hover {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

/* 上传按钮 */
.btn-upload {
    padding: 12px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-upload:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* 扫描按钮 */
.btn-scan {
    padding: 12px 20px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-scan:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* 相机按钮 */
.btn-camera {
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-camera:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 相册按钮 */
.btn-gallery {
    padding: 12px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-gallery:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* 图片预览容器 */
.image-preview-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 删除图片按钮 */
.btn-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-image:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* 上传中指示器 */
.uploading-indicator {
    padding: 10px;
    color: var(--gray-600);
    font-size: 14px;
}

/* ==================== 送货单扫描按钮美化 ==================== */

/* 送货单扫描按钮基础样式 */
.delivery-scan-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.delivery-scan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.delivery-scan-btn:hover::before {
    left: 100%;
}

.delivery-scan-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.delivery-scan-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 主要按钮 - 拍照 */
.delivery-scan-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.delivery-scan-btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a3f8f 100%);
}

.delivery-scan-btn-primary .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
}

/* 次要按钮 - 相册 */
.delivery-scan-btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.delivery-scan-btn-secondary:hover {
    background: linear-gradient(135deg, #3d9ae6 0%, #00d9e6 100%);
}

.delivery-scan-btn-secondary .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
}

/* 手动填写按钮 */
.delivery-scan-btn-manual {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #374151;
}

.delivery-scan-btn-manual:hover {
    background: linear-gradient(135deg, #96e0dc 0%, #fdc1d4 100%);
}

.delivery-scan-btn-manual .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.4);
}

/* 按钮图标包装器 */
.btn-icon-wrapper {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

/* 按钮内容区域 */
.btn-content {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
}

.btn-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.btn-subtitle {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* 按钮箭头 */
.btn-arrow {
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.delivery-scan-btn:hover .btn-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* 分隔线样式 */
.delivery-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.delivery-divider::before,
.delivery-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

.delivery-divider span {
    padding: 0 20px;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    background: white;
    position: relative;
    z-index: 1;
}

/* OCR预览容器 */
.ocr-preview-wrapper {
    position: relative;
    text-align: center;
}

/* 加载动画 */
.ocr-loading {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.switch-auth {
    text-align: center;
    margin-top: 18px;
    color: var(--gray-600);
    font-size: 14px;
}

.switch-auth a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.switch-auth a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 12px;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    /* 确保 iOS Safari 不出现点击延迟 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 5px;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* 移除点击高亮 */
    -webkit-tap-highlight-color: transparent;
    /* 优化触摸响应 */
    touch-action: manipulation;
    /* 确保可点击 */
    pointer-events: auto;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px 2px 0 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* 移除 :active transform 动画,避免 iOS Safari 点击区域变化问题 */

.nav-item svg {
    width: 26px;
    height: 26px;
    margin-bottom: 4px;
    transition: transform 0.3s;
}

.nav-item.active svg {
    transform: translateY(-2px);
}

.nav-item .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
    font-size: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    border-radius: 16px;
    margin: 20px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    z-index: 1500;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    /* 确保未激活时不阻挡点击 */
    pointer-events: none;
}

.modal.active {
    display: flex;
    pointer-events: auto;
}

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

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

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--gray-800);
    position: relative;
    padding-bottom: 15px;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray-400);
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    transform: rotate(90deg);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 5px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--gray-500);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background: var(--gray-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

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

/* 禁用按钮灰色效果 */
.btn.disabled {
    background: #9ca3af !important;
    box-shadow: none !important;
    pointer-events: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

/* 记录详情页样式 */
#record-detail-content {
    background: white;
    border-radius: 20px 20px 0 0;
    min-height: calc(100vh - 70px);
}

/* 商品主图 - 大图展示 */
.detail-main-photo {
    width: 100%;
    padding: 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-main-photo img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.detail-main-photo img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* 详情容器 */
.detail-container {
    padding: 0;
}

/* 详情页头部 */
.detail-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.btn-back {
    background: rgba(255, 255, 255, 0.25);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateX(-3px);
}

.detail-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

/* 详情分区 */
.detail-section {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.detail-section:last-of-type {
    border-bottom: none;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.detail-section-icon {
    font-size: 18px;
}

/* 详情网格布局 */
.detail-grid {
    display: grid;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.detail-value {
    font-size: 15px;
    color: var(--gray-800);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.6;
}

.detail-textarea {
    background: var(--gray-50);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    white-space: pre-wrap;
    line-height: 1.8;
}

/* 图片展示 */
.detail-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

/* 图片字段网格容器 */
.photos-grid-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    padding: 0 20px 20px;
}

.photos-grid-wrapper .detail-section {
    margin-bottom: 0;
    border-bottom: none;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.photos-grid-wrapper .detail-section-title {
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.photos-grid-wrapper .detail-photos {
    gap: 8px;
    grid-template-columns: 1fr;
}

.detail-photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-100);
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.detail-photo-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.detail-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s;
}

.detail-photo-item:hover img {
    transform: scale(1.1);
}

/* 详情操作按钮 */
.detail-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    background: var(--gray-50);
    border-radius: 0 0 20px 20px;
}

.detail-actions .btn {
    flex: 1;
    margin: 0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.detail-actions .btn svg {
    flex-shrink: 0;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .photos-grid-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 15px 15px;
    }

    .photos-grid-wrapper .detail-section {
        padding: 12px;
    }

    .photos-grid-wrapper .detail-section-title {
        font-size: 13px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }
}

/* 记录操作按钮 */
.record-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.record-actions button {
    margin: 0;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .action-btn {
        font-size: 16px;
        padding: 18px 20px;
    }

    .modal-content {
        max-width: 95%;
        padding: 20px;
    }

    .record-card {
        padding: 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 图片预览增强 */
.form-group img {
    border-radius: 12px;
    transition: all 0.3s;
}

/* 照片删除按钮美化 */
button[onclick*="removeEditPhoto"] {
    background: var(--danger-color) !important;
    color: white !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4) !important;
    transition: all 0.2s !important;
}

button[onclick*="removeEditPhoto"]:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 3px 12px rgba(245, 101, 101, 0.6) !important;
}

/* 滚动条美化 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: var(--gray-100);
}

*::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 图片预览模态框 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    /* 确保未激活时不阻挡点击 */
    pointer-events: none;
}

.image-preview-modal.active {
    pointer-events: auto;
}

.image-preview-modal.active {
    display: flex;
}

.image-preview-content {
    position: relative;
    max-width: 95%;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
    /* 移除点击高亮 */
    -webkit-tap-highlight-color: transparent;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* ==================== 密码输入框样式 ==================== */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.password-toggle svg {
    display: block;
}

/* 记住密码复选框样式 */
#remember-me {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ==================== 扫描码字段样式 ==================== */

/* 扫描输入组 */
.scan-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.scan-input-group input {
    flex: 1;
    background-color: var(--gray-50);
}

.scan-input-group .btn-scan {
    padding: 12px 20px;
    border: 2px solid #FF9800;
    border-radius: 8px;
    background: white;
    color: #FF9800;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
}

.scan-input-group .btn-scan:hover {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.scan-input-group .btn-scan:active {
    transform: translateY(0);
}

/* 扫描模态框 */
.scan-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2100;
    animation: fadeIn 0.3s ease;
    /* 确保未激活时不阻挡点击 */
    pointer-events: none;
}

.scan-modal.active {
    pointer-events: auto;
}

.scan-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.scan-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.scan-modal-close {
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.scan-modal-close:hover {
    color: var(--text-color);
}

/* 扫描器区域 */
.scan-reader {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
}

#scan-reader {
    width: 100%;
    height: 100%;
}

#scan-reader video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ZXing 扫描视频样式 */
#scan-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 扫描覆盖层 */
.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* 扫描框 */
.scan-frame {
    width: 280px;
    height: 120px;
    border: 3px solid #4CAF50;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* 扫描框标签 */
.scan-frame-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* 优化html5-qrcode生成的取景框样式 */
#scan-reader__scan_region {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
}

#scan-reader__dashboard {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* 扫描结果 */
.scan-result {
    padding: 20px;
    text-align: center;
}

.scan-result p {
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-size: 14px;
}

.scan-result-text {
    padding: 15px;
    background: var(--success-bg);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    color: var(--success-color);
    font-size: 16px;
    font-weight: 500;
    word-break: break-all;
    min-height: 20px;
}

.scan-result-text:empty {
    display: none;
}

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

/* ==================== OCR多商品表单样式 ==================== */

/* 步骤指示器 */
.step-indicator {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.step-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.step-indicator h3 {
    color: var(--gray-800);
    margin-bottom: 10px;
    font-size: 20px;
}

/* 货物选择列表 */
.goods-selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.goods-selection-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    /* 移除点击高亮 */
    -webkit-tap-highlight-color: transparent;
    /* 优化触摸响应 */
    touch-action: manipulation;
}

.goods-selection-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.goods-selection-item.selected {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.goods-selection-checkbox {
    margin-right: 12px;
    margin-top: 2px;
}

.goods-selection-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.goods-selection-info {
    flex: 1;
}

.goods-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.goods-model,
.goods-quantity,
.goods-notes {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* 商品详细卡片 */
.goods-detail-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.goods-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-200);
}

.goods-detail-header h4 {
    color: var(--gray-800);
    font-size: 18px;
    margin: 0;
}

/* 商品属性选择 */
.goods-type-selection {
    margin: 20px 0;
}

.btn-goods-type {
    flex: 1;
    padding: 20px;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.btn-goods-type:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.15);
}

.btn-goods-type div:first-child {
    font-size: 48px;
    margin-bottom: 10px;
}

.btn-goods-type div:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.goods-type-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 表单容器 */
.goods-form-container {
    animation: fadeIn 0.3s;
}

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

/* 图片上传和预览 */
.file-upload-container {
    margin-top: 8px;
}

.btn-upload {
    padding: 12px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-upload:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.image-preview-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-image:hover {
    background: #c53030;
    transform: scale(1.1);
}

.uploading-indicator {
    padding: 10px;
    color: var(--gray-600);
    font-size: 14px;
}

/* 扫描按钮 */
.btn-scan {
    padding: 12px 20px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-scan:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .step-icon {
        font-size: 36px;
    }

    .step-indicator h3 {
        font-size: 18px;
    }

    .goods-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .btn-goods-type div:first-child {
        font-size: 36px;
    }

    .btn-goods-type div:last-child {
        font-size: 14px;
    }
}

/* ==================== 送货单扫描按钮美化 ==================== */

/* 送货单扫描按钮基础样式 */
.delivery-scan-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.delivery-scan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.delivery-scan-btn:hover::before {
    left: 100%;
}

.delivery-scan-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.delivery-scan-btn:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 主要按钮 - 拍照 */
.delivery-scan-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.delivery-scan-btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a3f8f 100%);
}

.delivery-scan-btn-primary .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
}

/* 次要按钮 - 相册 */
.delivery-scan-btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.delivery-scan-btn-secondary:hover {
    background: linear-gradient(135deg, #3d9ae6 0%, #00d9e6 100%);
}

.delivery-scan-btn-secondary .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    /* 移除 backdrop-filter 以提高 iOS Safari 兼容性 */
}

/* 手动填写按钮 */
.delivery-scan-btn-manual {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #374151;
}

.delivery-scan-btn-manual:hover {
    background: linear-gradient(135deg, #96e0dc 0%, #fdc1d4 100%);
}

.delivery-scan-btn-manual .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.4);
}

/* 按钮图标包装器 */
.btn-icon-wrapper {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

/* 按钮内容区域 */
.btn-content {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
}

.btn-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.btn-subtitle {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* 按钮箭头 */
.btn-arrow {
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.delivery-scan-btn:hover .btn-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* 分隔线样式 */
.delivery-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.delivery-divider::before,
.delivery-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

.delivery-divider span {
    padding: 0 20px;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    background: white;
    position: relative;
    z-index: 1;
}

/* OCR预览容器 */
.ocr-preview-wrapper {
    position: relative;
    text-align: center;
}

/* 加载动画 */
.ocr-loading {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式优化 */
@media (max-width: 480px) {
    .delivery-scan-btn {
        padding: 18px 20px;
        gap: 14px;
    }

    .btn-icon-wrapper {
        width: 50px;
        height: 50px;
    }

    .btn-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }

    .btn-title {
        font-size: 16px;
    }

    .btn-subtitle {
        font-size: 12px;
    }

    .btn-arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* ==================== 步骤导航按钮样式 ==================== */

/* 步骤导航按钮容器 */
.step-navigation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-200);
}

/* 上一步按钮 */
.btn-prev {
    flex: 1;
    padding: 14px 20px;
    background: var(--gray-500);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-prev:hover {
    background: var(--gray-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-prev:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

/* 下一步按钮 */
.btn-next {
    flex: 2;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-next:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-next:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

/* 提交按钮（提交并继续添加） */
.btn-submit-continue {
    flex: 1.5;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit-continue:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-submit-continue:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

/* 完成订单按钮 */
.btn-finish {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-finish:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-finish:active {
    /* 移除 scale 变换,避免 iOS Safari 点击区域变化问题 */
    transform: translateY(0);
}

/* 禁用状态 */
.btn-prev:disabled,
.btn-next:disabled,
.btn-submit-continue:disabled,
.btn-finish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 按钮加载状态 */
.btn-prev.loading,
.btn-next.loading,
.btn-submit-continue.loading,
.btn-finish.loading {
    opacity: 0.7;
    cursor: wait;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .step-navigation-buttons {
        gap: 8px;
    }

    .btn-prev,
    .btn-next,
    .btn-submit-continue,
    .btn-finish {
        padding: 12px 16px;
        font-size: 14px;
    }
}
