* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-btn {
    padding: 1rem 2rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-btn:hover {
    background: #ff5252;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: white;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: #f8f9fa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Popular Packages */
.popular-packages {
    padding: 4rem 0;
    background: #f8f9fa;
}

.popular-packages h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.package-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.package-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.package-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.package-version {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.package-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.package-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
}

/* Usage Guide */
.usage-guide {
    padding: 4rem 0;
    background: white;
}

.usage-guide h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.guide-step {
    text-align: center;
    padding: 1.5rem;
}

.guide-step h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.guide-step p {
    color: #666;
    line-height: 1.6;
}

.code-example {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.code-example h3 {
    margin-bottom: 1rem;
    color: #333;
}

.code-example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 1rem;
    text-align: center;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input,
    .search-btn {
        width: 100%;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-content {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Converter Section */
.converter-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.converter-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: #333;
}

.converter-desc {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.converter-tool {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.converter-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.converter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.convert-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.converter-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #28a745;
}

.converter-result h3 {
    color: #28a745;
    margin-bottom: 1rem;
}

.result-content pre {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 1rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.copy-btn, .clear-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn {
    background: #28a745;
    color: white;
}

.copy-btn:hover {
    background: #218838;
}

.clear-btn {
    background: #6c757d;
    color: white;
}

.clear-btn:hover {
    background: #5a6268;
}

/* Supported Sources */
.supported-sources {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.supported-sources h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.source-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.source-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.source-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.source-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.source-desc {
    font-size: 0.9rem;
    color: #666;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
    padding: 2rem;
}

.search-results h3 {
    margin-bottom: 1rem;
    color: #333;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* 链接转换工具模态框样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.converter-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.converter-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.input-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.converter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.converter-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.converter-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.converter-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.3);
}

.converter-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.converter-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(108, 117, 125, 0.3);
}

.converter-btn.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.converter-btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(23, 162, 184, 0.3);
}

.converter-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.converter-result label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.result-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 100px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-result-btn, .test-speed-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-result-btn {
    background: #28a745;
    color: white;
}

.copy-result-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.test-speed-btn {
    background: #ffc107;
    color: #212529;
}

.test-speed-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.speed-test-result {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.speed-test-result h4 {
    margin: 0 0 15px 0;
    color: #0056b3;
}

.speed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #d1ecf1;
}

.speed-item:last-child {
    border-bottom: none;
}

.speed-url {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #495057;
    flex: 1;
    margin-right: 15px;
    word-break: break-all;
}

.speed-time {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.speed-fast {
    background: #d4edda;
    color: #155724;
}

.speed-medium {
    background: #fff3cd;
    color: #856404;
}

.speed-slow {
    background: #f8d7da;
    color: #721c24;
}

.speed-error {
    background: #f5c6cb;
    color: #721c24;
}

/* 内置转换工具样式 */
.converter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 60px 0;
    margin: 40px 0;
}

.converter-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.converter-title {
    text-align: center;
    margin-bottom: 30px;
}

.converter-title h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
}

.converter-description {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 30px;
}

.converter-input-section {
    margin: 30px 0;
}

.converter-input-field {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    box-sizing: border-box;
}

.converter-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.converter-convert-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 25px 0;
}

.converter-convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.3);
}

.converter-result-section {
    margin-top: 30px;
}

.converter-result-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    min-height: 120px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    color: #333;
}

.converter-copy-btn {
    margin-top: 20px;
    padding: 12px 25px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.converter-copy-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.3);
}



/* 响应式设计 - 内置转换工具 */
@media (max-width: 768px) {
    .converter-container {
        padding: 25px;
        margin: 0 10px;
    }
    
    .converter-title h2 {
        font-size: 2rem;
    }
    
    .converter-input-field {
        padding: 15px;
        min-height: 120px;
    }
    
    .converter-convert-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
}