* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4ade80;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray: #6c757d;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    min-height: 100vh;
    padding-bottom: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    width: 300px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.75rem 1.5rem;
    outline: none;
    font-size: 1rem;
}

.search-bar button {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #3aa8d0;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #22c55e;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.main-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark);
}

.main-title h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.main-title p {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.card-icon {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.card-icon i {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-content {
    padding: 1.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
    font-weight: 600;
}

.card p {
    color: var(--gray);
    margin-bottom: 1.8rem;
    flex: 1;
    line-height: 1.6;
}

.card-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: auto;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}

.card-button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(67, 97, 238, 0.4);
}

.management-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
    display: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--dark);
}

.sub-section-title {
    margin: 1.8rem 0 1rem 0;
    font-size: 1.2rem;
    color: var(--dark);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.section-title i {
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.color-option {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

.form-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-buttons .btn {
    flex: 1;
}

.tags-section {
    margin-top: 2rem;
}

.custom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.tag-item {
    background: #e9ecef;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    width: 100%;
}

.tag-item:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.tag-item.system-tag {
    background: #e7f5ff;
    border-left: 4px solid var(--primary);
}

.tag-item.custom-tag {
    background: #f8f9fa;
    border-left: 4px solid var(--success);
}

.tag-item .tag-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tag-item .tag-name {
    font-weight: 600;
    color: var(--dark);
}

.tag-item .tag-link {
    font-size: 0.85rem;
    color: var(--gray);
}

.tag-item .tag-actions {
    display: flex;
    gap: 0.5rem;
}

.tag-item .tag-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.tag-item .tag-actions .edit-btn {
    color: var(--primary);
}

.tag-item .tag-actions .edit-btn:hover {
    background: var(--primary);
    color: white;
}

.tag-item .tag-actions .delete-btn {
    color: var(--danger);
}

.tag-item .tag-actions .delete-btn:hover {
    background: var(--danger);
    color: white;
}

.tag-item.system-tag .tag-actions .delete-btn {
    color: var(--warning);
}

.tag-item.system-tag .tag-actions .delete-btn:hover {
    background: var(--warning);
    color: white;
}

.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--dark);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.no-tags-message {
    text-align: center;
    color: var(--gray);
    font-style: italic;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
}

/* 预设颜色类 */
.gradient-1 { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }
.gradient-2 { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
.gradient-3 { background: linear-gradient(135deg, #ffecd2, #fcb69f); }
.gradient-4 { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.gradient-5 { background: linear-gradient(135deg, #d4fc79, #96e6a1); }
.gradient-6 { background: linear-gradient(135deg, #a6c0fe, #f68084); }
.gradient-7 { background: linear-gradient(135deg, #fbc2eb, #a6c1ee); }
.gradient-8 { background: linear-gradient(135deg, #66a6ff, #89f7fe); }
.gradient-9 { background: linear-gradient(135deg, #fdbb2d, #22c1c3); }
.gradient-10 { background: linear-gradient(135deg, #ee9ca7, #ffdde1); }

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-bar {
        width: 100%;
        max-width: 400px;
    }
    
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .color-picker {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tag-item {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 1.7rem;
    }
    
    .main-title h2 {
        font-size: 1.8rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .color-picker {
        grid-template-columns: repeat(2, 1fr);
    }
}