:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --success-color: #28a745;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    padding-bottom: clamp(30px, 5vh, 90px);
    font-family: Arial, sans-serif;
    background-color: #f8fafc;
}

/* 头部地区 */
.header {
    background-color: #2989d8;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(12px, 2.5vh, 54px) clamp(20px, 3vw, 64px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影增强悬浮效果 */
    position: sticky; /* 关键属性 */
    top: 0; /* 固定在顶部 */
    z-index: 1000; /* 确保在其他内容之上 */
    transition: background-color 0.3s ease; /* 可选：添加过渡效果 */
}

.header:hover {
    background-color: #1a69a4;
}
/* logo设置 */
.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: clamp(28px, 3.8vh, 65px);
    height: clamp(28px, 3.8vh, 65px);
    margin-right: clamp(6px, 0.8vw, 16px);
    transition: transform 0.3s ease;
}

.logo-text {
    font-size: clamp(16px, 2.3vh, 50px);
    font-weight: bold;
}

.logo-text_2 {
    font-size: clamp(12px, 1.6vh, 35px);
    font-weight: bold;
    white-space: nowrap;
}

.logo:hover {
    transform: rotate(15deg);
}

/* nav格式 */
.nav {
    margin-top: clamp(6px, 1.2vh, 26px);
}

.nav-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-item {
    margin-right: clamp(8px, 1vw, 24px);
    margin-bottom: 5px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: clamp(14px, 1.6vh, 32px);
    padding: clamp(4px, 0.8vh, 18px) clamp(8px, 1vw, 20px);
    border-radius: 4px;
    transition: all 0.3s;
    display: inline-block;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

/*搜索的格式*/
.theme-toggle {
    cursor: pointer;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: none;
    border-radius: 3px 0 0 3px;
    outline: none;
}

.search-button {
    padding: 8px 12px;
    border: none;
    background-color: white;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    outline: none;
}

/* 这里容器的设置和browse里面的不一样 */
.form-container {
    display: flex; /* 使用flex布局 */
    flex-direction: column; /* 改为纵向排列 */
    justify-content: flex-start; /* 左对齐（默认值，可省略） */
    align-items: flex-start; /* 左对齐（垂直方向的对齐方式） */
    gap: 10px; /* 可选：设置元素间距 */
}

/* 下拉菜单样式 */
select {
    padding: 8px; /* 可选：调整内边距 */
    border: 1px solid #ccc; /* 可选：边框样式 */
    border-radius: 4px; /* 可选：圆角 */
    flex: 1; /* 可选：让下拉菜单平均分配空间（如果需要） */
}

/* 按钮样式 */
button {
    padding: 8px 16px; /* 可选：调整内边距 */
    background-color: #007bff; /* 蓝色背景 */
    color: white; /* 白色文字 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


/* 当前筛选器样式 */
.current-filters {
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #2989d8;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
}

/* 主内容区域 */
.main-content {
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    margin: 0 auto;
}

/* 表格样式 */
.table-container {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    transition: all 0.3s;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /*定义了字体*/
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 添加现代字体栈 */
}

.table-container th, .table-container td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8f0;
    transition: all 0.2s;
}

.table-container th {
    background-color: #f7fafc;
    position: sticky;
    z-index: 50;
    border-bottom: 2px solid #e1e8f0;
    font-weight: 700; /* 表头加粗 */
    color: #2d3748; /* 深灰色增强可读性 */
}

.table-container tr:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}


.table-container td.td-entry a {
    color: #2989d8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.table-container td.td-entry a:hover {
    color: #1a69a4;
    text-decoration: underline;
    transform: translateY(-1px);
}

/* Species列斜体样式 */
.table-container td.td-organism {
    font-style: italic; /* 物种名称斜体 */
    color: #2d3748; /* 稍深颜色增强可读性 */
}

.table-container td[title] {
    position: relative;
}

.table-container td[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    margin-bottom: 5px;
}

/*表格样式结束*/


/* 分页样式 */
.pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    min-width: 36px;
    text-align: center;
}

.pagination a {
    color: #2989d8;
    border: 1px solid #e1e8f0;
    background-color: white;
}

.pagination a:hover {
    background-color: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #2989d8;
}

.pagination .active {
    background-color: #2989d8;
    color: white;
    border: 1px solid #2989d8;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination .disabled {
    color: #6c757d;
    background-color: #f8f9fa;
    border: 1px solid #e1e8f0;
    cursor: not-allowed;
}

.pagination .page-info {
    margin: 0 10px;
    color: #6c757d;
}

/* 错误信息格式 */
.error-message {
    padding: 15px;
    margin: 20px 0;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* 底部格式 */
#bottom {
    background-color: #2989d8;
    color: #ccc7d5;
    font-size: clamp(10px, 1.5vh, 32px);
    padding: clamp(5px, 1.2vh, 26px) 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: background-color 0.3s ease;
}

#bottom:hover {
    background-color: #1a69a4;
}

/* 打印时取消固定定位 */
@media print {
    .header, #bottom { position: static; }
}