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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 页头样式 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Logo区域 */
.logo-section {
    flex-shrink: 0;
}

.logo-link {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.site-logo {
    width: 200px;
    height: 60px;
    object-fit: contain;
}

.site-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    width: 200px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logo-link:hover .site-logo-text {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: scale(1.02);
}

/* 搜索区域 */
.search-section {
    flex: 1;
    max-width: 600px;
    text-align: center;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.search-engine-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    min-width: 70px;
    border-right: none;
    height: 36px;
}

.search-engine-select:hover {
    border-color: #ddd;
}

.search-engine-select:focus {
    border-color: #ddd;
    box-shadow: none;
}

.search-form {
    display: flex;
    flex: 1;
    max-width: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 14px;
    outline: none;
    height: 36px;
}

.search-input:focus {
    border-color: #ddd;
    box-shadow: none;
}

.search-btn {
    padding: 8px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    border-radius: 0 20px 20px 0;
    height: 36px;
    min-width: 70px;
}

.search-btn:hover {
    background: #45a049;
}

/* 管理员区域 */
.admin-section {
    flex-shrink: 0;
    min-width: 200px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.admin-link, .logout-link {
    padding: 5px 10px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.3s;
}

.logout-link {
    background: #e74c3c;
}

.admin-link:hover {
    background: #229954;
}

.logout-link:hover {
    background: #c0392b;
}

.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    padding: 0 20px;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #2c3e50;
}

.category-list {
    list-style: none;
    padding: 10px 0;
}

.category-item {
    margin: 0;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    gap: 10px;
}

.category-link:hover {
    background: #f8f9fa;
    color: #3498db;
}

.category-link.active {
    background: #3498db;
    color: white;
}

.category-icon {
    width: 16px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 14px;
}

.category-count {
    font-size: 12px;
    color: #999;
}

.sidebar-actions {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.action-link {
    display: block;
    padding: 8px 0;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.action-link:hover {
    color: #2980b9;
}

/* 内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 幻灯片样式 */
.slideshow-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 200px;
}

.slideshow-container {
    position: relative;
    height: 100%;
}

.slides-wrapper {
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.slide-link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.slide-link-wrapper:hover .slide-image {
    transform: scale(1.05);
}

.slide-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
    border: 1px solid rgba(255,255,255,0.3);
}

.dot.active {
    background: white;
    border-color: white;
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
    z-index: 10;
}

.slide-nav:hover {
    background: rgba(0,0,0,0.7);
}

.slide-nav.prev {
    left: 15px;
}

.slide-nav.next {
    right: 15px;
}

.no-slides .placeholder-slide {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.placeholder-slide h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.placeholder-slide p {
    font-size: 16px;
    opacity: 0.9;
}

/* 推荐链接和主体链接样式 */
.recommended-section, .main-links-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.section-title {
    font-size: 20px;
    color: #2c3e50;
    margin: 0;
}

.category-group {
    margin-bottom: 30px;
}

.category-header {
    margin-bottom: 15px;
}

.category-title {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-description {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* 链接卡片容器 */
.link-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    max-width: 100%;
}

/* 链接卡片样式 */
.link-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 80px;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.card-link {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    gap: 12px;
}

.card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.recommended-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

/* 推荐卡片特殊样式 */
.recommended-card {
    border-color: #f39c12;
}

.recommended-card:hover {
    border-color: #e67e22;
}

/* 空状态样式 */
.no-links, .no-content {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-state p {
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

/* 页脚样式 */
.site-footer {
    background: #2c3e50;
    color: white;
    margin-top: 40px;
    padding: 20px 0;
}

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

.footer-content {
    text-align: center;
    margin-bottom: 15px;
}

.footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.footer-row:last-child {
    margin-bottom: 0;
}

.footer-item {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-item a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-item.github a {
    color: #74c0fc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
}

.footer-item.github a:hover {
    color: #339af0;
    background: rgba(116, 192, 252, 0.1);
    transform: translateY(-1px);
}

.github-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.github-text {
    font-size: 14px;
    font-weight: 500;
}

.github-separator {
    color: #7f8c8d;
    font-weight: normal;
    margin: 0 2px;
}

.github-repo {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.9;
}

.footer-item.github a:hover .github-repo {
    opacity: 1;
}

.separator {
    color: #7f8c8d;
    font-size: 12px;
    margin: 0 5px;
}

.footer-links {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #34495e;
}

.footer-link {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

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

.hidden {
    display: none;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
