* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    min-width: 320px;
}

/* 响应式设计 - 移动端优化 */
@media screen and (max-width: 768px) {
    body {
        font-size: 13px;
    }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
    flex-wrap: wrap;
}

/* 移动端头部 */
@media screen and (max-width: 768px) {
    .header {
        height: auto;
        padding: 10px;
    }
    
    .logo {
        font-size: 16px !important;
        margin-right: 10px !important;
    }
    
    .nav {
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
        gap: 5px !important;
    }
    
    .nav a {
        font-size: 14px;
        padding: 10px 12px !important;
    }
    
    .nav a.active {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
        border-left: 4px solid #45a049;
    }
    
    .nav a.active::after {
        display: none;
    }
    
    .user-info {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
        font-size: 12px;
    }
}

.logo {
    font-size: 20px;
    font-weight: bold;
    margin-right: 40px;
}

.nav {
    flex: 1;
    display: flex;
    gap: 5px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
    font-size: 15px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav a.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    font-weight: 600;
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #4CAF50;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info a {
    color: #fff;
    text-decoration: none;
}

/* 主内容 */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #f0f0f0;
}

.page-header h1,
.page-header h2 {
    font-size: 28px;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn-info:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-default {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    box-shadow: none;
}

.btn-default:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    min-width: 60px;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 32px;
    line-height: 1.5;
    vertical-align: middle;
    box-sizing: border-box;
}

/* 确保button和a标签的btn-sm样式一致 */
button.btn-sm,
a.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    min-width: 60px !important;
    height: 32px !important;
    line-height: 1.5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border: none !important;
    font-family: inherit !important;
    font-weight: 500 !important;
}

.btn-link {
    color: #3498db;
    text-decoration: none;
    margin: 0 5px;
    background: none;
    box-shadow: none;
    padding: 5px 10px;
}

.btn-link:hover {
    text-decoration: underline;
    transform: none;
}

.text-danger {
    color: #e74c3c;
}

/* 搜索框 */
.search-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-box form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box input[type="text"],
.search-box input[type="date"],
.search-box select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.search-box input:focus,
.search-box select:focus {
    outline: none;
    border-color: #4CAF50;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 表格容器 */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 表格 */
.data-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    display: table;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.data-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    border: none;
    font-size: 14px;
}

.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table td .btn-sm {
    margin: 2px;
}

/* 强制统一操作列按钮大小 */
.data-table td button.btn-sm,
.data-table td a.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    min-width: 60px !important;
    max-width: none !important;
    height: 32px !important;
    line-height: 1.5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border: none !important;
    margin: 2px !important;
    white-space: nowrap !important;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9ff;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.text-center {
    text-align: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 卡片容器 */
.card,
.config-container {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
}

.badge-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff;
}

.badge-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
}

.badge-info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pagination a,
.pagination span {
    color: #666;
    text-decoration: none;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.pagination a.active,
.pagination .active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
}

/* 仪表盘 */
.dashboard h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 32px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border-left: 4px solid #4CAF50;
    cursor: pointer;
    display: block;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-left-color: #45a049;
}

.stat-card h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
}

.stat-number.warning {
    color: #e74c3c;
}

.quick-links {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.quick-links h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 底部 */
.footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 15px;
    margin-top: auto;
}


/* ==================== 移动端优化 ==================== */

/* 主内容区域 */
@media screen and (max-width: 768px) {
    .main-content {
        padding: 15px 10px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .page-header h1,
    .page-header h2 {
        font-size: 22px;
    }
    
    .page-header .actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* 搜索框 */
@media screen and (max-width: 768px) {
    .search-box {
        padding: 15px;
        border-radius: 8px;
    }
    
    .search-box form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input[type="text"],
    .search-box input[type="date"],
    .search-box select {
        width: 100%;
        min-width: auto;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .search-box .btn {
        width: 100%;
    }
}

/* 表格 */
@media screen and (max-width: 768px) {
    .table-container {
        margin: 0 -10px;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 800px;
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* 统计卡片 */
@media screen and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

/* 快捷链接 */
@media screen and (max-width: 768px) {
    .link-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .link-card {
        padding: 16px;
    }
}

/* 按钮 */
@media screen and (max-width: 768px) {
    .btn {
        padding: 12px 18px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        width: auto;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 分页 */
@media screen and (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 表单 */
@media screen and (max-width: 768px) {
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label,
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* 卡片容器 */
@media screen and (max-width: 768px) {
    .card,
    .config-container {
        padding: 20px 15px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-link,
    .nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* 横屏优化 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .header {
        height: auto;
        padding: 5px 10px;
    }
    
    .nav {
        gap: 5px;
    }
    
    .nav a {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* 打印样式 */
@media print {
    .header,
    .nav,
    .user-info,
    .search-box,
    .pagination,
    .actions,
    .no-print {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .main-content {
        padding: 0;
    }
    
    .data-table {
        border: 1px solid #000;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid #000;
        padding: 5px;
    }
}

/* 平板优化 (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 大屏优化 (>1400px) */
@media screen and (min-width: 1400px) {
    .main-content {
        max-width: 1600px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Toast提示框样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: #4CAF50;
    color: #fff;
}

.toast-error {
    background: #f44336;
    color: #fff;
}

.toast-warning {
    background: #ff9800;
    color: #fff;
}

.toast-info {
    background: #2196F3;
    color: #fff;
}

/* 移动端Toast优化 */
@media screen and (max-width: 768px) {
    .toast {
        min-width: 80%;
        max-width: 90%;
        padding: 12px 20px;
        font-size: 14px;
        top: 10px;
    }
}


/* ========== 移动端优化 ========== */
@media screen and (max-width: 768px) {
    /* 表格容器横向滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    /* 页面头部 */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 18px;
    }
    
    .page-header .actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-header .actions .btn {
        flex: 1;
        min-width: calc(50% - 4px);
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* 搜索框 */
    .search-box form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input[type="text"],
    .search-box input[type="date"],
    .search-box select {
        width: 100%;
    }
    
    .search-box .btn {
        width: 100%;
    }
    
    /* 表单 */
    .form-horizontal .form-group {
        flex-direction: column;
    }
    
    .form-horizontal label {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
    }
    
    .form-horizontal .form-control {
        width: 100%;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 15px !important;
    }
    
    .stat-number {
        font-size: 20px !important;
    }
    
    /* 模态框 */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 5% auto;
    }
    
    /* 按钮组 */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
    }
    
    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination a,
    .pagination span {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* 图表容器 */
    .chart-container {
        padding: 10px !important;
    }
    
    /* 表单操作按钮 */
    .form-actions .btn {
        width: 100%;
        margin: 5px 0 !important;
    }
    
    /* 报表汇总 */
    .report-summary {
        padding: 15px !important;
    }
    
    .report-summary p {
        font-size: 13px;
    }
    
    /* 财务卡片 */
    .finance-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* 商品表单 */
    .goods-form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .data-table td,
    .data-table th {
        padding: 12px 8px;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 小屏幕优化 */
@media screen and (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .page-header h2 {
        font-size: 16px;
    }
    
    .btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table td,
    .data-table th {
        padding: 8px 4px;
    }
}


/* ==================== 新增页面样式 ==================== */

/* 补货建议页面 */
.replenish-container {
    padding: 0;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.summary-cards .card {
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-cards .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.summary-cards .card h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    border-bottom: none;
    padding-bottom: 0;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    line-height: 1.2;
}

.filter-box {
    background: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-box label {
    color: #555;
    font-weight: 500;
    margin: 0;
}

.filter-box select {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.batch-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    padding: 15px 0;
}

/* 数据分析看板 */
.dashboard-enhanced {
    padding: 0;
}

.dashboard-enhanced h1 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.metric-card.blue { border-left: 4px solid #3498db; }
.metric-card.green { border-left: 4px solid #2ecc71; }
.metric-card.orange { border-left: 4px solid #e67e22; }
.metric-card.purple { border-left: 4px solid #9b59b6; }

.metric-icon {
    font-size: 40px;
    line-height: 1;
}

.metric-content {
    flex: 1;
}

.metric-content h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    color: #333;
    line-height: 1.2;
}

.metric-trend {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.metric-trend.up { color: #2ecc71; }
.metric-trend.down { color: #e74c3c; }

.metric-link {
    font-size: 12px;
    color: #3498db;
    text-decoration: none;
}

.metric-link:hover {
    text-decoration: underline;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.todo-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.todo-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.todo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.todo-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.todo-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.todo-count {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 8px;
    line-height: 1;
}

.todo-text {
    display: block;
    font-size: 13px;
    color: #666;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .barcode-container,
    .metrics-grid,
    .charts-grid,
    .todo-grid,
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .metric-icon {
        font-size: 32px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .filter-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .batch-actions {
        flex-direction: column;
    }
    
    .batch-actions button {
        width: 100%;
    }
}


/* 警告提示框 */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.alert strong {
    font-weight: 600;
}

.alert-warning {
    border-left-color: #ff9800;
    background: #fff3e0;
    color: #e65100;
}

.alert-danger {
    border-left-color: #f44336;
    background: #ffebee;
    color: #c62828;
}

.alert-success {
    border-left-color: #4CAF50;
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-info {
    border-left-color: #2196F3;
    background: #e3f2fd;
    color: #1565c0;
}


/* 必填字段标记 */
.required {
    color: #f44336;
    font-weight: bold;
    margin-left: 2px;
}


/* ==================== 现代化表单样式 ==================== */

/* 表单容器 */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 现代化表单 */
.modern-form {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 表单分组 */
.form-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
    border-bottom: none;
}

/* 分组标题 */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 表单行（两列布局） */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* 表单组 */
.form-group {
    margin-bottom: 0;
}

/* 表单提示文字 */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* 带按钮的输入框 */
.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button .form-control {
    flex: 1;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 商品工具栏 */
.goods-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.toolbar-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.info-value.total-amount {
    color: #4CAF50;
    font-size: 18px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .goods-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-info {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .btn-generate {
        width: 100%;
    }
}


/* ==================== 商品搜索下拉框样式 ==================== */
.goods-search-wrapper {
    position: relative;
    width: 100%;
}

.goods-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.goods-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: none;
}

.goods-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    margin-top: 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.goods-dropdown-item {
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f5f5f5;
    background: white;
}

.goods-dropdown-item:last-child {
    border-bottom: none;
}

.goods-dropdown-item:hover {
    background: #f5f5f5;
}

.goods-dropdown-item .goods-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.goods-dropdown-item .goods-code {
    font-size: 12px;
    color: #999;
}

.goods-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}
