/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 页头优化 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.1;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.15);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.header-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.header-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 搜索框样式 */
.search-container {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: #333;
    outline: none;
    placeholder: #9ca3af;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.search-button:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateX(2px);
}

.search-button span {
    font-size: 1.1rem;
}

/* 主内容 */
.main {
    padding: 2rem 0;
}

/* 网站网格优化 */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

/* 网站卡片优化 */
.site-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* PC端确保site-content正常显示 */
@media (min-width: 769px) {
    main .sites-grid .site-card .site-content {
        display: block !important;
    }

    main .sites-grid .site-card {
        min-height: 400px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    main .sites-grid .site-header {
        border-bottom: 4px solid #e2e8f0 !important;
        border-radius: 0 !important;
    }

    main .sites-grid .site-actions {
        padding: 0 !important;
        margin-top: auto !important;
        flex-direction: row !important;
    }
}

.site-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.site-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* 强制PC端显示site-content - 最高优先级 */
@media (min-width: 769px) {
    main .sites-grid .site-card .site-content {
        display: flex !important;
        flex: 1 !important;
        flex-direction: column !important;
        padding: 1.5rem !important;
    }
}

.site-header {
    padding: 2rem 1.5rem;
    border-bottom: 4px solid #e2e8f0;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.site-header.online {
    border-bottom-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.site-header.down {
    border-bottom-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.site-header.unknown {
    border-bottom-color: #6b7280;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.site-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.site-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.site-logo {
    font-size: 2.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
}

.site-card:hover .site-logo {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.site-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.site-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status {
    color: white;
}

.badge-status.online {
    background: #10b981;
}

.badge-status.down {
    background: #ef4444;
}

.badge-status.unknown {
    background: #6b7280;
}

.badge-credibility {
    background: #667eea;
    color: white;
}

.badge-credibility.A {
    background: #3b82f6;
}

.badge-credibility.B {
    background: #f59e0b;
}

.badge-credibility.C {
    background: #ef4444;
}

.site-description {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1rem;
    padding: 1rem 1rem 1rem 3rem;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    text-indent: 2em !important;
    text-align: justify;
    text-justify: inter-ideograph;
}

.site-description::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.site-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 24px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.tag:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
}

.site-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.site-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
}

.btn {
    padding: 0.85rem 1.8rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

.btn span {
    font-size: 1.1rem;
    line-height: 1;
}

.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, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
}

/* 页脚优化 */
.footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #f3f4f6;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.footer-section a:hover {
    color: #f3f4f6;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #9ca3af;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-card {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计优化 */
@media (max-width: 1400px) {
    .sites-grid {
        gap: 1.8rem;
    }
}

@media (max-width: 1200px) {
    .sites-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .search-container {
        max-width: 500px;
    }

    .search-input {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    .search-button {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 3rem 0 2rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .search-container {
        max-width: 100%;
        margin-top: 1.5rem;
    }

    .search-box {
        flex-direction: column;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.98);
    }

    .search-input {
        padding: 1rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .search-button {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 0 0 16px 16px;
    }

    .search-button:hover {
        transform: none;
    }

    .site-logo {
        width: 3rem;
        height: 3rem;
        font-size: 1.8rem;
    }

    .site-info {
        gap: 0.5rem;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    main .sites-grid .site-card {
        min-height: auto;
        display: block;
    }

    main .sites-grid .site-header {
        padding: 1.5rem;
        border-bottom: none;
        border-radius: 16px;
    }

    main .sites-grid .site-card .site-content {
        display: none !important;
    }

    main .sites-grid .site-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1.5rem 1.5rem;
        margin-top: 0;
    }

    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        justify-content: center;
    }

    .footer {
        padding: 3rem 0 1.5rem;
        margin-top: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section a:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-container {
        margin-top: 1rem;
    }

    .search-input {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .search-button {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .site-logo {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }

    .site-info {
        gap: 0.4rem;
    }

    .site-name {
        font-size: 1.1rem;
    }

    /* 确保小屏幕移动设备也隐藏site-content */
    main .sites-grid .site-card .site-content {
        display: none !important;
    }

    main .sites-grid .site-card {
        min-height: auto !important;
        display: block !important;
    }

    main .sites-grid .site-header {
        padding: 1.5rem !important;
        border-bottom: none !important;
        border-radius: 16px !important;
    }

    main .sites-grid .site-actions {
        padding: 0 1.5rem 1.5rem !important;
        margin-top: 0 !important;
    }
}

/* 移除了可能导致PC端被误判为移动设备的CSS规则 */

/* 横屏移动设备也隐藏 */
@media (max-width: 768px) and (orientation: landscape) {
    main .sites-grid .site-card .site-content {
        display: none !important;
    }

    main .sites-grid .site-card {
        min-height: auto !important;
        display: block !important;
    }
}