/* 网址导航网站样式 - 兼容性良好 */

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

body {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.description {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 搜索框样式 */
.search-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 20px;
    position: relative;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e6ed;
    border-right: none;
    border-radius: 25px 0 0 25px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: #667eea;
}

.search-btn {
    padding: 15px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5a6fd8;
}

.search-engines {
    text-align: center;
}

.search-engine {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
}

.search-engine:hover,
.search-engine.active {
    background: #667eea;
    color: white;
}

/* 主要内容样式 */
.main-content {
    margin-bottom: 60px;
}

.category-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.category-title i {
    color: #667eea;
    margin-right: 10px;
}

.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.website-card {
    display: block;
    padding: 20px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.website-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.website-card:hover::before {
    transform: scaleX(1);
}

.website-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.website-icon img {
    max-width: 32px;
    max-height: 32px;
    border-radius: 4px;
}

.website-icon i {
    font-size: 24px;
    color: #667eea;
}

.website-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: #333;
}

.website-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.website-clicks {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

/* 底部样式 */
.footer {
    text-align: center;
    color: white;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.footer p {
    margin-bottom: 5px;
    opacity: 0.8;
}

.footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .category-section {
        padding: 20px;
    }
    
    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .website-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    #searchInput {
        border-radius: 25px;
        border: 2px solid #e0e6ed;
        margin-bottom: 10px;
    }
    
    .search-btn {
        border-radius: 25px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 管理后台简单样式 */
.admin-container {
    max-width: 800px;
    margin: 50px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.admin-header {
    background: #667eea;
    color: white;
    padding: 20px;
    text-align: center;
}

.admin-content {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.btn:hover {
    background: #5a6fd8;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
}

.table tr:hover {
    background: #f8f9fa;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}