/* 全局变量设置 */
:root {
    --primary-color: #f2a3b3;
    --primary-light: #ffd6e0;
    --primary-dark: #e57f9a;
    --secondary-color: #a9d1f7;
    --text-color: #4a4a4a;
    --light-text: #6e6e6e;
    --success-color: #77dd77;
    --warning-color: #fdfd96;
    --danger-color: #ff9e9e;
    --background-color: #fff9fb;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --card-padding: 20px;
}

/* 基础样式 */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

.inventory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M95,50A45,45,0,1,1,50,5,45,45,0,0,1,95,50Z" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="10"/></svg>') repeat;
    background-size: 80px 80px;
    opacity: 0.4;
}

.header-content {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    color: #fff;
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.header-icon {
    margin-right: 15px;
    color: #fff;
}

.subtitle {
    color: #fff;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

/* 搜索框样式 */
.search-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    border-top: 4px solid var(--primary-color);
}

.search-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.search-input-group {
    display: flex;
    flex: 1;
    min-width: 300px;
}

.search-input-container {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #e3e3e3;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background-color: var(--primary-dark);
}

.log-button {
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 11px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.log-button:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.inventory-table th {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.inventory-table tr {
    border-bottom: 1px solid #f3f3f3;
    transition: var(--transition);
}

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

.inventory-table tr:hover {
    background-color: #f9f9f9;
}

.inventory-table td {
    padding: 15px;
    vertical-align: middle;
}

.book-title {
    font-weight: 500;
    color: var(--text-color);
}

.book-author {
    color: var(--light-text);
    font-style: italic;
}

/* 库存和状态标签样式 */
.stock-badge, .status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.stock-high {
    background-color: var(--success-color);
    color: #fff;
}

.stock-medium {
    background-color: var(--warning-color);
    color: #8a7800;
}

.stock-low {
    background-color: var(--danger-color);
    color: #fff;
}

.status-active {
    background-color: #d9f5e6;
    color: #2a9d5c;
}

.status-inactive {
    background-color: #ffe8e8;
    color: #e35555;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-adjust, .btn-view {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.btn-adjust {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary-color);
}

.btn-adjust:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-view {
    background-color: var(--secondary-color);
    color: #3573b5;
    border: 1px solid #8ab9e3;
}

.btn-view:hover {
    background-color: #8ab9e3;
    color: white;
}

/* 分页样式 */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border-radius: var(--border-radius);
    background-color: #fff;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid #e3e3e3;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item:not(.active) .page-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.page-item.disabled .page-link {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .inventory-container {
        padding: 15px;
    }

    .page-header {
        padding: 30px 20px;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .log-button {
        text-align: center;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .inventory-table {
        min-width: 800px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-adjust, .btn-view {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 25px 15px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .pagination .page-link {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: 0.9rem;
    }
}
