/* 基础样式重置和工具类 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 图标优化样式 */
.stat-icon {
    transition: all 0.2s ease-in-out;
}

.stat-icon:hover {
    transform: scale(1.1);
}

.stat-badge {
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.stat-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flex {
    display: flex;
}

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

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

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.warning {
    background-color: #ffc107;
    color: #333;
}

/* 按钮样式 */
.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    margin: var(--spacing-xs);
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* 个人中心主内容区居中样式 */
.main-content-centered {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 1200px;
    width: 100%;
}

@media (min-width: 1024px) {
    .main-content-centered {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* 图标加载优化 */
.icon-preload {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* 图标优化样式 */
.icon-optimized {
    transition: all 0.2s ease-in-out;
}

.icon-optimized:hover {
    transform: scale(1.1);
}

/* 字体显示优化 */
@font-face {
    font-display: swap;
}

/* 关键资源预加载 */
link[rel="preload"] {
    font-display: swap;
}