:root{
	/* 主色取自头像 flower #4696d2，蓝白基调参考 zotero-chinese */
	--blue: #4696d2;
	--blue-dark: #2c6f9e;
	--blue-deep: #1f5b8a;
	--blue-light: #eaf4fb;
	--blue-soft: #f4f9fd;

	--bg: #f7fafc;
	--card: #ffffff;
	--border: #d6e8f5;
	--text: #3d5a73;
	--text-strong: #1f3a52;
	--shadow-out: 0 3px 12px rgba(70, 150, 210, 0.12);
	--shadow-hover: 0 10px 24px rgba(70, 150, 210, 0.2);
	--nav-bg: rgba(247, 250, 252, 0.82);
}

html.dark{
	--blue: #63aadd;
	--blue-dark: #7db9e4;
	--blue-deep: #9cc7e8;
	--blue-light: #1d3346;
	--blue-soft: #16242f;

	--bg: #0e1a26;
	--card: #16242f;
	--border: #244055;
	--text: #a8c1d6;
	--text-strong: #d7e6f2;
	--shadow-out: 0 3px 14px rgba(0, 0, 0, 0.5);
	--shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.6);
	--nav-bg: rgba(14, 26, 38, 0.82);
}

*{
	box-sizing: border-box;
}

html{
	background: var(--bg);
}

body{
	margin: 0;
	font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
	color: var(--text);
	min-height: 100vh;
	/* flower 原图做页面背景：中心对齐右上角，尺寸 1680px（840=1680/2 使中心落在右缘顶角） */
	background:
		url("../images/flower.min.svg") no-repeat calc(100% + 800px) -840px / 1680px 1680px,
		var(--bg);
}

a{
	color: inherit;
	text-decoration: none;
}

:focus{
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

.container{
	width: 100%;
	margin: 0 auto;
	/* 全宽遮罩：左右 padding 撑出 900px 内容区，背景覆盖含 margin 的整行 */
	padding: 40px max(20px, calc((100% - 900px) / 2)) 20px;
	/* 0.7 遮罩，压住透出的 flower 纹理，保证正文可读 */
	background: rgba(247, 250, 252, 0.7);
}

html.dark .container{
	background: rgba(14, 26, 38, 0.7);
}

/* ---------- 顶部导航 ---------- */
.nav{
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 56px;
	padding: 0 max(20px, calc((100vw - 900px) / 2));
	background: var(--nav-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}

.nav-logo{
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--blue-deep);
}

.nav-logo img{
	height: 26px;
	width: 26px;
	border-radius: 50%;
	background: #fff;
	padding: 2px;
	border: 1px solid var(--border);
}

html.dark .nav-logo img{
	background: var(--card);
}

.nav-links{
	display: flex;
	align-items: center;
	gap: 22px;
}

.nav-links a{
	font-size: 0.92rem;
	color: var(--text);
	font-weight: 500;
	transition: color 0.18s ease;
}

.nav-links a:hover{
	color: var(--blue);
}

.nav-links a.active{
	color: var(--blue);
	font-weight: 600;
}

/* ---------- 主题切换按钮 ---------- */
.nav-theme-btn{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--card);
	color: var(--blue-dark);
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
	margin-left: 2px;
}

.nav-theme-btn:hover{
	background: var(--blue-light);
	color: var(--blue-deep);
	transform: translateY(-2px);
}

.theme-icon{
	width: 17px;
	height: 17px;
	display: none;
}

html:not(.dark) .theme-sun{ display: block; }
html.dark .theme-moon{ display: block; }

/* ---------- 顶部欢迎区（浅蓝白清爽风） ---------- */
.hero{
	/* 半透明渐变，露出 body 的 flower 纹理（中心在页面左上角） */
	background: linear-gradient(180deg, rgba(236, 247, 255, 0.7), rgba(247, 250, 252, 0.7));
	/* border-bottom: 1px solid var(--border); */
	padding: 135px 20px 84px;
	text-align: center;
}

html.dark .hero{
	background: linear-gradient(180deg, rgba(20, 34, 47, 0.7), rgba(14, 26, 38, 0.7));
}

.hero-inner{
	display: flex;
	flex-direction: column;
	align-items: center;
	animation: rise-in 0.7s ease forwards;
}

#profile{
	height: 112px;
	width: 112px;
	border-radius: 50%;
	background: #fff;
	padding: 6px;
	border: 2px solid var(--blue-light);
	box-shadow: var(--shadow-out);
	animation: float 4.5s ease-in-out infinite;
}

html.dark #profile{
	background: var(--card);
	border-color: var(--border);
}

@keyframes float{
	0%, 100%{ transform: translateY(0); }
	50%{ transform: translateY(-7px); }
}

#name{
	margin: 22px 0 8px;
	color: var(--blue-deep);
	font-size: 1.75rem;
	letter-spacing: 1px;
}

#slogan{
	margin: 0;
	color: var(--text);
	font-size: 0.98rem;
}

#social{
	display: flex;
	gap: 14px;
	margin-top: 20px;
}

#social a{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--card);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-out);
	color: var(--blue-dark);
	transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

#social a:hover{
	background: var(--blue-light);
	color: var(--blue-deep);
	transform: translateY(-3px);
}

#social svg{
	width: 20px;
	height: 20px;
}

@keyframes rise-in{
	from{
		opacity: 0;
		transform: translateY(14px);
	}
	to{
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- 分区 ---------- */
.card-section{
	margin: 0 0 52px;
	/* 锚点跳转时给 sticky 导航让位 */
	scroll-margin-top: 72px;
}

.anchor{
	display: block;
	scroll-margin-top: 72px;
}

.section-head{
	margin-bottom: 20px;
}

.section-title{
	margin: 0 0 6px;
	font-size: 1.2rem;
	color: var(--blue-deep);
	display: flex;
	align-items: center;
	gap: 8px;
	letter-spacing: 1px;
}

.section-sub{
	margin: 0;
	font-size: 0.86rem;
	opacity: 0.7;
}

/* ---------- 卡片网格 ---------- */
.grid{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 16px;
}

/* 分区只有一张卡时限制宽度，避免横向拉满 */
.grid:has(.tile:only-child) .tile{
	max-width: 420px;
}

.tile{
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
	border-radius: 16px;
	background: var(--card);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-out);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tile:hover{
	transform: translateY(-4px);
	box-shadow: var(--shadow-hover);
	border-color: var(--blue);
}

.tile-top{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.tile-icon{
	font-size: 1.5rem;
	line-height: 1;
}

.tile_name{
	font-weight: 600;
	color: var(--text-strong);
	font-size: 1.02rem;
}

.badge{
	flex-shrink: 0;
	font-size: 0.72rem;
	padding: 2px 9px;
	border-radius: 999px;
	font-weight: 600;
}

.badge.ok{
	background: var(--blue-light);
	color: var(--blue-dark);
	border: 1px solid var(--border);
}

.badge.old{
	background: #f1f5f9;
	color: #94a3b8;
	border: 1px solid var(--border);
}

html.dark .badge.old{
	background: #243447;
	color: #94b0c6;
}

.badge.toy{
	background: #f1f5f9;
	color: #94a3b8;
	border: 1px solid var(--border);
}

html.dark .badge.toy{
	background: #243447;
	color: #94b0c6;
}

.tile_desc{
	margin: 0;
	font-size: 0.88rem;
	opacity: 0.82;
}

/* ---------- 领域标签 ---------- */
.tags{
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tag{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--card);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-out);
	color: var(--blue-dark);
	font-size: 0.88rem;
	font-weight: 500;
	transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.tag:hover{
	transform: translateY(-2px);
	background: var(--blue-light);
	border-color: var(--blue);
}

/* ---------- 留言板：留言-回复卡片，瀑布流铺展 ---------- */
.guestbook{
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.gb-stats{
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 22px;
	font-size: 0.78rem;
	opacity: 0.55;
}

.gb-stats strong{
	color: var(--blue-deep);
	font-size: 1em;
}

/* 瀑布流：CSS columns 按内容高度自然铺列，卡片不跨列断开 */
.gb-list{
	list-style: none;
	margin: 0;
	padding: 0;
	columns: 3 230px;
	column-gap: 14px;
}

/* 留言卡片：一条留言 + 其 AI 回复作为一个整体卡片 */
.gb-item{
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin: 0 0 14px;
	padding: 14px 16px;
	border-radius: 16px;
	background: var(--card);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-out);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	animation: rise-in 0.45s ease backwards;
}

.gb-item:hover{
	transform: translateY(-3px);
	box-shadow: var(--shadow-hover);
	border-color: var(--blue);
}

/* 轮询刷新时静默更新，避免整屏重播动画（见 guestbook.js） */
.gb-list.gb-settled .gb-item{
	animation: none;
}

/* 首屏入场逐条错开 */
.gb-list .gb-item:nth-child(2){ animation-delay: 0.05s; }
.gb-list .gb-item:nth-child(3){ animation-delay: 0.1s; }
.gb-list .gb-item:nth-child(4){ animation-delay: 0.15s; }
.gb-list .gb-item:nth-child(5){ animation-delay: 0.2s; }

.gb-item-head{
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	font-size: 0.85rem;
}

.gb-item-user{
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

/* 留言头像：按昵称生成的透明花 SVG，圆形展示 */
.gb-avatar{
	width: 32px;
	height: 32px;
	border-radius: 50%;
	flex-shrink: 0;
	background: transparent;
	box-shadow: 0 0 0 1px var(--border);
}

.gb-item-name{
	font-weight: 600;
	color: var(--blue-deep);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gb-item-time{
	font-size: 0.74rem;
	opacity: 0.5;
	flex-shrink: 0;
}

/* 留言正文 */
.gb-item-text{
	margin: 0;
	font-size: 0.93rem;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}

/* 空状态：可点击跳转输入框 */
.gb-empty{
	margin: 4px 0 2px;
	padding: 26px 18px;
	text-align: center;
	font-size: 0.9rem;
	color: var(--text);
	opacity: 0.85;
	background: var(--blue-soft);
	border: 1.5px dashed var(--blue);
	border-radius: 14px;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.gb-empty:hover{
	background: var(--blue-light);
	border-color: var(--blue-deep);
	transform: translateY(-1px);
}

.gb-empty-icon{
	display: block;
	font-size: 1.7rem;
	line-height: 1;
	margin-bottom: 7px;
}

/* 输入栏：聊天式，聚焦时整栏高亮 */
.gb-form{
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px 10px;
	border-radius: 16px;
	background: var(--blue-soft);
	border: 1px solid var(--border);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.gb-form:focus-within{
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgba(70, 150, 210, 0.14);
}

.gb-input-head{
	display: flex;
	align-items: center;
	gap: 10px;
}

.gb-form input#gb-name{
	flex: 0 0 170px;
	font: inherit;
	font-size: 0.9rem;
	color: var(--text);
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 8px 12px;
	transition: border-color 0.18s ease;
}

.gb-form input#gb-name:focus{
	outline: none;
	border-color: var(--blue);
}

/* 占位符统一弱化，避免深浅模式下提示文字看不清或带浏览器默认灰 */
.gb-form input#gb-name::placeholder,
.gb-form textarea::placeholder{
	color: var(--text);
	opacity: 0.45;
}

/* 深色模式下表单背景与 --card 同色，输入框填充会"消失"，改用更亮的 --blue-light 作底色 */
html.dark .gb-form input#gb-name{
	background: var(--blue-light);
}

.gb-count{
	margin-left: auto;
	font-size: 0.74rem;
	opacity: 0.5;
	flex-shrink: 0;
}

.gb-form textarea{
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--text);
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 6px 2px;
	width: 100%;
	min-height: 84px;
	resize: vertical;
}

.gb-form textarea:focus{
	outline: none;
}

.gb-btn-wrap{
	display: flex;
	justify-content: flex-end;
}

.gb-btn{
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	padding: 9px 18px;
	border-radius: 999px;
	border: 1px solid var(--blue);
	background: var(--blue);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 3px 9px rgba(70, 150, 210, 0.35);
	transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.gb-btn-icon{
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

.gb-btn:hover{
	background: var(--blue-dark);
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(70, 150, 210, 0.45);
}

.gb-btn:disabled{
	opacity: 0.6;
	cursor: default;
	transform: none;
	box-shadow: none;
}
}

/* AI 自动回复块：卡片内嵌，左侧蓝边 + 浅蓝底，与访客留言清晰区分 */
.gb-item-ai{
	margin-top: 10px;
	padding: 9px 12px;
	border-radius: 12px;
	background: var(--blue-light);
	border-left: 3px solid var(--blue);
}

.gb-item-ai-head{
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.76rem;
	font-weight: 700;
	color: var(--blue-deep);
	margin-bottom: 3px;
	letter-spacing: 0.3px;
}

.gb-item-ai-head::before{
	content: "✦";
	color: var(--blue);
}

.gb-item-ai-text{
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
	opacity: 0.8;
}

/* "思考中"占位：虚线弱化 + 省略号闪烁，等 AI 回复生成后由 JS 替换为真实内容 */

.gb-item-ai-thinking .gb-item-ai-text{
	font-style: italic;
}

.gb-item-ai-thinking .gb-item-ai-text::after{
	content: "…";
	display: inline-block;
	animation: gb-dots 1.2s steps(3, end) infinite;
}

@keyframes gb-dots{
	0%{ content: ""; }
	33%{ content: "."; }
	66%{ content: ".."; }
	100%{ content: "..."; }
}

/* ---------- 右侧锚点目录（折叠圆点 + hover 展开卡片） ---------- */
.side-dots{
	position: fixed;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 40;
	display: flex;
	align-items: center;
}

/* 折叠态：圆点 minimap，一眼看出当前所在分区 */
.side-dots-rail{
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.side-dots-rail a{
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--card);
	border: 2px solid var(--blue);
	box-shadow: var(--shadow-out);
	transition: background 0.2s ease, transform 0.2s ease;
}

.side-dots-rail a:hover{
	transform: scale(1.25);
}

.side-dots-rail a.active{
	background: var(--blue);
	transform: scale(1.35);
}

/* DeepSeek 风格：hover / 键盘聚焦时，左侧浮出条目卡片 */
.side-dots-card{
	position: absolute;
	right: 150%;
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	width: 190px;
	max-height: 72vh;
	overflow-y: auto;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow-out);
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.side-dots:hover .side-dots-card,
.side-dots:focus-within .side-dots-card{
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
	pointer-events: auto;
}

.side-dots-card a{
	display: block;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 0.9rem;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background 0.15s ease, color 0.15s ease;
}

.side-dots-card a:hover{
	background: var(--blue-soft);
	color: var(--blue-deep);
}

.side-dots-card a.active{
	background: var(--blue-light);
	color: var(--blue-deep);
	font-weight: 600;
}

@media (max-width: 768px){
	.side-dots{
		display: none;
	}
}

/* ---------- 页脚 ---------- */
.footer{
	margin: 48px 0 52px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	color: var(--text);
	opacity: 0.75;
}

.footer-line{
	display: flex;
	align-items: center;
	justify-content: center;
}

.footicon{
	height: 16px;
}

.footname{
	margin: 0 15px 0 5px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px){
	body{
		/* 移动端降低 flower 背景图尺寸（700px，中心仍对齐右上角） */
		background:
			url("../images/flower.min.svg") no-repeat calc(100% + 350px) -350px / 700px 700px,
			var(--bg);
	}
	.hero{
		padding: 52px 16px 64px;
	}
	#name{
		font-size: 1.4rem;
	}
	.container{
		padding: 28px 14px 16px;
	}
	.grid{
		grid-template-columns: 1fr;
	}
	.nav-links{
		gap: 14px;
	}
}
