
:root {
	/* 主题颜色 */
	--t-c1: 145, 219, 239;
	--t-c2: 86, 208, 237;
	--t-c3: 88, 124, 174;

	--t-w: 255, 255, 255;
	--t-b: 0, 0, 0;

	scrollbar-color: rgba(var(--t-b2), 0.3) rgba(var(--t-b2), 0.05);
}

[theme="0"] {
	/* 浅色 */
	--t-b1: 255, 255, 255;
	--t-b2: 0, 0, 0;
}

[theme="1"] {
	/* 深色 */
	--t-b1: 0, 0, 0;
	--t-b2: 255, 255, 255;
}

::selection {
	background: rgba(var(--t-c2), 0.2);
}

:lang(en) {
	text-align: justify;
	word-break: keep-all;
}






html,
body {
	height: 100%;
	width: 100%;
	margin: 0;
}

body {
	line-height: 1.7;
	font-size: 17px;
	min-width: 380px;

	background-color: rgba(var(--t-b1), 0.8);
	background-size: 1000px 1000px;
	background-image: repeating-linear-gradient(45deg, rgba(var(--t-b2), 0.04) 0, rgba(var(--t-b2), 0.04) 1px, transparent 0, transparent 50%);

	font-family:
		"Noto Sans",
		"Noto Sans CJK",
		"Noto Sans SC",
		Arial, 
		system-ui, 
		sans-serif;
}

body::before {
	content: "";
	position: fixed;
	height: 100%;
	width: 100%;
	top: 0;
	left: 12%;
	z-index: -1;
	opacity: 0.1;
	transform: scaleY(-1);
	background-image: url("../src/sakura.webp");
	background-position: right bottom;
	background-size: contain;
	background-repeat: no-repeat;
	pointer-events: none;
}

[theme="1"] body::before {
	filter: invert(1) opacity(0.2);
}

img,
a {
	user-select: none;
	text-decoration: none;
	-webkit-user-drag: none;
}

textarea,
button {
	all: unset;
	box-sizing: border-box;
}

summary:focus-visible,
textarea:focus-visible,
button[onclick]:focus-visible {
	outline: 2px solid rgba(var(--t-c2), 1);
	outline-offset: -2px;
}






/* MAIN PAGE */

mp > .hint {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 340px;
	text-align: right;
	box-sizing: border-box;
	padding: 15px;
	background-color: rgba(var(--t-b), 0.05);
	color: rgba(var(--t-b2), 0.6);
	backdrop-filter: blur(20px);
	border: 2px solid rgba(var(--t-b2), 0.08);
	border-radius: 5px;
	overflow: hidden;
	transition: 0.3s;
}

mp > .hint:hover,
mp > .hint:active {
	border: 2px solid rgba(var(--t-c2), 0.8);
}

mp > .hint:active {
	transform: scale(0.95);
}

mp > .background {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 0;
	height: 100%;
	aspect-ratio: 5 / 3;
	user-select: none;
	pointer-events: none;
}

[theme="1"] mp > .background {
	filter: brightness(0.8);
}



mp > header {
	position: fixed;
	top: 10px;
	left: 20px;
	display: inline-block;
	color: rgba(var(--t-b2), 0.4);
	user-select: none;
}



mp > menu.shadow {
	position: fixed;
	height: 100%;
	width: 100%;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
	z-index: 10;
	background-color: rgba(var(--t-b), 0.4);
}

mp > menu.list {
	position: fixed;
	height: calc(100% - 20px);
	width: 27%;
	top: 0;
	right: 0;
	margin: 10px;
	padding: 0 0 0 14px;
	z-index: 15;
	border-radius: 5px;
	background-color: rgba(var(--t-b2), 0.1);
	transition: 0.4s;
}

mp > menu.list > div:nth-of-type(1) {
	height: calc(100% - 60px);
	overflow-x: hidden;
	overflow-y: scroll;
	scrollbar-color: rgba(var(--t-b2), 0.3) transparent;
}

mp > menu.list > div:nth-of-type(2) {
	padding-top: 11px;
	width: calc(100% - 14px);
	border-top: 1px solid rgba(var(--t-b2), 0.2);
}

mp .card {
	position: relative;
	display: table;
	min-height: 90px;
	width: 100%;
	line-height: 1.5;
	box-sizing: border-box;
	word-break: break-all;
	padding: 13px 15px;
	margin-top: 10px;
	overflow: hidden;
	background-color: rgba(var(--t-b), 0.05);
	color: rgba(var(--t-b2), 0.5);
	border-radius: 5px;
	backdrop-filter: blur(10px);
	border: 2px solid rgba(var(--t-b2), 0.08);
	transition: 0.2s;
}

mp .card[onclick] {
	cursor: pointer;
}

mp .card[onclick]:hover,
mp .card[onclick]:active {
	border: 2px solid rgba(var(--t-c2), 0.8);
}

mp .card[onclick]:active {
	transform: scale(0.95);
}



mp .card button,
mp .card a {
	display: inline-block;
	background-color: rgba(var(--t-c2), 0.5);
	color: rgba(var(--t-w), 1);
	padding: 5px 15px;
	margin-right: 12px;
	border-radius: 5px;
	cursor: pointer;
	transition: 0.2s;
}

mp .card button:hover,
mp .card button:active,
mp .card a:hover,
mp .card a:active {
	background-color: rgba(var(--t-c2), 0.8);
}

mp .card button:active,
mp .card a:active {
	transform: scale(0.9);
}

mp .card > box {
	display: block;
	text-align: justify;
	user-select: text;
}

mp .card[data-type="1"] > box {
	width: calc(100% - 100px);
}

mp .card[data-type="1"] > img {
	position: absolute;
	right: 0;
	top: 0;
	height: 100%;
	width: 100px;
	object-fit: cover;
}

mp .card[data-type="3"] > img {
	position: absolute;
	left: 0;
	top: -50%;
	width: 100%;
	object-fit: cover;
	filter: brightness(0.4) blur(10px);
	z-index: -1;
}

mp > menu key {
	color: rgba(var(--t-c2), 0.6) !important;
}

mp > menu textarea {
	display: inline-block;
	padding: 12px;
	height: 36px;
	width: calc(100% - 50px);
	box-sizing: border-box;
	outline: none;
	resize: none;
	border: none;
	line-height: 10px;
	border-radius: 5px;
	vertical-align: top;
	white-space: nowrap;
	scrollbar-width: none;
	overflow-x: overlay;
	overflow-y: hidden;
	background-color: rgba(var(--t-w), 0.4);
	color: rgba(var(--t-b), 0.6);
}

mp > menu textarea::placeholder {
	color: rgba(var(--t-b), 0.4);
	user-select: none;
}



mp .theme-btn {
	display: inline-block;
	float: right;
	height: 36px;
	width: 36px;
	padding: 6px 6px;
	box-sizing: border-box;
	background-color: rgba(var(--t-c2), 0.6);
	border-radius: 5px;
	cursor: pointer;
	transition: 0.2s;
}

mp .theme-btn:active {
	transform: scale(0.9);
}

mp .theme-btn::after {
	font-size: 24px;
	line-height: 22px;
	color: rgba(var(--t-b2), 0.6);
	transition: 0.2s;
}

	[theme="1"] mp .theme-btn::after {
		content: "☀";
	}

	[theme="0"] mp .theme-btn::after {
		content: "◐";
	}



mio-iframe {
	position: absolute;
	display: block;
	height: 100%;
	width: 100%;
	z-index: 20;
	overflow-y: overlay;
	overflow-x: hidden;
	background-color: rgba(var(--t-b1), 1);
	scrollbar-color: rgba(var(--t-b2), 0.4) rgba(var(--t-b1), 0.05);
	scrollbar-width: thin;
}

mio-iframe > button {
	position: fixed !important;
	right: 20px !important;
	top: 15px !important;
	z-index: 100;
}



sp > .blog-navi {
	position: absolute;
	top: 120px;
	left: 16%;
	width: calc(16% - 40px);
	min-height: 100px;
	max-height: 330px;
	padding: 10px 20px 20px 20px;
	z-index: 25;
	border-radius: 5px;
	background-color: rgba(var(--t-b2), 0.05);
	background-color: color-mix(in srgb, rgb(var(--t-w)) 95%, rgb(var(--t-b)) 5%);
	user-select: none;
	overflow-x: hidden;
	overflow-y: overlay;
	scrollbar-color: rgba(var(--t-b2), 0.3) transparent;
	scrollbar-width: thin;
}

sp > .blog-navi::before {
	content: "索引";
	display: block;
	height: 45px;
	margin-bottom: 6px;
	color: rgba(var(--t-b2), 0.6);
	font-size: 24px;
	font-weight: bolder;
	border-bottom: 2px solid rgba(var(--t-b2), 0.1);
}

sp > .blog-navi button {
	display: block;
	width: fit-content;
	max-width: 100%;
	color: rgba(var(--t-c2), 1);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
	transition: 0.1s;
}

sp > .blog-navi button:hover {
	color: rgba(var(--t-c1), 1);
	text-decoration-color: rgba(var(--t-c1), 1);
}

sp > .blog-navi button[type="2"] {
	margin-left: 18px;
	max-width: calc(100% - 45px);
	opacity: 0.8;
}

sp > .blog-navi button[type="3"] {
	margin-left: 36px;
	max-width: calc(100% - 65px);
	opacity: 0.6;
}



mp > prompt {
	position: fixed;
	z-index: 100;
	top: 0;
	bottom: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	background-color: rgba(var(--t-b), 0.6);
	backdrop-filter: blur(10px);
	opacity: 0;
	transition: 0.4s;
}

mp > prompt > .prompt {
	display: inline-block;
	width: 40%;
	min-height: 180px;
	max-height: 310px;
	padding: 0px 0px 20px 20px;
	box-sizing: border-box;
	border: 1px solid rgba(var(--t-b2), 0.2);
	background-color: rgba(var(--t-b1), 0.7);
	transform: scale(0.8);
	backdrop-filter: blur(100px);
	border-radius: 5px;
	transition: 0.2s;
}

mp > prompt > .prompt > div {
	overflow-x: hidden;
	overflow-y: overlay;
	height: 100%;
	padding: 10px 5px 10px 0px;
	word-break: break-word;
	color: rgba(var(--t-b2), 0.4);
	scrollbar-width: thin;
	user-select: text;
}

mio-iframe > button,
mp > prompt > .prompt > button {
	position: absolute;
	top: 10px;
	right: 20px;
	float: right;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(var(--t-w), 0.8);
	background-color: rgba(255, 0, 0, 0.6);
	border-radius: 5px;
	font-weight: bolder;
	cursor: pointer;
	user-select: none;
	transition: 0.1s;
}

mio-iframe > button:active,
mp > prompt > .prompt > button:active {
	transform: scale(0.9);
}

mp > prompt.active {
	opacity: 1;
}

mp > prompt.active > .prompt {
	transform: scale(1) !important;
}






/* SUB PAGE */

sp structure {
	position: relative;
	display: block;
	z-index: 1;
}

	sp structure[type="side"] {
		width: 50%;
		padding: 120px 15% 120px 35%;
	}

	sp structure[type="center"] {
		width: 50%;
		padding: 120px 25% 120px 25%;
	}

	sp structure[background="grid"] {
		background-size: 30px 30px;
		background-image:
			linear-gradient(90deg, rgba(var(--t-b2), 0.05) 1px, transparent 1px),
			linear-gradient(0deg, rgba(var(--t-b2), 0.05) 1px, transparent 1px);
	}

	sp structure[background="sakura"]::before {
		content: "";
		position: fixed;
		height: 100%;
		width: 100%;
		top: 0;
		left: 0;
		z-index: -1;
		opacity: 0.1;
		background-image: url("../src/sakura.webp");
		background-position: right bottom;
		background-size: contain;
		background-repeat: no-repeat;
		pointer-events: none;
	}

	[theme="1"] sp structure[background="sakura"]::before {
		filter: invert(1) opacity(0.1);
	}



para {
	display: block;
	padding-bottom: 140px;
	color: rgba(var(--t-b2), 0.5);
	word-break: break-word;
}

note {
	color: rgba(var(--t-b2), 0.3);
}

hr {
	margin-block: 0;
	width: 100%;
	border: none;
	border-top: 2px rgba(var(--t-b2), 0.3) solid;
}

mat {
	display: block;
	width: 100%;
	height: 5px;
	pointer-events: none;
}

att {
	display: inline-block;
	padding: 0px 8px 0px 8px;
	color: rgba(var(--t-c2), 1);
	background-color: rgba(var(--t-c2), 0.2);
	border-radius: 5px;
}

	.theme-0 att {
		background-color: rgba(var(--t-c3), 0.2);
		color: rgba(var(--t-c2), 1);
	}

secret {
	padding: 2px 8px 2px 8px;
	background-color: rgba(var(--t-b), 0.4);
	color: rgba(var(--t-w), 0);
	transition: 0.2s;
}

	secret:hover {
		color: rgba(var(--t-w), 1);
	}

kaomoji {
	font-family: system-ui, sans-serif;
}



/* 提示框 */

quote {
	display: block;
	background-color: rgba(var(--t-c3), 0.2);
	padding: 10px 15px;
	border-radius: 5px;
}

	quote[type="caution"]::before {
		content: "CAUTION";
		position: absolute;
		margin-top: -27px;
		font-weight: bolder;
		color: rgba(255, 200, 0, 0.6);
	}

	quote[type="caution"] {
		background-color: rgba(255, 200, 0, 0.2);
		padding: 35px 15px 10px 15px;
	}

	quote[type="warn"]::before {
		content: "WARNING";
		position: absolute;
		margin-top: -27px;
		font-weight: bolder;
		color: rgba(255, 0, 0, 0.6);
	}

	quote[type="warn"] {
		background-color: rgba(255, 0, 0, 0.1);
		padding: 35px 15px 10px 15px;
	}



/* 缩进 */

i1, i2, i3 {
	display: block;
}

	i1 {
		margin-left: 25px;
	}

	i2 {
		margin-left: 50px;
	}

	i3 {
		margin-left: 75px;
	}



/* 代码块 */

mio-code {
	position: relative;
	display: block;
	white-space: pre;
	counter-reset: counter-list;
	padding: 10px 10px 10px 0px;
	color: rgba(var(--t-b2), 0.6);
	background-color: rgba(var(--t-b), 0.05);
	border-radius: 5px;
	tab-size: 14;
	font-size: 14px;
	overflow-x: overlay;
	overflow-y: hidden;
	scrollbar-color: rgba(var(--t-b2), 0.3) transparent;
	scrollbar-width: thin;
}

	mio-code[type="normal"] > div {
		height: 24px;
	}

	mio-code[type="normal"] > div::before {
		content: counter(counter-list);
		counter-increment: counter-list;
		position: sticky;
		left: 0;
		width: 35px;
		display: inline-block;
		padding-right: 10px;
		margin-right: 10px;
		text-align: right;
		font-size: 14px;
		color: rgba(var(--t-b2), 0.2);
		border-right: 2px solid rgba(var(--t-c2), 0.2);
		backdrop-filter: blur(100px);
		pointer-events: none;
	}

	mio-code[type="simple"] {
		padding-left: 10px;
	}

	mio-code.limit {
		max-height: 600px;
		overflow: hidden;
	}

	mio-code > a {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 30px;
		line-height: 26px;
		text-align: center;
		background-color: transparent;
		backdrop-filter: blur(100px);
		cursor: pointer;
	}



/* 标题 */

h {
	display: block;
	color: rgba(var(--t-b2), 0.6);
	font-weight: bolder;
}

	h[type="1"] {
		font-size: 28px;
		height: 50px;
	}

	h[type="2"] {
		font-size: 20px;
		height: 35px;
	}

	h[type="3"] {
		font-size: 16px;
		height: 30px;
	}



/* 链接 */

.link {
	color: rgba(var(--t-c3), 1);
	text-decoration: underline;
	text-decoration-color: rgba(var(--t-c3), 0.4);
	cursor: pointer;
	transition: 0.3s;
	user-select: text !important;
}

	.link:hover {
		text-decoration-color: rgba(var(--t-c3), 1);
	}



/* 图像 */

mio-img {
	display: inline-block;
	border-radius: 5px;
	box-sizing: border-box;
	border: 1px solid rgba(var(--t-b2), 0.2);
	background-color: color-mix(in srgb, rgb(var(--t-w)) 95%, rgb(var(--t-b)) 5%);
	overflow: hidden;
	cursor: pointer;
}

	mio-img img {
		vertical-align: top;
		width: 100%;
		height: 100%;
		opacity: 0;
		pointer-events: none;
	}

	[theme="1"] mio-img[type="invert"] img {
		filter: invert(100%);
	}


/* 列表 */

list {
	display: block;
	color: rgba(var(--t-t1), 0.6);
	word-break: break-all;
	margin-left: 25px;
}

	list[type="1"]::before {
		content: "-";
		margin-right: 11px;
	}

	list[type="2"]::before {
		content: "•";
		margin-right: 13px;
	}

	list[type="1"]::before,
	list[type="2"]::before,
	list[type="3"]::before {
		margin-left: -20px;
		color: rgba(var(--t-t1), 0.4);
	}

	list[type="3-reset"] {
		margin-left: 0;
		counter-reset: counter-list;
	}

	list[type="3"] {
		counter-increment: counter-list;
	}

	list[type="3"]::before {
		content: counter(counter-list) ".";
		margin-right: 7px;
	}



/* 表格 */

table {
	border-collapse: collapse;
	border-bottom: 2px rgba(var(--t-b2), 0.4) solid;
	overflow: scroll;
	max-width: 100vh;
}

	thead tr th {
		min-width: 80px;
		text-align: center;
		border-top: 2px rgba(var(--t-b2), 0.4) solid;
		border-bottom: 2px rgba(var(--t-b2), 0.4) solid;
		color: rgba(var(--t-b2), 0.8);
		font-weight: bolder;
	}

	td, th {
		vertical-align: top;
		padding: 5px 10px;
		text-align: center;
		color: rgba(var(--t-b2), 0.6);
	}


/* 隐藏音乐标签 */
mio-music {
	position: relative;
	display: block;
	padding: 10px 15px;
	height: 140px;
	box-sizing: border-box;
	border: 1px solid rgba(var(--t-b2), 0.2);
	overflow: hidden;
	border-radius: 5px;
	background-color: rgba(var(--t-b2), 0.05);
	background-color: color-mix(in srgb, rgb(var(--t-w)) 95%, rgb(var(--t-b)) 5%);
	cursor: pointer;
	user-select: none;
	transition: 0.2s;
}

mio-music span {
	position: absolute;
	width: calc(100% - 144px);
	pointer-events: none;
}

mio-music div {
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	color: rgba(var(--t-b2), 0.6);
}

mio-music div:nth-of-type(1) {
	font-size: 22px;
}

mio-music div:nth-of-type(2) {
	opacity: 0.4;
}

mio-music img {
	position: absolute;
	top: -150px;
	right: 0;
	height: calc(100% + 300px);
	opacity: 0;
	filter: brightness(0.6);
	pointer-events: none;

	mask-image: linear-gradient(to left, #000, transparent);
	-webkit-mask-image: linear-gradient(to left, #000, transparent);
	mask-size: 100% 100%;
	mask-repeat: no-repeat;
}



/* 动画 */

@keyframes fade {
	0% {opacity: 0;}
	50% {opacity: 0;}
	100% {opacity: 1;}
}

.fade {
	animation: fade 1s ease-in;
	animation-fill-mode:forwards;
}






/* 响应式设计 */

/* PC */
@media (orientation: landscape) {
	.f-mb {
		display: none !important;
	}
}

/* phone */
@media (orientation: portrait) {
	.f-pc {
		display: none !important;
	}

	sp structure[background="grid"],
	body {
		background-size: 30px 30px;
		background-image: 
			linear-gradient(90deg, rgba(var(--t-b2), 0.02) 1px, transparent 1px),
			linear-gradient(0deg, rgba(var(--t-b2), 0.02) 1px, transparent 1px);
	}

	[theme="1"] body::before {
		filter: invert(1) opacity(0.3);
	}

	mp > .background {
		left: -45%;
	}

	mp > menu.list {
		width: 90%;
		padding: 0 12px 0 12px;
		background-color: rgba(var(--t-b1), 0.4);
		height: 100%;
		margin: 0;
		border-radius: 5px;
		backdrop-filter:  blur(10px);
	}

	mp > header {
		left: unset;
		right: 20px;
	}

	mp > .hint {
		width: unset;
		bottom: 10px;
		right: 10px;
		padding: 7px;
		backdrop-filter: blur(30px) brightness(0.9);
	}

	mp > prompt > .prompt {
		width: 90%;
	}

	mp > prompt > .prompt > div {
		padding: 10px 15px 10px 0px;
	}

	mp > menu.list > div:nth-of-type(2) {
		width: 100%;
	}

	mp > menu textarea {
		width: calc(100% - 50px);
	}

	sp > .blog-navi {
		display: none !important;
	}

	sp structure {
		width: 90% !important;
		padding: 120px 5% 120px 5% !important;
	}

	mio-music img {
		height: calc(100% + 20px);
		top: -10px;
	}
}



.f-no {
	user-select: none;
	pointer-events: none;
}



/* 夜间模式 */

[theme="1"] mp > .hint {
	background-color: rgba(var(--t-b), 0.2);
}
[theme="1"] mio-iframe {
	background-color: color-mix(in srgb, rgb(var(--t-b1)) 80%, rgb(var(--t-b2)) 20%);
}
[theme="1"] body::before,
[theme="1"] sp > .blog-navi::before,
[theme="1"] sp structure[background="sakura"]::before {
	opacity: 1;
}
[theme="1"] mp .card[data-type="1"] > img {
	filter: brightness(0.8);
}
[theme="1"] sp > .blog-navi,
[theme="1"] mio-img,
[theme="1"] mio-music {
	background-color: color-mix(in srgb, rgb(var(--t-w)) 25%, rgb(var(--t-b)) 75%);
}
[theme="1"] mio-code {
	background-color: rgba(var(--t-b), 0.2);
}
[theme="1"] mp > loading {
	backdrop-filter: blur(2px) brightness(0.7);
}
[theme="1"] h {
	color: rgba(var(--t-b2), 1) !important;
}
[theme="1"] .link {
	color: rgba(var(--t-c2), 1);
	text-decoration-color: rgba(var(--t-c2), 0.4);
}
[theme="1"] .link:hover {
	text-decoration-color: rgba(var(--t-c2), 1);
}