/**
 * 主站全局样式表。
 *
 * 与 Tailwind 工具类配合使用，提供品牌色变量、组件级样式与排版微调。
 * 优先使用 Tailwind 工具类；此处仅放置难以用工具类表达的样式。
 *
 * 品牌色：
 *   --color-primary    #1e40af  深蓝色（主色）
 *   --color-secondary  #10b981  绿色（强调色）
 */

/* ===== 品牌色 CSS 变量（供 CSS 中使用） ===== */
:root {
    --color-primary: #1e40af;
    --color-secondary: #10b981;
    --color-primary-dark: #1e3a8a;
    --color-primary-light: #3b82f6;
}

/* ===== 基础排版 ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

/* ===== 标题层级（与 Next.js tailwind typography 配套） ===== */
h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.875rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }

/* ===== 链接默认样式 ===== */
a {
    transition: color 0.15s ease-in-out;
}

/* ===== 品牌按钮 ===== */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    display: inline-block;
    transition: background-color 0.15s ease-in-out;
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    display: inline-block;
    transition: all 0.15s ease-in-out;
}
.btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn-text {
    color: var(--color-primary);
    font-weight: 500;
    display: inline-block;
}
.btn-text:hover {
    text-decoration: underline;
}

/* ===== 卡片悬停效果 ===== */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* ===== Section 通用容器 ===== */
.section {
    padding: 4rem 0;
}
.section-sm {
    padding: 2.5rem 0;
}

/* ===== 容器最大宽度（与 max-w-7xl 对齐） ===== */
.container-page {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    .container-page { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
    .container-page { padding-left: 2rem; padding-right: 2rem; }
}

/* ===== 页面头部 Hero 区（索引页通用） ===== */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 5rem 0 3rem;
    text-align: center;
}

/* ===== 富文本内容容器（来自 StreamField RichTextBlock） ===== */
.rich-text-content {
    line-height: 1.75;
}
.rich-text-content h2 { margin-top: 2rem; margin-bottom: 1rem; color: var(--color-primary); }
.rich-text-content h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.rich-text-content p { margin-bottom: 1rem; }
.rich-text-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.rich-text-content ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.rich-text-content blockquote {
    border-left: 4px solid var(--color-secondary);
    padding-left: 1rem;
    color: #4b5563;
    font-style: italic;
    margin: 1rem 0;
}

/* ===== 表单字段样式（ContactPage 表单） ===== */
.form-field label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="datetime-local"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.form-field .help-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}
.form-field .error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
