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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #000;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 半透明导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 1rem 0;
}

/* 分类标签栏 */
.category-bar {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    overflow-x: auto;
    white-space: nowrap;
}

.category-tags {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    height: 100%;
}

.category-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tag:hover,
.category-tag.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

@media (max-width: 768px) {
    .category-tags {
        padding: 0 1rem;
    }
    
    .category-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
}

.nav-logo span {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-left: 0.5rem;
    letter-spacing: 1px;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 200px;
    transition: background 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .nav-search {
        margin-left: 1rem;
    }
    
    .search-input {
        width: 120px;
        font-size: 0.8rem;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.category-filter {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.nav-link {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-right: 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.admin-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn:hover {
    background: #fff;
    color: #000;
}

/* 主要内容区域 */
.main-content {
    margin-top: 150px !important;
    min-height: calc(100vh - 150px) !important;
    padding-top: 20px;
}

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

/* 瀑布流布局 */
.waterfall {
    column-count: 4;
    column-gap: 1.5rem;
}

@media (max-width: 1024px) {
    .waterfall {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .waterfall {
        column-count: 2;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        gap: 0.3rem;
        margin-left: 0.5rem;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .main-content {
        margin-top: 140px;
        min-height: calc(100vh - 140px);
    }
}

@media (max-width: 480px) {
    .waterfall {
        column-count: 1;
    }
    
    .category-filter {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .nav-menu {
        gap: 0.2rem;
        margin-left: 0.3rem;
    }
    
    .nav-link {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* 杯子卡片 */
.cup-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    break-inside: avoid;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cup-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.cup-image {
    width: 100%;
    height: auto;
    display: block;
}

.cup-content {
    padding: 1rem;
}

.cup-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cup-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cup-category {
    font-size: 0.8rem;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.cup-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cup-likes {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.cup-likes:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.cup-likes.liked {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.2);
}

.cup-likes i {
    font-size: 0.9rem;
}

.cup-likes span {
    font-size: 0.8rem;
    font-weight: 500;
}

.share-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.share-btn i {
    font-size: 0.9rem;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    opacity: 0.7;
}

.loading i {
    margin-right: 0.5rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 98%;
    width: 98%;
    margin: 0.5% auto;
    max-height: 98vh;
    height: 98vh;
    overflow-y: auto;
    padding: 1rem;
}



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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
}

.form-group select {
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
}

.form-group select option {
    background: #1a1a1a;
    color: #fff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #fff;
    color: #000;
}

/* 管理员后台样式 */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.admin-list {
    display: grid;
    gap: 1rem;
}

.admin-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-item-info h4 {
    margin-bottom: 0.5rem;
}

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

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

.btn-danger {
    background: #ff4757;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #ff3742;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .modal-content.large {
        margin: 5% auto;
        padding: 1rem;
    }
    
    .admin-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .admin-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 杯子详情样式 */
.cup-detail-container {
    display: flex;
    gap: 1rem;
    max-height: 95vh;
    height: 95vh;
    overflow-y: auto;
}

.cup-detail-images {
    flex: 1;
    min-width: 0;
}

.cup-detail-info {
    flex: 0 0 350px;
    padding: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
    margin-top: 0;
}

.detail-category {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

.image-carousel {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    transition: transform 0.3s ease;
    height: 90vh;
    max-height: 90vh;
}

.carousel-image {
    min-width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    max-width: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: background 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.image-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

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

.indicator.active {
    background: white;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.detail-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.detail-category {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.detail-description {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-description-container {
    max-height: none;
    overflow-y: visible;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.detail-stats {
    display: flex;
    gap: 1.5rem;
    color: #888;
    font-size: 0.9rem;
}

.detail-likes, .detail-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.detail-likes i {
    color: #ff4757;
}

/* 响应式详情样式 */
@media (max-width: 768px) {
    .modal-content.large {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 0.5rem;
    }
    
    .cup-detail-container {
        flex-direction: column;
        gap: 0.5rem;
        max-height: 100vh;
        height: 100vh;
        padding: 0.5rem;
    }
    
    .cup-detail-images {
        width: 100%;
    }
    
    .carousel-container {
        height: 65vh;
        max-height: 65vh;
    }
    
    .cup-detail-info {
        flex: none;
        width: 100%;
        padding: 0.5rem;
        max-height: 35vh;
    }
    
    .carousel-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}
@media (max-width: 768px) {
    .cup-detail-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cup-detail-info {
        flex: none;
        order: -1;
    }
    
    .carousel-container {
        height: 50vh;
    }
    
    .carousel-btn {
        padding: 0.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 40vh;
    }
    
    .cup-detail-info {
        padding: 0.5rem;
    }
}

/* 吸底页脚 */
.footer {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0.7;
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
    transform: translateY(-2px);
}

.back-to-top.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 70px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* 调整主要内容区域，避免被页脚遮挡 */
.main-content {
    margin-top: 150px !important;
    margin-bottom: 60px;
    min-height: calc(100vh - 210px);
}

@media (max-width: 768px) {
    .footer {
        padding: 0.8rem 0;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
    
    .main-content {
        margin-top: 140px !important;
        margin-bottom: 50px;
        min-height: calc(100vh - 190px);
    }
}