/**
 * FitMate - Base Styles
 * 全局基础样式重置与初始化
 */

/* ========================================
   CSS Reset - 样式重置
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
}

/* ========================================
   Typography - 字体排版
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Lists - 列表
   ======================================== */
ul, ol {
    list-style: none;
}

/* ========================================
   Images - 图片
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Form Elements - 表单元素
   ======================================== */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* ========================================
   Utility Classes - 工具类
   ======================================== */

/* 文字截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文本对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* 字体粗细 */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 文字颜色 */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* 背景颜色 */
.bg-primary { background-color: var(--primary-light); }
.bg-success { background-color: var(--success-light); }
.bg-warning { background-color: var(--warning-light); }
.bg-danger { background-color: var(--danger-light); }

/* Flex 工具类 */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Display 工具类 */
.d-none { display: none; }
.d-block { display: block; }

/* 溢出隐藏 */
.overflow-hidden { overflow: hidden; }

/* ========================================
   Animations - 动画
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========================================
   Skeleton Loading - 骨架屏
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border-light) 25%,
        var(--border) 50%,
        var(--border-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
