/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Todo应用容器 */
.todo-app {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    flex: 1;
}

/* 输入区域 */
.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

#urlInput, #titleInput, #tagInput {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#urlInput:focus, #titleInput:focus, #tagInput:focus {
    outline: none;
    border-color: #667eea;
}

#titleInput {
    flex: 0.6;
}

#tagInput {
    flex: 0.8;
}

.tag-input-section {
    position: relative;
    flex: 0.8;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.tag-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.tag-suggestion:hover {
    background-color: #f8f9fa;
}

.tag-suggestion:last-child {
    border-bottom: none;
}

.smart-suggestion {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-left: 3px solid #ffc107;
}

.smart-suggestion:hover {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.suggestion-icon {
    margin-right: 8px;
    font-size: 14px;
}

.add-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
}

.add-btn:active {
    transform: translateY(0);
}

/* 标签过滤区域 */
.tag-filter-section {
    margin-bottom: 20px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tag-filter {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    user-select: none;
}

.tag-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tag-filter:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.tag-filter .count {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.7;
}

/* 控制区域 */
.control-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
}

.clear-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    background: #c82333;
}

.pagination-section {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.page-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #5a6268;
}

.page-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

#pageSize {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

/* 网址墙 */
.link-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.link-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.link-item.favorite {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
}

.link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.link-url {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    line-height: 1.4;
}

.link-url:hover {
    text-decoration: underline;
}

.link-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.link-tag {
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
}

.link-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: auto;
}

.link-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.favorite-btn, .edit-btn, .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    flex: 1;
}

.favorite-btn {
    background: #ffc107;
    color: #212529;
}

.favorite-btn:hover {
    background: #e0a800;
}

.favorite-btn.active {
    background: #fd7e14;
    color: white;
}

.edit-btn {
    background: #17a2b8;
    color: white;
}

.edit-btn:hover {
    background: #138496;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

/* 底部 */
.footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .todo-app {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .stats-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .filter-section {
        flex-wrap: wrap;
    }
    
    .link-list {
        grid-template-columns: 1fr;
    }
    
    .link-actions {
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-item {
    animation: fadeIn 0.3s ease-out;
}

/* 网站图标样式 */
.favicon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
}