/* common.css - 公共样式 */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #3b82f6;
    --accent: #6366f1;
    --light: #f8fafc;
    --light-gray: #f1f5f9;
    --dark: #1e293b;
    --gray: #64748b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--light-gray);
    line-height: 1.6;
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: 6px;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light-gray);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
}

/* 通用卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--light);
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background-color: var(--light);
}

/* 章节标题样式 */
.section {
    padding: 40px 0;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 通用网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 页眉样式 */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.header-scrolled {
    padding: 8px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    margin-right: 8px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 24px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a.active {
    color: #fff;
    font-weight: 600;
}

.nav-links a.active:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* 会员登录/注册按钮样式 */
.nav-links .login-btn {
    padding: 6px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    border-radius: 6px;
    margin-left: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-links .login-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff !important;
}

.nav-links .register-btn {
    padding: 6px 16px;
    background-color: #fff;
    color: var(--primary) !important;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
}

.nav-links .register-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-hover) !important;
}

/* 已登录用户菜单 */
.nav-links .user-menu {
    margin-left: 16px;
}

.nav-links .user-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-links .user-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff !important;
}

.nav-links .user-link i {
    font-size: 18px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-top: 8px;
    padding: 8px 0;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    font-weight: 400;
}

.dropdown-menu a:hover {
    background-color: var(--light-gray);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* 页脚样式 */
footer {
    background: var(--dark);
    padding: 40px 0 20px;
    color: #94a3b8;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #64748b;
}

.footer-bottom a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #fff;
}

/* 联系信息样式 */
.contact {
    padding: 40px 0;
    background: var(--primary);
    text-align: center;
}

.contact h2 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 12px;
}

.contact p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 20px;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.contact-item i {
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.contact-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tag-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.tag-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.2);
}

.tag-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.tag-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}

/* 表单元素 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 筛选标签样式 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 14px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 列表样式 */
.list-group {
    list-style: none;
    padding: 0;
}

.list-group-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--light);
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background-color: var(--light);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background-color: var(--light-gray);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 面包屑导航 */
.breadcrumb-section {
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    margin-top: 60px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .current {
    color: var(--primary);
    font-weight: 500;
}

/* 消息提示 */
.message-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-success {
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
}

.message-error {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

.message-info {
    background: rgba(37, 99, 235, 0.95);
    color: #fff;
}

.message-warning {
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: var(--light);
    color: var(--primary);
}

.pagination a.active {
    background-color: var(--primary);
    color: #fff;
}

.pagination .prev,
.pagination .next {
    width: auto;
    padding: 0 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        margin-top: 8px;
        border-radius: 0 0 8px 8px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 8px 0;
    }
    
    .nav-links a {
        padding: 10px 0;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        color: #fff;
    }
    
    .nav-links .login-btn,
    .nav-links .register-btn {
        margin: 8px 0;
        text-align: center;
    }
    
    .nav-links .user-menu {
        margin: 8px 0;
        width: 100%;
    }
    
    .nav-links .user-link {
        justify-content: center;
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .section-title h2 {
        font-size: 20px;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .breadcrumb-section {
        margin-top: 56px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 24px 0;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .logo-text {
        font-size: 16px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.ml-20 { margin-left: 20px; }
.mr-10 { margin-right: 10px; }
.mr-15 { margin-right: 15px; }
.mr-20 { margin-right: 20px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

.z-1 { z-index: 1; }
.z-10 { z-index: 10; }
.z-100 { z-index: 100; }
.z-1000 { z-index: 1000; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.bg-white { background-color: #fff; }
.bg-light { background-color: var(--light); }
.bg-light-gray { background-color: var(--light-gray); }
.bg-dark { background-color: var(--dark); }
.bg-primary { background-color: var(--primary); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-dark { color: var(--dark); }
.text-white { color: #fff; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }

/* 清除浮动 */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* 隐藏元素 */
.hidden {
    display: none;
}

/* 显示元素 */
.visible {
    display: block;
}

/* 禁止选择 */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* 光标指针 */
.cursor-pointer {
    cursor: pointer;
}

/* 禁用状态 */
.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 过渡动画 */
.transition {
    transition: all 0.2s ease;
}
