/*
Theme Name: CardPouchy
Theme URI: https://cardpouchy.com/
Author: CardPouchy
Author URI: https://cardpouchy.com/
Description: CardPouchy.com 专用经典主题。美国球星卡代买代卖服务落地页，按设计稿 rdpuchy2.png 还原，兼容 WooCommerce（订金 / 我的订单）。
Version: 0.7.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cardpouchy
Tags: e-commerce, custom-colors, custom-logo, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   本文件：设计变量 + reset + 排版 + 按钮 + 表单 + 通用板块标题
   各板块组件样式在 assets/css/main.css
   ========================================================= */

/* ---------------------------------------------------------
   1. 设计变量（Design Tokens）
   ---------------------------------------------------------
   全部取自设计稿 rdpuchy2.png 的实际取样，不是估计值：
     --cp-bg        #f2f2f7  页头 / 服务 / 流程 / 页脚 的底色
     品牌五色       来自 5 张服务卡片
     深色板块底色   来自绿色板块与红色板块（配合纹理图使用）
     容器宽度       1320px（交易流程 4 张 300px 卡片 + 40px 间距实测吻合）
   ========================================================= */
:root {
	/* 底色与卡片 */
	--cp-bg:      #f2f2f7;
	--cp-surface: #ffffff;

	/* 品牌五色（服务卡片取样） */
	--cp-brand-green:  #44b58a;
	--cp-brand-yellow: #eec219;
	--cp-brand-red:    #ff5041;
	--cp-brand-blue:   #196cf1;
	--cp-brand-brown:  #8f7575;

	/* Hero「联系客服」按钮的深红 */
	--cp-brand-red-strong: #e61f19;

	/* 深色纹理板块的兜底底色 */
	--cp-green-deep: #417e5b;
	--cp-red-deep:   #a11402;

	/* 文字 */
	--cp-ink:    #131313;
	--cp-body:   #3c4450;
	--cp-muted:  #83858c;
	--cp-border: #e4e4ec;

	/* 首屏渐变（纹理图缺失时的兜底） */
	--cp-hero-gradient: linear-gradient(100deg, #eaf7fc 0%, #cdedf7 48%, #48b8de 100%);

	/* 排版 */
	--cp-font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* 布局 */
	--cp-container: 1320px;
	--cp-gap: 40px;
	--cp-radius-sm: 6px;
	--cp-radius: 12px;
	--cp-radius-lg: 18px;
	--cp-section-y: clamp(72px, 8.5vw, 150px);

	/* 阴影 */
	--cp-shadow-sm: 0 2px 6px rgba(19, 19, 19, .05);
	--cp-shadow:    0 10px 28px rgba(19, 19, 19, .09);
	--cp-shadow-lg: 0 24px 56px rgba(19, 19, 19, .16);
}

/* ---------------------------------------------------------
   2. Reset / 基础
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--cp-bg);
	color: var(--cp-body);
	font-family: var(--cp-font-sans);
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}

/* 锚点跳转时给吸顶页头留出空间 */
[id] { scroll-margin-top: 90px; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	color: var(--cp-ink);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -.01em;
}

p { margin: 0 0 1.1em; }

a {
	color: var(--cp-brand-blue);
	text-decoration: none;
	transition: color .18s ease, opacity .18s ease;
}

a:hover,
a:focus { color: var(--cp-brand-red-strong); }

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

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }

blockquote {
	margin: 0 0 1.4em;
	padding-left: 20px;
	border-left: 4px solid var(--cp-brand-red);
	color: var(--cp-muted);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--cp-border); text-align: left; }

/* ---------------------------------------------------------
   3. 布局
   ========================================================= */
.cp-container {
	width: 100%;
	max-width: var(--cp-container);
	margin-inline: auto;
	padding-inline: 24px;
}

.cp-container--narrow { max-width: 860px; }

.cp-section { padding-block: var(--cp-section-y); }

.cp-section__head {
	margin: 0 auto clamp(34px, 4vw, 60px);
	text-align: center;
}

.cp-section__title {
	margin: 0 0 4px;
	font-size: clamp(28px, 3.4vw, 42px);
	font-weight: 800;
	color: var(--cp-ink);
}

.cp-section__sub {
	margin: 0;
	color: var(--cp-ink);
	font-size: clamp(15px, 1.5vw, 20px);
	font-weight: 600;
}

/* 深色板块上的标题 */
.cp-section__head--light .cp-section__title,
.cp-section__head--light .cp-section__sub { color: #fff; }

/* ---------------------------------------------------------
   4. 按钮
   ========================================================= */
.cp-btn,
.wp-block-button__link,
button,
input[type="submit"],
input[type="button"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 32px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--cp-ink);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.cp-btn:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
	background: #000;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: var(--cp-shadow);
}

.cp-btn--red { background: var(--cp-brand-red-strong); }
.cp-btn--red:hover { background: #c8170f; }

.cp-btn--dark { background: var(--cp-ink); }
.cp-btn--dark:hover { background: #000; }

.cp-btn--yellow { background: var(--cp-brand-yellow); color: var(--cp-ink); }
.cp-btn--yellow:hover { background: #d9b013; color: var(--cp-ink); }

.cp-btn--ghost {
	background: transparent;
	border-color: var(--cp-ink);
	color: var(--cp-ink);
}

.cp-btn--ghost:hover { background: var(--cp-ink); color: #fff; }

.cp-btn--light { background: #fff; color: var(--cp-ink); }
.cp-btn--light:hover { background: #fff; color: var(--cp-brand-red-strong); }

.cp-btn--lg { padding: 15px 40px; font-size: 16px; }

.cp-btn--block { width: 100%; }

/* ---------------------------------------------------------
   5. 表单
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 13px 16px;
	border: 1px solid var(--cp-border);
	border-radius: var(--cp-radius-sm);
	background: #fff;
	color: var(--cp-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

input::placeholder,
textarea::placeholder { color: #9a9ca4; }

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--cp-brand-blue);
	outline-offset: 1px;
}

.cp-field { margin: 0 0 16px; }

/* 蜜罐字段：移出视口，真人看不见 */
.cp-field--hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* 提交结果提示 */
.cp-alert {
	max-width: 720px;
	margin: 0 auto 28px;
	padding: 14px 20px;
	border-radius: var(--cp-radius);
	text-align: center;
	font-size: 15px;
}

.cp-alert--ok { background: rgba(255, 255, 255, .16); color: #fff; }
.cp-alert--error { background: var(--cp-brand-yellow); color: var(--cp-ink); }

/* ---------------------------------------------------------
   6. 无障碍
   ========================================================= */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 18px;
	clip: auto;
	background: #fff;
	color: var(--cp-ink);
	box-shadow: var(--cp-shadow);
	z-index: 100000;
}

.cp-skip-link:focus { position: fixed !important; top: 8px; left: 8px; }

/*
 * WordPress 后台工具栏存在时，吸顶页头往下让位。
 * 桌面（>=783px）工具栏是 fixed、高 32px；
 * 窄屏（<=782px）工具栏变成 absolute、会随页面一起滚走，
 * 此时页头要贴顶 top:0，否则滚动后页头上方会留出一条空白。
 */
.admin-bar .cp-header { top: 32px; }

@media screen and (max-width: 782px) {
	.admin-bar .cp-header { top: 0; }
}

/* ---------------------------------------------------------
   7. 通用文章排版（博客 / 单页复用）
   ========================================================= */
.cp-entry__meta { margin-bottom: 22px; color: var(--cp-muted); font-size: 14px; }
.cp-entry__thumb { margin-bottom: 26px; border-radius: var(--cp-radius-lg); overflow: hidden; }
.cp-entry__content > *:last-child { margin-bottom: 0; }

.alignleft  { float: left;  margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-inline: auto; }

.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--cp-muted); font-size: 14px; text-align: center; }

.cp-notice {
	padding: 20px 24px;
	border: 1px dashed var(--cp-border);
	border-radius: var(--cp-radius);
	background: #fff;
	text-align: center;
}

.cp-notice p:last-child { margin-bottom: 0; }
