* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.nav-buttons .logout-btn {
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.nav-buttons .logout-btn:first-child {
    background-color: #2196F3;
}

.nav-buttons .logout-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-buttons .logout-btn:first-child:hover {
    background-color: #1976D2;
}

.nav-buttons .logout-btn:last-child:hover {
    background-color: #aa1313;
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: 80px 20px 40px;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.query-section {
    background-color: rgba(45, 45, 45, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.query-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.query-tab {
    padding: 12px 24px;
    background-color: #333;
    color: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.query-tab.active {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.query-tab:hover:not(.active) {
    background-color: #444;
}

.query-content {
    display: none;
}

.query-content.active {
    display: block;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-container label {
    font-weight: 500;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.filter-container select,
.filter-container input {
    padding: 12px 15px;
    border: 2px solid #555;
    border-radius: 6px;
    background-color: #333;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 160px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-container select:focus,
.filter-container input:focus {
    outline: none;
    border-color: #2196F3;
    background-color: #444;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* 美化月份选择器和日期选择器的样式 */
.filter-container input[type="month"],
.filter-container input[type="date"] {
    /* 移除可能干扰原生日历选择器的样式 */
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    background-color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 12px 15px;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-container input[type="month"]:hover,
.filter-container input[type="date"]:hover {
    border-color: #2196F3;
    background-color: #3a3a3a;
}

.filter-container input[type="month"]:focus,
.filter-container input[type="date"]:focus {
    border-color: #2196F3;
    background-color: #444;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.query-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.query-btn:hover {
    background: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

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

.results-container {
    background-color: rgba(45, 45, 45, 0.9);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #555;
}

.no-data {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 1.1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(51, 51, 51, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: linear-gradient(135deg, #616161 0%, #424242 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #555;
    color: #e0e0e0;
}

.orders-table tr:hover {
    background-color: rgba(75, 75, 75, 0.5);
}

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

/* 未付款状态样式 */
.orders-table td.payment-unpaid {
    color: #f44336 !important;
    font-weight: 600;
}

.stats-container {
    background-color: rgba(68, 68, 68, 0.7);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.stats-item {
    display: inline-block;
    margin-right: 30px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.stats-label {
    color: #b0b0b0;
    margin-right: 5px;
}

.stats-value {
    color: #2196F3;
    font-weight: 600;
}

/* 导航按钮 */
.nav-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 10px 20px 30px 0;
    flex-wrap: wrap;
    align-items: center;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input {
    padding: 10px 15px;
    border: 2px solid #555;
    border-radius: 6px;
    background-color: #333;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #2196F3;
    background-color: #444;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.search-button {
    padding: 10px 15px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 100px 15px 30px;
    }

    h1 {
        font-size: 2rem;
    }

    .query-tabs {
        flex-direction: column;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-container select,
    .filter-container input {
        width: 100%;
    }

    .results-table {
        display: block;
        overflow-x: auto;
    }

    .stats-item {
        display: block;
        margin-right: 0;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }
}

/* 选项卡头部样式 */
.query-tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* 确保搜索框在右侧对齐 */
.query-tabs {
    flex: 1;
    min-width: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .query-tabs-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .query-tabs {
        min-width: auto;
    }
    
    .search-box {
        width: 100%;
    }
}

/* 卡片容器样式 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* 进货统计卡片样式 */
.purchase-card {
    background-color: rgba(51, 51, 51, 0.7);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.purchase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: #2196F3;
}

/* 卡片头部样式 */
.card-header {
    background: linear-gradient(135deg, #616161 0%, #424242 100%);
    padding: 14px 16px;
    border-bottom: 1px solid #555;
}

.store-name {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* 卡片内容样式 */
.card-body {
    padding: 12px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    color: #b0b0b0;
    font-weight: 500;
    font-size: 0.9rem;
}

.info-value {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-value.highlight {
    color: #2196F3;
    font-size: 1rem;
}

/* 浮动订单窗口样式 */
.order-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

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

.modal-content {
    background-color: #2d2d2d;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
}

.modal-header {
    background: linear-gradient(135deg, #616161 0%, #424242 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
}

.modal-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(51, 51, 51, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.orders-table th {
    background: linear-gradient(135deg, #424242 0%, #333 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.orders-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #555;
    color: #e0e0e0;
}

.orders-table tr:hover {
    background-color: rgba(75, 75, 75, 0.5);
}

/*  overdue样式 - 超过平均进货时间+7天 */
.purchase-card.overdue {
    background-color: rgba(139, 0, 0, 0.5);
    border-color: #f44336;
}

.purchase-card.overdue:hover {
    border-color: #ff5252;
}

.purchase-card.overdue .card-header {
    background: linear-gradient(135deg, #8b0000 0%, #660000 100%);
}