/* ===== Reset ===== */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ===== Theme Variables ===== */
:root {
	--bg: #f0f0f0;
	--text: #1a1a1a;
	--text-secondary: #666666;
	--card-bg: rgba(255, 255, 255, 0.6);
	--card-border: rgba(0, 0, 0, 0.08);
	--navbar-bg: rgba(255, 255, 255, 0.72);
	--footer-bg: rgba(255, 255, 255, 0.6);
	--accent: #3a7bd5;
	--link-line: #3a7bd5;
	--shadow: rgba(0, 0, 0, 0.08);
	--nav-height: 60px;
	--toggle-bg: rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] {
	--bg: #1a1a1a;
	--text: #e8e8e8;
	--text-secondary: #aaaaaa;
	--card-bg: rgba(50, 50, 50, 0.6);
	--card-border: rgba(255, 255, 255, 0.08);
	--navbar-bg: rgba(30, 30, 30, 0.78);
	--footer-bg: rgba(30, 30, 30, 0.6);
	--accent: #5a9bf5;
	--link-line: #5a9bf5;
	--shadow: rgba(0, 0, 0, 0.35);
	--toggle-bg: rgba(255, 255, 255, 0.08);
}

/* ===== Base ===== */
html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Source Han Sans SC', 'Noto Sans SC', 'HarmonyOS Sans',
		'vivo Sans', 'OPPO Sans', system-ui, -apple-system, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	transition: background 0.4s ease, color 0.4s ease;
}

/* ===== Navbar ===== */
.navbar {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--nav-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 clamp(16px, 4vw, 32px);
	background: var(--navbar-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--card-border);
	transition: background 0.4s ease;
}

.nav-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--text);
	text-decoration: none;
	letter-spacing: 3px;
	transition: color 0.3s ease;
}

.nav-logo {
	height: 32px;
	width: auto;
	display: block;
	border-radius: 4px;
}

.nav-brand:hover {
	color: var(--accent);
}

/* Hamburger toggle (checkbox hack) */
.nav-toggle {
	display: none;
}

.nav-toggle-label {
	display: none;
	cursor: pointer;
	padding: 8px;
	margin-right: -8px;
}

.nav-toggle-label span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--text);
	margin: 5px 0;
	border-radius: 2px;
	transition: all 0.3s ease;
}

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

.nav-links a {
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 8px;
	transition: color 0.3s ease, background 0.3s ease;
}

.nav-links a:hover {
	color: var(--text);
	background: var(--toggle-bg);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 10px;
	background: var(--toggle-bg);
	cursor: pointer;
	transition: background 0.3s ease;
	margin-left: 4px;
}

.theme-toggle:hover {
	background: var(--card-border);
}

/* CSS-drawn sun/moon icon */
.theme-icon {
	display: block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #f5a623;
	position: relative;
	transition: all 0.4s ease;
	box-shadow: 0 0 0 0 transparent;
}

/* Sun rays (light mode) */
.theme-icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: transparent;
	box-shadow:
		0 -14px 0 -5px #f5a623,
		0 14px 0 -5px #f5a623,
		-14px 0 0 -5px #f5a623,
		14px 0 0 -5px #f5a623,
		-10px -10px 0 -5px #f5a623,
		10px -10px 0 -5px #f5a623,
		-10px 10px 0 -5px #f5a623,
		10px 10px 0 -5px #f5a623;
	transition: all 0.4s ease;
}

/* Moon crescent mask (dark mode) */
html[data-theme="dark"] .theme-icon {
	background: #c8d6e5;
	box-shadow: inset -5px -2px 0 0 #8395a7;
}

html[data-theme="dark"] .theme-icon::before {
	box-shadow: none;
}

/* ===== Hero Section ===== */
.hero {
	position: relative;
	height: calc(100vh - var(--nav-height));
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hero-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(to bottom,
			rgba(0, 0, 0, 0.1) 0%,
			rgba(0, 0, 0, 0.05) 40%,
			rgba(0, 0, 0, 0.5) 100%);
	z-index: 1;
}

.hero-content {
	position: relative;
	z-index: 2;
	text-align: center;
}

.hero-glass {
	display: inline-block;
	padding: 0.2em 0.6em;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero-title {
	font-size: clamp(3rem, 10vw, 6rem);
	font-weight: 900;
	color: #ffffff;
	letter-spacing: 12px;
	text-shadow:
		0 2px 20px rgba(0, 0, 0, 0.3),
		0 4px 40px rgba(0, 0, 0, 0.15);
	animation: heroFadeIn 1.2s ease-out;
}

.hero-hint {
	position: absolute;
	bottom: 32px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85rem;
	letter-spacing: 2px;
	animation: float 2s ease-in-out infinite;
}

/* ===== Content Sections ===== */
.section {
	padding: 80px 24px;
	max-width: 960px;
	margin: 0 auto;
}

/* ===== Section Block ===== */
.section-block {
	width: 100%;
}

.section-title {
	font-size: 1.8rem;
	font-weight: 700;
	text-align: center;
	display: flex;
	align-items: center;
	gap: 1em;
	margin-bottom: 16px;
	color: var(--text);
}

.section-title::before,
.section-title::after {
	content: '';
	flex: 1;
	height: 2px;
	background: var(--card-border);
	border-radius: 2px;
}

/* ===== Link Cards Grid ===== */
.link-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-top: 32px;
}

/* ===== Link Card ===== */
.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    border-radius: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid var(--card-accent);   /* 彩色细线环绕 */
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s ease;
}

.link-card:hover {
    transform: translateY(-2px);
}

.card-main-title {
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 8px;
}

.card-subtitle {
	font-size: 0.9rem;
	color: var(--text-secondary);
	opacity: 0.8;
	min-height: 1.2em;
}

/* ===== Preset Card Colors ===== */
.card-color-blue {
	--card-accent: #7faedb;    /* 原 #3a7bd5 → 柔和蓝 */
}

.card-color-green {
	--card-accent: #6bbf84;    /* 原 #27ae60 → 薄荷绿 */
}

.card-color-purple {
	--card-accent: #b392c7;    /* 原 #8e44ad → 淡紫 */
}

.card-color-orange {
	--card-accent: #f0b27a;    /* 原 #e67e22 → 奶油橘 */
}

.card-color-red {
	--card-accent: #e4412f;    /* 原 #e74c3c → 柔和珊瑚红 */
}

.card-color-teal {
	--card-accent: #7ed6c4;    /* 原 #1abc9c → 淡青 */
}

.card-color-pink {
	--card-accent: #ff8fa3;    /* 原 #ff004c → 樱花粉 */
}

/* ===== Footer ===== */
.footer {
	background: var(--footer-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-top: 1px solid var(--card-border);
	padding: 32px clamp(16px, 4vw, 32px);
	transition: background 0.4s ease;
}

.footer-inner {
	max-width: 960px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
}

.footer-copy {
	font-size: 0.9rem;
	color: var(--text);
	font-weight: 600;
}

.footer-desc {
	font-size: 0.85rem;
	color: var(--text-secondary);
	margin-top: 4px;
}

.footer-logo {
	max-height: 48px;
	width: auto;
	opacity: 0.8;
	transition: opacity 0.3s ease;
}

.footer-logo:hover {
	opacity: 1;
}

/* ===== Animations ===== */
@keyframes float {
	0%,
	100% {
		transform: translateX(-50%) translateY(0);
	}

	50% {
		transform: translateX(-50%) translateY(-8px);
	}
}

@keyframes heroFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ===== Responsive: Tablet & Mobile ===== */

/* 中等屏幕：一行两个卡片 */
@media (min-width: 600px) and (max-width: 1024px) {
    .link-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 原有 768px 断点：导航、间距等 */
@media (max-width: 768px) {
    .nav-toggle-label {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--navbar-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--card-border);
        padding: 12px 0;
        gap: 0;
    }

    .nav-links a {
        padding: 12px 24px;
        border-radius: 0;
        width: 100%;
    }

    .theme-toggle {
        margin: 8px 24px;
        align-self: flex-start;
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .section {
        padding: 48px 16px;
    }
}

/* 手机单列卡片（≤599px） */
@media (max-width: 599px) {
    .link-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .link-card {
        padding: 24px 20px;
    }
}

/* ===== Responsive: Small Mobile ===== */
@media (max-width: 480px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        order: -1;
    }

    .hero-title {
        letter-spacing: 6px;
    }
}