/* ==========================================================================
   校园卡系统 · 统一补丁 (ui-patch.css)
   --------------------------------------------------------------------------
   加载顺序：必须放在 theme.css 之后。
   theme.css 会覆盖各页面内置 <style> 的同名规则，但只覆盖了一部分，
   导致「输入框与下拉框外观不一致」「同行两栏不等宽」等问题；
   本文件用于把这些不一致抹平，并统一页头品牌 logo 与低调页脚。
   仅做视觉覆盖，不改任何 class 名与 DOM 结构。

   【缓存】各页面以 ui-patch.css?v=<版本> 引用本文件。
   改动本文件后必须同步提升各页面 <link> 上的 ?v= 版本号，
   否则浏览器与 CDN 会在 max-age 内继续使用旧样式（改完看不到效果）。
   当前版本：20261003a
   ========================================================================== */

/* ---------- 0) 正文统一使用阿里健康体 2.0（无盲文拼音版） ----------
   楷体标题不受影响（--font-title 在下方第 6 节，优先级更高）。
   这里重定义 theme.css 的 --font-sans 并直接作用于 body，
   兼顾 admin.html（未加载 theme.css）的情况。
   45R 常规 + 85B 粗体两个字重，粗体为真字重。 */
@font-face {
    font-family: "AlibabaHealthCN";
    src: url("fonts/AlibabaHealthCN-45R.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "AlibabaHealthCN";
    src: url("fonts/AlibabaHealthCN-85B.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
:root {
    --font-sans: "AlibabaHealthCN", "PingFang SC", "HarmonyOS Sans SC",
                 "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
body { font-family: var(--font-sans); }

/* ---------- 1) 表单：同行各列严格等宽 ----------
   起因：theme.css 的 .form-row / .form-grid 用 1fr（= minmax(auto,1fr)），
   列的自动最小宽度取内容最小宽度，左右内容不同就会不等宽。
   给栅格项 min-width:0 即可把自动最小宽度压为 0，从而各列严格等宽；
   相比直接改 grid-template-columns，这种做法不会覆盖各页面的响应式断点。 */
.form-group { min-width: 0; }
.form-group > input,
.form-group > select,
.form-group > textarea { width: 100%; box-sizing: border-box; }

/* ---------- 2) 表单控件统一：边框 / 高度 / 圆角完全一致 ---------- */
.form-group input,
.form-group select,
.form-group textarea {
    border: 2px solid var(--border, #ded9d0);
    border-radius: 12px;
    box-sizing: border-box;
    min-height: 54px;
    padding: 15px 20px;
    font-size: 16px;
    line-height: 1.25;
}
.form-group select { padding-right: 46px; }    /* 给下拉箭头留位 */
.form-group textarea { min-height: 110px; }
.inline-group select { padding-right: 26px; }  /* 高 一/二/三 这类窄下拉 */

/* 结算页逐卡号输入框（仅首页存在） */
.card-number-input input {
    border: 2px solid var(--border, #ded9d0);
    border-radius: 12px;
    box-sizing: border-box;
    min-height: 54px;
    padding: 12px 20px;
    font-size: 20px;
}

/* ---------- 3) 页头品牌 logo ----------
   徽标为矢量 logo.svg（机械斑鸠 · 校园卡），宽高比约 5.34:1。
   因为比例很长，改用「定宽 + height:auto」控制尺寸：这样只给一个维度，
   另一个维度按固有比例算出来，窄屏被 max-width 压缩时也不会被拉变形。 */
.header .brand-logo {
    display: block;
    width: 288px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 14px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.header-left .brand-logo { width: 232px; max-width: 100%; height: auto; margin: 0; }
.login-logo {
    display: block;
    width: 276px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
}

/* ---------- 4) 低调页脚：备案号与版权并排居中，均不突出 ---------- */
.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 14px;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 26px 0 0;
    text-align: center;
    line-height: 1.6;
}
.footer .divider { display: none; }
.beian-link {
    display: inline;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: var(--steel, #6b7a8f);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    text-decoration: none;
}
.beian-link:hover { color: var(--brass-deep, #8a5c24); text-decoration: underline; }
.copyright {
    color: var(--steel, #6b7a8f);
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

/* ---------- 5) 卡片说明：保留后台录入的手动换行 ----------
   后台「说明」已改为多行文本域，说明里的换行符需要在申请页如实呈现；
   white-space: pre-line 会保留 \n 换行，同时仍按容器宽度自动折行。 */
.card-details p { white-space: pre-line; }

/* ---------- 6) 标题统一使用楷体 ----------
   只作用于标题（h1-h4 与各页的标题类），不动按钮、徽章、表单标签等 UI 文字。
   字体栈按平台依次回退：Windows → 楷体/KaiTi，macOS → Kaiti SC/STKaiti，
   最后退到通用衬线体，保证没有楷体的设备也不会缺字。 */
:root {
    --font-title: "KaiTi", "Kaiti SC", "STKaiti", "楷体", "楷体_GB2312",
                  "Noto Serif SC", "Songti SC", "SimSun", serif;
}
h1, h2, h3, h4,
.card-title,
.section-title,
.sub-section-title,
.timeline-title,
.panel-title,
.form-title,
.results-title,
.lost-card-title,
.create-type-title,
.cancelled-reason-title {
    font-family: var(--font-title);
}
