:root {
    --neon-blue: #0ff0fc;
    --neon-purple: #bc13fe;
    --primary-blue: #1890ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #e0f7ff 0%, #f0e6ff 100%);
    position: relative;
    overflow-x: hidden;
}

/* 绚丽旋转背景效果 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(15, 240, 252, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(188, 19, 254, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 40% 80%, rgba(255, 44, 237, 0.15) 0%, transparent 30%);
    animation: rotate 30s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 粒子效果 */
.particle {
    position: fixed;
    border-radius: 50%;
    opacity: 0.3;
    animation: floatUp 15s infinite linear;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 36px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 20px rgba(15, 240, 252, 0.3);
}

/* ========== 双卡片标签栏 ========== */
.nav-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.nav-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 240, 252, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(15, 240, 252, 0.2);
}

/* 左侧卡片 - 蓝色系 */
.nav-card-db .card-header {
    border-bottom: 2px solid rgba(15, 240, 252, 0.15);
    background: linear-gradient(135deg, rgba(15, 240, 252, 0.06) 0%, rgba(15, 240, 252, 0.02) 100%);
}

.nav-card-db .card-icon svg {
    color: var(--neon-blue);
}

.nav-card-db .card-title {
    color: #0d7377;
}

.nav-card-db .action-btn.add {
    background: linear-gradient(135deg, #0ff0fc 0%, #1890ff 100%);
}

/* 右侧卡片 - 紫色系 */
.nav-card-web .card-header {
    border-bottom: 2px solid rgba(188, 19, 254, 0.15);
    background: linear-gradient(135deg, rgba(188, 19, 254, 0.06) 0%, rgba(188, 19, 254, 0.02) 100%);
}

.nav-card-web .card-icon svg {
    color: var(--neon-purple);
}

.nav-card-web .card-title {
    color: #7b2d8e;
}

.nav-card-web .action-btn.add {
    background: linear-gradient(135deg, #bc13fe 0%, #ff2ced 100%);
}

/* 卡片头部 */
.card-header {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.card-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-card-db .card-icon {
    background: rgba(15, 240, 252, 0.12);
}

.nav-card-web .card-icon {
    background: rgba(188, 19, 254, 0.12);
}

.card-icon svg {
    width: 15px;
    height: 15px;
}

.card-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.action-btn.manage {
    background: rgba(0, 0, 0, 0.05);
    color: #888;
}

.action-btn.manage:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #555;
}

.action-btn.add {
    color: #fff;
}

.action-btn.add:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(15, 240, 252, 0.3);
}

/* 管理模式 */
.manage-mode .action-btn.manage {
    background: #ff4d4f;
    color: #fff;
}

.manage-mode .action-btn.manage:hover {
    background: #ff7875;
}

/* 标签区域 */
.card-tags {
    padding: 10px 14px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
    max-width: calc(33.333% - 6px);
    overflow: hidden;
}



/* 数据表标签 - 蓝色系 */
.nav-card-db .tag {
    background: linear-gradient(135deg, rgba(15, 240, 252, 0.08) 0%, rgba(24, 144, 255, 0.08) 100%);
    border: 1px solid rgba(15, 240, 252, 0.2);
    color: #0d7377;
}

.nav-card-db .tag:hover {
    background: linear-gradient(135deg, rgba(15, 240, 252, 0.2) 0%, rgba(24, 144, 255, 0.2) 100%);
    border-color: var(--neon-blue);
    color: #0a5c5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 240, 252, 0.2);
}

/* 网页标签 - 紫色系 */
.nav-card-web .tag {
    background: linear-gradient(135deg, rgba(188, 19, 254, 0.08) 0%, rgba(255, 44, 237, 0.08) 100%);
    border: 1px solid rgba(188, 19, 254, 0.2);
    color: #7b2d8e;
}

.nav-card-web .tag:hover {
    background: linear-gradient(135deg, rgba(188, 19, 254, 0.2) 0%, rgba(255, 44, 237, 0.2) 100%);
    border-color: var(--neon-purple);
    color: #5e1a70;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(188, 19, 254, 0.2);
}

.tag-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.tag-del {
    display: none;
    color: #ff4d4f;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 2px;
    line-height: 1;
}

.manage-mode .tag-del {
    display: inline;
}

/* 拖拽手柄 */
.tag-drag-handle {
    display: none;
    cursor: grab;
    font-size: 14px;
    opacity: 0.4;
    margin-right: 2px;
    user-select: none;
    line-height: 1;
}

.manage-mode .tag-drag-handle {
    display: inline;
}

.manage-mode .tag-drag-handle:active {
    cursor: grabbing;
}

/* 拖拽中的标签 — 悬浮态 */
.tag-dragging {
    opacity: 0.92;
    transform: scale(1.08) rotate(1deg);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

/* 拖拽占位符 */
.tag-drag-placeholder {
    display: inline-flex;
    align-items: center;
    border-radius: 16px;
    border: 2px dashed rgba(15, 240, 252, 0.5);
    background: rgba(15, 240, 252, 0.05);
    margin: 0;
    vertical-align: middle;
    transition: width 0.15s;
}

.nav-card-web .tag-drag-placeholder {
    border-color: rgba(188, 19, 254, 0.5);
    background: rgba(188, 19, 254, 0.05);
}

/* 管理模式下标签样式 */
.manage-mode .tag {
    cursor: grab;
}

.manage-mode .tag:active {
    cursor: grabbing;
}

/* 标签悬浮气泡 */
.tag-tooltip {
    position: fixed;
    z-index: 10000;
    padding: 6px 12px;
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: 12px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    max-width: 260px;
    word-break: break-all;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.15s;
}
.tag-tooltip.show {
    opacity: 1;
}

.empty-hint {
    color: #bbb;
    font-size: 13px;
    padding: 4px 0;
}

/* ========== 工具卡片网格 ========== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* 工具卡片 */
.tool-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(15, 240, 252, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 240px;
}

.tool-card.active {
    cursor: pointer;
}

.tool-card.active:hover {
    transform: translateY(-8px);
    border-color: var(--neon-blue);
    box-shadow: 0 8px 30px rgba(15, 240, 252, 0.3);
}

.tool-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 图片区域占卡片的三分之二 */
.tool-img {
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f0ff 100%);
    overflow: hidden;
}

.tool-icon {
    font-size: 60px;
    filter: grayscale(0);
}

.tool-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-card.disabled .tool-icon {
    filter: grayscale(1);
    opacity: 0.5;
}

/* 信息区域占卡片的三分之一 */
.tool-info {
    flex: 1;
    padding: 5px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
}

.tool-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.tool-card.active .tool-title {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tool-desc {
    font-size: 12px;
    color: #888;
}

.tool-card.disabled .tool-desc {
    color: #aaa;
}

.footer {
    text-align: center;
    padding: 15px 20px;
    color: #fff;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    width: 360px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin: 0 0 18px;
    color: #333;
    font-size: 17px;
}

.modal-content input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s;
}

.modal-content input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(15, 240, 252, 0.1);
}

.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.btn-cancel, .btn-confirm {
    padding: 8px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    color: #fff;
}

.btn-confirm:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(15, 240, 252, 0.3);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 40px 15px 20px;
    }
    
    h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .nav-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 12px 20px;
    }
    
    h1 {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .nav-cards {
        gap: 12px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tool-card {
        height: auto;
        aspect-ratio: 1;
    }
}
