/* 网址导航和书签管理系统样式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部样式 */
.header {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* 导航栏样式 */
.nav-tabs {
    background: #fff;
    padding: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.nav-tabs ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-tabs li {
    flex: 1;
}

.nav-tabs a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs a:hover,
.nav-tabs a.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

/* 内容区域样式 */
.content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 400px;
}

/* 分类样式 */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.category:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.category h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* 书签网格布局 */
.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bookmark-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-height: 80px;
}

.bookmark-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.bookmark-content {
    flex: 1;
}

.bookmark-title {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.3;
}

.bookmark-item:hover .bookmark-title {
    color: #3498db;
}

.bookmark-url {
    color: #3498db;
    font-size: 11px;
    margin-bottom: 6px;
    word-break: break-all;
    opacity: 0.8;
}

.bookmark-description {
    color: #7f8c8d;
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 30px;
}

.bookmark-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: 5px;
}

.bookmark-actions .btn {
    flex: 1;
    min-width: 50px;
    text-align: center;
    font-size: 10px;
    padding: 4px 6px;
}

/* 收藏书签特殊样式 */
.bookmark-item.favorite {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fff 0%, #fef9e7 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.bookmark-item.favorite:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
    border-color: #e67e22;
}

.bookmark-item.favorite .bookmark-link {
    color: #e67e22;
    font-weight: 600;
}

.bookmark-item.favorite .bookmark-url {
    color: #d68910;
    font-weight: 500;
}

/* 收藏页面书签卡片无按钮时的样式调整 */
#favoritesContainer .bookmark-item {
    padding-bottom: 15px;
    align-items: center;
    min-height: 80px;
}

#favoritesContainer .bookmark-description {
    margin-bottom: 0;
}

/* 排序顺序样式 */
.sort-order {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: normal;
    margin-left: 10px;
}

.bookmark-sort {
    font-size: 11px;
    color: #95a5a6;
    font-weight: normal;
    margin-left: 8px;
}

/* 分类标题中的排序顺序 */
.category h3 .sort-order {
    background: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* 书签标题中的排序顺序 */
.bookmark-link .bookmark-sort {
    background: #f8f9fa;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .bookmark-grid {
        grid-template-columns: 1fr;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bookmark-actions {
        flex-direction: column;
        margin-top: 15px;
    }
    
    .bookmark-actions .btn {
        flex: none;
    }
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 统计信息样式 */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    background: #f8f9fa;
}

.search-box input:focus {
    background: white;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs ul {
        flex-direction: column;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bookmark-actions {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* 隐藏/显示内容 */
.hidden {
    display: none;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #bdc3c7;
}

/* 成功/错误消息样式 */
.alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #3498db;
    color: #0c5460;
}
