/* =============================================
   base.css - 全局基础样式 & CSS 变量
   所有页面共享
   ============================================= */

/* ---------- CSS 变量 ---------- */
:root {
	--primary: #6366f1;
	--primary-dark: #4f46e5;
	--success: #10b981;
	--error: #ef4444;
	--text: #1e293b;
	--bg: #f8fafc;

	--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

	--radius-sm: 0.5rem;
	--radius-md: 0.75rem;
	--radius-lg: 1rem;

	--shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	--shadow-card-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ---------- 重置 & 基础 ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	touch-action: manipulation;
	-ms-touch-action: manipulation;
	margin: 0;
	padding: 0;
	min-height: 100vh;
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ---------- 容器（通用卡片容器） ---------- */
.container {
	background: #fff;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	padding: 1.25rem;
	width: 100%;
	max-width: 720px;
	margin: 16px auto;
	position: relative;
	overflow: hidden;
}

/* 顶部渐变条 */
.container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 8px;
	background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* 主页面专用：居中大容器 */
.container--center {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1rem;
}

.container--center .container {
	max-width: 700px;
	margin: 1rem;
	padding: 2rem;
}

/* ---------- 响应式：移动端全屏 ---------- */
@media (max-width: 750px) {
	.container {
		margin: 0;
		min-height: 100vh;
		border-radius: 0;
		width: 100%;
		max-width: 100%;
	}

	.container--center {
		padding: 0;
	}

	.container--center .container {
		margin: 0;
		min-height: 100vh;
		border-radius: 0;
		max-width: 100vw;
	}
}

/* ---------- 标题 ---------- */
h1 {
	color: var(--primary);
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0.75rem 0;
}

.container--center h1 {
	font-size: 1.8rem;
	margin-bottom: 1.5rem;
	margin-top: 0;
	text-align: center;
}

/* ---------- 通用按钮 ---------- */
.btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	background: var(--primary);
	color: #fff;
	border: none;
	border-radius: var(--radius-md);
	padding: 0.75rem 1.25rem;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	text-decoration: none;
}

.btn:hover {
	background: var(--primary-dark);
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn--disabled,
.btn:disabled {
	background: #94a3b8;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn--secondary {
	background: #64748b;
}

.btn--secondary:hover {
	background: #475569;
}

.btn--danger {
	background: var(--error);
}

.btn--danger:hover {
	background: #dc2626;
}

/* ---------- 通用链接 ---------- */
a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* ---------- 通用图标按钮/图标链接 ---------- */
.back {
	color: #64748b;
	text-decoration: none;
	font-size: 0.95rem;
}

/* ---------- 顶栏（返回 + 标题） ---------- */
.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
}

/* ---------- 图片包装 ---------- */
.img-wrap {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}

.img-wrap img {
	width: 100%;
	height: auto;
	display: block;
}

/* ---------- 提示文字 ---------- */
.note {
	color: var(--error);
	font-weight: 600;
	margin: 8px 0 16px;
}

.note--top {
	margin-top: 30px;
}
