/* 页面特定样式 */

/* AI热点排名 */
.trending-section {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.trending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.trending-header .section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trending-update {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.trending-list {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
}

.trending-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    background: var(--bg-hover);
}

.trending-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.trending-rank.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
}

.trending-rank.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.trending-rank.top-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #000;
}

.trending-rank.normal {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.trending-keyword {
    flex: 1;
    font-weight: 500;
}

.trending-index {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.trending-index i.up {
    color: var(--success);
}

.trending-index i.down {
    color: #f85149;
}

.trending-index i.stable {
    color: var(--text-secondary);
}

/* GitHub Trending 样式 */
.github-trending-section {
}

.github-item {
    cursor: pointer;
}

.github-item:hover {
    background: var(--bg-hover);
}

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

.trending-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.repo-stars {
    color: #f0b400;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.repo-language {
    color: var(--accent);
}

.repo-desc {
    width: 100%;
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-state i {
    margin-right: 0.5rem;
}

/* 统计面板 */
.stats-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 480px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 2000;
    padding: 1.5rem;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.stats-panel.open {
    right: 0;
}

.stats-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.stats-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.stats-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.stats-panel-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.stats-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.stats-section {
    margin-bottom: 2rem;
}

.stats-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-section-title i {
    color: var(--accent);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.stats-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.stats-rank.top-1 { background: linear-gradient(135deg, #ffd700, #ffb700); color: #000; }
.stats-rank.top-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #000; }
.stats-rank.top-3 { background: linear-gradient(135deg, #cd7f32, #b87333); color: #000; }
.stats-rank.normal { background: var(--bg-hover); color: var(--text-secondary); }

.stats-item-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.stats-item-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== 页面通用内容区 ========== */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.section-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-card h2 i {
    color: var(--accent);
}

.section-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.section-card p:last-child {
    margin-bottom: 0;
}

.vision-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.vision-box i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.vision-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.vision-box p {
    color: var(--text-secondary);
    margin: 0;
}

/* 联系页面 */
.contact-email {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.contact-email i {
    font-size: 1.25rem;
    color: var(--accent);
}

.contact-email a {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
}

.contact-email a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

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

.form-submit {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: #79b8ff;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* 免责声明警告框 */
.warning-box {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.warning-box h3 {
    color: var(--warning);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box p {
    color: var(--text-secondary);
    margin: 0;
}

/* 导航链接列表 */
.nav-links-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.nav-links-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-links-list a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* 响应式 - 断点: 640px, 768px, 1024px, 1200px */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 0.25rem;
    }
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    .nav-logo span {
        display: none;
    }
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 汉堡菜单按钮 */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
        position: relative;
    }

    .hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-primary);
        margin: 2px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 导航菜单 */
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* 导航搜索框 - 移动端 */
    .nav-search-wrap .nav-search-input {
        width: 0;
        max-width: 0;
        opacity: 0;
    }

    .nav-search-wrap.active .nav-search-input {
        width: 140px;
        max-width: 140px;
        opacity: 1;
    }

    /* 导航按钮组 - 移动端适配 */
    .nav-search-btn,
    .hamburger {
        width: 36px;
        height: 36px;
    }

    /* 工具卡片 - 2列布局 */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* 小屏幕标签横向滚动 */
    .tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 1rem 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* 工具卡片内部调整 */
    .tool-card {
        padding: 0.875rem;
    }

    .tool-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .tool-name {
        font-size: 0.95rem;
    }

    .tool-desc {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tool-link {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }

    /* 文章卡片 */
    .article-card,
    .article-item {
        padding: 1rem;
    }

    .article-item.has-thumb {
        flex-direction: column;
    }

    .article-item.has-thumb .article-thumb-wrap {
        width: 100%;
        height: auto;
        margin-right: 0;
        margin-bottom: 0.75rem;
    }

    .article-item.has-thumb .article-thumb-wrap img {
        width: 100%;
        height: auto;
    }

    .article-title {
        font-size: 1rem;
    }

    /* Trending */
    .trending-item {
        padding: 0.875rem 1rem;
    }

    .trending-keyword {
        font-size: 0.95rem;
    }

    .trending-index span {
        display: none;
    }

    /* 统计面板移动端适配 */
    .stats-panel {
        width: 100%;
        right: -100%;
    }

    .stats-panel.open {
        right: 0;
    }

    /* 筛选栏移动端适配 */
    .filter-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 1rem 0.5rem;
        gap: 0.5rem;
        /* 隐藏滚动条但保留功能 */
        -ms-overflow-style: none;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-bar .tab-btn {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .filter-sort {
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* 480px以下: 优化工具卡片为单列但保留最小宽度 */
@media (max-width: 480px) {
    .nav {
        padding: 0 0.75rem;
    }

    .nav-container {
        padding: 0;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-logo span {
        display: none;
    }

    .nav-actions {
        gap: 0.25rem;
    }

    .theme-toggle,
    .stats-btn,
    .nav-search-btn,
    .hamburger {
        width: 36px;
        height: 36px;
    }

    .tools-section {
        padding: 0 0.75rem 2rem;
    }

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

    .tool-card {
        padding: 0.75rem;
    }

    .tool-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .tool-name {
        font-size: 0.9rem;
    }

    .tool-links {
        flex-direction: column;
        gap: 0.375rem;
    }

    .tool-link {
        padding: 0.5rem;
        font-size: 0.75rem;
        text-align: center;
        border-radius: 6px;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .articles-section {
        padding: 0.75rem;
    }

    .trending-section {
        padding: 0.75rem;
    }

    /* 底部调整 */
    .footer {
        padding: 0.5rem 0.75rem;
    }

    .footer-links {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .footer-link {
        font-size: 0.8rem;
    }

    /* 文章页面移动端优化 */
    .search-section {
        padding: 80px 1rem 1.5rem;
    }

    .article-item {
        padding: 1rem;
    }

    .article-title {
        font-size: 0.95rem;
    }

    .article-meta {
        font-size: 0.75rem;
        gap: 0.75rem;
    }

    /* 页面通用内容区移动端 */
    .page-content {
        padding: 2rem 1rem;
    }

    .section-card {
        padding: 1.5rem;
    }

    .vision-box {
        padding: 1.25rem;
    }

    .warning-box {
        padding: 1.25rem;
    }

    .form-submit {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 640px以下: 1列布局（仅超小屏幕使用） */
@media (max-width: 400px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 1920px以上: 扩展容器和网格到4列 */
@media (min-width: 1920px) {
    .tools-section {
        max-width: 1440px;
    }

    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}