/* ==================== 基础样式重置 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #1a1a2e;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ==================== 页面容器 ==================== */
.page-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================== 顶部栏 ==================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.avatar-section:hover {
    background: #f8f9fa;
}

.avatar-section:hover .avatar-img,
.avatar-section:hover .avatar-placeholder {
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.avatar-placeholder svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.contact-info {
    font-size: 14px;
    color: #333333;
    font-weight: 500;
}

/* 功能按钮 */
.func-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.func-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
}

.header-right {
    position: relative;
}

.func-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 200;
}

.func-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.func-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333333;
    transition: all 0.2s ease;
}

.func-menu a:hover {
    background: #fff5f5;
    color: #e94560;
}

/* ==================== 区块通用样式 ==================== */
.section-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

/* ==================== 热门推荐 ==================== */
.hot-section {
    padding: 6px 0;
}

.hot-header {
    margin-bottom: 8px;
}

.hot-label {
    font-size: 13px;
    font-weight: 600;
    color: #e94560;
}

.hot-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
}

.hot-item {
    flex-shrink: 0;
    width: 72px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    scroll-snap-align: start;
}

.hot-item:hover {
    transform: translateY(-2px);
}

.hot-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4px;
    background: #f8f9fa;
}

.hot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hot-name {
    font-size: 11px;
    color: #333;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ==================== 轮播图区 ==================== */
.slide-section {
    padding: 8px 0;
}

.slide-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    width: 100%;
}

.slide-item {
    display: none;
    width: 100%;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

.slide-item.active {
    display: block;
    opacity: 1;
}

.slide-item a {
    display: block;
    width: 100%;
}

.slide-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.slide-placeholder {
    width: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    border-radius: 12px;
}

.slide-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slide-dot.active {
    background: #e94560;
    width: 24px;
    border-radius: 4px;
}

/* ==================== 公告区（精简版） ==================== */
.notice-section {
    padding: 0;
}

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.notice-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-item:hover {
    background: #fafafa;
    color: #e94560;
}

/* ==================== 分类导航 ==================== */
.category-section {
    padding: 6px 0;
}

.category-tabs {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.category-tab {
    flex: 1;
    padding: 8px 0;
    border-radius: 25px;
    border: 1px solid #e8e8e8;
    background: #f8f9fa;
    color: #666666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.category-tab:hover {
    background: #fff5f5;
    border-color: #e94560;
    color: #e94560;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.15);
    transform: translateY(-1px);
}

.category-tab.active {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

/* ==================== 卡片网格（CSS 变量控制） ==================== */
.card-section {
    padding: 6px 0 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: var(--cards-per-row-desktop, repeat(6, 1fr));
    gap: 16px;
    min-height: 200px;
    align-items: start;
    justify-content: center;
}

.card-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
}

.card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: #e8e8e8;
}

.card-item:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-image {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-item:hover .card-image img {
    transform: scale(1.08);
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.card-title {
    padding: 6px 8px;
    font-size: 12px;
    color: #333333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1.3;
    flex-shrink: 0;
}

.card-item:hover .card-title {
    background: #fff5f5;
    color: #e94560;
}

/* 卡片类型标签 */
.card-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    z-index: 5;
}

.card-type-badge.link {
    background: rgba(78, 204, 163, 0.9);
    color: #fff;
}

.card-type-badge.detail {
    background: rgba(233, 69, 96, 0.9);
    color: #fff;
}

.card-type-badge.custom {
    background: linear-gradient(135deg, #f9a825, #ff9800);
    color: #fff;
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: #999999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 页脚 ==================== */
.site-footer {
    text-align: center;
    padding: 16px;
    color: #999999;
    font-size: 13px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.site-footer .visitor-count {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #e94560, #ff6b6b, #f9a825, #4ecca3, #7c4dff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== 响应式设计 - PC端优化 ==================== */
@media (min-width: 1024px) {
    .page-wrapper {
        max-width: 1100px;
        padding: 0 24px;
    }

    .card-item:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    }

    .section-card:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
        transform: translateY(-2px);
    }
}

/* ==================== 响应式设计 - 平板端 ==================== */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: var(--cards-per-row-tablet, repeat(4, 1fr));
        gap: 14px;
    }

    .page-wrapper {
        padding: 0 12px;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .slide-item img,
    .slide-placeholder {
        min-height: 120px;
    }

    .category-tab {
        padding: 8px 20px;
        font-size: 14px;
    }

    .notice-item {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ==================== 响应式设计 - 手机端 ==================== */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: var(--cards-per-row-mobile, repeat(3, 1fr));
        gap: 12px;
    }

    .slide-item img,
    .slide-placeholder {
        min-height: 100px;
    }

    .category-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    .slide-placeholder {
        font-size: 18px;
    }

    .section-card {
        border-radius: 12px;
    }

    .top-bar {
        padding: 10px 12px;
    }

    .avatar-section {
        gap: 8px;
    }

    .contact-info {
        font-size: 13px;
    }

    .func-btn {
        width: 40px;
        height: 40px;
        font-size: 11px;
    }
}
}

/* ==================== 空状态 ==================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999999;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

/* ==================== Toast提示 ==================== */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
    z-index: 89;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.5);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ==================== 多功能悬浮按钮组 ==================== */
.float-btn-group {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    z-index: 90;
    pointer-events: none; /* 让按钮自己处理点击 */
}

.float-btn-group > * {
    pointer-events: auto;
}

.float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.25);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.float-btn svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.float-btn span {
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* 返回顶部按钮 */
.float-btn#backToTop {
    background: linear-gradient(135deg, #666666, #999999);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    display: none; /* 初始隐藏 */
}

.float-btn#backToTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    display: flex; /* 显示时才用flex */
}

.float-btn#backToTop:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 效果展示按钮 */
.float-btn[href*="showcase"] {
    background: linear-gradient(135deg, #7c4dff, #b388ff);
}

.float-btn[href*="showcase"]:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
}

/* 留言板按钮 */
.float-btn[href*="guestbook"] {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
}

.float-btn[href*="guestbook"]:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .float-btn-group {
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        gap: 8px;
    }

    .float-btn {
        width: 48px;
        height: 48px;
    }

    .float-btn svg {
        width: 18px;
        height: 18px;
    }

    .float-btn span {
        font-size: 9px;
    }
}

/* ==================== 留言板页面样式 ==================== */

/* 留言列表 */
.guestbook-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 单条留言 */
.guestbook-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.guestbook-item:hover {
    background: #fafafa;
    margin: 0 -20px;
    padding: 16px 20px;
}

.guestbook-item:last-child {
    border-bottom: none;
}

/* 留言头部 */
.guestbook-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.guestbook-item-nickname {
    font-weight: 600;
    color: #e94560;
    font-size: 14px;
}

.guestbook-item-time {
    font-size: 12px;
    color: #999;
}

/* 留言内容 */
.guestbook-item-content {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    word-break: break-all;
    white-space: pre-wrap;
}

/* 留言表单 */
.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    outline: none;
    border-color: #e94560;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

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

.guestbook-form button {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

.guestbook-form button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

.guestbook-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 分页按钮 */
.pagination-btn {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    color: #666;
    padding: 10px 32px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #fff5f5;
    border-color: #e94560;
    color: #e94560;
}

/* 空状态 */
.guestbook-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

/* 新消息高亮动画 */
@keyframes highlightNew {
    0% { background: rgba(233, 69, 96, 0.1); }
    100% { background: transparent; }
}

/* 响应式 - 手机端悬浮按钮 */
@media (max-width: 480px) {
    .guestbook-float-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    .guestbook-float-btn svg {
        width: 18px;
        height: 18px;
    }
    .guestbook-float-btn span {
        font-size: 9px;
    }
}

/* ==================== 留言板头部图片 ==================== */
.guestbook-header-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    display: block;
}

/* ==================== 管理员回复 ==================== */
.guestbook-reply {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff5f5, #fff0f0);
    border-radius: 10px;
    border-left: 3px solid #e94560;
}

.guestbook-reply-label {
    font-size: 12px;
    font-weight: 600;
    color: #e94560;
    margin-bottom: 6px;
}

.guestbook-reply-content {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    word-break: break-all;
    white-space: pre-wrap;
}
