* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

 body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }
		
		 /* 电脑和平板最大宽度适配 */
		 			body {
		 				max-width: 100%;
		 				margin: 0 auto;
		 				background-color: #f5f5f5;
		 			}
		 			
		 			/* 平板适配 */
		 			@media screen and (min-width: 769px) and (max-width: 1024px) {
		 				body {
		 					max-width: 90%;
		 				}
		 				
		 				.container {
		 					padding: 20px 0;
		 				}
		 			}
		 			
		 			/* 桌面端适配 */
		 			@media screen and (min-width: 1025px) {
		 				body {
		 					max-width: 1200px;
		 					box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
		 					min-height: 100vh;
		 				}
		 				
		 				.container {
		 					padding: 30px 0;
		 				}
		 			}
		 			
		 			/* 大屏幕适配 */
		 			@media screen and (min-width: 1440px) {
		 				body {
		 					max-width: 1400px;
		 				}
		 			}
		        

header {
	text-align: center;
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	color: white;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
	font-size: 2.2rem;
	margin-bottom: 10px;
}

.subtitle {
	font-size: 1.1rem;
	opacity: 0.9;
}

.container {
	display: flex;
	flex-direction: column;
	gap: 30px;
    padding-bottom: 120px;
    /* 允许页面内容滑动 */
    overflow-x: hidden;
}

/* 错误提示样式 */
.update-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

.retry-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 8px;
    cursor: pointer;
}

.retry-button:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* 底部导航栏样式 - 修复网页端闪烁版本 */
.bottom-menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    width: 60%;
    max-width: 1000px;
    font-size: 1.4em;
    padding: 0 1.5em;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    height: 80px;
}

.menu__item {
    all: unset;
    flex-grow: 1;
    z-index: 100;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 0.5em 0;
    transition: all var(--duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-decoration: none;
    transform: translate3d(0, 0, 0) scale(1);
    /* 去除焦点轮廓 */
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.menu__item:focus {
    outline: none !important;
}

.menu__item::before {
    content: "";
    z-index: -1;
    width: 3.7em;
    height: 3.7em;
    border-radius: 50%;
    position: absolute;
    transform: scale(0);
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    transition: transform var(--duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 1; /* 确保初始透明度为1 */
}

/* 初始隐藏类 - 防止网页端闪烁 */
.menu__item.initial-hide::before {
    opacity: 0 !important;
    transition: none !important;
}

/* 激活状态动画 - 从下到上、从小到大的缩放显示 */
.menu__item.active {
    transform: translate3d(0, -0.65em, 0) scale(1);
    animation: activeItemScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes activeItemScale {
    0% {
        transform: translate3d(0, 0, 0) scale(0.6);
        opacity: 0.2;
    }
    100% {
        transform: translate3d(0, -0.65em, 0) scale(1);
        opacity: 1;
    }
}

/* 上一个激活项的消失动画 - 从上到下、从大到小的缩放消失 */
.menu__item.previous-active {
    animation: previousActiveItemScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes previousActiveItemScale {
    0% {
        transform: translate3d(0, -0.65em, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(0.6);
        opacity: 0;
    }
}

.menu__item.active::before {
    transform: scale(1);
    animation: activeBeforeScale 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes activeBeforeScale {
    0% {
        transform: scale(0.5);
    }
    100% {
        transform: scale(1);
    }
}

/* 上一个激活项的背景消失动画 */
.menu__item.previous-active::before {
    animation: previousActiveBeforeScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes previousActiveBeforeScale {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

.menu__text {
    font-size: 0.4em;
    margin-top: 0.2em;
    color: #666;
    transition: all var(--duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 500;
    transform: scale(1);
    /* 防止文字被选中 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.menu__item.active .menu__text {
    color: #fff;
    font-weight: 600;
    animation: activeTextScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes activeTextScale {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 上一个激活项的文字消失动画 */
.menu__item.previous-active .menu__text {
    animation: previousActiveTextScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes previousActiveTextScale {
    0% {
        transform: scale(1);
        opacity: 1;
        color: #fff;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
        color: #666;
    }
}

.icon {
    margin-top: 0.3em;
    width: 1.5em;
    height: 1.5em;
    stroke: #666;
    fill: transparent;
    stroke-width: 1.4pt;
    stroke-miterlimit: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    transition: all var(--duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(1);
}

.menu__item.active .icon {
    stroke: #fff;
    animation: strok 1.5s reverse, activeIconScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes activeIconScale {
    0% {
        transform: scale(0.7);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 上一个激活项的图标消失动画 */
.menu__item.previous-active .icon {
    animation: previousActiveIconScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes previousActiveIconScale {
    0% {
        transform: scale(1);
        opacity: 1;
        stroke: #fff;
    }
    100% {
        transform: scale(0.7);
        opacity: 0;
        stroke: #666;
    }
}

.menu__border {
    left: 0;
    bottom: 99%;
    width: 7em;
    height: 1.5em;
    position: absolute;
    clip-path: url(#menu);
    background-color: white;
    transition: transform var(--duration) cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.2s ease;
    opacity: 1; /* 确保初始透明度为1 */
}

.svg-container {
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

/* 动画关键帧 */
@keyframes strok {
    100% {
        stroke-dashoffset: 400;
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .bottom-menu {
        width: 95%;
        font-size: 1.2em;
        height: 65px;
        bottom: 15px;
    }
	.menu__border {
	    width: 7.25em;
	    height: 1.6em;
	}
    
    .menu__text {
        font-size: 0.45em;
    }
}

@media screen and (max-width: 480px) {
    .bottom-menu {
        font-size: 1em;
        height: 60px;
        padding: 0 1em;
    }
    
    .menu__text {
        font-size: 0.4em;
    }
}

/* 平板适配 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .bottom-menu {
        max-width: 450px;
        font-size: 1.3em;
    }
	.menu__border {
	    width: 7.5em;
	    height: 1.8em;
	}
}

/* 桌面端适配 */
@media screen and (min-width: 1025px) {
    .bottom-menu {
        max-width: 350px;
        font-size: 1.2em;
    }
	.menu__border {
	    width: 7.5em;
	    height: 1.8em;
	}
}










.card {
	background: white;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-title {
	font-size: 1.4rem;
	margin-bottom: 15px;
	color: #2c3e50;
	border-bottom: 2px solid #f0f2f5;
	padding-bottom: 10px;
}

.upload-btn {
	background: linear-gradient(135deg, #410ce0 0%, #7819e5 100%);
	color: white;
	border: none;
	padding: 14px 25px;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
	margin-top: 10px;
	display: inline-block;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

.upload-btn:hover {
	background-color: #260c8f;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-preview {
	display: none max-width: 0;
	max-height: 0;
}

.settings-grid {
	display: grid;
	grid-template-columns: 0.4fr 1fr;
	gap: 20px;
}

@media (max-width: 760px) {
	.settings-grid {
		grid-template-columns: 1fr;
	}
}

.grid-inputs {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
	flex-wrap: nowrap;
	/* 防止换行 */
}

.grid-input {
	flex: 1;
	min-width: 120px;
}


/* 移动端优化 - 但保持同行显示 */
@media (max-width: 768px) {
	.grid-inputs {
		flex-direction: row;
		/* 保持横向排列 */
		flex-wrap: nowrap;
		/* 防止换行 */
	}

	.grid-input {
		min-width: 80px;
		/* 减小最小宽度以适应小屏幕 */
	}

	.grid-input:first-child {
		margin-right: 7.5px;
	}

	.grid-input:last-child {
		margin-left: 7.5px;
	}

}

/* 修复移动端数字输入框箭头显示问题 */
@media (max-width: 768px) {
	.grid-number-input {
		/* 确保在移动端始终显示数字输入的上下箭头 */
		-moz-appearance: textfield;
		appearance: textfield;
	}

	.grid-number-input::-webkit-outer-spin-button,
	.grid-number-input::-webkit-inner-spin-button {
		-webkit-appearance: inner-spin-button;
		appearance: inner-spin-button;
		opacity: 1;
		display: block;
	}

	/* 针对Firefox浏览器 */
	.grid-number-input::-moz-number-spin-box {
		display: block;
	}

	.grid-number-input:focus::-webkit-outer-spin-button,
	.grid-number-input:focus::-webkit-inner-spin-button {
		opacity: 1;
	}
}

label {
	display: block;
	margin-bottom: 5px;
	font-weight: 550;
	color: #2c3e50;
}

input,
select {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 1rem;
	transition: border 0.3s;
}

input:focus,
select:focus {
	border-color: #6a11cb;
	outline: none;
	box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}

.toggle-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 8px 0;
	gap: 10px;
}

.toggle-container2 {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	align-self: flex-start;
	margin: -10px 10px;
	margin-bottom: 10px;
	gap: 10px;
}

.toggle-label {
	color: #2c3e50;
	padding-bottom: 8px;
}

.toggle-switch {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 24px;
}

.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: .4s;
	border-radius: 24px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	transition: .4s;
	border-radius: 50%;
}

input:checked+.slider {
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

input:checked+.slider:before {
	transform: translateX(26px);
}

/* 添加画布拖拽相关样式 */
.canvas-container {
	width: 100%;
	overflow: hidden;
	border: 1px solid #eee;
	border-radius: 8px;
	margin-bottom: 15px;
	background-color: #f9f9f9;
	padding: 10px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	position: relative;
	touch-action: none;
	/* 禁用默认触摸行为以支持 pinch-zoom */
	cursor: grab;
}

.canvas-container.dragging {
	cursor: grabbing;
}

.canvas-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	transform-origin: center center;
	transition: transform 0.1s ease;
}

/* 画布缩放控制按钮样式 */
.zoom-controls {
	position: absolute;
	top: 15px;
	right: 15px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 1001;
	/* 确保在最上层显示 */
	pointer-events: none;
	/* 防止遮挡画布交互 */
}

.zoom-btn {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.8);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 18px;
	font-weight: bold;
	color: #333;
	transition: all 0.2s ease;
	user-select: none;
	pointer-events: auto;
	/* 允许按钮交互 */
}

.zoom-btn:hover {
	background: rgba(255, 255, 255, 0.8);
	transform: scale(1.1);
}

.zoom-btn:active {
	transform: scale(0.95);
}

/* 缩放级别显示 */
.zoom-level {
	background: rgba(255, 255, 255, 0.8);
	color: rgb(0, 0, 0);
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	text-align: center;
	min-width: 50px;
	pointer-events: auto;
}

/* 重置按钮样式 */
.reset-view-btn {
	position: absolute;
	bottom: 15px;
	right: 15px;
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.8);
	border: none;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	font-size: 12px;
	color: #333;
	transition: all 0.2s ease;
	z-index: 1001;
	pointer-events: auto;
}

.reset-view-btn:hover {
	background: rgba(255, 255, 255, 1);
	transform: scale(1.05);
}

.reset-view-btn:active {
	transform: scale(0.95);
}

/* 电脑端拖动提示 */
.desktop-drag-tip {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.8);
	color: white;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	text-align: center;
	z-index: 1002;
	display: none;
	pointer-events: none;
	backdrop-filter: blur(4px);
}

.desktop-drag-tip.show {
	display: block;
}

@media (min-width: 769px) {
	.desktop-drag-tip {
		font-size: 14px;
		padding: 12px 16px;
	}
}

/* 移动端提示 */
.mobile-zoom-tip {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.8);
	color: white;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	text-align: center;
	z-index: 1002;
	display: none;
	pointer-events: none;
	backdrop-filter: blur(4px);
}

.mobile-zoom-tip.show {
	display: block;
}

@media (max-width: 768px) {
	.zoom-controls {
		top: 10px;
		right: 10px;
	}

	.zoom-btn {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.reset-view-btn {
		bottom: 10px;
		right: 10px;
		padding: 5px 10px;
		font-size: 11px;
	}

	.mobile-zoom-tip {
		font-size: 12px;
		padding: 10px 14px;
		max-width: 80%;
	}
}

/* 拖拽提示 */
.drag-tip {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 10px 15px;
	border-radius: 6px;
	font-size: 14px;
	text-align: center;
	z-index: 20;
	display: none;
}

.drag-tip.show {
	display: block;
}

@media (max-width: 768px) {
	.drag-tip {
		font-size: 12px;
		padding: 8px 12px;
	}
}

/* 隐藏canvas-container的类 */
.canvas-container.hidden {
	display: none !important;
}

/* 隐藏header的类 */
header.hidden {
	display: none !important;
}

/* 手机端固定到顶部，原位置不显示 */
@media (max-width: 768px) {
	.canvas-container:not(.hidden) {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1000;
		margin: 0;
		padding: 10px;
		border-radius: 0;
		border-left: none;
		border-right: none;
		border-top: none;
		max-height: 35vh;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	}
}

canvas {
	display: block;
	margin: 0 auto;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	/* 添加以下样式 */
	max-width: 100%;
	height: auto;
	image-rendering: -moz-crisp-edges;
	/* Firefox */
	image-rendering: -webkit-optimize-contrast;
	/* Safari */
	image-rendering: pixelated;
	/* Chrome */
	image-rendering: crisp-edges;
	/* Standard */
}

.stats-container {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 20px;
}

@media (max-width: 768px) {
	.stats-container {
		grid-template-columns: 1fr;
	}
}

.stat-card {
	background: white;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-title {
	font-size: 1.2rem;
	margin-bottom: 15px;
	color: #2c3e50;
	text-align: center;
	padding-bottom: 10px;
	border-bottom: 1px solid #f0f2f5;
}

.bead-count {
	font-size: 2.5rem;
	font-weight: 700;
	text-align: center;
	color: #6a11cb;
}

:root {
	--bg-color: #f8f9fa;
	--border-color: #e9ecef;
	--swatch-border-color: #ddd;
	--text-color: #2c3e50;
	--count-color: #6a11cb;
}



.crop-preview-dialog .dialog-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 15px 20px;
	background: #f8f9fa;
	border-top: 1px solid #dee2e6;
}

.crop-preview-dialog .btn {
	padding: 8px 16px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	transition: all 0.2s;
}

.crop-preview-dialog .btn-primary {
	background: #6a11cb;
	color: white;
}

.crop-preview-dialog .btn-primary:hover {
	background: #5a0db3;
}

.crop-preview-dialog .btn-secondary {
	background: #6c757d;
	color: white;
}

.crop-preview-dialog .btn-secondary:hover {
	background: #5a6268;
}

/* 桌面端拖拽提示 */
.desktop-drag-tip {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 0.8rem;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.desktop-drag-tip.show {
	opacity: 1;
}

/* 背景色相关样式 */
.background-section {
	grid-column: 1 / -1;
	margin-bottom: 15px;
	padding: 8px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e9ecef;
	box-sizing: border-box;
}

.background-section h4 {
	margin-bottom: 10px;
	color: #6c757d;
	font-size: 0.9rem;
}

.background-colors {
	display: flex;
	flex-wrap: wrap;
	gap: 1px;
	margin-bottom: 10px;
}

.background-color-item {
	display: flex;
	align-items: center;
	padding: 2px;
	border-radius: 6px;
	background-color: white;
	border: 2px solid transparent;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 60px;
}

.background-color-item:hover {
	border-color: #6a11cb;
	transform: translateY(-2px);
	box-shadow: 0 2px 8px rgba(106, 17, 203, 0.2);
}


.background-color-item .color-swatch {
	width: 31px;
	height: 31px;
	justify-content: center;
}

.background-color-item .color-name {
	font-weight: 600;
	color: #2c3e50;
	font-size: 0.9rem;
}

.canvas-selecting-background:hover {
	box-shadow: 0 0 0 2px #6a11cb;
}

@media screen and (max-width: 768px) {
	.background-section {
		transform: scale(0.9);
		transform-origin: top center;
	}
}

@media screen and (max-width: 480px) {
	.background-section {
		transform: scale(0.85);
		transform-origin: top center;
	}
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
	.background-section {
		margin: 0 0 15px 0;
		width: 100%;
	}
}

.colors-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
	gap: 0px;
	max-height: 480px;
	overflow-y: auto;
}

.color-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(71px, 1fr));
	margin: -4px;
	overflow-x: auto;
}

.color-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px;
	border-radius: 6px;
	background-color: var(--bg-color);
	border: 1px solid var(--border-color);
}

.color-swatch {
	width: 31px;
	height: 31px;
	border-radius: 3px;
	margin-bottom: 6px;
	border: 1px solid var(--swatch-border-color);
	will-change: background-color;
}

.color-name {
	font-weight: 600;
	color: var(--text-color);
	font-size: 0.9rem;
}

.color-count {
	color: var(--count-color);
	font-weight: 600;
	font-size: 0.95rem;
}

.loading {
	display: none;
	text-align: center;
	padding: 10px;
}

.spinner {
	border: 4px solid rgba(255, 255, 255, 0.329);
	border-radius: 50%;
	border-top: 4px solid #fca0ff;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

footer {
	text-align: center;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid #eee;
	color: #7f8c8d;
	font-size: 0.9rem;
}

.setting-group {
	margin-bottom: 22px;
	border: 1.5px solid #d5d5d5;
	/* 添加描边 */
	padding: 10px;
	border-radius: 10px;
}

.setting-group h3 {
	margin-bottom: 12px;
	color: #333;
	border-bottom: 1px solid #d5d5d5;
	padding-bottom: 6px;
}

.input-row input,
.input-row select {
	padding: 7px 16px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 1rem;
}

.input-row input[type="number"] {
	text-align: center;
}

.input-row {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
	gap: 10px;
	font-size: 1rem;
}

.input-row label {
	min-width: 120px;
	font-weight: 500;
	font-size: 1rem;
}

.slider-container {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.slider-container input[type="range"] {
	flex: 1;
}

.slider-value {
	min-width: 30px;
	text-align: center;
	font-weight: bold;
}

.color-picker {
	display: flex;
	align-items: center;
	gap: 2px;
}

.color-picker input[type="color"] {
	position: absolute;
	width: 0;
	height: 0;
	padding: 0;
	margin: 0;
	border: none;
	opacity: 0;
	pointer-events: none;
	/* 禁用输入框本身的点击事件 */
}

.color-preview {
	width: 30px;
	height: 30px;
	border-radius: 5px;
	border: 1px solid #ddd;
	background-color: #ff0000;
	cursor: pointer;
	/* 添加手指光标表示可点击 */
}

.control-buttons {
	display: flex;
	justify-content: center;
	gap: 15px;
	margin-top: 20px;
}

.save-btn-container {
	margin-bottom: 15px;
	text-align: right;
}

@media (max-width: 768px) {
	.input-row {
		flex-direction: row;
		align-items: center;
	}

	.input-row label {
		min-width: auto;
		margin-bottom: 0;
		flex-shrink: 0;
		font-size: 0.9rem;
		width: 80px;
		/* 固定标签宽度 */
	}

	.slider-container,
	.color-picker {
		flex: 1;
		justify-content: flex-end;
		/* 右对齐 */
	}

	.save-btn-container {
		text-align: center;
	}
}

/* 颜色选项菜单样式 ___________________*/

.color-options-menu {
	background: var(--color-bg-primary, white);
	border: 1px solid var(--color-border-default, #ddd);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	min-width: 180px;
	overflow: hidden;
}

.color-options-header {
	justify-content: flex-end;
	align-items: center;
	background: var(--color-bg-secondary, #f5f7fa00);
	border-bottom: 1px solid var(--color-border-light, #eeeeee00);
	height: 0;
}

.close-options {

	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: var(--color-text-muted, #66666600);
	outline: none;
	/* 建议补充 focus 样式 */
}

.close-options:focus,
.close-options:hover {
	color: var(--color-text-primary, #333);
}

.color-options-content {
	padding: 5px 0;
}

.option-btn {
	display: block;
	width: 100%;
	padding: 8px 15px;
	background: none;
	border: none;
	text-align: left;
	cursor: pointer;
	font-size: 14px;
	color: var(--color-text-primary, #333);
	outline: none;
}

.option-btn:hover,
.option-btn:focus {
	background: var(--color-bg-hover, #f0f2f5);
}

.option-btn:active {
	background: var(--color-bg-active, #e4e7eb);
}


/* 替换颜色对话框样式 */
.replace-color-dialog {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 150px;
	z-index: 1001;
}

.replace-color-dialog .dialog-content {
	background: white;
	border-radius: 12px;
	width: 90%;
	max-width: 500px;
	max-height: 51vh;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px;
	background: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
}

.close-dialog {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
}

.dialog-body {
	padding: 20px;
	max-height: 480px;
}

.search-section {
	margin-bottom: 15px;
}

.search-input {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}


.color-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10px;
	border: 1px solid #eee;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
}

.color-option:hover {
	background: #f8f9fa;
	border-color: #6a11cb;
}

.color-option .color-swatch {
	width: 30px;
	height: 30px;
	border-radius: 4px;
	margin-bottom: 5px;
	border: 1px solid #ddd;
}

.color-option .color-name {
	font-size: 12px;
	font-weight: 600;
	color: #333;
}

/* 颜色选项选中状态 */
.color-option.selected {
	border: 2px solid #6a11cb;
	transform: scale(1.1);
	box-shadow: 0 4px 8px rgba(106, 17, 203, 0.3);
}

/* 对话框操作按钮 */
.dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}


/* 颜色列表样式调整 */
.background-section,
.main-colors-section {
	margin-bottom: 20px;
}

.background-section h4,
.main-colors-section h4 {
	display: flex;
	margin-bottom: 8px;
	color: #666;
	font-size: 18px;
	border-bottom: 1px solid #eee;
	padding-top: 5px;
}

.color-item {
	display: flex;
	align-items: center;
	padding: 8px;
	border-radius: 6px;
	background-color: white;
	border: 2px solid transparent;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 70px;
	cursor: pointer;
}

.color-item:hover {
	border-color: #6a11cb;
	transform: translateY(-0.2px);
	box-shadow: 0 2px 8px rgba(106, 17, 203, 0.2);
}

.setting-group {
	margin-bottom: 22px;
	border: 1.5px solid #d5d5d5;
	padding: 10px;
	border-radius: 10px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.setting-group.collapsed {
	padding: 5px 10px;
}

.setting-group h3 {
	margin-bottom: 12px;
	color: #333;
	border-bottom: 1px solid #d5d5d5;
	padding-bottom: 6px;
	cursor: pointer;
	user-select: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.setting-group.collapsed h3 {
	margin-bottom: 0;
	border-bottom: none;
}

.setting-group .toggle-icon {
	transition: transform 0.3s ease;
}

.setting-group.collapsed .toggle-icon {
	transform: rotate(180deg);
}

.setting-group .group-content {
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
	opacity: 1;
}

.setting-group.collapsed .group-content {
	max-height: 0 !important;
	opacity: 0;
}

/* 确保内容区域在折叠时不会显示滚动条 */
.setting-group.collapsed .group-content::-webkit-scrollbar {
	display: none;
}


/* 修改消息弹窗样式 */
.toast-message {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(135deg, rgba(106, 17, 203, 0.9) 40%, rgba(37, 117, 252, 0.9) 100%);
	color: white;
	padding: 12px 16px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1020;
	max-width: 100%;
	width: auto;
	text-align: center;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	will-change: opacity, transform;
}

/* 显示时的动画 */
.toast-message.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* 初始状态 slightly below */
.toast-message {
	transform: translateX(-50%) translateY(-20px);
}

/* 替换成功消息样式 */
.replacement-success-message {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	color: white;
	padding: 12px 16px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1002;
	transition: opacity 0.3s ease, transform 0.3s ease;
	max-width: 100%;
	width: auto;
	opacity: 0;
	will-change: opacity, transform;
}

.replacement-success-message.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.replacement-success-message.initial {
	transform: translateX(-50%) translateY(-20px);
}

.replacement-success-message .message-content {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
}

.color-with-name {
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 8px;
	border-radius: 4px;
}

.color-swatch-small {
	width: 16px;
	height: 16px;
	border-radius: 3px;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.color-name-small {
	font-size: 12px;
	font-weight: 600;
}

.undo-replacement-btn {
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	transition: background 0.2s;
	margin-left: 5px;
}

.undo-replacement-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* 撤销成功消息样式 */
.undo-success-message {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	color: white;
	padding: 12px 16px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1002;
	transition: opacity 0.3s ease, transform 0.3s ease;
	max-width: 90%;
	width: auto;
	opacity: 0;
	will-change: opacity, transform;
}

.undo-success-message.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.undo-success-message.initial {
	transform: translateX(-50%) translateY(-20px);
}

/* 手机端适配：整体缩放略小 */
@media screen and (max-width: 768px) {

	.toast-message,
	.replacement-success-message,
	.undo-success-message {
		transform: scale(0.9) translateX(-50%) translateY(-10px);
		font-size: 14px;
		padding: 10px 12px;
	}

	.color-name-small,
	.undo-replacement-btn {
		font-size: 11px;
	}

	.color-swatch-small {
		width: 14px;
		height: 14px;
	}
}

@media screen and (max-width: 768px) {

	.toast-message,
	.replacement-success-message,
	.undo-success-message {
		transform: scale(0.85) translateX(-50%) translateY(-8px);
		font-size: 13px;
		padding: 8px 10px;
	}

	.color-name-small,
	.undo-replacement-btn {
		font-size: 10px;
	}

	.color-swatch-small {
		width: 12px;
		height: 12px;
	}
}


@media screen and (max-width: 768px) {

	.color-options-header,
	.close-options,
	.color-options-menu {
		transform: scale(0.9);
		transform-origin: top center;
	}

}


@media screen and (max-width: 768px) {
	body {
		padding: 15px;
		max-width: 100%;
	}

	header {
		padding: 15px 10px;
		margin-bottom: 20px;
	}

	h1 {
		font-size: 1.8rem;
	}

	.subtitle {
		font-size: 1rem;
	}

	.card {
		padding: 15px;
	}

	.card-title {
		font-size: 1.2rem;
		margin-bottom: 12px;
	}
}

@media screen and (max-width: 768px) {
	body {
		padding: 10px;
	}

	header {
		padding: 12px 8px;
		border-radius: 8px;
	}

	h1 {
		font-size: 1.5rem;
	}

	.card {
		padding: 12px;
		border-radius: 8px;
	}

	.card-title {
		font-size: 1.1rem;
	}

	.upload-btn {
		padding: 12px 20px;
		font-size: 0.95rem;
	}

	.setting-group {
		padding: 8px;
		margin-bottom: 15px;
	}

	.setting-group h3 {
		font-size: 1rem;
		margin-bottom: 8px;
	}
}

@media (hover: none) and (pointer: coarse) {

	/* 针对触屏设备优化按钮大小 */
	.upload-btn,
	.option-btn,
	.color-option {
		min-height: 10px;
		/* 符合移动端最小触控区域标准 */
	}

	.toggle-container,
	.toggle-container-secondary {
		min-height: 25px;
		align-items: center;
	}

	input,
	select {
		min-height: 28px;
	}

	/* 增加触摸反馈 */
	.upload-btn:active,
	.option-btn:active,
	.color-option:active {
		transform: scale(0.98);
	}
}

@media screen and (max-width: 768px) {

	.color-grid,
	.background-section {
		grid-template-columns: repeat(auto-fill, minmax(74px, 1rem));
		margin: -8px;
	}

	.color-item .background-color-item {
		transform: scale(1.16);
	}

	.color-swatch {
		width: 28px;
		height: 28px;
	}

	.color-name,
	.color-count {
		font-size: 0.85rem;
	}
}

@media screen and (max-width: 768px) {
	.stats-container {
		gap: 10px;
	}

	.stat-title {
		font-size: 1rem;
		margin-bottom: 10px;
	}

	.bead-count {
		font-size: 2rem;
	}
}

@media screen and (max-width: 768px) {

	.input-row {
		gap: 8px;
	}

	.input-row label {
		min-width: 100px;
		font-weight: 500;
		font-size: 1rem;
	}

	input,
	select {
		padding: 10px 12px;
		font-size: 16px;
		/* 防止iOS缩放 */
	}
}







.container {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

h1 {
	text-align: center;
	margin-bottom: 20px;
	padding: 20px;
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	color: white;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	font-size: 2rem;
}

.controls {
	background: white;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.grid-inputs {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
	flex-wrap: nowrap;
}

.grid-input {
	flex: 1;
	min-width: 120px;
}


.input-row:last-child {
	margin-bottom: 0;
}

label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #2c3e50;
	font-size: 1rem;
}

input[type="file"] {
	width: 100%;
	padding: 12px;
	border: 2px dashed #ddd;
	border-radius: 8px;
	background: #f8f9fa;
	cursor: pointer;
	transition: border-color 0.3s;
	color: transparent;
}

input[type="file"]:hover {
	border-color: #6a11cb;
}

input[type="range"] {
	width: 100%;
	margin: 10px 0;
	-webkit-appearance: none;
	height: 6px;
	background: #e9ecef;
	border-radius: 3px;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="number"] {
	width: 80px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1rem;
	text-align: center;
}

input[type="number"]:focus {
	border-color: #6a11cb;
	outline: none;
	box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}

input[type="checkbox"] {
	width: auto;
	margin-right: 8px;
	transform: scale(1.2);
}

.input-row input,
.input-row select {
	padding: 7px 16px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 1rem;
}

.input-row input[type="number"] {
	text-align: center;
}

input[type="file"]::file-selector-button {
	color: #333;
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 6px 12px;
	margin-right: 10px;
	cursor: pointer;
}

input[type="file"]:valid {
	color: #666;
}

.grid-size-row {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
	gap: 10px;
	font-size: 1rem;
}

.grid-size-row label {
	min-width: 120px;
	font-weight: 500;
	font-size: 1rem;
	margin-bottom: 0;
}
/* 默认隐藏图像对比区域 */
.image-comparison-container {
    display: none; /* 使用 !important 确保优先级 */
    background: white;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-comparison-container h3 {
	font-size: 1.3rem;
	margin-bottom: 15px;
	color: #2c3e50;
	border-bottom: 2px solid #f0f2f5;
	padding-bottom: 10px;
	width: 100%;
	/* 标题占满宽度 */
	text-align: center;
}

.comparison-wrapper {
	position: relative;
	max-width: 100%;
	/* 限制最大宽度为父容器宽度 */
	height: 400px;
	overflow: hidden;
	border: 2px solid #e9ecef;
	border-radius: 8px;
	background: #f8f9fa;
	/* 移除固定宽度，让容器跟随内容 */
}

#originalImageContainer {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

#originalImageContainer:not(:empty) {
	background: white;
}

#originalImage {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

#resultCanvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

@media (max-width: 768px) {
	.comparison-wrapper {
		height: 300px;
		max-width: 100%;
		/* 确保在移动端不超出屏幕 */
	}

	/* 其他移动端样式保持不变 */
}

/* 分割线样式 */
.splitter {
	position: absolute;
	top: 0;
	left: 60%;
	/* 默认位置，露出40%原图 */
	width: 3px;
	height: 100%;
	background-color: #6a11cb;
	cursor: col-resize;
	z-index: 20;
	transition: background-color 0.2s;
}

.splitter::before {
	content: '';
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 20px;
	background-color: #6a11cb;
	border-radius: 50%;
	z-index: 21;
}

.splitter:hover {
	background-color: #2575fc;
}

.splitter.dragging {
	background-color: #2575fc;
}

.splitter.dragging::before {
	background-color: #2575fc;
}

/* 透明度控制 */
.transparency-control {
	margin-top: 15px;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 8px;
}

.transparency-control label {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.transparency-control span {
	font-weight: normal;
	color: #6c757d;
}

button {
	background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-right: 10px;
}

button:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

button:active:not(:disabled) {
	transform: translateY(0);
}

button:disabled {
	background: #95a5a6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

#blockSizeLabel {
	color: #6c757d;
	font-size: 0.9rem;
	margin-left: 10px;
}

.next-button-container {
	text-align: center;
	margin-top: 20px;
}

.slider-btn {
	width: 30px;
	height: 30px;
	border-radius: 15%;
	background: #3498db;
	color: white;
	border: none;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.slider-btn:hover {
	background: #2980b9;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.slider-btn:active {
	transform: translateY(0);
}

.slider-container {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.slider-container input[type="range"] {
	flex: 1;
}

.size-presets {
	display: flex;
	gap: 1px;
	margin-top: 4px;
}

.size-preset {
	flex: 1;
	padding: 4px 12px;
	border: 1px solid #ccc;
	background: #f5f5f5;
	border-radius: 4px;
	cursor: pointer;
	color: #333333;
	text-align: center;
}

.size-preset:hover {
	background: #e0e0e0;
}

.size-preset.active {
	background: #007bff;
	color: white;
	border-color: #007bff;
}

/* 移动端适配 */
@media (max-width: 768px) {
	body {
		padding: 5px;
	}

	h1 {
		font-size: 1rem;
		padding: 15px;
		margin-bottom: 15px;
	}

	.controls {
		padding: 15px;
	}

	.comparison-wrapper {
		height: 300px;
	}


	.image-comparison-container h3 {
		font-size: 1rem;
	}

	.input-row {
		margin-bottom: 10px;
	}

	label {
		font-size: 0.8rem;
	}

	input[type="number"] {
		width: 60px;
		padding: 5px 8px;
	}

	button {
		padding: 8px 16px;
		font-size: 0.9rem;
	}

	#blockSizeLabel {
		display: block;
		margin-left: 0;
		margin-top: 5px;
	}
}

/* 触屏设备优化 */
@media (hover: none) and (pointer: coarse) {
	button {
		min-height: 4px;
	}

	input[type="range"] {
		min-height: 4px;
	}

	input[type="checkbox"] {
		min-height: 4px;
		min-width: 4px;
	}
}

/* 遮罩层 */
.notice-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	transition: opacity 0.3s ease;
}

/* 内容卡片 */
.notice-content {
	background: #fff;
	color: #333;
	padding: 20px 24px;
	border-radius: 12px;
	width: 90%;
	max-width: 420px;
	text-align: center;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
	font-size: 15px;
	line-height: 1.6;
	animation: popIn 0.3s ease;
}

/* 弹出动画 */
@keyframes popIn {
	from {
		transform: scale(0.9);
		opacity: 0;
	}

	to {
		transform: scale(1);
		opacity: 1;
	}
}

/* 标题 */
.notice-content h3 {
	margin-top: 0;
	color: #007aff;
	font-size: 18px;
}

/* 按钮区 */
.notice-buttons {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 15px;
}

/* 主按钮 */
#closeNoticeBtn {
	padding: 8px 20px;
	background: #007aff;
	color: white;
	border: none;
	border-radius: 20px;
	font-size: 15px;
	cursor: pointer;
}

#closeNoticeBtn:hover {
	background: #005fcc;
}

/* 次按钮 */
#neverShowBtn {
	padding: 8px 20px;
	background: #ccc;
	color: #333;
	border: none;
	border-radius: 20px;
	font-size: 15px;
	cursor: pointer;
}

#neverShowBtn:hover {
	background: #bbb;
}




/* 图纸 */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
    border-color: #6a11cb;
}

.category-icon {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.category-item:hover .category-icon {
    background: #6a11cb;
    border-color: #6a11cb;
}

.category-icon svg {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.category-item:hover .category-icon svg {
    filter: brightness(0) invert(1);
}

.category-name {
    font-size: 14px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

/* 我的世界主界面 */
.minecraft-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 5px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.tab-item {
    background: #ffffff; /* 白色背景 */
    border: 2px solid #1E90FF; /* 道奇蓝边框 */
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    color: #1E90FF; /* 蓝色文字 */
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
    font-family: inherit;
}

.tab-item:hover {
    background: #E6F3FF; /* 浅蓝色悬停背景 */
    color: #0066CC; /* 深蓝色悬停文字 */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); /* 悬停时阴影稍强 */
    border-color: #0066CC; /* 悬停时边框变深 */
}

/* 我的世界物品 - 可折叠分类 */
.category-section {
    margin: 9px 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #E6F3FF; /* 添加浅蓝色边框增强层次感 */
}

.category-title {
    background: #E6F3FF; /* 浅蓝色背景 */
    color: #0066CC; /* 深蓝色文字 */
    padding: 6px 10px; /* 增加内边距提升舒适度 */
    margin: 0;
    font-size: 1rem;
    border-left: 5px solid #1E90FF; /* 道奇蓝左侧边框 */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease; /* 统一所有属性的过渡效果 */
}

.category-title:hover {
    background: #D4E6FF; /* 悬停时稍深的蓝色 */
    color: #0052A3; /* 文字颜色同步加深 */
}

.category-title::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #1E90FF; /* 箭头颜色与边框一致 */
}

/* 可选：展开状态的样式（如果需要） */
.category-section.active .category-title {
    background: #D4E6FF;
    border-left-color: #0052A3;
}

.category-section.active .category-title::after {
    transform: rotate(180deg);
}
.category-section.collapsed .category-title::after {
    transform: rotate(-90deg);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.category-section.collapsed .items-grid {
    max-height: 0;
    padding: 0 15px;
    opacity: 0;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e9ecef;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #6a11cb;
}

.item-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 6px;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 2px;
}

.item-name {
    font-size: 11px;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
    color: #2c3e50;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
        padding: 15px;
        margin: 10px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .category-name {
        font-size: 12px;
    }
    
    .minecraft-tabs {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        padding: 15px;
        margin: 10px;
    }
    
    .tab-item {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
        padding: 12px;
    }
    
    .item-card {
        padding: 6px;
    }
    
    .item-image {
        width: 40px;
        height: 40px;
    }
    
    .item-name {
        font-size: 10px;
    }
    
    .back-button {
        margin: 15px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .toast {
        padding: 10px 20px;
        font-size: 0.9rem;
        transform: scale(0.9) translate(-55%, -55%);
    }
}

@media screen and (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .category-item {
        padding: 10px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
    }
    
    .category-icon svg {
        width: 25px;
        height: 25px;
    }
    
    .minecraft-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .tab-item {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .item-image {
        width: 35px;
        height: 35px;
    }
    
    .back-button {
        margin: 10px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .toast {
        padding: 8px 16px;
        font-size: 0.8rem;
        transform: scale(0.85) translate(-58%, -58%);
    }
}

/* 平板适配 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 18px;
        padding: 18px;
    }
    
    .minecraft-tabs {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
        padding: 18px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 10px;
        padding: 15px;
    }
}

/* 桌面端适配 */
@media screen and (min-width: 1025px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 25px;
        padding: 25px;
    }
    
    .minecraft-tabs {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 20px;
        padding: 25px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 12px;
        padding: 20px;
    }
}

/* 触屏设备优化 */
@media (hover: none) and (pointer: coarse) {
    .category-item:active,
    .tab-item:active,
    .item-card:active,
    .back-button:active {
        transform: scale(0.98);
    }
    
    .category-item:hover,
    .tab-item:hover,
    .item-card:hover,
    .back-button:hover {
        transform: none;
    }
}