/**
 * 网址导航系统 - 样式文件
 * @version 1.0.0
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #2ecc71;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== 头部 ==================== */
.header {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo h1 {
    font-size: 24px;
    color: #fff;
    font-weight: 600;
}

.logo a:hover {
    color: #fff;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.search-box form {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 5px 15px;
    overflow: hidden;
}

.search-box input {
    border: none;
    background: transparent;
    color: #fff;
    padding: 8px;
    outline: none;
    width: 200px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

/* ==================== 主体内容 ==================== */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* 统计信息 */
.stats {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stats span {
    color: #666;
}

.stats strong {
    color: #2ecc71;
    font-size: 16px;
}

/* 区块 */
.section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    display: flex;
    align-items: center;
    border-left: 4px solid #2ecc71;
    padding-left: 12px;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.category-icon {
    font-size: 20px;
    margin-right: 8px;
}

.section-title .more {
    margin-left: auto;
    color: #999;
    font-size: 13px;
}

.section-title .more:hover {
    color: #2ecc71;
}

/* 推荐网站网格 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.website-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.website-card:hover {
    border-color: #2ecc71;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
}

.website-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
}

.website-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.website-info h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.website-info p {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 网站列表 */
.website-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.website-item {
    display: block;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.website-item:hover {
    background: #e8f5e9;
    border-color: #2ecc71;
    color: #2ecc71;
}

.website-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 横向标签列表 */
.website-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.website-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.website-tag:hover {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

.website-tag.hot {
    background: #fff3e0;
    border-color: #ffe0b2;
    color: #f57c00;
}

.website-tag.hot:hover {
    background: #f57c00;
    color: #fff;
    border-color: #f57c00;
}

/* ==================== 页脚 ==================== */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
    margin-top: 40px;
}

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

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

.footer a {
    color: #2ecc71;
}

.footer a:hover {
    color: #fff;
}

/* ==================== 分类页面 ==================== */
.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 30px;
}

.category-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.category-header p {
    opacity: 0.9;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-nav a {
    padding: 8px 20px;
    background: #fff;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-nav a:hover,
.category-nav a.active {
    background: #2ecc71;
    color: #fff;
}

/* ==================== 搜索页面 ==================== */
.search-header {
    text-align: center;
    padding: 40px 0;
}

.search-header h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    border-color: #2ecc71;
}

.search-form button {
    padding: 12px 30px;
    background: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #27ae60;
}

.search-results {
    margin-top: 30px;
}

.search-result-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-result-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.search-result-item h3 {
    margin-bottom: 8px;
}

.search-result-item h3 a {
    color: #2ecc71;
}

.search-result-item p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.search-result-item .meta {
    font-size: 12px;
    color: #999;
}

/* ==================== 提交页面 ==================== */
.submit-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

.form-group label .required {
    color: #e74c3c;
    margin-left: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #2ecc71;
}

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

.form-group .help-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination a.active {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

.pagination a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .search-box {
        order: 2;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .website-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats {
        flex-direction: column;
        text-align: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .submit-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }
    
    .search-box {
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .search-box form {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .website-list {
        grid-template-columns: 1fr;
    }
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }

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

.section {
    animation: fadeIn 0.5s ease;
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2ecc71;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== 提示框 ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
