:root {
    --primary-color: #007bff;
    --hover-color: #0056b3;
    --bg-color: #f8f9fa;
    --text-color: #333;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 48px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 48px;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* 搜索框样式 */
.search-container {
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 96px); /* 减去导航栏和页脚的高度 */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.search-container:not(:has(.table-container)) {
    justify-content: center;
    padding-top: 0;
    padding-bottom: 25vh;
}

.search-container h1 {
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.search-container:not(:has(.table-container)) h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 600px;
    transition: all 0.3s ease;
}

.search-container:has(.table-container) .search-box {
    max-width: 600px;
    margin: 0 auto 1rem auto;
}

.search-input {
    border-radius: 4px;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    box-shadow: none;
    height: 42px;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.15);
    outline: none;
}

.search-button {
    border-radius: 4px;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    margin-left: 8px;
    height: 42px;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background-color: var(--hover-color);
    transform: none;
}

.input-group {
    align-items: center;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    width: 100%;
}

.table {
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 设置各列的宽度 */
.table th:nth-child(1) { width: 25%; } /* 文件名 */
.table th:nth-child(2) { width: 8%; }  /* 版本 */
.table th:nth-child(3) { width: 12%; } /* 状态 */
.table th:nth-child(4) { width: 8%; } /* 分类 */
.table th:nth-child(5) { width: 8%; }  /* 大小 */
.table th:nth-child(6) { width: 15%; } /* 修改时间 */
.table th:nth-child(7) { width: 8%; } /* 创建者 */
.table th:nth-child(8) { width: 16%; } /* 操作 */

.table td {
    vertical-align: middle;
    padding: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
}

/* 徽章样式 */
.badge {
    font-size: 0.8em;
    padding: 0.4em 0.8em;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    padding: 0.5rem 1.2rem;
    transition: all 0.3s ease;
}

/* 登录模态框样式 */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.login-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.8rem;
}

/* 分页样式 */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* 自定义容器 */
.container-custom {
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
    width: 100%;
}

/* 导航栏样式 */
.navbar {
    padding: 0;
    height: 48px;
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
    width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.nav-container .navbar-nav {
    padding-right: 2rem;
}

.navbar.border-bottom {
    border-bottom: none;
}

header {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    margin-bottom: 48px;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin-top: 0;
    padding-top: 0;
}

.navbar.mb-3 {
    margin-bottom: 0 !important;
}

.navbar .container-custom {
    display: flex;
    align-items: center;
}

.navbar-nav {
    width: 100%;
    justify-content:flex-end;
}

.navbar .navbar-nav {
    display: flex;
    align-items: center;
}

.navbar .nav-item {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.navbar .nav-link {
    padding: 0;
    line-height: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
}

.navbar .nav-link .bi {
    font-size: 1.3rem;
}

.navbar .nav-link .bi-house-door {
    color: var(--text-color);
}

.navbar .nav-item:last-child {
    margin-left: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    .search-container {
        padding: 1rem;
    }

    .btn {
        padding: 0.4rem 1rem;
    }
}
