/*! ethan-static v1.0.0 | shared tokens, chrome components and fonts
 *  Source: https://github.com/KabulMus/MyStatic
 *  Fonts:  https://static.ethan929.com/f/<content-hash>/
 */

/* --- 0. 字体声明（共享字体，内容寻址） --- */
@font-face{font-family:'Musical';src:url('https://static.ethan929.com/f/e091faa7/Musical-Light.woff2') format('woff2');font-weight:300;font-style:normal;font-display:swap;}
@font-face{font-family:'Musical';src:url('https://static.ethan929.com/f/2a5cb6e3/Musical-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'Musical';src:url('https://static.ethan929.com/f/1941616f/Musical-Semibold.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;}
@font-face{font-family:'Musical';src:url('https://static.ethan929.com/f/64468a43/Musical-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap;}
@font-face{font-family:'Icons';src:url('https://static.ethan929.com/f/e3adc677/Icons-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:block;font-feature-settings:"liga" 1;}

/* --- 1. 共享设计令牌 ---
   只放两站数值完全一致、语义一致的变量。
   站点专属令牌（分类色、代码工具栏、品牌色等）留在各自的 :root 里。 */

:root {
    --primary-blue: #1e66c6;
    --color-blue: var(--primary-blue);
    --color-blue-bg: rgba(30, 102, 198, 0.1);
    --color-blue-border: rgba(30, 102, 198, 0.3);
    --primary-purple: #7463f1;
    --bg-light: #f1f5f9;
    --text-main: #1D1D1F;
    --text-sub: #6b7280;
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --card-bg: #ffffff;
    --card-shadow: 0 8px 20px -4px rgba(14, 52, 112, 0.12), 0 4px 8px -2px rgba(14, 52, 112, 0.08);
    --card-hover-shadow: 0 12px 30px rgba(14, 52, 112, 0.2);
    --item-border: rgba(0, 0, 0, 0.08);
    --card-radius: 12px;
    --on-primary: #ffffff;
    /* 背景装饰的墨色（线稿小图形）：亮底 ≈0.105 品牌蓝，暗底 0.075 亮蓝，感知亮度接近 */
    --bg-doodle: rgba(30, 102, 198, 0.1);
    --selection-bg: #1e67c640;
}

/* 深色模式变量 */
:root[data-theme='dark'] {
    --primary-blue: #93c5fd;
    --color-blue: var(--primary-blue);
    --color-blue-bg: rgba(147, 197, 253, 0.15);
    --color-blue-border: rgba(147, 197, 253, 0.3);
    --primary-purple: #aaa2e9;
    --bg-light: #081023;
    --text-main: #F5F5F7;
    --text-sub: #94a3b8;
    --navbar-bg: rgba(3, 9, 23, 0.8);
    --card-bg: #1e293b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.7);
    --item-border: rgba(255, 255, 255, 0.08);
    --on-primary: #0f172a;
    --bg-doodle: rgba(147, 197, 253, 0.05);
    --selection-bg: #93c5fd80;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --primary-blue: #93c5fd;
        --color-blue: var(--primary-blue);
        --color-blue-bg: rgba(147, 197, 253, 0.15);
        --color-blue-border: rgba(147, 197, 253, 0.3);
        --primary-purple: #aaa2e9;
        --bg-light: #081023;
        --text-main: #F5F5F7;
        --text-sub: #94a3b8;
        --navbar-bg: rgba(3, 9, 23, 0.8);
        --card-bg: #1e293b;
        --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
        --card-hover-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.7);
        --item-border: rgba(255, 255, 255, 0.08);
        --on-primary: #0f172a;
        --bg-doodle: rgba(147, 197, 253, 0.05);
        --selection-bg: #93c5fd80;
    }
}

/* --- 2. 共享基础复位 --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}

/* 彻底隐藏所有滚动条，但保留滑动/滚动功能 */
*::-webkit-scrollbar { display: none; } /* Chrome, Safari, Edge */

/* 确保表单元素继承页面字体 */
button, input, select, textarea { font-family: inherit; }

/* --- 选中文字颜色 --- */
::selection {
    background: var(--selection-bg);
}

/* 图标字体（ligature） */
icons {
    font-family: 'Icons';
    font-weight: 400;
}

/* --- 响应式显隐控制 --- */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
}

/* --- 3. 共享导航组件 ---
   .navbar 与 .nav-container 两站宽度/定位不同，属于站点皮肤，留在各自样式表。 */

.nav-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text-main);
	font-weight: 700;
	font-size: 1.1rem;
    stroke: var(--text-main);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
	transition: color 0.2s ease, font-weight 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.nav-brand:hover { color: var(--primary-blue); font-weight: 900; stroke: var(--primary-blue); stroke-width: 6; }

.nav-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(0,0,0,0.05);
}

.nav-links {
	display: flex;
	gap: 20px;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--text-main);
	cursor: pointer;
	padding: 5px;
	align-items: center;
	justify-content: center;
    stroke: var(--text-main);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
	transition: color 0.2s ease, font-weight 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

/* 触屏设备（无悬停能力）不启用按钮 hover，避免点击后样式残留/卡住 */
@media (hover: hover) and (pointer: fine) {
    .menu-toggle:hover { color: var(--primary-blue); stroke-width: 6; }
}

.menu-toggle.active { color: var(--primary-blue); stroke-width: 6; }

.menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; }

.nav-links a {
	text-decoration: none;
	color: var(--text-main);
	font-size: 0.9rem;
	font-weight: 400;
	transition: color 0.2s ease, font-weight 0.2s ease;
	position: relative;
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

/* 使用伪元素预留粗体占位，防止等宽字体抖动 */
.nav-links a::before {
	content: attr(data-text);
	height: 0;
	visibility: hidden;
	overflow: hidden;
	user-select: none;
	pointer-events: none;
	font-weight: 700;
}

.nav-links a:hover { color: var(--primary-blue); font-weight: 700; }

/* --- 移动端下拉菜单 --- */
.nav-dropdown {
	position: absolute;
	top: 70px;
	right: 20px;
	background: var(--card-bg);
	border-radius: 12px;
	box-shadow: var(--card-shadow);
	display: flex;
	flex-direction: column;
	min-width: 150px;
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-20px);
	transition: all 0.5s ease;
	z-index: 101;
}

.nav-dropdown.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.nav-dropdown a {
	text-decoration: none;
	color: var(--text-main);
	padding: 12px 16px;
	font-weight: 400;
	font-size: 1rem;
    line-height: 0.8;
	border-radius: 8px;
	transition: color 0.2s ease, font-weight 0.2s ease;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
}

.nav-dropdown a::before {
	content: attr(data-text);
	height: 0;
	visibility: hidden;
	overflow: hidden;
	user-select: none;
	pointer-events: none;
	font-weight: 700;
}

.nav-dropdown a:hover {
	color: var(--primary-blue);
	font-weight: 700;
}

/* --- 导航分割线 --- */
.nav-divider {
    display: inline-block;
    width: 2px;
    height: 20px;
    background: var(--text-sub);
    opacity: 0.3;
    align-self: center;
    border-radius: 3px;
}

/* 移动端下拉菜单内的横向分割线 */
.dropdown-divider {
    height: 1px;
    background: var(--text-sub);
    opacity: 0.2;
    margin: 8px 16px;
}

/* --- 页面激活态样式 (用于子页面) --- */
.nav-links a.active,
.nav-dropdown a.active {
    color: var(--primary-blue);
    font-weight: 700;
}

/* 确保激活态的 ::before 空间保持稳定 */
.nav-links a.active::before,
.nav-dropdown a.active::before {
    font-weight: 700;
}

/* --- 4. 共享按钮与切换器 ---
   主站另有 .back-home-btn，位置与它自己的规则留在主站。 */

.theme-toggle-btn,
.lang-toggle-btn {
    position: fixed; right: 25px; width: 44px; height: 44px; z-index: 101;
    border-radius: 50%; background: var(--card-bg); color: var(--text-main);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--item-border);
    box-shadow: var(--card-shadow);
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease; cursor: pointer;
    text-decoration: none;
}

.theme-toggle-btn { bottom: 25px; }
.lang-toggle-btn { bottom: 80px; }

.theme-toggle-btn svg,
.lang-toggle-btn svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle-btn:hover,
    .lang-toggle-btn:hover {
        transform: scale(1.1); color: var(--primary-blue); box-shadow: var(--card-hover-shadow);
    }
}

/* 主题按钮双图标：CSS 按 data-theme 控制显隐（data-theme 由 head 首帧内联脚本设定，无 JS 替换闪烁） */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: flex; }
:root[data-theme='dark'] .theme-toggle-btn .icon-sun { display: flex; }
:root[data-theme='dark'] .theme-toggle-btn .icon-moon { display: none; }

/* --- 5. 共享页脚 ---
   footer 容器本身的宽度/间距两站不同，留在各自样式表。 */

footer p {
    color: var(--text-sub);
    margin: 4px 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a {
    color: var(--primary-blue);
    text-decoration: none;
	border-bottom: 1.5px solid transparent;
	transition: border-color 0.2s ease;
}

footer a:hover {
    border-bottom-color: var(--primary-blue);
}

/* --- 6. 共享全局 Toast --- */

.toast-notice {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg);
    color: var(--text-main);
    padding: 10px 22px;
    border-radius: 50px;
    border: 1px solid var(--primary-blue);
    box-shadow: var(--card-shadow);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    white-space: nowrap;
}

.toast-notice.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
