/* 链接检查器 - 现代化设计 */

/* 基础变量 */
:root {
    /* 颜色系统 */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #f7fafc;
    
    /* 文本颜色 */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    
    /* 背景颜色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-soft: #edf2f7;
    --bg-glass: rgba(255, 255, 255, 0.85);
    
    /* 边框颜色 */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-focus: #667eea;
    
    /* 状态颜色 */
    --success-color: #48bb78;
    --success-light: #c6f6d5;
    --warning-color: #ed8936;
    --warning-light: #fef2e8;
    --error-color: #f56565;
    --error-light: #fed7d7;
    --info-color: #4299e1;
    --info-light: #bee3f8;
    
    /* 间距系统 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* 字体大小 */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* 全局样式重置 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 现代化头部 */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: var(--font-2xl);
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.logo-text {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), #805ad5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: var(--spacing-xl);
}

.action-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-lg);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.action-btn-icon:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* 主要内容区域 */
.checker-container {
    flex: 1;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 现代化控制面板 */

.controls-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.checker-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.checker-title {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), #805ad5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.safety-notice {
    background: var(--warning-light);
    color: #744210;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-sm);
    border-left: 4px solid var(--warning-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.controls-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.control-group label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
}

.control-group select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 80px;
    transition: border-color var(--transition-fast);
}

.control-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* 现代化按钮组 */
.btn-group {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
}

.btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 进度显示区域 */
.progress-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.progress-text {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percent {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-soft);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #805ad5);
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat-item {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
    transition: background var(--transition-fast);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-item:hover::before {
    background: var(--primary-color);
}

.stat-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-item.active::before {
    background: rgba(255, 255, 255, 0.3);
}

.stat-value {
    font-weight: 700;
    font-size: var(--font-xl);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--font-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.stat-item.active .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* 特定状态的颜色 */
.stat-item[data-filter="accessible"]::before {
    background: var(--success-color);
}

.stat-item[data-filter="inaccessible"]::before {
    background: var(--error-color);
}

.stat-item[data-filter="deleted"]::before {
    background: var(--warning-color);
}

.stat-item[data-filter="kept"]::before {
    background: var(--info-color);
}

/* 书签列表区域 */
.bookmarks-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.bookmarks-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.bookmarks-header h2 {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.bookmarks-stats {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

/* 现代化书签项 */
.bookmark-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    transition: all var(--transition-normal);
    gap: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.bookmark-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-light);
    transition: background var(--transition-fast);
}

.bookmark-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.bookmark-item:last-child {
    border-bottom: none;
}

/* 书签状态样式 */
.bookmark-item.checking {
    background: var(--warning-light);
    animation: pulse 2s infinite;
}

.bookmark-item.checking::before {
    background: var(--warning-color);
}

.bookmark-item.accessible {
    background: var(--success-light);
}

.bookmark-item.accessible::before {
    background: var(--success-color);
}

.bookmark-item.inaccessible {
    background: var(--error-light);
}

.bookmark-item.inaccessible::before {
    background: var(--error-color);
}

.bookmark-item.kept {
    background: var(--info-light);
}

.bookmark-item.kept::before {
    background: var(--info-color);
}

.bookmark-item.deleted {
    background: var(--bg-soft);
    opacity: 0.6;
}

.bookmark-item.deleted::before {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 书签状态指示器 */
.bookmark-status {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--font-lg);
    color: var(--text-secondary);
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    transition: all var(--transition-normal);
}

.status-checking .bookmark-status {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.status-accessible .bookmark-status {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.status-inaccessible .bookmark-status {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.status-kept .bookmark-status {
    background: var(--info-color);
    color: white;
    border-color: var(--info-color);
}

/* 书签信息 */
.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-url {
    font-size: var(--font-sm);
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-url a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.bookmark-url a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 书签元数据 */
.bookmark-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.bookmark-category {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 600;
    color: white;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.bookmark-result {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

/* 书签操作按钮 */
.bookmark-actions-container {
    flex-shrink: 0;
    display: flex;
    gap: var(--spacing-sm);
}

.bookmark-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.keep-btn, .unkeep-btn, .delete-single-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-xs);
    font-weight: 600;
    transition: all var(--transition-normal);
    border: 2px solid;
    background: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-height: 32px;
}

.keep-btn {
    color: var(--info-color);
    border-color: var(--info-color);
}

.keep-btn:hover {
    background: var(--info-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.unkeep-btn {
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

.unkeep-btn:hover {
    background: var(--text-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.delete-single-btn {
    color: var(--error-color);
    border-color: var(--error-color);
}

.delete-single-btn:hover {
    background: var(--error-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 详情展开区域 */
.details-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.details-content {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.details-content h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-sm);
}

.details-content ul {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

.details-content li {
    margin-bottom: var(--spacing-xs);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .checker-container {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 var(--spacing-md);
    }
    
    .checker-container {
        padding: var(--spacing-md);
        gap: var(--spacing-lg);
    }
    
    .controls-section,
    .progress-section,
    .bookmarks-section,
    .details-section {
        padding: var(--spacing-lg);
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .control-group {
        justify-content: space-between;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
    }
    
    .bookmark-meta {
        justify-content: space-between;
        width: 100%;
    }
    
    .bookmark-actions-container {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: var(--font-lg);
    }
    
    .checker-title {
        font-size: var(--font-xl);
    }
    
    .bookmark-title {
        font-size: var(--font-base);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载和空状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
    font-size: var(--font-lg);
}

/* 分类颜色保持 */
.category-机器人 { background: #8b5cf6; }
.category-Chrome同步 { background: #06b6d4; }
.category-移动设备书签 { background: #10b981; }
.category-default { background: var(--text-muted); }

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: var(--font-xl);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--error-light);
    color: var(--error-color);
}

.modal-body {
    padding: var(--spacing-xl);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
}

.form-actions .btn {
    min-width: 100px;
}