/**
 * @fileoverview 基础样式
 * @description 浏览器默认样式归一化、排版、滚动条、焦点环与通用工具类。
 *              页面背景的霓虹光晕在此统一绘制，保证登录页与后台页面观感一致。
 * @author calvinliu@hk.chinamobile.com
 * @version V1.0.0
 * @license MIT
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    background-color: #050a15;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html[data-theme="light"] {
    background-color: #eef2f8;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--font-md);
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 深色主题的固定背景：三层径向光晕 + 极细网格，营造赛博霓虹氛围 */
html[data-theme="dark"] body {
    background-image:
        radial-gradient(1100px 620px at 8% -8%, rgba(34, 211, 238, 0.16), transparent 62%),
        radial-gradient(900px 560px at 92% 4%, rgba(129, 140, 248, 0.16), transparent 60%),
        radial-gradient(760px 520px at 54% 104%, rgba(244, 114, 182, 0.1), transparent 64%),
        linear-gradient(180deg, #050a15 0%, #070f1f 46%, #050a14 100%);
    background-attachment: fixed;
}

/* 浅色主题的固定背景：低对比度冷灰渐变，保持干净的商务底色 */
html[data-theme="light"] body {
    background-image:
        radial-gradient(900px 520px at 10% -10%, rgba(8, 145, 178, 0.08), transparent 60%),
        radial-gradient(760px 480px at 92% 0%, rgba(99, 102, 241, 0.07), transparent 58%),
        linear-gradient(180deg, #f3f6fb 0%, #eef2f8 48%, #e9eff7 100%);
    background-attachment: fixed;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-sans);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--dur-1) var(--ease-out);
}

a:hover {
    color: var(--text-primary);
}

img,
svg {
    display: block;
    max-width: 100%;
}

button {
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

input,
textarea {
    color: inherit;
}

textarea {
    resize: none;
}

/* 统一数字显示：表格、图表数值使用等宽数字，避免跳动 */
.num {
    font-family: var(--font-number);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

::selection {
    color: var(--text-primary);
    background: rgba(34, 211, 238, 0.32);
}

html[data-theme="light"] ::selection {
    color: #0b2239;
    background: rgba(8, 145, 178, 0.2);
}

/* 全站隐藏滚动条：内容仍可滚动，但界面不出现任何滚动条轨道 */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* 键盘焦点环：只在键盘导航时出现，鼠标点击不显示 */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 文本框自带边框与柔和光圈，不再叠加全局焦点环，避免聚焦后边框过粗 */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable="true"]:focus-visible {
    outline: none;
}

/* 表单元素基础：统一字体、颜色与最小点击区域 */
input,
textarea,
select {
    font-size: var(--font-md);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 通用工具类：确保 hidden 属性不会被组件的 display 声明覆盖 */
[hidden] {
    display: none !important;
}

.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
