/* 统一样式文件 - 优化版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航样式 - 固定定位 */
.app-header {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 顶部导航菜单 - 默认显示 */
.top-nav {
    display: flex;
    align-items: center;
    margin: 0 20px;
    flex: 1;
    justify-content: center;
}

.nav-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: white;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
}

/* 下拉菜单样式 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .nav-item::after {
    content: ' ▾';
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 4px;
    overflow: hidden;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.dropdown-item:hover, .dropdown-item.active {
    color: #1e3c72;
}

.dropdown-item:hover {
    background: #f5f7fa;
}

.dropdown-item.active {
    background: rgba(30, 60, 114, 0.1);
}

/* 移动端菜单按钮 - 默认隐藏 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.header-user {
    display: flex;
    align-items: center;
}

.user-name {
    margin-right: 15px;
    font-weight: 500;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 移动端菜单样式 - 重新设计 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu.open {
    display: block;
}

.mobile-nav {
    background: white;
    width: 280px;
    height: 100%;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    padding: 15px 20px;
    transition: background 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    background: #f5f7fa;
    color: #1e3c72;
}

.mobile-nav-item.active {
    background: rgba(30, 60, 114, 0.1);
    font-weight: 500;
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.mobile-nav-group {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.mobile-nav-header:hover {
    background: #f5f7fa;
}

.submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.mobile-nav-header.active .submenu-arrow {
    transform: rotate(90deg);
}

.mobile-submenu {
    display: none;
    background: #f8f9fa;
}

.mobile-submenu.open {
    display: block;
}

.mobile-submenu .mobile-nav-item {
    padding-left: 50px;
}

.submenu-icon {
    margin-right: 10px;
    font-size: 0.9rem;
}

/* 主内容区域 - 添加顶部边距以避开固定导航 */
.app-main {
    flex: 1;
    padding: 90px 20px 20px;
    overflow: auto;
    margin-top: 70px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.main-header h2 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.8rem;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title, .badge {
    background: rgba(30, 60, 114, 0.1);
    color: #1e3c72;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e3f2fd;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.search-btn, .clear-btn {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 400;
    transition: opacity 0.3s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
	
}

.search-btn:hover, .clear-btn:hover {
    opacity: 0.9;
}

.clear-btn {
    background: #95a5a6;
}

/* 搜索框样式 */
.search-box {
    background-color: white;
    border-radius: 30px;
    padding: 8px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.search-box .input-group {
    display: flex;
    align-items: center;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 8px 0;
    outline: none;
    font-size: 16px;
    background: transparent;
    width: 100%;
}

/* 双搜索框布局 */
.dual-search-container {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 25px;
    flex-wrap: wrap;
    align-items: flex-end;
	align-items: center; 
}

.dual-search-container .search-box {
    flex: 1;
    min-width: 300px;
    margin: 0;
	
}

.search-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 0; /* 移除底部边距 */
    align-items: center; /* 确保按钮容器内元素居中 */
}

.search-notice {
    text-align: center;
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 14px;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    background: white;
    position: absolute;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f7fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.product-code {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.product-id {
    font-size: 11px;
    color: #999;
    margin-left: 5px;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 页脚样式 */
.app-footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: auto;
}

/* 库存页面特定样式 */
.accordion-header {
    cursor: pointer;
}

.accordion-collapse {
    border-top: 1px solid #e9ecef;
}

.quantity {
    font-weight: 500;
    color: #2c3e50;
}

/* 存货明细页面特定样式 */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-top: none;
    transition: background-color 0.3s;
}

.list-group-item:first-child {
    border-top: 1px solid #e9ecef;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.list-group-item-action {
    color: #495057;
    text-decoration: none;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    color: #1e3c72;
}

.list-group-item h6 {
    margin-bottom: 5px;
    font-weight: 600;
}

.list-group-item .text-muted {
    font-size: 0.85rem;
}

/* 仪表板样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1e3c72;
    margin: 10px 0;
}

.stat-desc {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 消息公告样式 */
.announcement-list {
    list-style: none;
}

.announcement-list li {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.announcement-list li:last-child {
    border-bottom: none;
}

.announcement-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.announcement-content {
    flex: 1;
}

.announcement-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.announcement-desc {
    color: #6c757d;
    margin-bottom: 5px;
}

.announcement-time {
    font-size: 0.8rem;
    color: #999;
}

/* 分页控件样式 */
.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-controls .btn {
    margin: 0;
}

/* 状态提示样式 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.demo-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* 工具类 */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.w-100 { width: 100%; }
.flex-grow-1 { flex-grow: 1; }

/* 分页选择器样式 */
.page-selector {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.page-selector select {
    margin: 0 5px;
    padding: 5px;
}

/* 强制分页控件不换行 */
.pagination-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
}

.page-selector {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .app-header {
        padding: 0 15px;
    }
    
    .header-brand h1 {
        font-size: 1.3rem;
    }
    
    .top-nav {
        margin: 0 10px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* 在小屏幕上隐藏常规导航，显示移动菜单按钮 */
	    .dual-search-container {
        flex-direction: column;
        gap: 10px;
		 align-items: center;
    }
    
    .search-box, .dual-search-container .search-box {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 8px 15px;
        margin-bottom: 0;
    }
    
    .search-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 0;
        margin-bottom: 0;
			 align-items: center;
    }
    
    .search-btn, .clear-btn {
        flex: 1;
        margin: 0;
        text-align: center;
    }
    .top-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .app-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding: 10px 15px;
    }
    
    .header-brand {
        flex: 1;
    }
    
    .header-brand h1 {
        font-size: 1.2rem;
    }
    
    .header-user {
        margin-left: 10px;
    }
    
    .user-name {
        display: none;
    }
    
    /* 主内容区域调整 */
    .app-main {
        padding: 10px 15px 15px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-header h2 {
        font-size: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 搜索框调整 */
    .dual-search-container {
		
        flex-direction: column;
    }
    
    .search-box, .dual-search-container .search-box {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 8px 15px;
    }
    
    .search-box .input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-btn, .clear-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
		    margin-bottom: 0; /* 移除底部边距 */
    align-items: center; /* 确保按钮容器内元素居中 */
    }
    
    /* 表格调整 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th, .table td {
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 14px;
    }
    
    /* 卡片调整 */
    .card-body {
        padding: 15px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    /* 分页控件调整 */
    .pagination-controls {
        flex-direction: row !important;
        gap: 5px;
        align-items: center;
        padding: 5px 0;
    }
    
    .pagination-controls .btn {
        padding: 6px 10px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .page-selector span {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .page-selector select {
        padding: 4px;
        font-size: 13px;
        margin: 0 3px;
        max-width: 60px;
    }
    
    #page-info, #page-info-bottom {
        white-space: nowrap;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    /* 按钮调整 */
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
	    .search-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-btn, .clear-btn {
        width: 100%;
    }
    .app-main {
        padding: 10px 10px 10px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .search-box {
        padding: 8px 12px;
    }
    
    .search-box input {
        font-size: 14px;
    }
    
    .pagination-controls {
        gap: 3px;
    }
    
    .pagination-controls .btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .page-selector span {
        font-size: 12px;
    }
    
    .page-selector select {
        padding: 3px;
        font-size: 12px;
        max-width: 50px;
    }
    
    #page-info, #page-info-bottom {
        font-size: 12px;
        margin: 0 3px;
    }
}
/* 移动端首页按钮样式 */
.mobile-home-btn {
    display: none;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
    margin-left: 10px;
}

.mobile-home-btn:hover {
    background: rgba(255,255,255,0.3);
}

.home-icon {
    font-size: 1.2rem;
    display: block;
}

/* 移动端退出按钮样式 */
.mobile-logout-btn {
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 10px;
    background: rgba(255,255,255,0.05);
    font-weight: 500;
}

.mobile-logout-btn .nav-icon {
    color: #ff6b6b;
}

/* 响应式设计 - 移动端调整 */
@media (max-width: 768px) {
    /* 隐藏桌面端退出按钮，显示移动端首页按钮 */
    .desktop-logout {
        display: none;
    }
    
    .mobile-home-btn {
        display: block;
    }
    
    /* 调整用户名显示 */
    .user-name {
        font-size: 0.9rem;
        margin-right: 8px;
    }
    
    /* 调整头部用户区域布局 */
    .header-user {
        display: flex;
        align-items: center;
    }
}

/* 桌面端保持原样 */
@media (min-width: 769px) {
    .mobile-home-btn {
        display: none;
    }
    
    .desktop-logout {
        display: inline-block;
    }
}