/* =========================================================
   FreightSay 许愿树 · 样式（v0.3 自包含镜像版）
   策略：所有规则以 .fsth-root 为作用域，优先级压过主题，
   卡片用纯色背景（不用 backdrop-filter，避开 Chrome 旋转动画文字模糊 bug）
   ========================================================= */

/* ---- 主场景容器（全屏，隔离主题） ---- */
.fsth-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	overflow: hidden;
	background: #0a0f1a;
	font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
	color: #e8ecf2;
	line-height: 1.6;
	margin: 0 !important;
	padding: 0 !important;
	/* 消除主题可能继承的 transform/filter 影响 */
	transform: none !important;
	filter: none !important;
}

/* 全局重置：主题样式一旦伸进 .fsth-root 内部就被清空 */
.fsth-root *,
.fsth-root *::before,
.fsth-root *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: inherit;
}

/* ---- 双背景层交叉淡入淡出 ---- */
.fsth-bg {
	position: absolute; inset: 0; z-index: 0;
	background-size: cover; background-position: center;
	opacity: 0;
	transition: opacity 3.5s ease-in-out;
}
.fsth-bg.active { opacity: 1; }

/* ---- 季节粒子层 ---- */
.fsth-particles {
	position: absolute; inset: 0; z-index: 2;
	pointer-events: none; overflow: hidden;
}
.fsth-particle {
	position: absolute; top: -24px;
	will-change: transform, opacity;
	animation-name: fsth-fall;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}
.fsth-particle.petal { background: #ffd0e4; border-radius: 0 100% 0 100%; }
.fsth-particle.leaf  { background: #e0873a; border-radius: 0 100% 0 100%; }
.fsth-particle.snow  { background: #ffffff; border-radius: 50%; }
.fsth-particle.mote  { background: rgba(255,248,220,.6); border-radius: 50%; }

@keyframes fsth-fall {
	0%   { transform: translateY(-24px) translateX(0) rotate(0deg); opacity: 0; }
	8%   { opacity: var(--peak, .7); }
	92%  { opacity: var(--peak, .7); }
	100% { transform: translateY(104vh) translateX(var(--drift, 30px)) rotate(360deg); opacity: 0; }
}

/* ---- 底部暗色渐变遮罩 ---- */
.fsth-root::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(
		to bottom,
		transparent 45%,
		rgba(4, 8, 18, .40) 65%,
		rgba(4, 8, 18, .80) 82%,
		rgba(4, 8, 18, .96) 100%
	);
	pointer-events: none; z-index: 1;
}

/* ---- 品牌卡片（左侧，含音乐控件） ---- */
.fsth-brand {
	position: absolute; top: 24px; left: 28px; z-index: 15;
	background: rgba(20, 16, 12, .45);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255,255,255,.1);
	border-radius: 14px;
	padding: 12px 18px;
	pointer-events: auto;
	display: flex; align-items: center; gap: 14px;
}
.fsth-brand-text { display: flex; flex-direction: column; justify-content: center; }
.fsth-brand-name {
	font-size: 32px; font-weight: 800; letter-spacing: 2px;
	color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.55);
	line-height: 1.15;
	text-decoration: none; transition: opacity .2s;
}
.fsth-brand-name:hover { opacity: .8; }
.fsth-brand-tagline {
	font-size: 12.5px; color: rgba(255,255,255,.58); margin-top: 1px;
	letter-spacing: .5px; font-weight: 300;
}

/* ---- 右上角统计 + 时段 ---- */
.fsth-stats {
	position: absolute; top: 24px; right: 28px; z-index: 15;
	display: flex; align-items: center; gap: 12px;
	pointer-events: none;
}
.fsth-stats > * { pointer-events: auto; }
.fsth-stat-box {
	display: flex; align-items: center; gap: 14px; font-size: 12px;
	color: rgba(255,255,255,.7);
	background: rgba(20, 16, 12, .35);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 20px; padding: 6px 14px;
}
.fsth-stat-num { color: #7dd3fc; font-weight: 600; }
.fsth-time-indicator {
	display: flex; align-items: center; gap: 7px;
	background: rgba(20, 16, 12, .35);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 20px; padding: 6px 14px;
	font-size: 12px; color: rgba(255,255,255,.55);
}
.fsth-time-dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: rgba(125,211,252,.7);
	animation: fsth-dot-pulse 2s ease-in-out infinite;
}
@keyframes fsth-dot-pulse {
	0%, 100% { opacity: .4; transform: scale(.9); }
	50% { opacity: 1; transform: scale(1.15); }
}

/* ---- 许愿卡片层 ---- */
.fsth-ribbons {
	position: absolute; inset: 0; z-index: 3;
	pointer-events: none;
	overflow: visible;
}

/* ---- 许愿卡片（纯色半透明，绝不用 backdrop-filter —— 避开文字模糊 bug） ---- */
.fsth-card {
	position: absolute;
	width: 180px;
	max-width: 23vw;
	/* 纯色半透明背景，告别 blur 导致的文字糊 */
	background: rgba(10, 16, 30, .90);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 10px;
	padding: 0;
	color: #d4dce8;
	font-size: 13px; line-height: 1.55;
	pointer-events: auto;
	animation: fsth-sway 5s ease-in-out infinite alternate, fsth-fadein .8s ease-out both;
	will-change: transform, opacity;
	cursor: default;
	transition: border-color .25s, box-shadow .25s, transform .2s;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
.fsth-card:hover {
	border-color: rgba(255,255,255,.22);
	box-shadow: 0 8px 24px rgba(0,0,0,.35);
	transform: scale(1.03);
	z-index: 10;
}
/* 顶部颜色线条 */
.fsth-card-accent { height: 3px; width: 100%; flex-shrink: 0; }
.fsth-card-body { padding: 10px 12px 11px; }
.fsth-card-text {
	margin-bottom: 7px; word-break: break-word;
	display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.fsth-card-meta {
	display: flex; align-items: center; justify-content: space-between; gap: 6px;
	border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px;
	font-size: 11px; color: rgba(212,220,232,.55);
}
.fsth-card-author { font-weight: 600; color: rgba(212,220,232,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsth-card-role { color: rgba(125,211,252,.7); white-space: nowrap; }
.fsth-card-time { color: rgba(212,220,232,.45); white-space: nowrap; font-style: italic; }

@keyframes fsth-sway {
	from { transform: rotate(-1.2deg) translateY(0); }
	to   { transform: rotate(1.2deg) translateY(-5px); }
}
@keyframes fsth-fadein {
	from { opacity: 0; transform: translateY(12px) scale(.95); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 空状态 / 加载 ---- */
.fsth-empty {
	position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
	background: rgba(14,22,38,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
	padding: 14px 24px; font-size: 14px; color: rgba(255,255,255,.6);
	z-index: 4; pointer-events: none;
}

/* ---- 底部表单区 ---- */
.fsth-form-area {
	position: absolute; right: 28px; bottom: 28px;
	z-index: 6; width: 310px; max-width: calc(100vw - 56px);
}
.fsth-form-card {
	background: rgba(14, 22, 38, .85);
	backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255,255,255,.1);
	border-radius: 14px; padding: 18px 20px 16px;
	box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.fsth-label {
	display: block; font-size: 15px; font-weight: 700;
	color: #e8ecf2; margin-bottom: 8px;
}
.fsth-form-card textarea,
.fsth-form-card input[type="text"] {
	width: 100%;
	background: rgba(255,255,255,.07);
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 8px; padding: 10px 12px;
	font-size: 14px; font-family: inherit;
	color: #e8ecf2; outline: none;
	transition: border-color .2s, background .2s;
	resize: vertical;
}
.fsth-form-card textarea::placeholder,
.fsth-form-card input[type="text"]::placeholder { color: rgba(255,255,255,.35); }
.fsth-form-card textarea:focus,
.fsth-form-card input[type="text"]:focus {
	border-color: rgba(47, 111, 186, .7); background: rgba(255,255,255,.1);
}
.fsth-count { text-align: right; font-size: 11px; color: rgba(255,255,255,.4); margin: 3px 0 10px; }
.fsth-row { display: flex; gap: 8px; margin-bottom: 10px; }
.fsth-colors-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fsth-color-label { font-size: 12px; color: rgba(255,255,255,.55); margin-right: 2px; }
.fsth-color-opt { position: relative; cursor: pointer; }
.fsth-color-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.fsth-color-dot {
	display: block; width: 22px; height: 22px; border-radius: 50%;
	border: 2px solid transparent; transition: transform .15s, border-color .15s;
}
.fsth-color-opt input:checked + .fsth-color-dot { border-color: #fff; transform: scale(1.15); }
.fsth-anon-row {
	display: flex; align-items: center; gap: 6px;
	font-size: 13px; color: rgba(255,255,255,.6); margin-bottom: 12px; cursor: pointer;
}
.fsth-btn {
	width: 100%; background: linear-gradient(135deg, #2f6fba, #245a99);
	color: #fff; border: none; border-radius: 9px;
	padding: 11px 16px; font-size: 15px; font-weight: 700;
	cursor: pointer; transition: opacity .15s, transform .1s;
}
.fsth-btn:hover { opacity: .9; }
.fsth-btn:active { transform: scale(.98); }
.fsth-btn:disabled { opacity: .5; cursor: not-allowed; }
.fsth-msg { margin-top: 8px; font-size: 13px; min-height: 1.2em; }
.fsth-msg.is-error { color: #f87171; }
.fsth-msg.is-ok { color: #6ee7b7; }

/* ---- 表单底部链接 ---- */
.fsth-form-links { display: flex; justify-content: center; gap: 24px; margin-top: 10px; }
.fsth-link {
	font-size: 12.5px; color: rgba(255,255,255,.4);
	text-decoration: none; cursor: pointer;
	display: inline-flex; align-items: center; gap: 5px; transition: color .2s;
}
.fsth-link:hover { color: rgba(255,255,255,.75); }
.fsth-link svg { width: 14px; height: 14px; opacity: .65; }

/* ---- 登录引导 ---- */
.fsth-login-prompt { text-align: center; padding: 14px 4px 6px; }
.fsth-login-text {
	font-size: 12.5px; color: rgba(255,255,255,.55); margin: 0 0 16px;
	line-height: 1.75; text-align: center;
}
.fsth-login-btn {
	display: inline-block; background: rgba(47,111,186,.7); color: #fff;
	border: none; border-radius: 9px; padding: 10px 28px;
	font-size: 14px; font-weight: 700; cursor: pointer;
	text-decoration: none; transition: background .2s;
}
.fsth-login-btn:hover { background: rgba(47,111,186,.9); }

/* ---- 我的丝带弹窗 ---- */
.fsth-modal {
	display: none; position: fixed; inset: 0;
	background: rgba(0,0,0,.55); z-index: 50;
	backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
	justify-content: center; align-items: center;
}
.fsth-modal.show { display: flex; }
.fsth-modal-mask { position: absolute; inset: 0; }
.fsth-modal-panel {
	background: rgba(14, 22, 38, .94);
	border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
	width: 420px; max-width: 90vw; max-height: 70vh;
	display: flex; flex-direction: column;
	box-shadow: 0 20px 60px rgba(0,0,0,.5);
	animation: fsth-modal-in .25s ease-out;
}
@keyframes fsth-modal-in {
	from { opacity: 0; transform: translateY(20px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fsth-modal-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.fsth-modal-title { font-size: 17px; font-weight: 700; color: #e8ecf2; }
.fsth-modal-close {
	background: none; border: none; color: rgba(255,255,255,.5);
	font-size: 20px; cursor: pointer; padding: 4px 8px; line-height: 1; transition: color .15s;
}
.fsth-modal-close:hover { color: #fff; }
.fsth-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.fsth-my-item {
	background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
	border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
	border-left: 3px solid var(--fsth-accent, #2f6fba);
}
.fsth-my-text { font-size: 13.5px; line-height: 1.55; color: #d4dce8; margin-bottom: 6px; }
.fsth-my-meta { font-size: 11px; color: rgba(255,255,255,.4); }
.fsth-modal-empty { text-align: center; padding: 40px 20px; color: rgba(255,255,255,.45); font-size: 14px; }

/* ---- 展开全文（竖状许愿条） ---- */
.fsth-readmore {
	display: none; position: fixed; inset: 0; z-index: 51;
	background: rgba(0,0,0,.5); justify-content: center; align-items: center;
}
.fsth-readmore.show { display: flex; }
.fsth-readmore-panel {
	position: relative;
	background: rgba(14, 22, 38, .94);
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 12px;
	/* 竖状许愿条：窄而长 */
	width: 200px; max-width: 85vw;
	max-height: 70vh;
	padding: 28px 18px 20px;
	overflow-y: auto;
	border-top: 4px solid var(--fsth-accent, #2f6fba);
	box-shadow: 0 16px 48px rgba(0,0,0,.45);
	display: flex; flex-direction: column; align-items: center;
}
.fsth-readmore-close {
	position: absolute; top: 8px; right: 10px;
	background: none; border: none; color: rgba(255,255,255,.4);
	font-size: 18px; line-height: 1; cursor: pointer;
	padding: 4px 6px; border-radius: 4px; transition: color .15s, background .15s;
	z-index: 1;
}
.fsth-readmore-close:hover { color: #fff; background: rgba(255,255,255,.1); }
/* 竖状文字 */
.fsth-readmore-panel .fsth-rm-text {
	font-size: 14.5px; line-height: 2; color: rgba(255,255,255,.92);
	writing-mode: vertical-rl; text-orientation: mixed;
	letter-spacing: 2px; white-space: pre-wrap; word-break: break-word;
	text-align: center; max-height: 55vh; overflow-y: auto;
}
.fsth-readmore-panel .fsth-rm-meta {
	margin-top: 14px; font-size: 11px; color: rgba(255,255,255,.4);
	display: flex; flex-direction: column; align-items: center; gap: 3px;
	writing-mode: horizontal-tb;
}

/* ---- 背景音乐控件（内嵌品牌卡片右侧，竖向滑块） ---- */
.fsth-music {
	display: flex; align-items: center; gap: 8px;
	padding-left: 12px; border-left: 1px solid rgba(255,255,255,.1); margin-left: 2px;
}
.fsth-music-toggle {
	width: 34px; height: 34px; border-radius: 50%;
	background: rgba(47,111,186,.85); border: none; color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background .2s, transform .1s; flex-shrink: 0;
}
.fsth-music-toggle:hover { background: rgba(47,111,186,1); }
.fsth-music-toggle:active { transform: scale(.94); }
.fsth-music-toggle svg { width: 16px; height: 16px; }
.fsth-music-slider-wrap { height: 52px; width: 18px; position: relative; }
/* 滑块：用 .fsth-root 父级作用域，优先级压过主题 input[type=range] */
.fsth-music-vol {
	-webkit-appearance: none !important; appearance: none !important;
	width: 4px !important; height: 100% !important; border-radius: 2px !important;
	background: rgba(255,255,255,.22) !important;
	outline: none !important; cursor: pointer !important;
	writing-mode: vertical-lr !important; direction: rtl !important;
	border: none !important; padding: 0 !important; margin: 0 !important;
	display: block !important;
}
.fsth-music-vol::-webkit-slider-thumb {
	-webkit-appearance: none !important; appearance: none !important;
	width: 13px !important; height: 13px !important; border-radius: 50% !important;
	background: #7dd3fc !important; cursor: pointer !important; border: none !important;
}
.fsth-music-vol::-moz-range-thumb {
	width: 13px !important; height: 13px !important; border-radius: 50% !important;
	background: #7dd3fc !important; cursor: pointer !important; border: none !important;
}

/* ---- 移动端适配 ---- */
@media (max-width: 640px) {
	.fsth-brand { top: 14px; left: 14px; padding: 10px 14px; gap: 10px; }
	.fsth-brand-name { font-size: 22px; }
	.fsth-stats { top: 14px; right: 14px; gap: 8px; }
	.fsth-form-area { position: static; width: auto; max-width: none; margin: auto 12px 12px; z-index: 6; }
	.fsth-card { width: 150px; font-size: 12px; }
	.fsth-modal-panel { width: 95vw; max-height: 75vh; }
	.fsth-music-slider-wrap { height: 40px; width: 16px; }
	.fsth-music-toggle { width: 30px; height: 30px; }
	.fsth-music-toggle svg { width: 14px; height: 14px; }
}
