/* ========================================
   英文站全局字体 + 完整移动端适配 (global-font-responsive.css)
   ======================================== */

:root {
    /* ----- 字体家族 (纯英文系统栈) ----- */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: var(--font-family-base);
    --font-family-code: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;

    /* ----- 桌面端基准 (默认) ----- */
    --font-size-base: 18px;
    --line-height-base: 1.65;
    --line-height-heading: 1.2;

    /* 字重 */
    --font-weight-normal: 400;
    --font-weight-bold: 700;
}

/* 1. 基础设置 + 防止屏幕旋转时字体突变 */
html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: 1rem; /* 等于 18px */
    line-height: var(--line-height-base);
    font-weight: var(--font-weight-normal);
    color: #1a1a1a;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- 标题 ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: #0d0d0d;
    margin-top: 0;
    margin-bottom: 0.5em;
}
h1 { font-size: 2.222rem; } /* 40px */
h2 { font-size: 1.778rem; } /* 32px */
h3 { font-size: 1.333rem; } /* 24px */
h4 { font-size: 1.111rem; } /* 20px */
h5 { font-size: 1rem; }     /* 18px */
h6 { font-size: 0.889rem; } /* 16px */

/* 段落及内联元素继承 */
p, li, span, a, label {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
p { margin-top: 0; margin-bottom: 1.2em; }

/* 链接 */
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 代码 */
code, pre {
    font-family: var(--font-family-code);
    font-size: 0.9em;
    background: #f4f4f5;
    padding: 0.1em 0.4em;
    border-radius: 4px;
}
pre { padding: 1em; overflow-x: auto; }

/* ----- 辅助类 ----- */
.text-sm   { font-size: 0.889rem; }
.text-lg   { font-size: 1.111rem; }
.text-bold { font-weight: var(--font-weight-bold); }

/* ========================================
   📱 移动端适配核心区
   ======================================== */

/* --- 平板 (1024px 以下) --- */
@media (max-width: 1024px) {
    :root {
        --font-size-base: 17px; /* 平滑过渡 */
    }
}

/* --- 手机 (768px 以下) --- */
@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;   /* 基准缩小 */
        --line-height-base: 1.7;  /* ⭐ 移动端行高拉大，提升可读性 */
    }

    /* 手机端标题适当缩小 */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
}

/* --- 小屏手机 (480px 以下) --- */
@media (max-width: 480px) {
    :root {
        --font-size-base: 15px;
    }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
}

/* ========================================
   🚨 关键修复：防止 iOS 输入框自动缩放
   ======================================== */
/* iOS Safari 在 focus 表单时会强制放大页面，设置 font-size >= 16px 即可阻止 */
input,
textarea,
select,
button {
    font-family: inherit;
    font-size: 16px; /* ⭐ 核心修复：不低于 16px */
    line-height: inherit;
}

/* 针对极小的按钮文字，保持可读性 */
button {
    font-weight: var(--font-weight-medium, 500);
}

/* ========================================
   📐 可选：限制最大宽度，改善大屏阅读
   ======================================== */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}