/* ============================================================
 * 金考题 Web 端基础层（base）
 * 依赖：theme.css（token）先于本文件加载
 * 注意：body 规则只写 background-color（不用 background 简写）——
 *       login.html 自带 body{background:linear-gradient(...)} 靠
 *       background-image 层共存，简写会把它打掉
 * ============================================================ */

/* ----- Reset ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    font-size: var(--fs-md);
    line-height: var(--lh-base);
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ----- 可访问性：键盘焦点环（鼠标点击不触发） ----- */
:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

/* ----- 选中文本 ----- */
::selection {
    background: var(--primary-tint-bg-strong);
    color: var(--primary-active);
}

/* ----- 滚动条（WebKit） ----- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ----- 布局容器 ----- */
.jk-container,
.container {
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sp-5);
    padding-right: var(--sp-5);
}

/* ----- 文字工具类 ----- */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-brand     { color: var(--primary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

.fs-xs  { font-size: var(--fs-xs); }
.fs-sm  { font-size: var(--fs-sm); }
.fs-md  { font-size: var(--fs-md); }
.fs-lg  { font-size: var(--fs-lg); }
.fs-xl  { font-size: var(--fs-xl); }
.fs-2xl { font-size: var(--fs-2xl); }
.fs-3xl { font-size: var(--fs-3xl); }

.fw-medium   { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

/* ----- 通用动效工具（只作用于视觉属性，禁 all） ----- */
.transition-colors {
    transition: color var(--t-base) var(--ease),
                background-color var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
}

/* ----- 屏幕阅读器辅助（视觉隐藏） ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
