:root {
	--bg-1: #0c1410;
	--bg-2: #12261a;
	--panel: #1b2d21;
	--panel-border: #3a6148;
	--text-main: #e9f6ea;
	--text-sub: #a3c4a9;
	--accent: #9bf75b;
	--accent-2: #d4ff75;
}
* {
	box-sizing: border-box;
}
html {
	min-height: 100vh;
}
body {
	margin: 0;
	padding: 12px;
	font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
	color: var(--text-main);
	background: radial-gradient(circle at 20% 0, #1e3a2a 0, transparent 40%),
	radial-gradient(circle at 100% 20%, #21452f 0, transparent 35%),
	linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.page {
	max-width: 900px;
	margin: 0 auto;
}
.title-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	position: relative;
	background: linear-gradient(180deg, #2e5139, #1b2f21);
	border: 1px solid var(--panel-border);
	border-radius: 14px;
	padding: 10px 14px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 2px;
	color: var(--accent-2);
	text-shadow: 0 0 10px rgba(155, 247, 91, 0.35);
}
.panel {
	margin-top: 12px;
	background: rgba(19, 35, 25, 0.92);
	border: 1px solid var(--panel-border);
	border-radius: 14px;
	padding: 12px;
}
.panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	margin: -12px -12px 10px;
	padding: 9px 12px;
	border-bottom: 1px solid rgba(116, 163, 128, 0.25);
	background: #1c3224;
	color: #cce79a;
	border-radius: 14px 14px 0 0;
}
.part-grid {
	display: grid;
	grid-template-columns: auto 1fr auto 1fr;
	gap: 8px;
	align-items: center;
}
.part-grid .head {
	font-size: 13px;
	color: #b8d8bf;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 6px;
}
.head-reset-btn {
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	border: 1px solid #5f825f;
	background: #1a2f20;
	color: #d7edd8;
	font-size: 12px;
	cursor: pointer;
	white-space: nowrap;
}
.head-reset-btn:hover {
	filter: brightness(1.08);
}
.part-label {
	font-weight: 700;
	color: #d8ff9f;
}
.part-select {
	height: 36px;
	border-radius: 10px;
	border: 1px solid #436d52;
	background: #101f16 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23d8ff9f' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 6px center / 12px;
	color: #d8ff9f;
	padding: 0 24px 0 6px;
	font-size: 13px;
	font-weight: 700;
	width: 100%;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
.part-select:focus {
	outline: none;
	border-color: var(--accent);
}
.input-field {
	height: 36px;
	border-radius: 10px;
	border: 1px solid #436d52;
	background: #101f16;
	color: #f2fff5;
	padding: 0 10px;
	font-size: 15px;
	width: 100%;
}
.sync-head {
	justify-content: center;
	text-align: center;
}
.sync-buttons {
	display: flex;
	gap: 6px;
}
.sync-buttons > button {
	flex: none;
	height: 30px;
	width: 30px;
	border-radius: 50%;
	border: 1px solid #5f825f;
	padding: 0;
	background: #1a2f20;
	color: #d7edd8;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	justify-self: center;
}
.sync-buttons > button:hover {
	filter: brightness(1.08);
}
.reset-btn {
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid #5f825f;
	background: #1a2f20;
	color: #d7edd8;
	cursor: pointer;
}
.reset-btn:hover {
	filter: brightness(1.08);
}
.coin-stock-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-top: 10px;
}
.coin-stock-item {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 6px;
}
.coin-row-reset-btn {
	width: 36px;
	height: 36px;
	align-self: flex-end;
	flex-shrink: 0;
	border-radius: 10px;
	border: 1px solid #5f825f;
	background: #1a2f20;
	color: #d7edd8;
	cursor: pointer;
	position: relative;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 18px;
}
.coin-row-reset-btn:hover {
	filter: brightness(1.08);
}
.coin-stock-label {
	font-size: 12px;
	color: #b8d8bf;
	font-weight: 700;
}
.collapsible-panel {
	margin-top: 10px;
	border-radius: 12px;
	border: 1px solid #436d52;
	background: #16291d;
	overflow: hidden;
}
.collapsible-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	cursor: pointer;
	user-select: none;
	font-size: 14px;
	font-weight: 700;
	color: #d8ff9f;
	transition: background 0.2s;
}
.collapsible-header:hover {
	background: #1c3224;
}
.collapsible-icon {
	transition: transform 0.2s;
	font-size: 12px;
	color: #b8d8bf;
}
.collapsible-panel.expanded .collapsible-icon {
	transform: rotate(90deg);
}
.collapsible-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.2s, padding 0.2s;
	padding: 0 12px;
	interpolate-size: allow-keywords;
}
.collapsible-panel.expanded .collapsible-content {
	max-height: fit-content;
	padding: 0 12px 12px;
}
.tips {
	margin: 0;
	font-size: 13px;
	color: var(--text-sub);
	line-height: 1.45;
}
.tips + .tips {
	margin-top: 4px;
}
.summary-layout {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.summary-badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: 10px 0;
	flex: 1;
}
.share-qr {
	margin-top: 0;
	padding: 6px;
	border: 1px solid #466d55;
	border-radius: 8px;
	background: #14261b;
}
.share-qr canvas {
	display: block;
	width: 92px;
	height: 92px;
}
.coin-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 13px;
	border: 1px solid #466d55;
	background: #14261b;
	color: #d6ebd8;
}
.coin-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: inline-block;
	flex: none;
}
.coin-dot.copper { background: radial-gradient(circle at 30% 30%, #ffd4b6, #c17743 70%); }
.coin-dot.silver { background: radial-gradient(circle at 30% 30%, #ffffff, #9ea4ae 70%); }
.coin-dot.gold { background: radial-gradient(circle at 30% 30%, #fff4b2, #e0a325 70%); }
.coin-dot.rainbow { background: conic-gradient(#ff6aa0, #ffd05c, #7dff7d, #70cfff, #b18cff, #ff6aa0); }
#output {
	display: block;
}
.result-table {
	border: 1px solid #4a7357;
	border-radius: 12px;
	overflow: hidden;
	background: #142419;
}
.result-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 10px;
	padding: 10px 12px;
	align-items: center;
	border-bottom: 1px solid rgba(116, 163, 128, 0.2);
}
.result-row:last-child { border-bottom: none; }
.result-header {
	font-weight: 700;
	background: #1c3224;
	color: #cce79a;
}
.result-total {
	font-weight: 700;
	background: linear-gradient(90deg, #284936, #2f5a3f);
	color: #f0ffd2;
}
.result-empty {
	color: var(--text-sub);
	padding: 8px 2px;
}
.validation-warning {
	margin-top: 12px;
	padding: 0;
	border-radius: 14px;
}
.validation-warning:empty {
	display: none;
}
.validation-warning .warn-item {
	padding: 10px 14px;
	background: rgba(255, 204, 0, 0.1);
	border: 1px solid rgba(255, 204, 0, 0.35);
	border-radius: 10px;
	color: #ffcc00;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}
.metric {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.metric .coin-dot {
	width: 12px;
	height: 12px;
}
.metric-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.material-summary {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	padding: 10px 12px;
	border-top: 1px solid rgba(116, 163, 128, 0.25);
}
/* 工具合集页 */
.nav-link {
	font-size: 13px;
	color: var(--text-sub);
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid var(--panel-border);
	border-radius: 999px;
	padding: 2px 10px;
	transition: color 0.2s, border-color 0.2s;
	position: absolute;
	right: 14px;
}
.nav-link:hover {
	color: var(--accent);
	border-color: var(--accent);
}
.tool-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.info-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
}
.info-label {
	flex: none;
	font-size: 13px;
	color: var(--text-sub);
	font-weight: 700;
	min-width: 4.5em;
	text-align: end;
}
.info-value {
	font-size: 14px;
	color: var(--text-main);
	line-height: 1.5;
}
.info-link {
	font-size: 14px;
	color: var(--accent);
	text-decoration: none;
}
.info-link:hover {
	text-decoration: underline;
}
.download-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border: 1px solid var(--panel-border);
	border-radius: 8px;
	background: rgba(19, 35, 25, 0.92);
}
.download-link:hover {
	border-color: var(--accent);
	text-decoration: none;
}
@media (max-width: 680px) {
	body { padding: 10px; }
	.title-bar { font-size: 20px; }
	.part-grid {
		grid-template-columns: auto 1fr auto 1fr;
		gap: 6px;
	}
	.part-grid .head {
		font-size: 12px;
	}
	.input-field {
		height: 34px;
		font-size: 14px;
		padding: 0 8px;
	}
	.coin-row-reset-btn {
		width: 34px;
		height: 34px;
	}
	.result-row {
		grid-template-columns: 1fr;
		gap: 4px;
		padding: 10px;
	}
	.result-header { display: none; }
}
