/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-content h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content p {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 400;
    margin-bottom: 25px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.header-stats .stat-item {
    text-align: center;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
}

.header-stats .stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 输入区域样式 */
.input-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#url-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

#url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.crawl-button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.crawl-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.crawl-button:active {
    transform: translateY(0);
}

.crawl-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 快速开始区域样式 */
.quick-start-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
}

.quick-start-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.quick-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.quick-btn:active {
    transform: translateY(0);
}

/* 选项区域样式 */
.options-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.options-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.option-group {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
    position: relative;
}

.option-item label:hover {
    color: #667eea;
}

.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.option-item small {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-left: 30px;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.option-item input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.option-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 进度条样式 */
.progress-section {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    color: #667eea;
    font-weight: 500;
    font-size: 1rem;
}

/* 结果区域样式 */
.results-section {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e1e8ed;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.export-group {
    display: flex;
    gap: 8px;
}

.export-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.export-txt-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.export-txt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.refresh-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.stats-bar {
    display: flex;
    gap: 30px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
    flex-wrap: wrap;
}

.stat-item {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.stat-item span {
    color: #667eea;
    font-weight: 700;
}

/* 搜索和过滤栏样式 */
.search-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 8px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    max-width: 300px;
}

#search-input {
    border: none;
    outline: none;
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    background: transparent;
}

.search-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #f8f9fa;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #7f8c8d;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.results-container {
    max-height: 500px;
    overflow-y: auto;
}

.results-list {
    padding: 20px 30px;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.result-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.result-item .link-icon {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.result-item .link-content {
    flex: 1;
    min-width: 0;
}

.result-item .link-url {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    display: block;
    margin-bottom: 5px;
}

.result-item .link-url:hover {
    text-decoration: underline;
}

.result-item .link-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 3px;
}

.result-item .link-title {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-item .link-type {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.link-type.external {
    background: #e3f2fd;
    color: #1976d2;
}

.link-type.internal {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 错误区域样式 */
.error-section {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
    text-align: center;
    padding: 40px;
}

.error-message h3 {
    color: #e74c3c;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.error-message p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.retry-button {
    padding: 12px 25px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* 页脚样式 */
.footer {
    margin-top: 30px;
    padding: 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
}

.footer-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.footer-content h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.footer-content > p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.footer-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
    min-width: 100px;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.feature-item span:last-child {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.footer-info {
    border-top: 1px solid #e1e8ed;
    padding-top: 20px;
}

.footer-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.5;
}

.footer-info p:last-child {
    font-weight: 500;
    color: #2c3e50;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content h1 {
        font-size: 2.2rem;
    }
    
    .header-stats {
        gap: 20px;
    }
    
    .header-stats .stat-item {
        padding: 12px 16px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .crawl-button {
        width: 100%;
    }
    
    .quick-buttons {
        justify-content: center;
    }
    
    .quick-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .option-group {
        flex-direction: column;
        gap: 15px;
    }
    
.option-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .result-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .export-group {
        flex-direction: column;
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .search-filter-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .result-item {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .result-item .link-type {
        position: static;
        align-self: flex-start;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .footer-features {
        gap: 15px;
    }
    
    .feature-item {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .footer-content h3 {
        font-size: 1.3rem;
    }
    
    .footer-content > p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 15px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .header-stats {
        gap: 15px;
    }
    
    .header-stats .stat-item {
        padding: 10px 12px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .input-section,
    .results-section,
    .error-section,
    .progress-section {
        padding: 20px 15px;
    }
    
    .results-list {
        padding: 15px;
    }
    
    .quick-buttons {
        gap: 8px;
    }
    
    .quick-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .option-item {
        padding: 8px;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .search-box {
        padding: 6px 12px;
    }
    
    #search-input {
        font-size: 0.8rem;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-item .link-url {
        font-size: 0.9rem;
        word-break: break-all;
    }
    
    .result-item .link-text,
    .result-item .link-title {
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 20px 15px;
    }
    
    .footer-features {
        gap: 10px;
    }
    
    .feature-item {
        min-width: 70px;
        padding: 10px 12px;
    }
    
    .feature-icon {
        font-size: 1.2rem;
    }
    
    .feature-item span:last-child {
        font-size: 0.8rem;
    }
    
    .footer-content h3 {
        font-size: 1.2rem;
    }
    
    .footer-content > p {
        font-size: 0.85rem;
    }
    
    .footer-info p {
        font-size: 0.8rem;
    }
}
