/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
                 Helvetica, Arial, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #81d4fa;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e94560 !important;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    padding: 8px 18px;
    border-radius: 8px;
    color: #b0b0b0 !important;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #e0e0e0 !important;
    background: rgba(233, 69, 96, 0.1);
}

.nav-link.active {
    color: #fff !important;
    background: #e94560;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding-top: 80px;
    padding-bottom: 40px;
}

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

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 8px;
}

.page-header p {
    color: #999;
    font-size: 0.95rem;
}

.news-count strong {
    color: #e94560;
    font-size: 1.1rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 10px 22px;
    border: 1px solid #0f3460;
    border-radius: 24px;
    background: transparent;
    color: #b0b0b0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: #e94560;
    color: #e0e0e0;
    background: rgba(233, 69, 96, 0.08);
}

.tab-btn.active {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
    font-weight: 600;
}

/* ===== News Cards ===== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.15);
    border-color: #e94560;
}

/* 新闻卡片整张可点击 */
.news-card-link {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
}
.news-card-link:hover {
    text-decoration: none !important;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.card-category {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
}

.cat-ai {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
}

.cat-hermes {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
}

.cat-openclaw {
    background: rgba(102, 187, 106, 0.15);
    color: #66bb6a;
}

.cat-claude {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.cat-codex {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.card-source {
    font-size: 0.82rem;
    color: #888;
}

.heat-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.heat-high {
    background: rgba(255, 87, 34, 0.2);
    color: #ff5722;
    border: 1px solid rgba(255, 87, 34, 0.3);
}

.heat-mid {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.heat-low {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.5;
}

.card-title a {
    color: #e0e0e0 !important;
    transition: color 0.2s;
}

.card-title a:hover {
    color: #4fc3f7 !important;
}

.card-summary {
    font-size: 0.9rem;
    color: #66bb6a;
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-time {
    font-size: 0.82rem;
    color: #666;
}

/* ===== Plugin Cards ===== */
.plugin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.plugin-card {
    display: block;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #e0e0e0 !important;
}

.plugin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.15);
    border-color: #e94560;
}

.plugin-rank-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
}

.plugin-rank-badge {
    font-size: 1.5rem;
    min-width: 48px;
    text-align: center;
    padding-top: 4px;
}

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

.plugin-rank-card .plugin-card-top {
    margin-bottom: 6px;
}

.plugin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-sm {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    background: #0f3460;
    color: #4fc3f7;
    border: 1px solid rgba(79, 195, 247, 0.15);
}

.tag-cat {
    background: rgba(233, 69, 96, 0.12);
    color: #e94560;
    border-color: rgba(233, 69, 96, 0.15);
}

.plugin-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.install-section {
    font-size: 0.8rem;
    color: #b0b0b0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.install-cmd {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: #1a1a3e;
    color: #66bb6a;
    font-size: 0.78rem;
    border: 1px solid rgba(102, 187, 106, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.install-cmd:hover {
    background: #66bb6a22;
    border-color: #66bb6a;
}

.install-bundled {
    color: #888;
    font-size: 0.78rem;
    font-style: italic;
}

.plugin-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.plugin-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.plugin-fullname {
    font-size: 0.78rem;
    color: #666;
}

.plugin-desc {
    font-size: 0.85rem;
    color: #b0b0b0;
    line-height: 1.5;
    margin-bottom: 10px;
}

.gh-stars, .gh-forks {
    font-size: 0.85rem;
    color: #ffd54f;
}

.gh-forks {
    color: #81c784;
}

.gh-link {
    font-size: 0.8rem;
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.2s;
}

.gh-link:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.tag-lang {
    background: rgba(102, 187, 106, 0.12);
    color: #66bb6a;
    border-color: rgba(102, 187, 106, 0.15);
}

.plugin-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 14px 22px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-val {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffd54f;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 0.78rem;
    color: #888;
}

.update-info {
    font-size: 0.78rem;
    color: #666;
    margin-top: 4px;
}

/* ===== Plugin Detail Page ===== */
.detail-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.detail-stars {
    font-size: 1.2rem;
    color: #ffd54f;
    font-weight: 700;
    white-space: nowrap;
}

.detail-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 16px;
}

.detail-subtitle a {
    color: #4fc3f7;
}

.detail-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #0f346022;
    border-radius: 10px;
    border: 1px solid #0f3460;
}

.meta-item {
    font-size: 0.8rem;
    color: #b0b0b0;
    padding: 2px 8px;
    background: #0f346044;
    border-radius: 6px;
}

.detail-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #e94560;
    color: #fff;
    border: 1px solid #e94560;
}

.btn-primary:hover {
    background: #ff5470;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #4fc3f7;
    border: 1px solid #4fc3f7;
}

.btn-secondary:hover {
    background: rgba(79, 195, 247, 0.1);
    transform: translateY(-2px);
}

.detail-owner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.owner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #0f3460;
}

.plugin-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.rating-num {
    color: #ffb300;
    font-weight: 600;
    font-size: 0.9rem;
}

.plugin-desc {
    font-size: 0.88rem;
    color: #999;
    line-height: 1.5;
    margin-bottom: 14px;
}

.plugin-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plugin-downloads {
    font-size: 0.82rem;
    color: #888;
}

.plugin-detail-link {
    font-size: 0.82rem;
    color: #4fc3f7;
    font-weight: 500;
}

/* ===== Plugin Detail Page ===== */
.plugin-detail-page .btn-back {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    background: #0f3460;
    color: #b0b0b0 !important;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.plugin-detail-page .btn-back:hover {
    background: #e94560;
    color: #fff !important;
}

.detail-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.detail-title {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.detail-rating {
    font-size: 1rem;
}

.detail-downloads {
    font-size: 1rem;
    color: #b0b0b0;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h2 {
    font-size: 1rem;
    color: #999;
    margin-bottom: 10px;
    font-weight: 500;
}

.detail-desc {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #d0d0d0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 16px;
    background: #0f3460;
    color: #4fc3f7;
    font-size: 0.82rem;
    border: 1px solid rgba(79, 195, 247, 0.2);
}

.detail-author {
    font-size: 1rem;
    color: #b0b0b0;
}

.detail-actions {
    margin-top: 20px;
}

.install-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a3e;
    border: 1px solid #66bb6a44;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.install-code {
    flex: 1;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #66bb6a;
    word-break: break-all;
}

.btn-copy {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #66bb6a55;
    background: transparent;
    color: #66bb6a;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #66bb6a22;
}

.install-hint {
    font-size: 0.82rem;
    color: #888;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #666;
    font-size: 1.1rem;
}

.error-msg {
    text-align: center;
    padding: 24px;
    color: #e94560;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px 20px;
    border-top: 1px solid #0f3460;
    margin-top: auto;
}

.footer-inner p {
    font-size: 0.82rem;
    color: #555;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #16213e;
        flex-direction: column;
        padding: 12px 20px;
        border-bottom: 1px solid #0f3460;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
    }

    .nav-toggle {
        display: block;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .tabs {
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .news-card {
        padding: 16px;
    }

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

    .plugin-list {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 20px;
    }

    .detail-title {
        font-size: 1.3rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        padding: 0 12px;
    }

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

    .page-container {
        padding: 0 12px;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
}

/* ===== Summary Section ===== */
.summary-section {
    max-width: 900px;
    margin: 0 auto 32px;
    padding: 0 20px;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-header h2 {
    font-size: 1.3rem;
    color: #ff6b35;
}

.summary-time {
    font-size: 0.82rem;
    color: #888;
}

.summary-card {
    background: linear-gradient(135deg, #16213e 0%, #1a1a3e 100%);
    border: 1px solid #ff6b3555;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.1);
}

.summary-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(255, 107, 53, 0.12);
    color: #ff8a50;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.summary-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #d0d0d0;
}

@media (max-width: 768px) {
    .summary-section {
        padding: 0 12px;
    }
    .summary-card {
        padding: 16px;
    }
    .summary-header h2 {
        font-size: 1.1rem;
    }
}

/* ===== Region Tabs (中国版/世界版) ===== */
.region-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.region-btn {
    padding: 14px 36px;
    border: 2px solid #0f3460;
    border-radius: 16px;
    background: transparent;
    color: #b0b0b0;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    min-width: 180px;
    position: relative;
}

.region-btn .region-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.08);
    color: #888;
}

.region-btn:hover {
    border-color: #533483;
    color: #e0e0e0;
    background: rgba(83, 52, 131, 0.1);
}

.region-btn.active {
    border-color: #533483;
    background: linear-gradient(135deg, #533483 0%, #e94560 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.25);
}

.region-btn.active .region-count {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.region-panel {
    display: none;
}

.region-panel.active {
    display: block;
}

.header-count {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .region-tabs {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .region-btn {
        min-width: 140px;
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}
