/* ====================
   PuranCMS 前台样式表
   ==================== */

/* CSS 变量 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --secondary-color: #722ed1;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --text-color: #000;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e8e8e8;
    --bg-color: #f5f5f5;
    --white: #fff;
    --accent-color: #c8a97e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 4px;
    --radius-lg: 8px;
    --transition: all 0.3s ease;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部工具栏 */
.top-bar {
    background-color: #fafafa;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 12px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left span {
    color: var(--text-secondary);
}

.top-bar-right a {
    margin-left: 15px;
    color: var(--text-secondary);
}

.top-bar-right a:hover {
    color: var(--primary-color);
}

/* 主头部 */
.main-header {
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.main-header.scrolled {
    background-color: var(--white);
    box-shadow: var(--shadow);
}

.main-header .container {
    display: flex;
    align-items: center;
    padding: 15px;
}

.logo {
    margin-right: 40px;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo .logo-img {
    height: 40px;
}

.logo .logo-transparent {
    display: block;
}

.logo .logo-default {
    display: none;
}

.main-header.scrolled .logo .logo-transparent {
    display: none;
}

.main-header.scrolled .logo .logo-default {
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

/* 主导航 */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: block;
    padding: 10px 15px;
    color: var(--white);
    font-weight: normal;
}

.main-header.scrolled .nav-item > a {
    color: var(--text-color);
    text-shadow: none;
}

.nav-item > a:hover,
.nav-item.active > a {
    color: var(--accent-color);
}

.main-header.scrolled .nav-item > a:hover,
.main-header.scrolled .nav-item.active > a {
    color: var(--accent-color);
}

/* 子导航 */
.sub-nav {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.nav-item:hover .sub-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-nav-item > a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    white-space: nowrap;
}

.sub-nav-item > a:hover,
.sub-nav-item.active > a {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* 用户操作区 */
.header-user-actions {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 20px;
}

.header-user-actions .user-link,
.header-user-actions .user-logout {
    color: var(--white);
    font-size: 14px;
    padding: 0 8px;
    transition: var(--transition);
}

.main-header.scrolled .header-user-actions .user-link,
.main-header.scrolled .header-user-actions .user-logout {
    color: var(--text-color);
}

.main-header.scrolled .header-user-actions .user-link:hover,
.main-header.scrolled .header-user-actions .user-logout:hover {
    color: var(--accent-color);
}

.header-user-actions .user-link:hover,
.header-user-actions .user-logout:hover {
    color: var(--accent-color);
}

.header-user-actions .user-divider {
    color: var(--white);
    font-size: 14px;
    opacity: 0.5;
}

.main-header.scrolled .header-user-actions .user-divider {
    color: var(--text-color);
}

/* 用户头像样式 */
.header-user-actions .user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.header-user-actions .header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.main-header.scrolled .header-user-actions .header-avatar {
    border-color: var(--accent-color);
}

.header-user-actions .header-avatar:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.header-user-actions .header-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #a88b4a 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.main-header.scrolled .header-user-actions .header-avatar-placeholder {
    border-color: var(--accent-color);
}

.header-user-actions .header-avatar-placeholder:hover {
    transform: scale(1.1);
}

.header-user-actions .user-logout-btn {
    color: var(--white);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    background: transparent;
}

.main-header.scrolled .header-user-actions .user-logout-btn {
    color: var(--text-color);
    background: transparent;
}

.main-header.scrolled .header-user-actions .user-logout-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.header-user-actions .user-logout-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    z-index: 1002;
    position: relative;
}

/* 移动端关闭按钮和登录注册 - PC端隐藏 */
.mobile-nav-close {
    display: none;
}

.mobile-nav-actions {
    display: none;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--white);
    border-radius: 2px;
    transition: var(--transition);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -1px;
    margin-left: -12.5px;
}

.mobile-menu-btn span:nth-child(1) {
    transform: translateY(-8px);
}

.mobile-menu-btn span:nth-child(3) {
    transform: translateY(8px);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg);
}

.main-header.scrolled .mobile-menu-btn span {
    background-color: var(--text-color);
}

.main-header.scrolled .mobile-menu-btn.active span {
    background-color: #fff;
}

/* 面包屑导航 */
.breadcrumb-nav {
    background-color: transparent;
    padding: 15px 0;
    border-bottom: none;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    line-height: 1;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin: 0 8px;
    color: var(--text-muted);
    line-height: 1;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    line-height: 1;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

/* 主内容区 */
.main-content {
    min-height: calc(100vh - 400px);
    padding: 0;
}

/* 页尾 */
.footer {
    background-color: #000;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 500;
}

.footer-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link {
    margin-bottom: 10px;
}

.footer-link a {
    color: #e0e0e0;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link a:hover {
    color: #c8a97e;
}

.footer-phone {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 10px 0 15px;
    letter-spacing: 1px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.social-icon:hover {
    background-color: #c8a97e;
    color: #000;
}

.wechat-icon,
.tiktok-icon,
.weibo-icon,
.kuaishou-icon,
.xiaohongshu-icon,
.miniapp-icon,
.channels-icon {
    position: relative;
}

.social-qrcode {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.social-qrcode::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff;
}

.social-qrcode img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    display: block;
    margin: 0 auto 8px;
    border-radius: 4px;
}

.social-qrcode span {
    color: #333;
    font-size: 12px;
    display: block;
    white-space: nowrap;
}

.wechat-icon:hover .social-qrcode,
.tiktok-icon:hover .social-qrcode,
.weibo-icon:hover .social-qrcode,
.kuaishou-icon:hover .social-qrcode,
.xiaohongshu-icon:hover .social-qrcode,
.miniapp-icon:hover .social-qrcode,
.channels-icon:hover .social-qrcode {
    display: block;
}

/* 底部导航区域 - PC端一行显示，移动端两行显示 */
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 底部内容容器 - 使用flex布局实现水平排列 */
.footer-bottom-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1.5;
}

/* 版权信息样式 */
.footer-copyright {
    color: #888;
    font-size: 14px;
    line-height: 1.5;
    vertical-align: middle;
}

/* 分隔符样式 - 用于PC端显示 | 符号 */
.footer-separator {
    color: #888;
    font-size: 14px;
    margin: 0 8px;
    line-height: 1.5;
    vertical-align: middle;
}

/* ICP备案号和公安备案号共同样式 */
.footer-icp,
.footer-police {
    color: #888;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.5;
    vertical-align: middle;
}

/* 备案号悬停效果 - 变为金色 */
.footer-icp:hover,
.footer-police:hover {
    color: #c8a97e;
}

/* 公安备案图标样式 */
.police-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.btn-block {
    display: block;
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 分页样式 */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-list {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    background-color: var(--white);
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    cursor: not-allowed;
}

.pagination-info {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--bg-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 12px;
    transition: var(--transition);
}

.tag-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.tag-count {
    font-size: 10px;
    opacity: 0.7;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* 响应式设计 */
@media (max-width: 1023px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 767px) {
    /* 移动端 Logo 尺寸优化 */
    .logo .logo-img {
        height: 32px;
        max-width: 120px;
        object-fit: contain;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-user-actions {
        display: none;
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 1000;
        opacity: 0;
        pointer-events: none; /* 隐藏状态不拦截点击事件 */
        transition: opacity 0.3s ease;
    }

    .mobile-nav-backdrop.show {
        display: block;
        opacity: 1;
        pointer-events: auto; /* 显示时恢复点击响应 */
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 360px;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding-top: 70px;
    }

    .main-nav.open {
        right: 0;
    }

    .mobile-nav-close {
        display: none;
    }

    .mobile-nav-close-btn {
        display: none;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
    }

    .nav-item > a {
        padding: 16px 30px;
        color: #fff;
        text-shadow: none;
        font-size: 18px;
        text-align: left;
        font-weight: normal;
        letter-spacing: 1px;
        transition: var(--transition);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-item.has-sub > a::after {
        content: ' +';
        font-size: 20px;
        font-weight: 300;
        color: rgba(255, 255, 255, 0.8);
        transition: var(--transition);
        margin-left: 5px;
    }

    .nav-item.has-sub.open > a::after {
        content: ' −';
        color: var(--accent-color);
    }

    .main-header.scrolled .nav-item > a {
        color: #fff;
        text-shadow: none;
    }

    .nav-item > a:hover,
    .nav-item.active > a {
        color: var(--accent-color);
        background-color: rgba(255, 255, 255, 0.05);
    }

    .sub-nav {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        background-color: rgba(0, 0, 0, 0.15);
    }

    .nav-item.open .sub-nav {
        display: block;
    }

    .sub-nav-item > a {
        color: rgba(255, 255, 255, 0.7);
        padding: 12px 30px 12px 50px;
        font-size: 15px;
        text-align: left;
        transition: var(--transition);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .sub-nav-item > a:hover,
    .sub-nav-item.active > a {
        color: var(--accent-color);
        background-color: rgba(255, 255, 255, 0.05);
    }

    .mobile-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: auto;
        padding: 20px 30px;
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 20px));
    }

    .mobile-nav-actions a {
        display: block;
        padding: 12px 20px;
        color: #fff;
        font-size: 15px;
        text-align: center;
        border-radius: 8px;
        background-color: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        transition: var(--transition);
    }

    .mobile-nav-actions a:hover,
    .mobile-nav-actions a:active {
        background-color: var(--accent-color);
        border-color: var(--accent-color);
        color: #fff;
    }

    .mobile-nav-actions .mobile-user-info {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 12px 20px;
    }

    .mobile-nav-actions .mobile-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .mobile-nav-actions .mobile-avatar-placeholder {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-color) 0%, #a88b4a 100%);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .footer-content {
        display: grid;
        grid-template-columns: repeat(3, minmax(100px, 1fr));
        gap: clamp(0.5rem, 2vw, 1rem);
        justify-content: center;
        padding: 0 1rem;
    }

    .footer-column {
        margin-bottom: 0;
        min-width: 0;
        text-align: center;
    }

    .footer-column h3 {
        font-size: clamp(0.85rem, 3.2vw, 1rem);
        margin-bottom: 0.6rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-link {
        margin-bottom: 0.4rem;
        white-space: nowrap;
    }

    .footer-link a {
        font-size: clamp(0.75rem, 2.8vw, 0.85rem);
        opacity: 0.9;
    }

    .footer-column:last-child {
        grid-column: 1 / -1;
        padding-top: 0.8rem;
        margin-top: 0.3rem;
    }

    .footer-phone {
        font-size: 16px;
    }

    .footer-social {
        justify-content: center;
        gap: clamp(0.5rem, 2vw, 0.75rem);
        margin-top: 0.5rem;
    }

    .social-qrcode {
        display: none;
    }

    .top-bar {
        display: none;
    }

    /* 移动端底部导航两行显示 */
    /* 第一行：版权信息 */
    /* 第二行：ICP备案号和公安备案号横向排列 */
    .footer-bottom-content {
        flex-direction: column;
        gap: 10px;
    }

    /* 版权信息排在第一位 */
    .footer-copyright {
        order: 1;
    }

    /* ICP备案号和公安备案号容器排在第二位 */
    .footer-beian {
        order: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    /* 备案号样式 */
    .footer-icp,
    .footer-police {
        order: 2;
    }

    /* 移动端显示分隔符 */
    .footer-separator {
        display: inline !important;
        order: 2;
    }

    /* 移动端隐藏第一个分隔符 */
    .footer-separator-first {
        display: none !important;
    }
}

/* 简洁页尾样式 */
.simple-footer {
    background: #000;
    padding: 30px 0;
    color: #fff;
}

.simple-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.simple-footer .footer-content {
    text-align: center;
}

.simple-footer .copyright {
    font-size: 14px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.simple-footer .footer-info {
    font-size: 13px;
    margin-bottom: 10px;
}

.simple-footer .footer-info a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.simple-footer .footer-info a:hover {
    color: #fff;
}

.simple-footer .footer-links {
    font-size: 13px;
}

.simple-footer .footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.simple-footer .footer-links a:hover {
    color: #fff;
}
