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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    padding: 20px;
}

/* Logo样式 */
.logo-container {
    display: flex;
    justify-content: center;
    margin: 10px 0 15px;
}

.logo {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* 导航按钮样式 */
.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-button {
    padding: 20px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* 资源数量徽章样式 */
.resource-count-badge {
    float: right;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.nav-button:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-button:active {
    transform: translateY(0);
}

/* 按钮颜色样式 */
/* 使用CSS变量和HSL颜色模型为每个按钮生成独特颜色 */
.nav-buttons {
    --total-buttons: 9;
}

/* 全网影视资源搜索按钮使用固定红色 */
.nav-button:nth-child(1) {
    background-color: #e74c3c;
}

.nav-button:nth-child(1):hover {
    background-color: #c0392b;
}

/* 从第二个按钮开始，使用HSL颜色模型生成动态颜色 */
.nav-button:nth-child(n+2) {
    /* 使用CSS变量和HSL颜色模型，通过改变色相值生成不同颜色 */
    background: linear-gradient(135deg, var(--button-color), var(--button-color-dark));
}

.nav-button:nth-child(n+2):hover {
    /* 悬停时使用更深的颜色 */
    background: linear-gradient(135deg, var(--button-color-dark), var(--button-color-darker));
}

/* 通过JavaScript动态设置每个按钮的颜色 */

/* 资源列表样式 */
.resource-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-item {
    background-color: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #ecf0f1;
}

.resource-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.resource-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #2c3e50;
    line-height: 1.15;
}

.resource-title-link {
    color: #2c3e50;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.resource-title-link:hover {
    color: #3498db;
    transform: translateX(3px);
}

.resource-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
    color: #95a5a6;
    gap: 8px;
    line-height: 1.2;
}

.resource-description {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 6px;
    line-height: 1.3;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #95a5a6;
}

.resource-category {
    background-color: #ecf0f1;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 11px;
}

.resource-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
}

/* 百度网盘按钮样式 */
.resource-link.baidu {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.resource-link.baidu:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

/* UC网盘按钮样式 */
.resource-link.uc {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.resource-link.uc:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
}

/* 夸克网盘按钮样式 */
.resource-link.quark {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.resource-link.quark:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    transform: translateY(-1px);
}

/* 迅雷云盘按钮样式 */
.resource-link.xunlei {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.resource-link.xunlei:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
    transform: translateY(-1px);
}



/* 分类页面特定样式 */
.container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.category-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.category-title-section {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 4.8px;
    background-color: #34495e;
    color: white;
    border: none;
    padding: 6.4px 9.6px;
    border-radius: 4.8px;
    font-size: 11.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: fit-content;
    white-space: nowrap;
}

.back-button:hover {
    background-color: #2c3e50;
    transform: translateX(-1.6px);
}

.back-button::before {
    content: '←';
    font-size: 12.8px;
    font-weight: bold;
}

#category-title {
    font-size: 24px;
    font-weight: 800;
    color: #2c3e50;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: center;
}

.resource-count {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 搜索样式 */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
}

/* 管理后台样式 */
.admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-title {
    font-size: 24px;
    color: #2c3e50;
}

.admin-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-nav-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.admin-nav-button:hover {
    background-color: #2980b9;
}

.admin-nav-button.active {
    background-color: #2ecc71;
}

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

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #3498db;
}

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

.form-submit {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-submit:hover {
    background-color: #27ae60;
}

/* 管理列表样式 */
.admin-list {
    margin-top: 20px;
}

.admin-list-item {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-list-actions {
    display: flex;
    gap: 10px;
}

.edit-button, .delete-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.edit-button {
    background-color: #3498db;
    color: white;
}

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

.delete-button {
    background-color: #e74c3c;
    color: white;
}

.delete-button:hover {
    background-color: #c0392b;
}

/* 管理后台固定为PC端布局，不使用响应式设计 */

/* 详情页图片样式 */
.detail-image {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 详情页图片容器样式 */
.detail-images {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

/* 确保图片不被任何样式隐藏 */
img {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* PC端二维码引导样式 */
.pc-qr-code-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.pc-qr-code-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pc-qr-code-content h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.pc-qr-code-content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #666;
}

.browser-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.browser-item {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
}

.qr-code-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.qr-code-logo {
    max-width: 225px;
    height: auto;
}

.qr-code {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.qr-code img {
    max-width: 200px;
    height: auto;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
}

.qr-code-hint {
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
}

.close-qr-code {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-qr-code:hover {
    background-color: #2980b9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端隐藏二维码引导 */
    .pc-qr-code-container {
        display: none;
    }
}

/* PC端隐藏主内容，只显示二维码引导（非管理员） */
@media (min-width: 769px) {
    /* 非管理员在PC端访问时隐藏主内容 */
    body:not(.admin) .container {
        display: none;
    }
    
    /* 管理员在PC端访问时显示主内容 */
    body.admin .container {
        display: block;
    }
}

/* 漂浮AI提问图标样式 */
.ai-question-icon {
    position: fixed;
    bottom: 30px;
    right: 130px;
    z-index: 9999;
    cursor: grab;
    animation: float 3s ease-in-out infinite;
    user-select: none;
}

.ai-question-icon:active {
    cursor: grabbing;
}

.ai-question-icon.dragging {
    animation: none;
    opacity: 0.8;
    z-index: 99999;
}

.ai-icon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    padding: 0;
    position: relative;
    margin-bottom: 10px;
}

.ai-icon-content::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    background-image: url('/tou.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

.ai-icon-content:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.ai-icon-content svg {
    display: none;
}

.ai-icon-content span {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    display: block;
    color: #333;
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100px;
    text-shadow: 
        -0.5px -0.5px 0 white,
        0.5px -0.5px 0 white,
        -0.5px 0.5px 0 white,
        0.5px 0.5px 0 white;
}

.ai-icon-content span::before {
    content: '追剧小娱探';
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
}

/* 漂浮动画 */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 调整AI提问图标大小 */
    .ai-question-icon {
        bottom: 20px;
        right: 120px;
    }
    
    .ai-icon-content {
        width: 70px;
        height: 70px;
        padding: 0;
        margin-bottom: 8px;
    }
    
    .ai-icon-content::before {
        width: 70px;
        height: 70px;
    }
    
    .ai-icon-content span {
        font-size: 14px;
        bottom: -25px;
        width: 90px;
    }
    
    .ai-icon-content span::before {
        font-size: 14px;
    }
}

/* AI图标关闭按钮样式 */
.ai-close-button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: all 0.3s ease;
}

.ai-close-button:hover {
    background-color: #c0392b;
    transform: scale(1.25);
}

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