: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 ul {
	width: 100px;
	display: flex;
	height: 12px;
	margin: 8px auto;
	background: #d8dde1;
	border-radius: 10px;
	list-style: none;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(255, 255, 255, 0.8);
}

#ken li {
	flex-shrink: 0;
	height: 100%;
	list-style: none;
	position: relative;
	transition: width 0.3s ease;
}

.r {
	background: #ff4444
}

.o {
	background: #ffa534
}

.y {
	background: #ffdd57
}

.g {
	background: #77dd77
}

.b {
	background: #6699ff
}

.w {
	background: #ffffff;
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(0, 0, 0, 0.1);
	position: relative;
	z-index: 1;
}

.p {
	background: #ee82ee
}

.s {
	background: #00ffff
}

#ken .s1 {
	width: 1px
}

#ken .s2 {
	width: 2px
}

#ken .s3 {
	width: 3px
}

#ken .s4 {
	width: 4px
}

#ken .s5 {
	width: 5px
}

#ken .s6 {
	width: 6px
}

#ken .s7 {
	width: 7px
}

#ken .s8 {
	width: 8px
}

#ken .s9 {
	width: 9px
}

#ken .s10 {
	width: 10px
}

#ken .s11 {
	width: 11px
}

#ken .s12 {
	width: 12px
}

#ken .s13 {
	width: 13px
}

#ken .s14 {
	width: 14px
}

#ken .s15 {
	width: 15px
}

#ken .s16 {
	width: 16px
}

#ken .s17 {
	width: 17px
}

#ken .s18 {
	width: 18px
}

#ken .s19 {
	width: 19px
}

#ken .s20 {
	width: 20px
}

#ken .s21 {
	width: 21px
}

#ken .s22 {
	width: 22px
}

#ken .s23 {
	width: 23px
}

#ken .s25 {
	width: 25px
}

#ken .s27 {
	width: 27px
}

#ken .s28 {
	width: 28px
}

#ken .s29 {
	width: 29px
}

#ken .s30 {
	width: 30px
}

#ken .s32 {
	width: 32px
}

#ken .s33 {
	width: 33px
}

#ken .s35 {
	width: 35px
}

#ken .s37 {
	width: 37px
}

#ken .s38 {
	width: 38px
}

#ken .s39 {
	width: 39px
}

#ken .s40 {
	width: 40px
}

#ken .s42 {
	width: 42px
}

#ken .s43 {
	width: 43px
}

#ken .s45 {
	width: 45px
}

#ken .s46 {
	width: 46px
}

#ken .s47 {
	width: 47px
}

#ken .s48 {
	width: 48px
}

#ken .s50 {
	width: 50px
}

#ken .s52 {
	width: 52px
}

#ken .s53 {
	width: 53px
}

#ken .s55 {
	width: 55px
}

#ken .s57 {
	width: 57px
}

#ken .s58 {
	width: 58px
}

#ken .s60 {
	width: 60px
}

#ken .s62 {
	width: 62px
}

#ken .s63 {
	width: 63px
}

#ken .s65 {
	width: 65px
}

#ken .s67 {
	width: 67px
}

#ken .s68 {
	width: 68px
}

#ken .s70 {
	width: 70px
}

#ken .s72 {
	width: 72px
}

#ken .s73 {
	width: 73px
}

#ken .s75 {
	width: 75px
}

#ken .s80 {
	width: 80px
}

#ken .s82 {
	width: 82px
}

#ken .s87 {
	width: 87px
}

#ken .s90 {
	width: 90px
}

#ken .s100 {
	width: 100px
}

#ken .f {
	background-color:rgba(0, 0, 0, 0.3);
	border-radius: 10px;
	}
#ken .fr {color:red;}
#ken .fb {color:blue;}
#ken .fw {color:white;}
#ken .fy {color:yellow;}
#ken .fg {color:lime;}
#ken .fa {color:aqua;}
#ken .fp {color:fuchsia;}

#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;
	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 {
	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;
}

.ken-sharpness-tooltip {
    position: absolute;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
	color: white;
	text-align: center;
	white-space: nowrap;
    padding: 6px 10px;
	border-radius: 10px;
    font-size: 13px;
    opacity: 0.9;
    pointer-events: none;
    transition: all 0.2s ease;
    display: none;
}

.ken-sharpness-tooltip.active {
    display: block;
}

@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;
	}
}

@media (max-width: 375px) {
	#tree {
		padding: 12px 8px !important;
	}

	#quickSelect {
		height: 42px;
		font-size: 15px;
		padding: 10px;
	}
}