/**
 * 基础样式重置
 * 金信达智管平台 - JXD-SMP
 * 参考金蝶云星空设计规范
 */

/* ==================== CSS Reset ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== HTML & Body ==================== */
html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 链接样式 ==================== */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

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

a:active {
    color: var(--primary-active);
}

/* ==================== 列表样式 ==================== */
ul, ol {
    list-style: none;
}

/* ==================== 图片样式 ==================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-base);
}

/* ==================== 表单元素 ==================== */
input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

input:focus, button:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

button {
    cursor: pointer;
    border: none;
}

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

/* ==================== 表格 ==================== */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

th {
    font-weight: 600;
    text-align: left;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== 选择文本样式 ==================== */
::selection {
    background: var(--primary-light);
    color: var(--primary-color);
}

::-moz-selection {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ==================== 清除浮动 ==================== */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ==================== 文本样式 ==================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: var(--line-height-heading);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-title); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }
h5 { font-size: var(--font-size-sm); }
h6 { font-size: var(--font-size-xs); }

p {
    margin: 0;
    line-height: var(--line-height-base);
}

/* ==================== 辅助类 ==================== */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-break {
    word-wrap: break-word;
    word-break: break-all;
}

.text-nowrap {
    white-space: nowrap;
}

/* ==================== 显示控制 ==================== */
.d-none {
    display: none !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

/* ==================== Flex布局 ==================== */
.flex-row {
    flex-direction: row;
}

.flex-column {
    flex-direction: column;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.align-start {
    align-items: flex-start;
}

.align-center {
    align-items: center;
}

.align-end {
    align-items: flex-end;
}

/* ==================== 定位 ==================== */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

/* ==================== 溢出控制 ==================== */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-scroll {
    overflow: scroll;
}

/* ==================== 光标样式 ==================== */
.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.cursor-default {
    cursor: default;
}

/* ==================== 用户选择 ==================== */
.select-none {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.select-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.select-all {
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
}
