/* 公共样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #45a049;
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #45a049;
    text-decoration: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

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

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
}

.header h1 {
    margin-bottom: 10px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

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

.nav-links a {
    color: white;
    text-decoration: none;
}

.nav-links a:hover {
    color: #4CAF50;
}

.footer {
    background: #2c3e50;
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #bdc3c7;
}

.footer-links a:hover {
    color: white;
}

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

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

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

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

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

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

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

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

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
}

.pagination a:hover {
    background: #f5f5f5;
}

.pagination .active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* 主题相关样式 */
.theme-default {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --background-color: #f5f7fa;
    --text-color: #333;
    --card-bg: white;
    --border-color: #ddd;
}

.theme-dark {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #444;
}

.theme-blue {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --background-color: #e3f2fd;
    --text-color: #1565c0;
    --card-bg: white;
    --border-color: #bbdefb;
}

.theme-green {
    --primary-color: #4CAF50;
    --secondary-color: #8BC34A;
    --background-color: #f1f8e9;
    --text-color: #33691e;
    --card-bg: white;
    --border-color: #dcedc8;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.btn {
    background-color: var(--primary-color);
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px;
    }
    
    .search-btn {
        padding: 10px 15px;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* 工具类 */
.text-center {
    text-align: center;
}

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

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

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
}