:root {
	--primary-color: #007bff;
	--background-gradient: linear-gradient(to bottom right, #f0f0f0, #fafafa);
	--shadow-light: 0 2px 6px rgba(0, 0, 0, 0.1);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

body {
    background: white;
    color: #333;
    line-height: 1.6;
	padding-top: 60px;
}

#topNav {
	position: fixed;
	top: 0;
	left: 0;
	transform: translateZ(0);
	width: 100%;
	background: var(--background-gradient);
	padding: 12px 0;
	box-shadow: var(--shadow-light);
	z-index: 1000;
	display: flex;
	gap: 20px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	flex-wrap: nowrap;
	scroll-behavior: smooth;
}

#topNav::-webkit-scrollbar {
	display: none;
}

#topNav .nav-container {
	display: flex;
	gap: 20px;
	justify-content: center;
	margin: 0 auto;
	padding: 0 20px;
	min-width: max-content;
}

#topNav a {
	color: var(--primary-color);
	text-decoration: none;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 10px;
	transition: all 0.2s ease;
	white-space: nowrap;
	flex-shrink: 0;
}

#topNav a:hover {
	background: rgba(123, 104, 238, 0.3);
}

/* 主容器 */
#container {
    display: grid;
    grid-template-columns: 320px 1fr;
    max-width: 97%;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* 树形导航区 */
#tree {
    padding: 25px 20px;
    font-size: 15px;
    line-height: 1.7;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    height: 92vh;
    overflow-y: auto;
}

#tree p {
    margin-bottom: 1.5em;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

#tree p:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#tree a {
    display: inline-block;
    padding: 8px 15px;
    margin: 3px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    color: #1976d2;
    font-weight: 500;
    text-decoration: none;
    min-width: 50px;
}

#tree a:hover {
    background: #bbdefb;
    border-color: #90caf9;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

/* 选择框样式 */
#armor-selector {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 2px solid #1976d2;
    border-radius: 10px;
    background: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
    font-weight: 500;
}

#armor-selector:focus {
    outline: none;
    border-color: #0d47a1;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

/* 右侧内容区 */
#content {
    display: flex;
    flex-direction: column;
}

#bar {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 15px 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e0e0e0;
}

#line {
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, #4CAF50, #81C784);
    border-radius: 2px;
    margin-top: 5px;
    cursor: col-resize;
}

#data {
    padding: 10px;
    overflow-x: auto;
    height: calc(92vh - 60px);
    overflow-y: auto;
}

a {
    color: #007bff;
    text-decoration: none;
}

ul, ol, li {
    list-style: none;
}

em {
    color: #ff1493;
    font-style: normal;
}

/* 表格样式 */
table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    background: white;
}

th, td {
    padding: 14px;
    border: none;
    text-align: center;
    vertical-align: top;
}

th {
    background: #1976d2;
    color: white;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background-color: #f5f9ff;
}

tr:hover {
    background-color: rgba(123, 104, 238, 0.2);
}

/* 防具名称列样式 */
td:first-child {
    min-width: 220px;
    text-align: center;
    white-space: nowrap;
}

td:first-child div {
    margin-bottom: 5px;
}

td:first-child > div:last-child {
    margin-top: 10px;
}

td:first-child a {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
}

/* 跳转目标样式 */
.armor-highlight {
    animation: highlight 2s ease;
    box-shadow: 0 0 0 3px #ff9800;
}

@keyframes highlight {
    0% { background-color: #fff9c4; }
    100% { background-color: transparent; }
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    #container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 992px) {
    #container {
        grid-template-columns: 1fr;
        margin: 10px;
    }
    
    #tree {
        display: none;
    }
    
    #data {
        height: auto;
    }
    
    /* 顶部栏样式调整 */
    #bar {
        position: relative;
        padding: 15px 10px;
        padding-top: 60px;
    }
    
    /* 移动端选择框容器 */
    #mobile-selector-container {
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        z-index: 1000;
    }
    
    /* 移动端选择框样式 */
    #mobile-armor-selector {
        width: 100%;
        padding: 10px 12px;
        border: 2px solid #1976d2;
        border-radius: 10px;
        background: white;
        font-size: 16px;
        box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
        font-weight: 500;
    }
    
    /* 内容区域宽度调整 */
    #content {
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    /* 数据区域优化 */
    #data {
        padding: 10px 0;
        overflow-x: auto;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* 表格容器宽度优化 */
    .table-container {
        width: 100%;
        min-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }
    
    /* 表格宽度调整 */
    table {
        min-width: 1000px;
        width: auto;
        font-size: 12px;
        margin: 0;
    }
    
    /* 表头和单元格样式 */
    th, td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* 第一列宽度调整 */
    td:first-child {
        min-width: 180px;
        max-width: 200px;
        white-space: normal;
    }
    
    /* 固定表头 */
    thead th {
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* 隐藏桌面端选择框 */
    #armor-selector {
        display: none;
    }
}

@media (max-width: 768px) {
	#topNav {
		padding: 12px 0;
	}

	#topNav .nav-container {
		padding: 0 15px;
		gap: 18px;
	}

	#topNav::-webkit-scrollbar {
		display: none;
	}

	#topNav a {
		background: rgba(255, 255, 255, 0.9);
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
		font-size: clamp(14px, 3.5vw, 16px);
	}

    #tree {
        padding: 15px;
        font-size: 14px;
    }
    
    #tree a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    #data {
        padding: 15px;
    }
    
    th, td {
        padding: 10px;
    }
}

/* 在更小的屏幕上进一步调整 */
@media (max-width: 480px) {
    #bar {
        padding-top: 50px;
    }
    
    #mobile-selector-container {
        top: 5px;
        left: 5px;
        right: 5px;
    }
    
    #mobile-armor-selector {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    #data {
        padding: 5px 0;
    }
    
    th, td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    td:first-child {
        min-width: 160px;
        max-width: 180px;
    }
    
    .table-container {
        border-radius: 8px;
    }
    
    table {
        min-width: 900px;
    }
}