: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;
}

#container {
	display: grid;
	grid-template-columns: minmax(180px, 280px) 1fr;
	max-width: 97%;
	margin: 20px auto;
	background: white;
	border-radius: 16px;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
	overflow: hidden;
}

#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);
}

#tree {
	height: calc(100vh - 100px);
	overflow-y: auto;
	padding: 20px;
	background: #f8f9fa;
	border-right: 1px solid #dee2e6;
}

#tree a {
	display: block;
	padding: 8px 12px;
	margin: 4px 0;
	background: white;
	border: 1px solid #dee2e6;
	border-radius: 10px;
	transition: all 0.3s ease;
	color: #495057;
	text-decoration: none;
	font-size: 14px;
}

#tree a:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
	background: rgba(123, 104, 238, 0.3);
}

#data {
	height: calc(100vh - 100px);
	overflow-y: auto;
	padding: 10px;
	overflow-x: auto;
	background: #fff;
}

#ken {
	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;
}

#ken th, #ken td {
	padding: 14px;
	width: fit-content;
	text-align: center;
}

#ken th {
	background: #1976d2;
	color: white;
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 0.5px;
	font-size: 13px;
	position: sticky;
}

#ken tr:nth-child(even) {
	background-color: #f5f9ff;
}

#ken tr:hover {
	background-color: rgba(123, 104, 238, 0.2);
}

.centered-label {
	display: block;
	text-align: center;
}

.custom-select {
	width: 100%;
	margin-bottom: 15px;
	padding: 8px;
	border: 1px solid #dee2e6;
	border-radius: 10px;
}

.sort-button {
	margin-bottom: 5px;
	padding: 5px 10px;
	background: #20b2aa;
	color: white;
	border: none;
	border-radius: 10px;
	cursor: pointer;
}

.toggle-button {
	padding: 8px 16px;
	background-color: #20b2aa;
	color: white;
	border: none;
	border-radius: 10px;
	cursor: pointer;
}

.toggle-button:hover {
	background-color: #66cdaa;
}

a {
	color: #007bff;
	text-align: center;
	text-decoration: none;
}

.k, s {
    color: red;
}

s {
    text-decoration: none;
}

em, i {
	color: #ff1493;
	font-style: normal;
}

#quickSelect {
	width: 100%;
	margin: 15px 0;
	padding: 10px 35px;
	border: 1px solid #dee2e6;
	border-radius: 10px;
	background: #ef9a9a url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5" stroke="%23666" stroke-width="2"/></svg>') no-repeat right 15px center / 12px;
	text-align: center;
	text-align-last: center;
	color: white;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.ul-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  list-style-type: none;
  padding: 0;
  margin: 0 auto;
  width: fit-content;
  gap: 5px;
}

.ul-list li {
  padding: 8px;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  min-width: 50px;
  flex: 0 0 auto;
}

.ul-list u {
  color: red;
  text-decoration: none;
}

@media (max-width: 1079px) {
    #container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    #tree {
        height: auto;
        min-height: auto;
        padding: 15px 10px;
        border-right: none;
        border-bottom: 1px solid #ddd;
        overflow-y: visible;
    }
    
    #tree a {
        display: none !important;
    }
    
    #data {
        height: auto;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
	body {
		padding-top: 50px;
	}

	#topNav {
		padding: 12px 0;
	}

	#topNav .nav-container {
		padding: 0 15px;
		gap: 18px;
	}

	#topNav::-webkit-scrollbar {
		display: none;
	}

	#topNav a {
		font-size: clamp(14px, 3.5vw, 16px);
	}

	#container {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
		margin: 10px;
		border-radius: 12px;
	}

	#tree {
		position: static;
		height: auto !important;
		min-height: auto !important;
		padding: 15px 10px !important;
		border-right: none;
		border-bottom: 1px solid #ddd;
		overflow-y: visible !important;
		-webkit-overflow-scrolling: touch;
	}

	#tree a {
		display: none !important;
	}

	#data {
		height: auto !important;
		overflow-y: visible !important;
	}

	#ken th,
	#ken td {
		padding: 8px;
		font-size: 12px;
	}

	#quickSelect {
		padding: 12px 30px;
		font-size: 15px;
		background-position: right 10px center;
	}

	.w {
		box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
		border-width: 0.5px;
	}

	.ul-list {
		gap: 6px;
	}
  
	.ul-list li {
		padding: 6px;
		font-size: 12px;
		min-width: 100px;
	}

}

@media (max-width: 375px) {
	#tree {
		padding: 12px 8px !important;
	}

	#quickSelect {
		height: 42px;
		font-size: 15px;
		padding: 10px;
	}

	.ul-list {
		flex-direction: column;
		align-items: center;
	}
  
	.ul-list li {
		width: 100%;
		min-width: unset;
	}

}