/* ==========================================================================
   2. 全站基础：字体、链接、中英文切换、通用小东西
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--rx-void);
	color-scheme: dark;
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--rx-header) + 16px);
}

body {
	margin: 0;
	background: var(--rx-void);
	color: var(--rx-frost);
	font-family: var(--rx-font);
	font-size: var(--rx-size-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

img,
svg,
video,
canvas {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

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

button {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--rx-display);
	font-weight: 600;
	line-height: 1.02;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

p {
	margin: 0;
	text-wrap: pretty;
}

::selection {
	background: var(--rx-cyan);
	color: #001312;
}

:focus-visible {
	outline: 2px solid var(--rx-cyan);
	outline-offset: 3px;
}

/* ── 中英文切换 ──
   每段文字都有 .lang-en 和 .lang-zh 两份。<html> 上的 data-reflex-language
   决定显示哪一份（inc/setup.php 在页面载入前就设好，site.js 负责按钮）。 */
html:not([data-reflex-language="zh"]) .lang-zh,
html[data-reflex-language="zh"] .lang-en {
	display: none !important;
}

/* 中文标题：字距放松一点，行距大一点 */
html[data-reflex-language="zh"] h1,
html[data-reflex-language="zh"] h2,
html[data-reflex-language="zh"] h3 {
	letter-spacing: 0.02em;
	line-height: 1.18;
}

/* ── 内容宽度 ── */
.rx-wrap {
	width: min(100% - 2 * var(--rx-gutter), var(--rx-max));
	margin-inline: auto;
}

.rx-center {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.rx-section {
	position: relative;
	padding-block: var(--rx-space);
}

/* 跳到主要内容（只有用键盘 Tab 时才看得到） */
.rx-skip {
	position: fixed;
	left: 16px;
	top: -60px;
	z-index: 200;
	padding: 10px 16px;
	background: var(--rx-cyan);
	color: #001312;
	font-weight: 600;
}

.rx-skip:focus {
	top: 16px;
}

/* 线条图标 */
.rx-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

.rx-icon--flip {
	transform: scaleX(-1);
}

/* 底下的小字注解 */
.rx-footnote {
	margin-top: 24px;
	color: var(--rx-dim);
	font-size: var(--rx-size-small);
	max-width: 70ch;
}

/* 有渐层的文字（用在价格、数字） */
.rx-signal-text {
	background: var(--rx-signal);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* 只给读屏软件读、画面上看不到的文字（标题拆字时用） */
.rx-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
