/* 基础样式 */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

/* 用户区域样式 */
.user-area {
    display: none; /* 隐藏原来的用户区域 */
}

/* 悬浮用户按钮样式 */
.user-floating-buttons {
    position: fixed;
    right: 20px;
    top: 80%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-btn {
    width: 50px;
    height: 50px;
    background-color: #409eff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.user-btn:hover {
    transform: scale(1.1);
    background-color: #3a8ee6;
}

.user-btn.login-btn {
    background-color: #28a745;
}

.user-btn.login-btn:hover {
    background-color: #218838;
}

.user-btn.register-btn {
    background-color: #ff6b35;
}

.user-btn.register-btn:hover {
    background-color: #e55a2b;
}

.user-btn.avatar-btn {
    background-color: #9c27b0;
    font-weight: bold;
    font-size: 18px;
}

.user-btn.avatar-btn:hover {
    background-color: #8e24aa;
}

.user-btn.logout-btn {
    background-color: #dc3545;
}

.user-btn.logout-btn:hover {
    background-color: #c82333;
}

/* 登录/注册弹窗样式 */
.user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.user-modal.active {
    display: flex;
}

.user-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 80%;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s;
}

.user-modal.active .user-modal-content {
    transform: scale(1);
    opacity: 1;
}

.user-modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.user-modal .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.user-modal label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: 500;
}

.user-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.user-modal .form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.user-modal .btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.user-modal .btn-primary {
    background-color: #409eff;
    color: white;
}

.user-modal .btn-primary:hover {
    background-color: #3a8ee6;
}

.user-modal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.user-modal .btn-secondary:hover {
    background-color: #5a6268;
}

.user-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    background: none;
    border: none;
}

.user-close:hover {
    color: #333;
}

.login-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
}

.login-hint {
    color: #6c757d;
    font-size: 12px;
    margin-left: 10px;
}

.login-prompt .nav-card {
    border: 2px dashed #ddd;
    background: #f8f9fa;
    cursor: default;
}

.login-prompt .nav-card:hover {
    transform: none;
    box-shadow: none;
}

.login-prompt .fa-lock {
    font-size: 24px;
    color: #6c757d;
    margin-right: 10px;
}

a {
  color: inherit;
  text-decoration: none;
  word-wrap: break-word;
}

.foot {
    ext-align: center;
    display: flex;
    margin-top: 20px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    color: #696969;
    font-size: 14px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.category-section{
    background-color: rgb(255, 255, 255);
    padding: 1px 12px 10px 12px;
    margin-bottom: 20px;
    border-radius: 8px;
}

/* 响应式布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
    text-align: center;
}

.card-box {
    padding: 10px;
    box-sizing: border-box;
}

@media (max-width: 358px) {
    .card-box { width: 100%; }
}

@media (min-width: 358px) {
    .card-box { width: 50%; }
}

@media (min-width: 486px) {
    .card-box { width: 33.333%; }
}

@media (min-width: 768px) {
    .card-box { width: 25%; }
}

.category-title{
    margin: auto;
    padding: 6px;
}
.nav-title {
    display: block;
    background: white;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    width: 120px;
    margin: 10px 0 12px 0;
    display: flex;
    flex-direction: column;
    text-align: center;
}
/* 卡片样式 */
.nav-card {
    display: block;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
    width: 380px;
}

.nav-card:hover {
    transform: translateY(-3px);
}

.card-content {
    padding: 15px;
    display: flex;
    align-items: center;
    flex-direction: column;
    height: 100px;
}

.favicon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* 搜索框 */
.search-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

#searchInput {
    width: 100%;
    padding: 10px 2px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
}

.search-container input {
    text-indent: 10px;
}

/* 后台样式 */
.admin-header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.admin-section {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
    margin: 10px;
}

.form-section{
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: flex-start;
}
.category-item, .link-item{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
}

.category-item button, .link-item button {
    margin: 0 20px;
}
/* 图标上传样式 */
.icon-upload {
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-upload {
    position: relative;
    padding: 6px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.link-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 10px;
}
.post-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}


        /* 客服样式 */
        .kefu-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 50px;
            height: 50px;
            background-color: #409eff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            cursor: pointer;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            z-index: 999;
            transition: all 0.3s;
        }
        
        .kefu-btn:hover {
            transform: scale(1.1);
            background-color: #3a8ee6;
        }
        
        .kefu-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
        
        .kefu-modal-content {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            text-align: center;
            max-width: 300px;
            transform: scale(0.9);
            opacity: 0;
            transition: all 0.3s;
        }
        
        .kefu-modal.active .kefu-modal-content {
            transform: scale(1);
            opacity: 1;
        }
        
        .kefu-modal img {
            max-width: 100%;
            margin-bottom: 15px;
        }
        
        .kefu-close {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 20px;
            cursor: pointer;
            color: #999;
            transition: color 0.3s;
        }
        
        .kefu-close:hover {
            color: #333;
        }

/* 权限蒙版样式 */
.permission-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.permission-mask:hover {
    opacity: 1;
}

.permission-icon {
    font-size: 32px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.permission-mask.locked .permission-icon {
    color: #ff6b6b;
}

.permission-mask.denied .permission-icon {
    color: #ffa726;
}

/* 链接卡片容器样式 */
.link-item {
    position: relative;
}

/* 分类权限蒙版 */
.category-section.no-permission {
    position: relative;
}

.category-section.no-permission::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 5;
}

.category-section.no-permission .permission-mask {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    background: none;
    z-index: 6;
}

.category-section.no-permission .permission-icon {
    font-size: 48px;
}

/* 权限提示弹窗 */
.permission-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.permission-modal.active {
    display: flex;
}

.permission-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s;
}

.permission-modal.active .permission-modal-content {
    transform: scale(1);
    opacity: 1;
}

.permission-modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.permission-modal p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.permission-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    margin: 0 5px;
}

.permission-modal .btn-primary {
    background-color: #409eff;
    color: white;
}

.permission-modal .btn-primary:hover {
    background-color: #3a8ee6;
}

.permission-modal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.permission-modal .btn-secondary:hover {
    background-color: #5a6268;
}