/******************** 暗主题 ********************/
:root {
/* 背景		*/ --bg: #000;
/* 文本		*/ --text: #FFF;
/* 透明背景	*/ --bg-trans: #222B;
/* 文本-红	*/ --text-r: #F66;
/* 文本-绿	*/ --text-g: #6F6;
/* 文本-蓝	*/ --text-b: #6CF;
/* 文本-黄	*/ --text-y: #FD4;
/* 次要文本	*/ --text-muted: #888;
/* 链接文本	*/ --link: #39F;
/* 控件背景	*/ --ctrl-bg: #223;
/* 控件文本	*/ --ctrl-text: #EEE;
/* 按钮文本	*/ --btn-text: #EEE;
/* 按钮背景1	*/ --btn-1: #444;
/* 按钮背景2	*/ --btn-2: #222;
/* 禁用		*/ --disabled: #444;
/* 边框		*/ --border: #555;
/* 聚焦		*/ --focus: #0BD;
/* 表头背景	*/ --th-bg: #555B;
/* 表格偶数行	*/ --row-even: #5553;
}
/******************** 亮主题 ********************/
[data-theme="light"] {
/* 背景		*/ --bg: #FFF;
/* 文本		*/ --text: #333;
/* 透明背景	*/ --bg-trans: #DDDB;
/* 文本-红	*/ --text-r: #C28;
/* 文本-绿	*/ --text-g: #2E7;
/* 文本-蓝	*/ --text-b: #159;
/* 文本-黄	*/ --text-y: #FA8;
/* 次要文本	*/ --text-muted: #666;
/* 链接文本	*/ --link: #19D;
/* 控件背景	*/ --ctrl-bg: #EEF;
/* 控件文本	*/ --ctrl-text: #222;
/* 按钮文本	*/ --btn-text: #111;
/* 按钮背景1	*/ --btn-1: #EEF;
/* 按钮背景2	*/ --btn-2: #CCC;
/* 禁用		*/ --disabled: #BBB;
/* 边框		*/ --border: #AAA;
/* 聚焦		*/ --focus: #09F;
/* 表头背景	*/ --th-bg: #AAAB;
/* 表格偶数行	*/ --row-even: #AAA3;
}
/******************** 全局&容器类 ********************/
*, *::before, *::after {
	font-family: Consolas, Menlo, sans-serif;
	box-sizing: border-box;
}
html, body {
	margin: 0;
	padding: 0;
	min-height: 100dvh;
}
body {
	padding-top: env(safe-area-inset-top);
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--bg);
	color: var(--text);
	overflow-x: hidden;
	touch-action: manipulation;
	-webkit-font-smoothing: antialiased;
	-webkit-touch-callout: none;
}
main {
	margin: 0 auto;
	padding: 20px;
	width: 100%;
	max-width: 1000px;
}
section {
	padding: 8px 0;
	width: 100%;
}
fieldset {
	display: flex;
	flex-wrap: wrap;
	margin: 8px 0;
	padding: 8px;
	width: 100%;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg-trans);
}
fieldset legend {
	font-weight: bold;
	padding: 0 12px;
	font-size: 1.1em;
}
details {
	margin: 8px 0;
	padding: 8px;
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg-trans);
}
details summary {
	font-weight: bold;
	cursor: pointer;
	padding: 0 12px;
	font-size: 1.1em;
}
hr {
	margin: 24px auto;
	max-width: 100%;
	border: none;
	border-top: 1px dashed var(--border);
}
progress, meter {
	width: -webkit-fill-available;
	width: stretch;
	height: 30px;
	margin: 0 8px;
}
/******************** 文本类 ********************/
h1, h2, h3, h4, h5, h6 {
	margin: 1em 0 0.8em 0;
	text-align: center;
}
p {
	margin: 8px;
	line-height: 1.5;
}
small {
	font-size: 0.5em;
}
small, .muted {
	color: var(--text-muted);
}
code {
	padding: 3px 8px;
	border: 1px solid var(--border);
	background: var(--bg-trans);
	font-size: 0.9em;
	white-space: break-spaces;
}
pre {
	overflow-x: auto;
	line-height: 1;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: break-word;
	tab-size: 4;
}
a {
	color: var(--link);
	text-decoration: none;
}
ul, ol {
	margin: 8px 0;
	padding-left: 2em;
	column-gap: 3em;
}
li {
	line-height: 1.2;
}
li::marker {
	color: var(--text-muted);
	font-size: 0.7em;
}
/******************** 表格类 ********************/
table {
	margin: 16px auto;
	width: 96%;
	border-collapse: collapse;
	border: 1px solid var(--border);
}
caption {
	margin: 4px 0;
	font-weight: bold;
	font-size: 1.1rem;
}
th, td {
	padding: 8px 12px;
	border: 1px solid var(--border);
}
th {
	background: var(--th-bg);
	text-align: center;
	font-weight: bold;
}
tr:nth-child(even) {
	background: var(--tr-even);
}
/******************** 媒体类 ********************/
img, video, canvas {
	max-width: 100%;
	height: auto;
	display: block;
}
figure img, figure svg {
	object-fit: contain;
}
/******************** 表单类 ********************/
input, textarea, select, button, .btn {
	margin: 8px 4px;
	padding: 12px 16px;
	border: 2px solid var(--border);
	border-radius: 8px;
	font-size: 1.2rem;
}
input, textarea, select {
	background: var(--ctrl-bg);
	color: var(--ctrl-text);
}
input[type="text"], textarea {
	width: -webkit-fill-available;
	width: stretch;
}
textarea {
	min-height: 100px;
	resize: vertical;
}
/* 按钮 */
button, .btn {
	font-weight: bold;
	background: linear-gradient(180deg, var(--btn-1), var(--btn-2));
	color: var(--btn-text);
	text-align: center;
	text-decoration: none;
	white-space: pre-wrap;
	word-break: break-word;
	cursor: pointer;
	transition: all 0.14s ease-out;
	-webkit-tap-highlight-color: transparent;
}
/* 单选、复选 */
input[type="checkbox"], input[type="radio"] {
	width: 1.2rem;
	height: 1.2rem;
	accent-color: var(--focus);
	vertical-align: middle;
}
input[type="checkbox"] + label, input[type="radio"] + label {
	vertical-align: middle;
	cursor: pointer;
}
label input[type="checkbox"], label input[type="radio"] {
	margin: 8px 0 8px 20px;
	vertical-align: middle;
}
/* 交互事件 */
button:hover, .btn:hover {
	background: var(--border);
}
input:hover, textarea:hover, select:hover {
	outline: 2px solid var(--text);
}
button:active, .btn:active {
	transform: scale(0.9);
	transition: all 0.05s ease-out;
}
input:focus, textarea:focus, select:focus, button:focus, .btn:focus {
	outline: 2px solid var(--focus);
}
[disabled], [disabled]:hover, [disabled]:active {
	opacity: 0.45;
	filter: grayscale(0.6);
	cursor: not-allowed;
	pointer-events: none;
	background: var(--disabled);
}
/* 按钮组容器 */
.btnGrp {
	margin: 8px 4px;
	padding: -2px;
	background: linear-gradient(180deg, var(--btn-1), var(--btn-2));
	border: 2px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-wrap: wrap;
	gap: 0px;
}
.btnGrp button, .btnGrp .btn {
	flex: 1 auto;
	min-width: 44px;
	max-width: 100%;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-width: 1px;
	border-radius: 0;
}
/* 选项组容器 */
.optGrp {
	display: flex;
	flex-wrap: wrap;
}
.optGrp input[type="checkbox"], .optGrp input[type="radio"] {
	display: none;
}
.optGrp input:checked + .btn {
	outline: 2px solid var(--focus);
}
.optGrp input:disabled + .btn {
	opacity: 0.45;
	filter: grayscale(0.6);
	cursor: not-allowed;
	pointer-events: none;
	background: var(--disabled);
}
/******************** id类 ********************/
.sys-btn {
	position: absolute;
	top: 20px;
	width: 32px;
	height: 32px;
	border: none;
	cursor: pointer;
	background-position: center;
	background-size: contain;
	background-repeat: no-repeat;
}
#btn-home {
	left: 20px;
	background: url('/img/btn-home.svg');
}
#btn-darkmode {
	right: 20px;
	background: url('/img/btn-darkmode.svg');
}
/******************** class类 ********************/
.col { display: flex; flex-direction: column; }
.row { display: flex; flex-direction: row; flex-wrap: wrap; }
.center { display: flex; justify-content: center; align-items: center; }
.a-s { align-content: flex-start; }
.a-c { align-content: center; }
.a-e { align-content: flex-end; }
.j-s { justify-content: flex-start; }
.j-c { justify-content: center; }
.j-e { justify-content: flex-end; }
.i-s { align-items: flex-start; }
.i-c { align-items: center; }
.i-e { align-items: flex-end; }
.fill { width: -webkit-fill-available; width: stretch; }
/******************** 响应式 ********************/
@media (max-width: 500px) {
	.mobile-hidden { display: none; }
}
