/* ==========================================================================
   松滋高中学生论坛 · 设计令牌与基础排版
   --------------------------------------------------------------------------
   1. 设计令牌（Design Tokens）
   2. 现代化重置
   3. 排版系统
   4. 表单元素基础
   5. 可访问性
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
	/* 主色 —— 清爽学院蓝 */
	--svhs-primary: #1e5aa8;
	--svhs-primary-hover: #164a8a;
	--svhs-primary-active: #103a6e;
	--svhs-primary-light: #4a9dde;
	--svhs-primary-soft: #eef5ff;
	--svhs-primary-soft-2: #dfebfb;
	--svhs-primary-ring: rgba(30, 90, 168, .16);

	/* 辅助色 —— 活力橙 */
	--svhs-accent: #e8a33d;
	--svhs-accent-hover: #d4912c;
	--svhs-accent-soft: #fff7e8;

	/* 语义色 */
	--svhs-success: #0f9d58;
	--svhs-success-soft: #e9f7ef;
	--svhs-warning: #dba617;
	--svhs-warning-soft: #fdf6e3;
	--svhs-danger: #d63638;
	--svhs-danger-soft: #fdf0f0;
	--svhs-info: #1e5aa8;
	--svhs-info-soft: #eef5ff;

	/* 中性色 */
	--svhs-ink: #1f2937;
	--svhs-ink-2: #374151;
	--svhs-muted: #6b7280;
	--svhs-muted-2: #9ca3af;
	--svhs-line: #e3e8ef;
	--svhs-line-soft: #eef1f6;
	--svhs-canvas: #f5f7fa;
	--svhs-surface: #ffffff;
	--svhs-surface-2: #f8fafc;

	/* 渐变 */
	--svhs-grad-primary: linear-gradient(135deg, #164a8a 0%, #1e5aa8 42%, #2d7dd2 78%, #4a9dde 100%);
	--svhs-grad-hero: linear-gradient(135deg, #123a6d 0%, #1e5aa8 45%, #2f7fd4 100%);

	/* 圆角（参考 Zibll：整体更收敛，卡片 8px 级别） */
	--svhs-r-xs: 4px;
	--svhs-r-sm: 6px;
	--svhs-r-md: 8px;
	--svhs-r-lg: 10px;
	--svhs-r-xl: 14px;
	--svhs-r-full: 999px;

	/* 阴影（Zibll 式：极轻、贴近、几乎看不见边界） */
	--svhs-sh-xs: 0 1px 2px rgba(17, 24, 39, .04);
	--svhs-sh-sm: 0 1px 3px rgba(17, 24, 39, .05), 0 1px 2px rgba(17, 24, 39, .03);
	--svhs-sh-md: 0 3px 10px rgba(17, 24, 39, .06), 0 1px 3px rgba(17, 24, 39, .03);
	--svhs-sh-lg: 0 8px 24px rgba(17, 24, 39, .08), 0 2px 6px rgba(17, 24, 39, .04);
	--svhs-sh-primary: 0 5px 16px rgba(30, 90, 168, .16);
	--svhs-sh-dropdown: 0 8px 28px rgba(17, 24, 39, .12), 0 2px 5px rgba(17, 24, 39, .05);

	/* 间距节奏（8 的倍数） */
	--svhs-s1: 4px;
	--svhs-s2: 8px;
	--svhs-s3: 12px;
	--svhs-s4: 16px;
	--svhs-s5: 20px;
	--svhs-s6: 24px;
	--svhs-s7: 32px;
	--svhs-s8: 40px;
	--svhs-s9: 56px;
	--svhs-s10: 72px;

	/* 布局 */
	--svhs-content: 760px;
	--svhs-wide: 1080px;
	--svhs-max: 1240px;
	--svhs-header-h: 66px;

	/* 字体 */
	--svhs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	--svhs-font-num: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", sans-serif;

	/* 动效 */
	--svhs-ease: cubic-bezier(.4, 0, .2, 1);
	--svhs-ease-out: cubic-bezier(.16, 1, .3, 1);
	--svhs-t-fast: .14s;
	--svhs-t: .22s;
	--svhs-t-slow: .38s;

	/* 层级 */
	--svhs-z-header: 90;
	--svhs-z-dropdown: 95;
	--svhs-z-overlay: 100;
}

/* --------------------------------------------------------------------------
   2. 现代化重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--svhs-header-h) + 16px);
}

body {
	margin: 0;
	font-family: var(--svhs-font);
	font-size: 15px;
	line-height: 1.75;
	color: var(--svhs-ink);
	background: var(--svhs-canvas);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

svg {
	flex-shrink: 0;
}

.svhs-icon {
	width: 20px;
	height: 20px;
	display: inline-block;
	vertical-align: -0.18em;
	flex-shrink: 0;
}

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

hr {
	border: 0;
	border-top: 1px solid var(--svhs-line);
	margin: var(--svhs-s7) 0;
}

/* 列表重置（仅内容区，避免影响正文 ul/ol 语义） */
.svhs-page ul,
.svhs-page ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.svhs-page .svhs-rich ul,
.svhs-page .svhs-rich ol {
	padding-left: 1.4em;
	list-style: revert;
	margin: 0 0 1em;
}

.svhs-page .svhs-rich li {
	margin-bottom: .4em;
}

/* --------------------------------------------------------------------------
   3. 排版系统
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	color: var(--svhs-ink);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -.01em;
}

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 15px; }
h6 { font-size: 14px; }

p {
	margin: 0 0 1em;
}

a {
	color: var(--svhs-primary);
	text-decoration: none;
	transition: color var(--svhs-t-fast) var(--svhs-ease);
}

a:hover,
a:focus {
	color: var(--svhs-primary-hover);
}

strong, b {
	font-weight: 700;
}

small {
	font-size: 13px;
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: .92em;
}

code {
	background: var(--svhs-surface-2);
	border: 1px solid var(--svhs-line);
	border-radius: var(--svhs-r-xs);
	padding: 1px 6px;
	color: #b03060;
}

pre {
	background: #1c2430;
	color: #e6edf3;
	padding: var(--svhs-s4) var(--svhs-s5);
	border-radius: var(--svhs-r-md);
	overflow-x: auto;
	line-height: 1.65;
}

pre code {
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
}

blockquote {
	margin: var(--svhs-s5) 0;
	padding: var(--svhs-s3) var(--svhs-s5);
	border-left: 3px solid var(--svhs-primary);
	background: var(--svhs-primary-soft);
	border-radius: 0 var(--svhs-r-sm) var(--svhs-r-sm) 0;
	color: var(--svhs-ink-2);
}

blockquote p:last-child {
	margin-bottom: 0;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* --------------------------------------------------------------------------
   4. 表单元素基础
   -------------------------------------------------------------------------- */
input,
select,
textarea,
button {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid #d5dbe5;
	border-radius: var(--svhs-r-sm);
	background: var(--svhs-surface);
	color: var(--svhs-ink);
	font-size: 14.5px;
	transition: border-color var(--svhs-t-fast) var(--svhs-ease),
		box-shadow var(--svhs-t-fast) var(--svhs-ease);
	appearance: none;
}

select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	background-size: 16px;
	padding-right: 34px;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--svhs-primary);
	box-shadow: 0 0 0 3.5px var(--svhs-primary-ring);
}

input::placeholder,
textarea::placeholder {
	color: var(--svhs-muted-2);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
	background: var(--svhs-surface-2);
	color: var(--svhs-muted-2);
	cursor: not-allowed;
	opacity: .8;
}

input[type="checkbox"],
input[type="radio"] {
	width: 17px;
	height: 17px;
	accent-color: var(--svhs-primary);
	vertical-align: -3px;
	margin-right: 6px;
	cursor: pointer;
}

textarea {
	min-height: 140px;
	resize: vertical;
}

button {
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   5. 可访问性
   -------------------------------------------------------------------------- */
.svhs-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--svhs-primary);
	color: #fff;
	padding: 10px 20px;
	border-radius: 0 0 var(--svhs-r-sm) 0;
	font-weight: 600;
}

.svhs-skip-link:focus {
	left: 0;
	color: #fff;
}

:focus-visible {
	outline: 2px solid var(--svhs-primary);
	outline-offset: 2px;
}

.svhs-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* 选中文本配色 */
::selection {
	background: var(--svhs-primary-soft-2);
	color: var(--svhs-primary-hover);
}

/* 滚动条（Webkit） */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: #cbd3de;
	border-radius: var(--svhs-r-full);
	border: 2px solid var(--svhs-canvas);
}

::-webkit-scrollbar-thumb:hover {
	background: #adb8c6;
}

/* --------------------------------------------------------------------------
   兼容 WordPress 区块主题残留结构
   -------------------------------------------------------------------------- */
.wp-block-group,
.wp-block-columns {
	margin-block-start: 0;
}

.alignwide {
	max-width: var(--svhs-wide);
	margin-left: auto;
	margin-right: auto;
}

.alignfull {
	max-width: 100%;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
