/* ==================== 全局重置和基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    min-width: 1400px;
    color: #333;
    line-height: 1.6;
}

/* 确保所有下拉选择框使用微软雅黑字体 */
select {
    font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* ==================== 容器宽度控制 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== 顶部导航栏 ==================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    gap: 3rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-brand-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.nav-link {
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: transparent;
    border: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: #667eea;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-link.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-user-info:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
}

.nav-username {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.nav-points {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

/* ==================== 主内容区域 ==================== */
.main-content {
    margin-top: 90px;
    min-height: calc(100vh - 90px);
    padding-bottom: 3rem;
}

/* ==================== 通用按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #F44336 0%, #d32f2f 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #667eea;
    margin: 0;
}

.card-body {
    padding: 0;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #aaa;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* ==================== 消息提示框 ==================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border-left: 5px solid #10b981;
    color: #065f46;
}

.alert-error {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-left: 5px solid #ef4444;
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 5px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 5px solid #667eea;
    color: #667eea;
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1rem;
}

.loading-text {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==================== 分隔线 ==================== */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
    margin: 2rem 0;
}

/* ==================== 信息框 ==================== */
.info-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.info-box h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: #667eea;
    font-size: 1.1rem;
}

.info-box ul {
    margin: 0;
    padding-left: 1.5rem;
    line-height: 2;
}

/* ==================== 网格布局 ==================== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    min-width: 600px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    min-width: 900px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
    min-width: 1200px;
}

/* ==================== Flex 布局工具类 ==================== */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ==================== 文本工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: #667eea; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #ffc107; }
.text-muted { color: #6c757d; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ==================== 间距工具类 ==================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ==================== 隐藏/显示 ==================== */
.hidden { display: none !important; }
.visible { display: block !important; }

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in { animation: fadeIn 0.5s ease; }
.fade-in-up { animation: fadeInUp 0.6s ease; }

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .top-nav {
        padding: 0 1rem;
    }

    .nav-user-details {
        display: none;
    }
}

/* 禁用小屏幕响应式，保持固定宽度 */
@media (max-width: 1400px) {
    body {
        overflow-x: auto;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .top-nav,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-top: 0;
    }
}

/* ==================== 底部版权 ==================== */
.footer {
    text-align: center;
    color: #999;
    margin-top: auto;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}
