/* 全站公共样式：浅灰底 + 750px 头部 + 778px 菜单与白色内容块
   配色取自 phototool.cn：slate 灰阶（#0f172a / #475569 / #94a3b8）+ 主色蓝 #2563eb
   头部尺寸全部写死（不靠字体行高撑），并且强制竖向滚动条占位，
   这样无论页面长短、无论中文字体回退到哪一个，头部和内容框都不会位移。

   移动端：宽度不再是死的 750/778，而是「宽屏时最多 750/778，窄屏时跟着屏幕缩」（width:100% + max-width）。
   桌面上的几何一点没变（窗口够宽时 max-width 生效，仍是 750/778 居中）；
   手机上则自动变成满宽，再配合下面 @media 里的菜单换行、字号、点击区放大。 */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
}
div { margin: 0; padding: 0; }
body {
    margin: 0;
    padding: 0;
    text-align: center;
    background-color: #f5f8fc;
    background-image:
        radial-gradient(1100px 420px at 50% -100px, #e7f0ff 0%, rgba(231, 240, 255, 0) 62%),
        linear-gradient(180deg, #f8fafd 0%, #f4f7fb 100%);
    background-repeat: no-repeat;
    font-family: Arial, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}
#container { margin: 0 auto; padding: 0; }
h1, h2, h3 { margin-top: 0; }
p { text-align: left; }
h1 { font-size: 2em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1em; }
a { color: #2563eb; }
a:hover { text-decoration: none; color: #1d4ed8; }

/* 语言切换按钮：不套用菜单按钮样式 */
.i18n-item a {
    float: none;
    display: inline;
    min-height: 0;
    height: auto;
    line-height: 1.5;
    padding: 0;
    font-size: 12.5px;
    font-weight: normal;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    color: #64748b;
    text-decoration: none;
}
.i18n-item a:hover { color: #2563eb; }
.i18n-item b { color: #2563eb; font-weight: 600; }

/* 头部不再单独做成一块：和内容共用同一张白底，只靠一条很淡的分隔线过渡 */
/* Logo（方案 G）：线描小图标 + 双色字。深度只靠同色阶和 1px 白色高光，
   不用饱和色块、不用重投影，配白卡不突兀。纯 CSS，不引图片。
   上下各留一段留白，让它和页面顶边、下面的菜单条之间都有空气。 */
#logo {
    width: 100%; max-width: 750px; margin: 0 auto;
    height: auto; min-height: 45px;
    padding: 7px 0 6px;
    display: flex; align-items: center; gap: 9px;
    overflow: visible;
}
#logo .logo-mark {
    position: relative;
    flex: 0 0 auto;
    width: 26px; height: 24px;
    border: 1.5px solid rgba(37, 99, 235, .30);
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}
#logo .logo-mark::before {          /* 一条斜放的“山脊” */
    content: "";
    position: absolute; left: 4px; bottom: 5px;
    width: 12px; height: 12px;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(59, 130, 246, .55), rgba(37, 99, 235, .35));
    transform: rotate(45deg);
}
#logo .logo-mark::after {           /* 一个小太阳 */
    content: "";
    position: absolute; right: 4px; top: 4px;
    width: 5px; height: 5px; border-radius: 50%;
    background: #93c5fd;
}
#logo h1, #logo p { margin: 0; line-height: 32px; }
#logo h1 { padding: 0; font-size: 25px; letter-spacing: .5px; font-weight: bold; flex: 0 0 auto; }
#logo p { margin-left: auto; padding: 0; font-size: 1.2em; color: #64748b; letter-spacing: .3px; }
#logo a {
    text-decoration: none;
    /* 前两个字深蓝、后两个字亮蓝，两截各占一半；字的盒子宽度就是文字宽度，所以 50% 正好落在中间 */
    background: linear-gradient(90deg, #1e3a8a 0%, #1e3a8a 50%, #3b82f6 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .95));
}

/* 菜单：一条淡蓝灰的长条（和整体 white/slate-blue 同色系），上下各一条发丝线；
   高度仍写死 45px —— 线用 box-shadow 画，避免 border 把 45px 撑成 47px */
#menu {
    width: 100%; max-width: 778px; height: 45px; margin: 0 auto;
    background: #eaf0f8;
    box-shadow: inset 0 1px 0 #dfe7f1, inset 0 -1px 0 #d7e1ee;
    overflow: hidden;
}
#menu ul { margin: 0; padding: 5px 0 0 14px; list-style: none; }
#menu li { display: inline; }
#menu a {
    display: block;
    float: left;
    height: 29px;
    line-height: 29px;
    padding: 11px 30px 0 30px;
    text-decoration: none;
    font-weight: bold;
    color: #334155;
}
#menu a:hover { color: #2563eb; }

/* 内容块：不再自己铺白底，让画布的蓝色光晕透上来；
   白卡交给下面的 #page-bg，全站页面都是「浅灰画布 + 一张浮起的白卡」 */
#page {
    width: 100%; max-width: 778px; margin: 0 auto;
    background: transparent;
    background-image: none;
    text-align: center;
}
/* 所有页面统一的大框架卡片：正文区 #page-bg 本身就画成一个白卡片。
   边框用 box-shadow 画（不占布局），否则 778 会变成 780，且会动到头部几何的对齐。 */
#page-bg {
    padding: 10px;
    text-align: center;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 22px 46px -30px rgba(15, 23, 42, .35);
}

#footer { width: 100%; max-width: 750px; margin: 0 auto; padding: 20px 0; }
#footer p { margin: 0; text-align: center; font-size: smaller; color: #94a3b8; }
#footer a { color: #94a3b8; }
#footer a:hover { color: #2563eb; }

/* ============================ 移动端 ============================
   断点 768px：这一档以下是手机竖屏和多数安卓手机横屏。
   原则：结构不动（还是 logo / 菜单 / 内容块 / 页脚），只把宽度、留白、点击区改到手指能点。 */
@media (max-width: 768px) {
    body { font-size: 15px; }

    /* 头部：徽章和标题一行，副标题换到第二行；高度放开 */
    #logo {
        width: auto; max-width: none;
        height: auto;
        flex-wrap: wrap;
        row-gap: 3px;
        padding: 7px 14px 6px;
        overflow: visible;
        text-align: left; /* 手机上标题左对齐，和下面的菜单按钮对齐，不居中晃眼 */
    }
    #logo .logo-mark { width: 23px; height: 21px; border-radius: 5px; border-width: 1.2px; }
    #logo .logo-mark::before { left: 3px; bottom: 4px; width: 10px; height: 10px; }
    #logo .logo-mark::after { right: 3px; top: 3px; width: 4px; height: 4px; }
    #logo h1, #logo p {
        height: auto;
        line-height: 1.3;
    }
    #logo h1 { font-size: 21px; letter-spacing: .5px; }
    #logo p { font-size: 12.5px; color: #64748b; margin-left: 0; flex: 1 0 100%; }

    /* 菜单：改成可换行的按钮排，每个至少 44px 高（iOS 手指最小点击区） */
    #menu {
        width: auto; max-width: none;
        height: auto;
        overflow: visible;
        padding: 4px 6px 6px;
    }
    #menu ul {
        padding: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
    }
    #menu li { display: block; }
    #menu a {
        float: none;
        display: flex;
        align-items: center;
        min-height: 44px;
        height: auto;
        line-height: 1.2;
        padding: 0 14px;
        font-size: 14px;
        font-weight: 600;
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 0 0 1px #dfe7f1;
        color: #1e293b;
    }
    #menu a:active { background: #eff6ff; color: #2563eb; }
    /* 那个空的 chuantu.biz 菜单项在手机上只是占位，直接收起来免得白占一行 */
    #menu li a:empty { display: none; }

    /* 内容块：满宽、留白收窄、圆角变小（满宽时 10px 圆角显得太圆） */
    #page { width: auto; max-width: none; }
    #page-bg { padding: 8px; border-radius: 8px; }

    #footer {
        width: auto; max-width: none;
        padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    }

    /* 全站兜底：表格、图片、长单词不许把页面撑出横向滚动条 */
    img, video, iframe { max-width: 100%; height: auto; }
    table { max-width: 100%; }
    pre, code { white-space: pre-wrap; word-break: break-word; }
    input, select, textarea, button { font-size: 15px; } /* 小于 16px 时 iOS 聚焦会放大页面 */
    textarea { max-width: 100%; }
}

/* 小屏（iPhone SE 之类 375 及以下）：字号再收一点，头部再紧一档 */
@media (max-width: 380px) {
    #logo h1 { font-size: 19px; }
    #menu a { padding: 0 11px; font-size: 13.5px; }
}
