/*!
Theme Name: 爱翻译 AiFanyi
Theme URI: https://aifanyi.com/
Author: AiFanyi Studio
Author URI: https://aifanyi.com/
Description: 「爱翻译」全球翻译平台官网主题。面向跨境商务、国际旅行与全球沟通用户，提供专业高效的多语言解决方案。国际商务极简风格，主色 #1677FF，20px 圆角与高级 soft 阴影，全端响应式并优先移动端体验。后台可配置 Logo、Banner、服务内容、案例展示、咨询入口与联系方式。
Version: 1.0.0
Tested up to: 6.6
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: aifanyi
Tags: custom-logo, custom-menu, featured-images, translation-ready, business, landing-page, responsive

本主题基于 Underscores (_s) https://underscores.me/ 构建，(C) 2012-2020 Automattic, Inc.
以 GNU GPL v2 或更新版本授权。
*/

/*--------------------------------------------------------------
>>> 目录：
----------------------------------------------------------------
# 设计令牌（Design Tokens）
# 归一化与重置
# 基础排版
# 元素（链接 / 列表 / 表格 / 媒体）
# 表单与按钮基础
# 无障碍与对齐
# 站点基础布局
# 文章与页面（内页）
# 评论
# 小工具与分页
# 打印与动效偏好
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# 设计令牌
--------------------------------------------------------------*/
:root {
	/* 品牌色 */
	--af-primary: #1677ff;
	--af-ink: #111827;
	--af-bg: #f8fafc;

	/* 主色派生 */
	--af-primary-strong: #0b5ed7;
	--af-primary-soft: #e9f2ff;
	--af-primary-softer: #f4f8ff;
	--af-primary-line: #cfe1ff;

	/* 中性色阶 */
	--af-ink-2: #1f2937;
	--af-ink-3: #374151;
	--af-muted: #6b7280;
	--af-muted-2: #9ca3af;
	--af-line: #e6eaf0;
	--af-line-soft: #eef2f7;
	--af-surface: #ffffff;
	--af-surface-2: #f2f6fb;

	/* 语义色 */
	--af-success: #10b981;
	--af-warning: #f59e0b;
	--af-danger: #ef4444;
	--af-info: #0ea5e9;

	/* 圆角 */
	--af-radius: 20px;
	--af-radius-lg: 28px;
	--af-radius-md: 16px;
	--af-radius-sm: 12px;
	--af-radius-xs: 8px;
	--af-radius-pill: 999px;

	/* 高级 soft 阴影 */
	--af-shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
	--af-shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 12px rgba(17, 24, 39, .04);
	--af-shadow: 0 2px 6px rgba(17, 24, 39, .04), 0 12px 32px rgba(17, 24, 39, .06);
	--af-shadow-lg: 0 6px 18px rgba(17, 24, 39, .05), 0 24px 60px rgba(17, 24, 39, .08);
	--af-shadow-brand: 0 10px 24px rgba(22, 119, 255, .18), 0 24px 64px rgba(22, 119, 255, .12);
	--af-ring: 0 0 0 4px rgba(22, 119, 255, .12);

	/* 排版 */
	--af-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	--af-font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

	/* 布局与留白 */
	--af-container: 1200px;
	--af-container-narrow: 900px;
	--af-gutter: 20px;
	--af-section-y: 72px;
	--af-header-h: 72px;

	/* 动效 */
	--af-ease: cubic-bezier(.22, .61, .36, 1);
	--af-dur: .28s;
}

@media (min-width: 768px) {
	:root {
		--af-gutter: 32px;
		--af-section-y: 96px;
	}
}

@media (min-width: 1200px) {
	:root {
		--af-gutter: 40px;
		--af-section-y: 120px;
		--af-header-h: 80px;
	}
}

/*--------------------------------------------------------------
# 归一化与重置
--------------------------------------------------------------*/
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background-color: var(--af-bg);
	color: var(--af-ink-3);
	font-family: var(--af-font);
	font-size: 16px;
	line-height: 1.75;
	font-feature-settings: "kern" 1, "liga" 1, "tnum" 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

main {
	display: block;
}

hr {
	box-sizing: content-box;
	height: 0;
	overflow: visible;
	border: 0;
	border-top: 1px solid var(--af-line);
	margin: 32px 0;
}

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

svg {
	fill: currentColor;
}

figure {
	margin: 0;
}

/*--------------------------------------------------------------
# 基础排版
--------------------------------------------------------------*/
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 .5em;
	color: var(--af-ink);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.02em;
}

h1 {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
}

h2 {
	font-size: clamp(1.625rem, 3.6vw, 2.375rem);
	font-weight: 800;
}

h3 {
	font-size: clamp(1.25rem, 2.4vw, 1.5rem);
}

h4 {
	font-size: 1.125rem;
}

h5,
h6 {
	font-size: 1rem;
}

p {
	margin: 0 0 1.25em;
}

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

small {
	font-size: .875em;
}

strong,
b {
	font-weight: 700;
	color: var(--af-ink-2);
}

em,
i {
	font-style: italic;
}

blockquote {
	margin: 24px 0;
	padding: 20px 24px;
	border-left: 3px solid var(--af-primary);
	border-radius: var(--af-radius-sm);
	background: var(--af-primary-softer);
	color: var(--af-ink-2);
}

blockquote cite {
	display: block;
	margin-top: 8px;
	color: var(--af-muted);
	font-size: .875rem;
	font-style: normal;
}

code,
kbd,
samp,
pre {
	font-family: var(--af-font-mono);
	font-size: .9em;
}

code {
	padding: .15em .45em;
	border-radius: var(--af-radius-xs);
	background: var(--af-surface-2);
	color: var(--af-primary-strong);
}

pre {
	overflow: auto;
	max-width: 100%;
	padding: 20px;
	border: 1px solid var(--af-line);
	border-radius: var(--af-radius-sm);
	background: var(--af-surface-2);
	line-height: 1.7;
}

pre code {
	padding: 0;
	background: none;
	color: inherit;
}

abbr[title] {
	border-bottom: 1px dotted var(--af-muted-2);
	text-decoration: none;
	cursor: help;
}

/*--------------------------------------------------------------
# 元素
--------------------------------------------------------------*/
a {
	color: var(--af-primary);
	text-decoration: none;
	transition: color var(--af-dur) var(--af-ease), opacity var(--af-dur) var(--af-ease);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--af-primary);
	outline-offset: 2px;
	border-radius: var(--af-radius-xs);
}

ul,
ol {
	margin: 0 0 1.25em;
	padding-left: 1.4em;
}

li > ul,
li > ol {
	margin-bottom: 0;
}

dt {
	font-weight: 700;
	color: var(--af-ink-2);
}

dd {
	margin: 0 0 1em 1.4em;
}

table {
	width: 100%;
	margin: 0 0 24px;
	border-collapse: collapse;
	font-size: .95rem;
}

th,
td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--af-line);
	text-align: left;
}

th {
	color: var(--af-ink);
	font-weight: 700;
}

/*--------------------------------------------------------------
# 表单与按钮基础
--------------------------------------------------------------*/
button,
input,
select,
optgroup,
textarea {
	margin: 0;
	color: inherit;
	font-family: inherit;
	font-size: 100%;
	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: 12px 16px;
	border: 1px solid var(--af-line);
	border-radius: var(--af-radius-sm);
	background: var(--af-surface);
	color: var(--af-ink-2);
	transition: border-color var(--af-dur) var(--af-ease), box-shadow var(--af-dur) var(--af-ease);
	-webkit-appearance: none;
	appearance: none;
}

select {
	background-image: linear-gradient(45deg, transparent 50%, var(--af-muted) 50%), linear-gradient(135deg, var(--af-muted) 50%, transparent 50%);
	background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

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

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

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

label {
	display: inline-block;
	margin-bottom: 6px;
	color: var(--af-ink-2);
	font-size: .9rem;
	font-weight: 600;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: 0;
	border-radius: var(--af-radius-pill);
	background: var(--af-primary);
	color: #fff;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform var(--af-dur) var(--af-ease), box-shadow var(--af-dur) var(--af-ease), background var(--af-dur) var(--af-ease);
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
	background: var(--af-primary-strong);
	box-shadow: var(--af-shadow-brand);
	transform: translateY(-1px);
}

/*--------------------------------------------------------------
# 无障碍与对齐
--------------------------------------------------------------*/
.screen-reader-text {
	position: absolute !important;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	display: block;
	top: 16px;
	left: 16px;
	z-index: 100000;
	clip: auto !important;
	clip-path: none;
	width: auto;
	height: auto;
	padding: 14px 22px;
	border-radius: var(--af-radius-sm);
	background: var(--af-surface);
	box-shadow: var(--af-shadow);
	color: var(--af-primary);
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
}

.skip-link:focus {
	position: fixed !important;
}

.alignleft {
	float: left;
	margin: .4em 1.6em 1em 0;
}

.alignright {
	float: right;
	margin: .4em 0 1em 1.6em;
}

.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.alignwide {
	margin-left: -40px;
	margin-right: -40px;
	max-width: calc(100% + 80px);
}

.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
}

.clear::after,
.entry-content::after,
.site-footer::after {
	display: table;
	clear: both;
	content: "";
}

/*--------------------------------------------------------------
# 站点基础布局
--------------------------------------------------------------*/
.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1 0 auto;
}

.af-container {
	width: 100%;
	max-width: var(--af-container);
	margin: 0 auto;
	padding-left: var(--af-gutter);
	padding-right: var(--af-gutter);
}

.af-container--narrow {
	max-width: var(--af-container-narrow);
}

/*--------------------------------------------------------------
# 文章与页面（内页）
--------------------------------------------------------------*/
.af-page-shell {
	padding: calc(var(--af-header-h) + 48px) 0 var(--af-section-y);
}

.af-page-head {
	margin-bottom: 40px;
	text-align: center;
}

.af-page-head .page-title,
.af-page-head .entry-title {
	margin-bottom: 12px;
}

.af-page-head .archive-description {
	color: var(--af-muted);
}

.af-content-grid {
	display: grid;
	gap: 32px;
	align-items: start;
	grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
	.af-content-grid.has-sidebar {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 40px;
	}
}

.af-card-surface,
.hentry,
.no-results,
.comments-area,
.widget-area .widget {
	padding: 28px;
	border: 1px solid var(--af-line);
	border-radius: var(--af-radius);
	background: var(--af-surface);
	box-shadow: var(--af-shadow-sm);
}

@media (min-width: 768px) {
	.af-card-surface,
	.hentry,
	.no-results,
	.comments-area {
		padding: 40px;
	}
}

.hentry + .hentry {
	margin-top: 24px;
}

.entry-title {
	font-size: clamp(1.375rem, 3vw, 2rem);
}

.entry-title a {
	color: inherit;
}

.entry-title a:hover {
	color: var(--af-primary);
}

.entry-meta,
.entry-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	color: var(--af-muted);
	font-size: .875rem;
}

.entry-meta {
	margin-bottom: 16px;
}

.entry-footer {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--af-line-soft);
}

.entry-meta a,
.entry-footer a {
	color: var(--af-muted);
}

.entry-meta a:hover,
.entry-footer a:hover {
	color: var(--af-primary);
}

.post-thumbnail {
	display: block;
	margin-bottom: 24px;
	overflow: hidden;
	border-radius: var(--af-radius-md);
}

.post-thumbnail img {
	width: 100%;
	transition: transform .5s var(--af-ease);
}

.post-thumbnail:hover img {
	transform: scale(1.03);
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.more-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	text-decoration: none !important;
}

.page-links {
	margin-top: 20px;
	font-weight: 600;
}

.wp-caption {
	max-width: 100%;
	margin-bottom: 24px;
}

.wp-caption img {
	border-radius: var(--af-radius-sm);
}

.wp-caption-text {
	margin-top: 8px;
	color: var(--af-muted);
	font-size: .85rem;
	text-align: center;
}

.gallery {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	margin-bottom: 24px;
}

.gallery-item img {
	width: 100%;
	border-radius: var(--af-radius-sm);
}

.sticky .entry-title::before {
	content: "★ ";
	color: var(--af-primary);
}

.updated:not(.published) {
	display: none;
}

/*--------------------------------------------------------------
# 评论
--------------------------------------------------------------*/
.comments-area {
	margin-top: 32px;
}

.comments-title,
.comment-reply-title {
	font-size: 1.25rem;
}

.comment-list {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.comment-list ol.children {
	margin-top: 20px;
	padding-left: 24px;
	list-style: none;
	border-left: 2px solid var(--af-line-soft);
}

.comment-body {
	padding: 20px 0;
	border-bottom: 1px solid var(--af-line-soft);
}

.comment-author img {
	border-radius: 50%;
	margin-right: 10px;
}

.comment-metadata {
	color: var(--af-muted);
	font-size: .8rem;
}

.reply a {
	font-size: .85rem;
	font-weight: 600;
}

.comment-form {
	display: grid;
	gap: 16px;
}

.comment-form .form-submit {
	margin: 0;
}

.no-comments {
	color: var(--af-muted);
}

/*--------------------------------------------------------------
# 小工具与分页
--------------------------------------------------------------*/
.widget-area .widget + .widget {
	margin-top: 20px;
}

.widget-title {
	margin-bottom: 14px;
	font-size: 1rem;
}

.widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.widget li + li {
	margin-top: 8px;
}

.widget a {
	color: var(--af-ink-3);
}

.widget a:hover {
	color: var(--af-primary);
}

.navigation.pagination,
.navigation.posts-navigation,
.navigation.post-navigation {
	margin-top: 32px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: center;
}

.nav-links .page-numbers,
.nav-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--af-line);
	border-radius: var(--af-radius-sm);
	background: var(--af-surface);
	color: var(--af-ink-3);
	font-weight: 600;
	font-size: .9rem;
	text-decoration: none;
}

.nav-links .page-numbers.current,
.nav-links a:hover {
	border-color: var(--af-primary);
	background: var(--af-primary);
	color: #fff;
}

.post-navigation .nav-links {
	justify-content: space-between;
}

.post-navigation .nav-links a {
	height: auto;
	padding: 16px 20px;
	text-align: left;
}

.search-form {
	display: flex;
	gap: 10px;
}

.search-form label {
	flex: 1;
	margin: 0;
}

/*--------------------------------------------------------------
# 打印与动效偏好
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.af-hero__visual,
	.af-cta {
		display: none !important;
	}

	body {
		background: #fff;
	}
}
