/* ============================================================
   AirTAC 线性滑轨寿命计算 —— 现代化视觉层
   叠加在 index.css / series.css 之上：只改外观，不改布局与 DOM。
   通过 :has() 区分页面类型设定卡片高度；:has() 不可用时回退为
   系列页高度（仅影响启动页卡片过长，不影响功能）。
   ============================================================ */

:root {
    --primary: #1e5aa8;
    --primary-dark: #15427a;
    --primary-light: #e9f1fb;
    --text: #24292f;
    --muted: #6b7280;
    --line: #d8dee9;
    --card: #ffffff;
    --shadow-sm: 0 1px 4px rgba(23, 43, 77, .08);
    --shadow-md: 0 10px 30px rgba(23, 43, 77, .12);
}

/* ---------- 页面底色与字体 ---------- */
html {
    background: #d9e0ea;
}

body {
    background:
        radial-gradient(1100px 460px at 50% -120px, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(180deg, #eef2f8 0%, #dfe6f0 100%);
    min-height: 100vh;
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
    color: var(--text);
}

/* ---------- 主内容整体为一张圆角卡片 ---------- */
#tybd {
    position: relative;   /* 关键：让内部绝对定位元素以卡片为基准，窗口再宽也不会错位 */
    width: 1200px;        /* 原版内容实际跨度约 192~1174，982px 会截断标题区 */
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin: 20px auto 34px;
    min-height: 2130px; /* 默认：系列计算页 */
}

/* 启动页（含 5 张系列卡片）与 fw 说明页更矮 */
body:has(#tyIMG1) #tybd { min-height: 1000px; }
body:has(#tyAbout_fw) #tybd { min-height: 660px; }

/* ---------- 标题与版次徽章 ---------- */
#tyTitle, #tyTitleLSH {
    color: #17202b;
    letter-spacing: .3px;
}

#tyTitle span, #tyTitleLSH span,
#tyTitle TEXT-TAG, #tyTitleLSH TEXT-TAG {
    background: linear-gradient(135deg, #2a6cc4, var(--primary-dark));
    color: #ffffff;
    font-size: 17px !important;
    font-weight: 600;
    padding: 3px 16px;
    border-radius: 999px;
    vertical-align: 5px;
    margin-left: 10px;
    box-shadow: 0 2px 6px rgba(21, 66, 122, .35);
}

/* ---------- 表单控件 ---------- */
#tyForm11 { color: var(--text); }

#tyForm11 p[style*="0000FF"], #tyForm21 p[style*="0000FF"] {
    color: var(--primary) !important;
    font-weight: 700;
}

#tyForm21 input[type="text"] {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfcfe;
    padding: 5px 0;   /* 只留纵向内边距，避免单位文字与输入框之间出现间隙 */
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

#tyForm21 input[type="text"]:hover,
#tyForm21 select:hover {
    border-color: #b7c4d8;
}

#tyForm21 input[type="text"]:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 90, 168, .16);
}

#tyForm21 input[type="text"]:disabled {
    background: #eef1f6;
    color: #98a1b0;
    border-color: #e2e7ef;
}

#tyForm21 select,
#ID_selectYuYa {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfcfe;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

#tyForm21 select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 90, 168, .16);
}

/* ---------- 按钮 ---------- */
input[type="button"] {
    box-sizing: border-box;   /* 让内联 width(50/80/90px) 即按钮总宽，与原版尺寸一致 */
    text-align: center !important;
    background: linear-gradient(180deg, #2d6fc9 0%, var(--primary) 55%, var(--primary-dark) 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 7px;
    padding: 6px 8px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(21, 66, 122, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: filter .15s ease, transform .06s ease, box-shadow .15s ease;
}

input[type="button"]:hover {
    filter: brightness(1.09);
    box-shadow: 0 4px 10px rgba(21, 66, 122, .32);
}

input[type="button"]:active {
    transform: translateY(1px);
    filter: brightness(.97);
}

input[type="button"]:disabled {
    background: #a9b6c8;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- 右侧示意图相框 ---------- */
#tyForm31_2 img, #tyForm31_3 img, #tyForm31_4 img, #tyForm31_5 img,
#ID_MyShowIMG1, #ID_MyShowIMG2, #ID_MyShowIMG3, #ID_MyShowIMG4 {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 7px;
}

/* 安装方式：按用户要求去掉小节标题文字，示意图满尺寸原位加相框 */
#tyForm31_1 { display: none !important; }
#tyForm31_2 p { margin: 0 !important; }   /* 抵消相框内边距，图底保持原版位置 */


#tyForm31_3 p:first-of-type,
#tyForm31_4 p:first-of-type, #tyForm31_5 p:first-of-type {
    color: var(--muted);
    font-weight: 600;
}

/* ---------- 结果表格 ---------- */
#ID_table_JG {
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    background: #ffffff;
}

#ID_table_JG th {
    background: linear-gradient(180deg, #2d6fc9, var(--primary));
    color: #ffffff;
    border: none !important;
    padding: 9px 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

#ID_table_JG td {
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 9px 12px;
    background: #ffffff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 16px;
}

#ID_table_JG tr:last-child td { border-bottom: none !important; }

#ID_table_JG td[style*="0000FF"] {
    color: var(--primary) !important;
    font-weight: 700;
}

/* ---------- 声明与脚注：通栏居中（不再偏左） ---------- */
#tySM, #tySM2 {
    left: 0 !important;
    width: 100% !important;
    text-align: center;
}

#tySM p { color: #4a5568 !important; }
#tySM2 p { color: #98a1b2 !important; }

/* 计算页：结果区（表格+备注）加高后，版权下移到备注之下，避免重叠 */
body:has(#tyFormJG) #tySM2 { margin-top: 2150px !important; }
body:has(#tyFormJG) #tybd { min-height: 2210px; }

/* fw 说明页：版权收进卡片内（内容表格约至 470px 处结束） */
body:has(#tyAbout_fw) #tySM2 { margin-top: 540px !important; }

/* 表单行禁止换行，保证单位/按钮始终紧贴输入框 */
#tyForm21 p { white-space: nowrap; }

/* ---------- 启动页系列卡片 ---------- */
#tyIMG1, #tyIMG2, #tyIMG3, #tyIMG4, #tyIMG5 {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 12px 12px 18px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* 卡片加内边距后变高，下移第二行与声明区避免重叠（仅启动页，防止泄漏到计算页） */
body:has(#tyIMG1) #tyIMG4, body:has(#tyIMG1) #tyIMG5 { margin-top: 490px !important; }
body:has(#tyIMG1) #tySM { margin-top: 830px !important; }
body:has(#tyIMG1) #tySM2 { margin-top: 910px !important; }

/* 计算页右列保持原版坐标（tyForm31_2=80 / 31_3=400 / 31_4=730 / 31_5=1200），
   保证左右两栏 3、4、5 小节标题对齐；安装示意图不加相框即无标题穿线问题 */

#tyIMG1:hover, #tyIMG2:hover, #tyIMG3:hover, #tyIMG4:hover, #tyIMG5:hover {
    transform: translateY(-5px);
    border-color: #b9cce6;
    box-shadow: var(--shadow-md);
}

#tyIMG1 p img, #tyIMG2 p img, #tyIMG3 p img, #tyIMG4 p img, #tyIMG5 p img {
    border-radius: 8px;
}

/* ---------- fw 说明页 ---------- */
#tyAbout_fw p { color: #3a4450; }

#tyAbout_fw table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
}

#tyAbout_fw table td { background: #ffffff; }

/* ---------- fw 帮助弹层（new2） ---------- */
#fwOverlay .fwBox {
    border-radius: 14px;
    border: none;
    box-shadow: 0 18px 60px rgba(15, 35, 70, .30);
}

#fwOverlay .fwBox table th {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ---------- new2 单页导航链接 ---------- */
#tyLang .langLink.active { color: var(--primary) !important; }
