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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --hover-bg: #000000;
    --hover-text: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* 页面头部 */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 30px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 15px;
    transition: var(--transition);
    background-color: var(--bg-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* 添加导航按钮 */
.btn-add {
    padding: 12px 24px;
    background-color: var(--text-primary);
    color: var(--hover-text);
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-add:hover {
    background-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-add i {
    font-size: 14px;
}

/* 主要内容区域 */
.main {
    min-height: calc(100vh - 150px);
    padding: 50px 0 80px;
}

.nav-section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    font-size: 22px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* 导航卡片 */
.nav-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--hover-bg);
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 0;
}

.nav-card:hover::before {
    transform: translateY(0);
}

.nav-card:hover {
    border-color: var(--text-primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.nav-card:hover .card-icon,
.nav-card:hover .card-title,
.nav-card:hover .card-desc {
    color: var(--hover-text);
    position: relative;
    z-index: 1;
}

.card-icon {
    font-size: 32px;
    margin-bottom: 15px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}



/* 隐藏效果 */
.nav-card.hidden {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo {
        font-size: 24px;
    }

    .search-box {
        flex: 1;
        min-width: 200px;
    }

    .btn-add {
        padding: 10px 20px;
        font-size: 14px;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .nav-card {
        padding: 20px;
    }

    .card-icon {
        font-size: 28px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-desc {
        font-size: 13px;
    }

    .section-title {
        font-size: 20px;
    }

    .main {
        padding: 30px 0;
    }

    .nav-section {
        margin-bottom: 40px;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 20px 0;
    }

    .logo {
        font-size: 22px;
        width: 100%;
        text-align: center;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
    }

    .btn-add {
        width: 100%;
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-section {
    animation: fadeIn 0.6s ease-out;
}

.nav-card {
    animation: fadeIn 0.6s ease-out;
}

/* 卡片操作按钮 */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    gap: 8px;
    z-index: 2;
}

.nav-card:hover .card-actions {
    display: flex;
}

.card-btn {
    width: 32px;
    height: 32px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.card-btn:hover {
    background-color: var(--hover-text);
    transform: scale(1.1);
}

/* 拖拽相关样式 */
.nav-card.sortable-ghost {
    opacity: 0.4;
    background-color: var(--bg-secondary);
}

.nav-card.sortable-drag {
    cursor: move;
}

.nav-grid.sortable-dragging .nav-card {
    cursor: move;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
}

.btn-close {
    width: 36px;
    height: 36px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* 自定义滚动条样式（针对模态框） */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    background-color: var(--bg-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-group small a {
    color: var(--text-primary);
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--hover-text);
}

.btn-primary:hover {
    background-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* 删除确认对话框 */
.confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.confirm-dialog.active {
    display: flex;
}

.confirm-content {
    background-color: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
    text-align: center;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background-color: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon i {
    font-size: 32px;
    color: var(--text-primary);
}

.confirm-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--text-primary);
    color: var(--hover-text);
}

.btn-danger:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}