/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-top: 70px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #3498db;
}

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

/* 页面头部 */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.image-info {
    padding: 1rem;
}

.image-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.image-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.tag:hover {
    background-color: #2980b9;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background-color: white;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 筛选区域 */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.tag-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.sort-filter {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-filter label {
    font-weight: 600;
    color: #2c3e50;
}

.sort-filter select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    background-color: white;
}

/* 图片详情 */
.image-detail {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-container {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
}

.detail-info {
    padding: 2rem;
}

.detail-info h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-item .label {
    font-weight: bold;
    color: #7f8c8d;
}

.detail-actions {
    margin-bottom: 1.5rem;
}

.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #ecf0f1;
    color: #2c3e50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-like:hover {
    background-color: #e74c3c;
    color: white;
}

.btn-like.liked {
    background-color: #e74c3c;
    color: white;
}

.like-icon {
    font-size: 1.2rem;
}

.detail-description,
.detail-tags {
    margin-bottom: 1.5rem;
}

.detail-description h3,
.detail-tags h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.detail-description p {
    color: #555;
    line-height: 1.8;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-back {
    margin-top: 2rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 提示消息 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* 移动端导航 */
    .navbar .container {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
        background-color: #34495e;
        border-radius: 4px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #2c3e50;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }

    /* 图片网格 */
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .image-card img {
        height: 200px;
    }

    .image-info {
        padding: 0.75rem;
    }

    .image-info h3 {
        font-size: 0.95rem;
    }

    .image-meta {
        font-size: 0.85rem;
    }

    /* 页面头部 */
    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* 图片详情 */
    .detail-info {
        padding: 1rem;
    }

    .detail-info h1 {
        font-size: 1.5rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .full-image {
        max-height: 400px;
    }

    /* 筛选区域 */
    .filter-section {
        padding: 1rem;
    }

    .tag-filter {
        gap: 0.75rem;
    }

    .sort-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-filter select {
        width: 100%;
    }

    /* 按钮 */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* 公告容器 */
    .announcement-container {
        padding: 1rem;
    }

    .announcement-content h1 {
        font-size: 1.5rem;
    }

    .announcement-content h2 {
        font-size: 1.3rem;
    }

    .announcement-content h3 {
        font-size: 1.1rem;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .navbar .container {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
    }

    /* 图片网格 */
    .image-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 页面头部 */
    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* 图片详情 */
    .detail-info {
        padding: 1rem;
    }

    .detail-info h1 {
        font-size: 1.5rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .full-image {
        max-height: 400px;
    }

    /* 筛选区域 */
    .filter-section {
        padding: 1rem;
    }

    .tag-filter {
        gap: 0.75rem;
    }

    .sort-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-filter select {
        width: 100%;
    }

    /* 按钮 */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* 公告容器 */
    .announcement-container {
        padding: 1rem;
    }

    .announcement-content h1 {
        font-size: 1.5rem;
    }

    .announcement-content h2 {
        font-size: 1.3rem;
    }

    .announcement-content h3 {
        font-size: 1.1rem;
    }

    /* 表单元素 */
    input[type="text"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px;
    }

    /* 管理后台导航 */
    .admin-navbar .nav-menu {
        font-size: 0.9rem;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 表格 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.9rem;
    }

    /* 图片卡片 */
    .image-card {
        margin-bottom: 1rem;
    }

    .image-card img {
        border-radius: 8px 8px 0 0;
    }

    /* 加载指示器 */
    .loading-indicator {
        padding: 2rem 1rem;
    }

    /* 无限滚动结束提示 */
    .end-message {
        padding: 2rem 1rem;
    }
}

/* 小屏幕优化 (手机竖屏) */
@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .announcement-content {
        font-size: 0.95rem;
    }

    .detail-info h1 {
        font-size: 1.3rem;
    }

    .tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .image-card {
        transition: none;
    }

    .image-card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.98);
    }

    .nav-menu a:active {
        background: rgba(255,255,255,0.1);
    }

    /* 增大可点击区域 */
    .tag {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .like-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
