/* CSS变量定义 */
:root {
    --primary-color: #FEA500;
    --primary-hover: #ff8c00;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --border-color: #d9d9d9;
    --card-shadow:0 2px 5px 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;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* 通用容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}
.min-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height:600px;
}

/* 头部导航 */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-container {
    display: flex;
    align-items: center;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    width: 180px;
    display: flex;
    align-items: center;
}

.logo img {
    width: 180px;
    margin-top: 15px;
}

/* 电脑端导航 */
.main-nav {
    display: flex;
    gap: 30px;
    margin-right: 30px;
    margin-left: 30px;
}
.main-nav a {
    color: #666;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.3s ease;
    position: relative;
}

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

.main-nav a.active {
    color: var(--primary-color);
    font-weight: 500;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    width: 200px;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(254, 165, 0, 0.2);
    outline: none;
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.search-button:hover {
    color: var(--primary-color);
}

.user-actions {
    display: flex;
    gap: 20px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-login {
    background-color: #fff;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-login:hover {
    background-color: rgba(254, 165, 0, 0.1);
}

.btn-register {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
}

.btn-register:hover {
    background-color: var(--primary-hover);
}

/* 移动端菜单按钮 - 默认隐藏 */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

/* 移动端菜单 - 默认隐藏 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
}

.mobile-menu.active {
    right: 0;
}

.menu-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-menu {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.menu-items {
    display: flex;
    flex-direction: column;
}

.menu-items a {
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.menu-items a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}



/* 页脚 */
.main-footer {
    background-color: #001529;
    color: #fff;
    padding: 20px 0 20px;
    font-size: 13px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 15px;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.45);
}

/* 通用按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-hover);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #fff;
    opacity: 0.9;
}
.btn-success {
    background-color: #52c41a;
    border: 1px solid #52c41a;
    color: #fff;
}

.btn-success:hover {
    background-color: #52c41a;
    color: #fff;
    opacity: 0.9;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: #e6f7ff;
    background: var(--primary-color);
    color: #fff;
}

.btn-danger {
    background: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}
/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 4px;
    color: #666;
    transition: all 0.3s;
    font-size: 14px;
}

.pagination a:hover,
.pagination a.active {
    background-color: var(--primary-color);
    color: #fff;
}

.pagination a.next,
.pagination a.prev {
    width: auto;
    padding: 0 15px;
}


/* 个人中心通用布局 */
.dashboard {
    background-color: var(--bg-color);
    min-height: calc(100vh - 70px);
    padding: 20px 0;
    margin-top: 70px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    min-height: calc(100vh - 110px);
}

/* 个人中心侧边栏样式 */
.dashboard-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

/* 自定义滚动条样式 */
.dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.dashboard-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    min-height: calc(100vh - 110px);
}

.user-profile-card {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.large-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.change-avatar-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.change-avatar-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.user-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 8px 0;
    color: var(--text-color);
}

.user-title {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 12px;
}

/* 导航菜单 */
.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    padding: 12px 16px;
    justify-content: center;
}

.nav-item i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.2rem;
}

.nav-item span {
    flex: 1;
}

.nav-item:hover {
    background: rgba(254, 165, 0, 0.1);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(254, 165, 0, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

/* 菜单按钮样式 */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

/* 移动端菜单样式 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
}

.mobile-menu.active {
    right: 0;
}

.menu-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-menu {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.menu-items {
    display: flex;
    flex-direction: column;
}

.menu-items a {
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.menu-items a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
/* 弹窗遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

/* 消息弹窗 */
.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 300px;
    max-width: 80%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

/* 消息图标 */
.message-icon {
    text-align: center;
    margin-bottom: 15px;
}

.message-icon i {
    font-size: 36px;
}

.error-message .message-icon i {
    color: #f44336;
}

.success-message .message-icon i {
    color: #4caf50;
}

/* 消息内容 */
.message-content {
    text-align: center;
    font-size: 16px;
    color: #FFF;
}

/* 关闭按钮 */
.message-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.message-close:hover {
    color: #333;
}

/* 加载状态遮罩层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* 幻灯片导航 */
.nav-item {
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    padding: 6px 0px;
    justify-content: center;
}
/* 响应式样式 */
@media screen and (max-width: 768px) {
    .header-container {
        padding: 8px 15px;
        display: flex;
        flex-direction: row;
    }
    .menu-toggle {
        display: block;
    }

    .search-box {
        margin: 0 10px;
    }

    .search-box input {
        display: none;
    }

    .logo img {
        height: 30px;
    }
    .user-actions {
        display: flex;
        gap: 10px;
    }

    .btn-login,
    .btn-register {
        padding: 8px 8px;
        border-radius: 4px;
        font-size: 12px;
        transition: all 0.3s;
    }

    .btn-login {
        background-color: #fff;
        border: 1px solid var(--primary-color);
        color: var(--primary-color);
    }

    .btn-login:hover {
        background-color: rgba(254, 165, 0, 0.1);
    }

    .btn-register {
        background-color: var(--primary-color);
        border: 1px solid var(--primary-color);
        color: #fff;
    }

    .btn-register:hover {
        background-color: var(--primary-hover);
    }


    .main-footer {
        padding: 10px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;  /* 改为单列布局 */
        gap: 30px;
        padding: 0 20px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-section p {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .footer-section ul {
        gap: 8px;
    }

    .footer-section ul li a {
        font-size: 14px;
    }

    .footer-bottom {
        padding: 15px 20px 0;
        font-size: 12px;
    }
    .user-profile-card{
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .menu-toggle {
        font-size: 20px;
    }
    .header-container {
        padding: 8px 15px;
        display: flex;
        flex-direction: row;
    }
    .search-input {
        height: 30px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .search-box {
        display: none;
    }

    .logo img {
        height: 50px;
    }

    .mobile-menu {
        width: 80%;
    }
    .main-footer {
        padding: 5px 0 15px;
    }

    .footer-content {
        gap: 20px;
        padding: 0 15px;
    }

    .footer-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .footer-section p {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .footer-section ul li a {
        font-size: 13px;
    }

    .footer-bottom {
        padding: 12px 15px 0;
        font-size: 11px;
    }
    .user-profile-card{
        display: none;
    }
}
/* 响应式设计 */
@media (max-width: 992px) {
    /* 隐藏电脑端元素 */
    .main-nav {
        display: none;
    }

    /* 显示移动端元素 */
    .menu-toggle {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    /* 调整移动端布局 */
    .header-container {
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }

    .logo {
        width: auto;
        margin-right: 10px;
    }

    .search-box {
        display: none;
    }

    .header-right {
        margin-left: 0;
    }
    .user-profile-card{
        display: none;
    }
}
