/* ============================================================
 * 王者随机选英雄工具 —— 样式
 * 深蓝底 + 暗金质感，还原设计稿
 * ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
	--bg: #0b1020;
	--bg-2: #101a33;
	--panel: rgba(19, 29, 52, 0.72);
	--panel-border: rgba(198, 162, 96, 0.28);
	--gold: #d9b26a;
	--gold-light: #ecd29a;
	--gold-deep: #a9813f;
	--text: #d3d8e3;
	--muted: #8590a6;
	--red: #b3402f;
	--wine: rgba(86, 38, 52, 0.75);
	--wine-border: rgba(206, 130, 150, 0.45);
}

html, body { min-height: 100%; }

body {
	font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
	color: var(--text);
	background:
		radial-gradient(1200px 600px at 50% -80px, rgba(58, 82, 138, 0.35), transparent 70%),
		radial-gradient(900px 500px at 50% 420px, rgba(44, 62, 108, 0.28), transparent 70%),
		var(--bg);
	background-attachment: fixed;
	padding-bottom: 90px;
	position: relative;
	overflow-x: hidden;
}

/* 底部远山剪影 */
.bg-mountain {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	height: 220px;
	pointer-events: none;
	z-index: 0;
	background:
		linear-gradient(to top, rgba(20, 30, 56, 0.9), transparent);
}
.bg-mountain::before,
.bg-mountain::after {
	content: "";
	position: absolute;
	bottom: 0;
	width: 0; height: 0;
	border-style: solid;
	opacity: 0.5;
}
.bg-mountain::before {
	left: -5%;
	border-width: 0 24vw 150px 24vw;
	border-color: transparent transparent rgba(33, 47, 82, 0.85) transparent;
}
.bg-mountain::after {
	right: -8%;
	border-width: 0 30vw 190px 30vw;
	border-color: transparent transparent rgba(28, 42, 74, 0.9) transparent;
}

/* ---------------- 标题 ---------------- */
.site-header {
	position: relative;
	text-align: center;
	padding: 46px 20px 18px;
	z-index: 1;
}

.main-title {
	font-family: "STSong", "Songti SC", "SimSun", "Noto Serif SC", serif;
	font-size: 46px;
	font-weight: 700;
	letter-spacing: 10px;
	text-indent: 10px;
	background: linear-gradient(180deg, #f4e0ac 0%, #d9b26a 55%, #9c7334 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 2px 10px rgba(217, 178, 106, 0.18));
}

.title-divider {
	width: 280px;
	margin: 14px auto 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
	position: relative;
}
.title-divider span {
	position: absolute;
	left: 50%; top: 50%;
	width: 7px; height: 7px;
	transform: translate(-50%, -50%) rotate(45deg);
	background: var(--gold);
	box-shadow: 0 0 8px rgba(217, 178, 106, 0.7);
}

.position-mark {
	position: absolute;
	right: 56px;
	top: 58px;
	font-size: 13px;
	letter-spacing: 3px;
	color: var(--muted);
}
.position-mark::before {
	content: "";
	color: var(--red);
	margin-right: 6px;
}

/* ---------------- 复选框通用 ---------------- */
.check-item {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
	margin-right: 26px;
}
.check-item input {
	position: absolute;
	opacity: 0;
	width: 0; height: 0;
}
.check-box {
	width: 15px;
	height: 15px;
	border: 1px solid var(--gold-deep);
	border-radius: 3px;
	background: rgba(10, 15, 30, 0.6);
	margin-right: 9px;
	position: relative;
	transition: all .2s;
	flex: none;
}
.check-item input:checked + .check-box {
	background: linear-gradient(160deg, #e6c584, #b8903f);
	border-color: var(--gold-light);
	box-shadow: 0 0 8px rgba(217, 178, 106, 0.45);
}
.check-item input:checked + .check-box::after {
	content: "";
	position: absolute;
	left: 4px; top: 1px;
	width: 4px; height: 8px;
	border: solid #241a08;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.check-item input:focus-visible + .check-box {
	outline: 2px solid rgba(217, 178, 106, 0.55);
	outline-offset: 2px;
}
.check-text {
	font-size: 15px;
	color: #cfd5e2;
	letter-spacing: 2px;
}
.check-item:hover .check-text { color: var(--gold-light); }

/* ---------------- 一级筛选 ---------------- */
.primary-filter {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	padding: 22px 20px 14px;
	z-index: 1;
	position: relative;
}

/* ---------------- 进阶筛选面板 ---------------- */
.advanced-panel {
	position: relative;
	z-index: 1;
	margin: 10px auto 0;
	max-width: 1240px;
	background: var(--panel);
	border: 1px solid var(--panel-border);
	border-radius: 6px;
	padding: 22px 30px 26px;
	backdrop-filter: blur(4px);
}

.panel-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	border-bottom: 1px solid rgba(198, 162, 96, 0.22);
	padding-bottom: 14px;
	margin-bottom: 8px;
}
.panel-header h2 {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 4px;
	color: var(--gold-light);
}
.panel-hint {
	font-size: 12px;
	color: var(--muted);
	letter-spacing: 1px;
}

.advanced-empty {
	padding: 34px 0 18px;
	text-align: center;
	color: var(--muted);
	font-size: 14px;
	letter-spacing: 2px;
}

.adv-row {
	display: flex;
	align-items: center;
	padding: 15px 4px;
	border-bottom: 1px solid rgba(140, 155, 190, 0.14);
}
.adv-row:last-child { border-bottom: none; }

.adv-pos {
	width: 92px;
	flex: none;
	display: flex;
	align-items: center;
	font-size: 15px;
	letter-spacing: 3px;
	color: #c6cddc;
}
.adv-bar {
	display: inline-block;
	width: 3px;
	height: 16px;
	background: linear-gradient(180deg, #d05a44, #8f2d20);
	margin-right: 14px;
	border-radius: 1px;
}

.adv-tags {
	display: flex;
	flex-wrap: wrap;
}
.adv-tags .check-item { margin-bottom: 4px; }

/* ---------------- 抽取卡片 ---------------- */
.draw-stage {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 44px 20px 10px;
}

.hero-card {
	width: 380px;
	height: 470px;
	perspective: 1400px;
}

.card-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transition: transform .68s cubic-bezier(.45, .05, .3, 1);
	transform-style: preserve-3d;
}
.hero-card.flipping .card-inner {
	transform: rotateY(180deg);
}

.card-face {
	position: absolute;
	inset: 0;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 8px;
	overflow: hidden;
}

.card-front {
	background:
		radial-gradient(420px 260px at 50% -40px, rgba(70, 96, 150, 0.45), transparent 75%),
		linear-gradient(170deg, #1b2b4e 0%, #14203c 55%, #101a33 100%);
	border: 1px solid rgba(198, 162, 96, 0.45);
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.55),
		inset 0 0 40px rgba(30, 50, 90, 0.35);
	padding: 34px 34px 26px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.card-back {
	transform: rotateY(180deg);
	background:
		radial-gradient(circle at center, rgba(217, 178, 106, 0.22), transparent 65%),
		linear-gradient(170deg, #16233f, #0e1730);
	border: 1px solid rgba(198, 162, 96, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
}
.back-emblem {
	width: 120px;
	height: 120px;
	border: 2px solid var(--gold);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "STSong", "Songti SC", "SimSun", serif;
	font-size: 56px;
	color: var(--gold-light);
	box-shadow: 0 0 30px rgba(217, 178, 106, 0.35), inset 0 0 24px rgba(217, 178, 106, 0.2);
	animation: emblemPulse 1.4s ease-in-out infinite;
}
@keyframes emblemPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.06); }
}

/* 四角装饰 */
.corner {
	position: absolute;
	width: 16px;
	height: 16px;
	border-color: rgba(217, 178, 106, 0.75);
	border-style: solid;
}
.corner-tl { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.corner-tr { top: 10px; right: 10px; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }
.corner-br { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.card-refresh {
	position: absolute;
	top: 12px; right: 14px;
	background: none;
	border: none;
	color: rgba(217, 178, 106, 0.65);
	font-size: 18px;
	cursor: pointer;
	padding: 4px;
	line-height: 1;
	transition: transform .4s, color .2s;
}
.card-refresh:hover {
	color: var(--gold-light);
	transform: rotate(180deg);
}

/* 头像 */
.avatar-ring {
	width: 172px;
	height: 172px;
	border-radius: 50%;
	padding: 5px;
	background: conic-gradient(from 20deg, #8a6a30, #ecd29a, #a9813f, #f4e0ac, #8a6a30);
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
	position: relative;
	margin-top: 6px;
}
.avatar-ring::after {
	content: "";
	position: absolute;
	inset: 9px;
	border-radius: 50%;
	border: 3px solid #243352;
	box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
	pointer-events: none;
}
.avatar-ring img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	position: relative;
	z-index: 1;
}
.avatar-fallback {
	display: none;
	position: absolute;
	inset: 9px;
	z-index: 1;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	font-family: "STSong", "Songti SC", serif;
	font-size: 56px;
	color: var(--gold-light);
	background: radial-gradient(circle, #2a3a60, #15213c);
}
.avatar-fallback.show { display: flex; }

.hero-name {
	margin-top: 22px;
	font-family: "STSong", "Songti SC", "SimSun", serif;
	font-size: 32px;
	font-weight: 700;
	letter-spacing: 8px;
	text-indent: 8px;
	color: var(--gold-light);
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-role {
	margin-top: 14px;
	padding: 5px 18px;
	font-size: 13px;
	letter-spacing: 4px;
	color: #e8b9c6;
	background: var(--wine);
	border: 1px solid var(--wine-border);
	border-radius: 3px;
}

.hero-desc {
	margin-top: 20px;
	font-size: 13px;
	line-height: 1.95;
	letter-spacing: 1px;
	color: #9aa4b8;
	text-align: center;
}

/* ---------------- 按钮 ---------------- */
.action-bar {
	display: flex;
	gap: 26px;
	margin-top: 34px;
}

.btn {
	min-width: 190px;
	height: 52px;
	font-size: 17px;
	letter-spacing: 6px;
	text-indent: 6px;
	border-radius: 4px;
	cursor: pointer;
	transition: transform .15s, box-shadow .2s, background .2s, color .2s;
	font-family: inherit;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
	color: #2a1f08;
	font-weight: 600;
	border: 1px solid #f0d59c;
	background: linear-gradient(180deg, #f0d59c 0%, #d9b26a 45%, #b88c44 100%);
	box-shadow:
		0 6px 20px rgba(217, 178, 106, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover {
	background: linear-gradient(180deg, #f7e2b0, #e3bd76 50%, #c4974b);
	box-shadow: 0 8px 26px rgba(217, 178, 106, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:disabled {
	opacity: .7;
	cursor: wait;
}

.btn-ghost {
	color: #c8cfe0;
	background: rgba(20, 30, 54, 0.6);
	border: 1px solid rgba(198, 162, 96, 0.55);
}
.btn-ghost:hover {
	color: var(--gold-light);
	border-color: var(--gold);
	background: rgba(30, 42, 72, 0.7);
}

/* ---------------- 抽取历史 ---------------- */
.history-section {
	position: relative;
	z-index: 1;
	max-width: 1240px;
	margin: 52px auto 0;
	padding: 0 30px;
}

.history-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.history-header h2 {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 5px;
	color: var(--gold-light);
	position: relative;
	padding-right: 30px;
}
.history-header h2::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 100%;
	width: 60vw;
	max-width: 1060px;
	height: 1px;
	background: linear-gradient(90deg, rgba(198, 162, 96, 0.5), transparent);
}
.history-count {
	font-size: 13px;
	color: var(--muted);
	letter-spacing: 2px;
}

.history-list {
	margin-top: 20px;
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding: 4px 2px 14px;
	scrollbar-width: thin;
	scrollbar-color: rgba(198, 162, 96, 0.4) transparent;
}
.history-list::-webkit-scrollbar { height: 8px; }
.history-list::-webkit-scrollbar-thumb {
	background: rgba(198, 162, 96, 0.35);
	border-radius: 4px;
}

.history-empty {
	width: 100%;
	padding: 26px 0 30px;
	text-align: center;
	color: var(--muted);
	font-size: 13px;
	letter-spacing: 2px;
}

.history-item {
	position: relative;
	flex: none;
	width: 108px;
	padding: 16px 8px 13px;
	border-radius: 5px;
	background: linear-gradient(180deg, rgba(27, 40, 68, 0.85), rgba(16, 25, 46, 0.85));
	border: 1px solid rgba(150, 168, 205, 0.25);
	cursor: pointer;
	transition: transform .15s, border-color .2s, box-shadow .2s, opacity .2s;
	font-family: inherit;
	color: var(--text);
}
.history-item:hover {
	transform: translateY(-3px);
	border-color: rgba(217, 178, 106, 0.6);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.history-item.excluded {
	opacity: 0.5;
	border-color: rgba(208, 90, 68, 0.75);
	background: linear-gradient(180deg, rgba(64, 30, 34, 0.75), rgba(38, 20, 28, 0.85));
}
.history-item.excluded .mini-avatar {
	box-shadow: 0 0 0 2px rgba(208, 90, 68, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
	filter: grayscale(.5);
}

.mini-avatar {
	display: block;
	width: 58px;
	height: 58px;
	margin: 0 auto 10px;
	border-radius: 50%;
	overflow: hidden;
	position: relative;
	box-shadow: 0 0 0 2px rgba(198, 162, 96, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.mini-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mini-fallback {
	display: none;
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	font-family: "STSong", "Songti SC", serif;
	font-size: 24px;
	color: var(--gold-light);
	background: radial-gradient(circle, #2a3a60, #15213c);
}
.mini-fallback.show { display: flex; }

.mini-name {
	display: block;
	font-size: 14px;
	color: #dde2ee;
	letter-spacing: 1px;
	white-space: nowrap;
}
.mini-role {
	display: block;
	margin-top: 5px;
	font-size: 11px;
	color: var(--muted);
	letter-spacing: 1px;
	white-space: nowrap;
}

.exclude-badge {
	position: absolute;
	top: -7px;
	right: -7px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #c74e3c;
	color: #fff;
	font-size: 13px;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(.4);
	transition: all .18s;
}
.history-item.excluded .exclude-badge {
	opacity: 1;
	transform: scale(1);
}

.history-tip {
	margin-top: 6px;
	text-align: center;
	font-size: 12px;
	letter-spacing: 3px;
	color: #6b7690;
}

/* ---------------- Toast 提示 ---------------- */
.toast {
	position: fixed;
	left: 50%;
	top: 34%;
	transform: translate(-50%, -12px);
	padding: 12px 26px;
	font-size: 14px;
	letter-spacing: 2px;
	color: var(--gold-light);
	background: rgba(16, 24, 44, 0.92);
	border: 1px solid rgba(198, 162, 96, 0.55);
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s, transform .25s;
	z-index: 99;
}
.toast.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------------- 即将上线徽标 ---------------- */
.hero-badge {
	display: none;
	position: absolute;
	top: 13px;
	left: 30px;
	z-index: 3;
	padding: 3px 10px;
	font-size: 11px;
	letter-spacing: 2px;
	color: #ffe9c2;
	background: linear-gradient(180deg, #b5462f, #7d2a1c);
	border: 1px solid rgba(244, 207, 147, 0.6);
	border-radius: 10px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.soon-badge {
	position: absolute;
	top: -8px;
	left: -6px;
	padding: 2px 7px;
	font-size: 10px;
	letter-spacing: 1px;
	color: #ffe9c2;
	background: linear-gradient(180deg, #b5462f, #7d2a1c);
	border: 1px solid rgba(244, 207, 147, 0.55);
	border-radius: 9px;
	white-space: nowrap;
	z-index: 2;
}

/* ---------------- AI 智选 ---------------- */
.hero-card { height: 508px; }

.ai-reason {
	display: none;
	margin-top: 14px;
	padding: 9px 14px;
	width: 100%;
	font-size: 12.5px;
	line-height: 1.7;
	letter-spacing: 1px;
	color: #d9b26a;
	background: linear-gradient(180deg, rgba(217, 178, 106, 0.1), rgba(217, 178, 106, 0.05));
	border: 1px solid rgba(217, 178, 106, 0.35);
	border-radius: 4px;
	text-align: center;
}
.ai-reason.show { display: block; }
.ai-reason.loading { color: #b8a478; }
.ai-reason.loading::after {
	content: "";
	display: inline-block;
	width: 12px;
	text-align: left;
	animation: dots 1.2s steps(4) infinite;
}
@keyframes dots {
	0% { content: ""; }
	25% { content: "."; }
	50% { content: ".."; }
	75%, 100% { content: "..."; }
}
.ai-reason.error {
	color: #c98a7d;
	border-color: rgba(179, 92, 72, 0.4);
	background: rgba(125, 42, 28, 0.12);
}

.btn-ai {
	min-width: 168px;
	color: var(--gold-light);
	background: linear-gradient(180deg, rgba(45, 40, 72, 0.85), rgba(28, 26, 50, 0.85));
	border: 1px solid rgba(178, 146, 214, 0.6);
	box-shadow: 0 6px 18px rgba(90, 70, 140, 0.25);
}
.btn-ai:hover {
	border-color: #c4a8e0;
	background: linear-gradient(180deg, rgba(60, 52, 92, 0.9), rgba(36, 32, 62, 0.9));
	box-shadow: 0 8px 24px rgba(120, 95, 175, 0.4);
}
.btn-ai:disabled { opacity: .7; cursor: wait; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 720px) {
	.main-title { font-size: 30px; letter-spacing: 5px; text-indent: 5px; }
	.position-mark { display: none; }
	.advanced-panel { margin: 10px 14px 0; padding: 18px 16px; }
	.adv-row { flex-direction: column; align-items: flex-start; }
	.adv-tags { margin-top: 10px; }
	.hero-card { width: 320px; height: 480px; }
	.avatar-ring { width: 150px; height: 150px; }
	.hero-name { font-size: 28px; }
	.btn { min-width: 150px; }
	.action-bar { gap: 16px; }
	.history-section { padding: 0 14px; }
	.chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
	.chat-fab { right: 16px; bottom: 16px; }
}

/* ---------------- 卡面文字滚动区 ---------------- */
.card-scroll {
	width: 100%;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	/* 隐藏滚动条，滚轮即可滚动 */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.card-scroll::-webkit-scrollbar { display: none; }

/* ---------------- 智能助手 ---------------- */
.chat-fab {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 120;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	cursor: pointer;
	border: 1px solid rgba(244, 207, 147, 0.65);
	background:
		radial-gradient(circle at 30% 25%, rgba(255, 235, 190, 0.35), transparent 60%),
		linear-gradient(160deg, #2a3a66 0%, #17233f 60%, #101a33 100%);
	box-shadow:
		0 10px 26px rgba(0, 0, 0, 0.55),
		inset 0 0 14px rgba(217, 178, 106, 0.25);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	font-family: inherit;
	transition: transform .18s, box-shadow .2s, border-color .2s;
}
.chat-fab:hover {
	transform: translateY(-3px);
	border-color: var(--gold-light);
	box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(217, 178, 106, 0.4);
}
.chat-fab-main {
	font-family: "STSong", "Songti SC", serif;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1;
	background: linear-gradient(180deg, #f4e0ac, #d9b26a);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.chat-fab-sub {
	font-size: 10px;
	letter-spacing: 2px;
	text-indent: 2px;
	color: #c8b384;
	line-height: 1;
}

.chat-panel {
	position: fixed;
	right: 28px;
	bottom: 102px;
	z-index: 110;
	width: 372px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 150px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background:
		radial-gradient(320px 140px at 50% -40px, rgba(70, 96, 150, 0.4), transparent 75%),
		linear-gradient(170deg, #16233f 0%, #111b34 100%);
	border: 1px solid var(--panel-border);
	border-radius: 10px;
	box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65), inset 0 0 30px rgba(30, 50, 90, 0.3);
	opacity: 0;
	transform: translateY(14px) scale(.98);
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease;
}
.chat-panel.open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.chat-header {
	flex: none;
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 13px 16px;
	border-bottom: 1px solid rgba(198, 162, 96, 0.3);
	background: rgba(13, 20, 38, 0.6);
}
.chat-title {
	font-family: "STSong", "Songti SC", serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 3px;
	color: var(--gold-light);
}
.chat-subtitle {
	flex: 1;
	font-size: 11px;
	letter-spacing: 1px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.chat-close {
	flex: none;
	background: none;
	border: none;
	color: rgba(217, 178, 106, 0.7);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	transition: color .2s, transform .3s;
}
.chat-close:hover { color: var(--gold-light); transform: rotate(90deg); }

.chat-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 14px 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: rgba(198, 162, 96, 0.4) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb {
	background: rgba(198, 162, 96, 0.35);
	border-radius: 3px;
}

.chat-welcome {
	align-self: center;
	max-width: 92%;
	padding: 9px 14px;
	font-size: 12px;
	line-height: 1.8;
	letter-spacing: 1px;
	text-align: center;
	color: #a9b2c6;
	background: rgba(24, 34, 60, 0.6);
	border: 1px dashed rgba(198, 162, 96, 0.35);
	border-radius: 6px;
}

.chat-bubble {
	max-width: 84%;
	padding: 9px 13px;
	border-radius: 9px;
	font-size: 13px;
	line-height: 1.75;
	letter-spacing: 0.5px;
	white-space: pre-wrap;
	word-break: break-word;
}
.chat-bubble.user {
	align-self: flex-end;
	color: #241a08;
	background: linear-gradient(180deg, #ecd29a, #c89c50);
	border-bottom-right-radius: 2px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.chat-bubble.ai {
	align-self: flex-start;
	color: #ccd4e4;
	background: rgba(28, 40, 70, 0.92);
	border: 1px solid rgba(150, 168, 205, 0.3);
	border-bottom-left-radius: 2px;
}
.chat-bubble.error {
	align-self: flex-start;
	color: #c98a7d;
	background: rgba(125, 42, 28, 0.14);
	border: 1px solid rgba(179, 92, 72, 0.45);
}
.chat-bubble.loading {
	color: #b8a478;
	background: rgba(28, 40, 70, 0.7);
	border: 1px dashed rgba(198, 162, 96, 0.4);
}
.chat-bubble.loading::after {
	content: "";
	display: inline-block;
	width: 12px;
	text-align: left;
	animation: dots 1.2s steps(4) infinite;
}

.chat-input-bar {
	flex: none;
	display: flex;
	align-items: flex-end;
	gap: 9px;
	padding: 10px 12px;
	border-top: 1px solid rgba(198, 162, 96, 0.3);
	background: rgba(13, 20, 38, 0.6);
}
.chat-input {
	flex: 1;
	resize: none;
	max-height: 96px;
	padding: 9px 11px;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.6;
	color: var(--text);
	background: rgba(10, 15, 30, 0.72);
	border: 1px solid rgba(198, 162, 96, 0.35);
	border-radius: 6px;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
}
.chat-input::placeholder { color: #6b7690; }
.chat-input:focus {
	border-color: var(--gold);
	box-shadow: 0 0 0 2px rgba(217, 178, 106, 0.15);
}
.chat-send {
	flex: none;
	width: 68px;
	height: 37px;
	font-family: inherit;
	font-size: 14px;
	letter-spacing: 3px;
	text-indent: 3px;
	color: #2a1f08;
	font-weight: 600;
	border: 1px solid #f0d59c;
	border-radius: 6px;
	background: linear-gradient(180deg, #f0d59c 0%, #d9b26a 45%, #b88c44 100%);
	cursor: pointer;
	transition: filter .2s, transform .15s;
}
.chat-send:hover { filter: brightness(1.08); }
.chat-send:active { transform: translateY(1px); }
.chat-send:disabled { opacity: .55; cursor: wait; }
