body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
    margin: 0;
}

.navbar {
    width: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px 20px;
    height: 80px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 2rem;
    color: #fff;
}

.input-group {
    width: 100%;
    border-radius: 10px;
    margin-top: 20px;
}

.input-group-text {
    background-color: transparent;
    border: none;
}

.tag-filter-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-filter {
    max-width: 100%;
    margin: 10px auto;
}

.tag-filter .badge {
    margin-right: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
    border: 1px solid transparent;
    font-size: 0.8rem;
}

.tag-filter .badge:hover, 
.tag-filter .badge.active {
    opacity: 1;
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1) !important;
}

.stats {
    max-width: 100%;
    margin: 10px auto;
    text-align: center;
}

.bookmarks-container {
    width: 100%;
    padding: 0 20px;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.bookmarks-grid.list-view {
    grid-template-columns: 1fr;  /* 单列布局 */
}

.bookmarks-grid.list-view .date-group-content {
    grid-template-columns: 1fr;  /* 单列布局 */
}

.bookmarks-grid.list-view .bookmark-card {
    flex-direction: row;
    align-items: center;
    height: auto;
    margin-bottom: 10px;
    min-width: 0;  /* 列表模式下取消最小宽度 */
}

.bookmarks-grid.list-view .bookmark-thumbnail-wrapper {
    width: 100px;
    height: 100px;
    margin-right: 15px;
}

.bookmarks-grid.list-view .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bookmarks-grid.list-view .card-title {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.bookmark-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: white;
    width: 100%;
    min-width: 300px;  /* 添加最小宽度 */
    height: 100%;
    cursor: pointer;  
}

.bookmark-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: #f5f5f5;  
}

.bookmark-card .badge,
.bookmark-card button {
    pointer-events: auto;
}

.bookmark-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.bookmark-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;  
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
}

.bookmark-card:hover .bookmark-thumbnail {
    transform: scale(1.05);
}

.card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 12px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-tag, .badge-keyword {
    margin-right: 4px;
    margin-bottom: 4px;
    opacity: 0.9;
    font-size: 0.7rem;
}

.badge-tag {
    background-color: #e9ecef;
    color: #495057;
    transition: all 0.3s;
}

.badge-tag.active {
    background-color: #007bff;
    color: white;
}

.badge-keyword {
    background-color: #17a2b8;
    color: white;
}

.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
}

.delete-bookmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    color: red;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.bookmark-thumbnail-wrapper:hover .delete-bookmark {
    opacity: 1;
}

.delete-bookmark:hover {
    background-color: rgba(255, 0, 0, 0.2);
}

.date-group {
    width: 100%;
    margin-bottom: 20px;
}

.date-group-header {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 5px 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    border-bottom: 1px solid #e9ecef;
}

.date-group-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
}

.view-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.view-toggle button {
    margin-left: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.3s;
}

.view-toggle button.active {
    background-color: #007bff;
    color: white;
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0 10px;
    }

    .navbar {
        padding: 10px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand i {
        font-size: 1.5rem;
    }

    .date-group-content {
        grid-template-columns: 1fr;
    }

    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 10px;
        padding: 5px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .date-group-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .date-group-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1201px) {
    .date-group-content {
        grid-template-columns: repeat(4, 1fr);
    }
}
