/* 滾動條css */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	-webkit-border-radius: 10px;
	border-radius: 10px;
}

::-webkit-scrollbar-thumb {
	-webkit-border-radius: 4px;
	border-radius: 4px;
	background: rgb(219, 219, 219);
}

.search-suggestions .suggestion-section {
	padding: 0.3em 1em 0.1em 1em;
	font-size: 0.95em;
	color: #aaa;
	background: #232323;
	border-bottom: 1px solid #333;
	font-weight: bold;
}

/* 搜尋建議下拉選單樣式 */
.search-suggestions {
	position: absolute;
	background: #232323;
	color: #fff;
	border: 1px solid #444;
	border-radius: 0 0 6px 6px;
	max-height: 220px;
	overflow-y: auto;
	width: 300px;
	z-index: 1000;
	left: 0;
	top: 100%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-suggestions .suggestion-item {
	padding: 0.5em 1em;
	cursor: pointer;
	white-space: nowrap;
}

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.active {
	background: #42aaff;
	color: #222;
}

body {
	font-family: sans-serif;
	background: #ffffff;
	/*背景顔色*/
	color: #ddd;
	margin: 0;
}

.disclaimer {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100vw;
	z-index: 999;
	background-color: #2b2b2b;
	color: #aaa;
	padding: 1em;
	font-size: 0.9em;
	text-align: center;
	border-top: 1px solid #444;
	transition: transform 0.3s ease-out;
}

.disclaimer.hidden {
	transform: translateY(100%);
}

.disclaimer a {
	color: #ccc;
	text-decoration: underline;
}

.top-bar {
	position: sticky;
	top: 0;
	background-color: #1e1e1e;
	z-index: 100;
	padding: 1em 2em 0 2em;
	border-bottom: 1px solid #333;
}

.controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1em;
}

.search-controls {
	display: flex;
	align-items: center;
	gap: 1em;
	width: 100%;
	font-size: 0.9em;
}

.search-controls input[type='text'] {
	font-size: inherit;
}

.search-controls input[type='number'] {
	font-size: inherit;
}

.search-controls button {
	font-size: inherit;
}

.region-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	width: 100%;
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.region-controls.show {
	max-height: 200px;
	padding: 0.5em 0;
}

#region-checkboxes {
	display: grid;
	grid-template-columns: repeat(10, minmax(80px, 1fr));
	gap: 0.5em;
	width: 100%;
}

#region-checkboxes label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.toggle-regions-btn {
	padding: 0.3em 0.8em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
	transition: background 0.2s;
}

.level-range-btn {
	padding: 0.3em 0.8em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
	transition: background 0.2s;
}

.toggle-map-btn {
	padding: 0.3em 0.8em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
	transition: background 0.2s;
}

.toggle-regions-btn:hover {
	background: #444;
}

input[type='text'] {
	width: 150px;
	padding: 0.5em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #fff;
}

label {
	font-size: 0.9em;
}

#drop-container {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	padding: 1em 2em;
	padding-bottom: 4em;
}

.monster-card {
	display: flex;
	/*  主要變更：使子元素 monster-info-container 和 items-outer-container 水平排列 */
	flex-direction: row;
	/*  明確指定方向，雖然這是默認值 */
	background-color: #646464;
	/*怪物背景色*/
	border: 1px solid #555;
	border-radius: 8px;
	padding: 1em;
	/* width: 287px; */
	/*  移除或註釋掉固定寬度，讓 flexbox 控制寬度 */
	width: 100%;
	/* 或者根據需要設置一個 flex-basis */
	white-space: normal;
	box-sizing: border-box;
	/* text-align: center; */
	/*  可以移除，因為子元素會自己對齊 */
	margin-bottom: 20px;
	/* 保持或調整現有的 margin */
}

/* 新增樣式 */
.monster-info-container {
	flex: 1;
	/*  怪物資訊部分佔用1份空間，您可以調整比例，例如 flex: 0 0 300px; 或 flex-basis: 300px; */
	padding-right: 1em;
	/*  在右側添加一些間距 */
	border-right: 1px solid #444;
	/*怪物和爆率之間的分割條*/
	/*  添加分隔線 */
	text-align: center;
	/* 保持怪物圖片和名稱居中 */
}

.items-outer-container {
	flex: 2;
	/*  掉落物部分佔用2份空間，您可以調整比例 */
	padding-left: 1em;
	/*  在左側添加一些間距 */
	overflow-y: auto;
	/*  如果掉落物列表很長，允許滾動 */
	max-height: 450px;
	/*  可以設置一個最大高度，根據您的怪物卡片平均高度調整 */
}

.monster-image {
	width: 50px;
	height: 50px;
	object-fit: contain;
	margin-bottom: 0.5em;
}

.monster-name {
	font-weight: bold;
	color: #ffcc00;
	margin-bottom: 0.5em;
}

.monster-attr {
	display: grid;
	grid-template-columns: repeat(2, auto);
	gap: 0.4em;
	justify-content: center;
	margin: 0.5em auto 1em auto;
	padding: 0 1em;
	/* width: 100%; */
	/* 確保屬性容器不會過度擴張，如果需要可以設置 max-width */
	box-sizing: border-box;
}

.attr-box {
	background-color: #111;
	border: 1px solid #444;
	border-radius: 4px;
	padding: 0.3em 0.6em;
	font-size: 0.85em;
	color: #ccc;
	white-space: nowrap;
	text-align: center;
}

.attr-box.fullwidth {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.5em 0.6em;
}

.item-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: flex-start;
	margin-bottom: 8px;
}

.item-group>div {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	width: 100%;
}

.item {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.3em;
	text-align: left;
	/* padding-left: 1em; */
	/*  這個 padding 可以移到 .items-outer-container 或者保留，看效果 */
}

.hide-text {
	display: inline-block;
	margin: 2px;
}

.hide-text .item-icon {
	margin: 0;
}

.only-image-mode {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
}

.hide-text span {
	display: none;
}

.hide-text:hover span {
	display: inline-block;
	position: absolute;
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	padding: 0.2em 0.4em;
	border-radius: 4px;
	margin-left: 5px;
	z-index: 10;
	white-space: nowrap;
}

mark {
	background-color: yellow;
	color: black;
}

.item-icon.highlighted {
	box-shadow: 0 0 6px 3px gold;
	border-radius: 4px;
}

.toggle-all-btn {
	margin-right: 1em;
	padding: 0.2em 0.5em;
	border-radius: 4px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
}

.share-btn {
	padding: 0.2em 0.5em;
	border-radius: 5px;
	border: 1px solid #42aaff;
	background: #222;
	color: #42aaff;
	cursor: pointer;
}

.toggle-default-btn {
	margin-right: 1em;
	padding: 0.2em 0.5em;
	border-radius: 4px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
}

input[type='checkbox'] {
	appearance: none;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid #666;
	border-radius: 4px;
	background: #333;
	cursor: pointer;
	position: relative;
	vertical-align: middle;
	margin-top: 0;
	margin-right: 1px;
	transition: border-color 0.2s, background 0.2s;
}

input[type='checkbox']:checked {
	background: #42aaff;
	border-color: #42aaff;
}

input[type='checkbox']:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 4px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

input[type='number'] {
	width: 60px;
	padding: 0.5em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #fff;
	font-size: 1em;
	box-sizing: border-box;
}

/* 屬性剋制樣式 */
.resistance-tag {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 4px;
	margin: 1px;
	font-size: 0.9em;
	font-weight: bold;
	color: white;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 屬性顏色 */
.resistance-tag.resistance-fire {
	background-color: #cc3700;
}

.resistance-tag.resistance-poison {
	background-color: #6a3da8;
}

.resistance-tag.resistance-ice {
	background-color: #4f95b8;
}

.resistance-tag.resistance-lightning {
	background-color: #ffa500;
}

.resistance-tag.resistance-holy {
	background-color: #ffd700;
	color: #333;
}

.resistance-tag.resistance-heal {
	background-color: #2ecc71;
}

.resistance-tag.resistance-all2 {
	background: linear-gradient(45deg, #333 0%, #666 100%);
	padding: 4px 8px;
}

/* 懸停效果 */
.resistance-tag:hover {
	transform: translateY(-1px);
	transition: all 0.2s ease;
}

/* 選項容器樣式 */
.toggle-resistance-btn {
	padding: 0.3em 0.8em;
	border-radius: 5px;
	border: 1px solid #666;
	background: #333;
	color: #ddd;
	cursor: pointer;
	font-size: 0.9em;
	transition: background 0.2s;
}

.toggle-resistance-btn:hover {
	background: #444;
}

.resistance-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	width: 100%;
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.resistance-controls.show {
	max-height: 200px;
	padding: 0.5em;
}

.job-row span {
	padding: 0 4px;
	border-radius: 3px;
}

.hover-box {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.upper-box,
.lower-box {
	flex: 1;
	display: flex;
	justify-content: space-between;
}

.monster-summary-card {
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.monster-summary-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.monster-summary-card.expanded {
	border-color: #00bcd4;
	/* 例如，高亮已選中的簡化卡片 */
	background-color: #333;
}

.monster-card-detail .monster-image {
	width: 100px;
	/* 調整詳細視圖中的怪物圖片大小 */
	height: 100px;
}

.monster-card-detail .items-outer-container {
	/*max-height: 500px;
	/* 限制掉落物區域的高度，使其可滾動 */
	overflow-y: auto;
}

.img-container,
.attr-container,
.job-container,
.stats-container {
	flex: 1;
}

/* 選項容器樣式 */
#resistance-checkboxes {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0.5em;
	width: 100%;
	padding: 4px;
}

#resistance-checkboxes button {
	background-color: #333;
	border: 1px solid #666;
	padding: 0.3em 0.8em;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9em;
	transition: all 0.2s ease;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	width: 100%;
	color: white;
	position: relative;
}

/* 火按鈕 */
#resistance-checkboxes button[value^="F"] {
	background-color: #cc3700;
	border-color: #cc3700;
	grid-column: 1;
}

/* 毒按鈕 */
#resistance-checkboxes button[value^="S"] {
	background-color: #6a3da8;
	border-color: #6a3da8;
	grid-column: 2;
}

/* 冰按鈕 */
#resistance-checkboxes button[value^="I"] {
	background-color: #4f95b8;
	border-color: #4f95b8;
	grid-column: 3;
}

/* 雷按鈕 */
#resistance-checkboxes button[value^="L"] {
	background-color: #ffa500;
	border-color: #ffa500;
	grid-column: 4;
}

/* 聖按鈕 */
#resistance-checkboxes button[value^="H3"] {
	background-color: #ffd700;
	border-color: #ffd700;
	grid-column: 5;
	color: #333;
}

/* 可治癒按鈕 */
#resistance-checkboxes button[value="HS"] {
	background-color: #2ecc71;
	border-color: #2ecc71;
	grid-column: 6;
}

#resistance-checkboxes button:hover {
	filter: brightness(1.2);
}

#resistance-checkboxes button.selected {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}