/* AI Radar Dashboard Styles v2 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0f1419;
    color: #e7e9ea;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.header {
    padding: 20px 0 16px;
    border-bottom: 1px solid #2f3336;
}

.header-main h1 {
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
}

.header-meta {
    font-size: 0.85em;
    color: #71767b;
    margin-top: 4px;
}

.header-meta .divider {
    margin: 0 8px;
}

/* Index Card */
.index-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #1e2740 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid #2f3336;
}

.index-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.index-item {
    text-align: center;
}

.index-item.main .index-value {
    font-size: 3em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.index-item .index-value.small {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
}

.index-item .index-label {
    font-size: 0.75em;
    color: #71767b;
    margin-top: 4px;
}

.index-divider {
    width: 1px;
    height: 40px;
    background: #2f3336;
}

/* Insight Card */
.insight-card {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #2f3336;
}

.insight-label {
    font-size: 0.8em;
    color: #71767b;
    margin-bottom: 8px;
}

.insight-text {
    font-size: 1.1em;
    font-weight: 500;
    color: #fff;
}

/* Cards */
.card {
    background: #1a1f2e;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #2f3336;
}

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

.card-header h2 {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
}

.badge {
    background: #2f3336;
    color: #71767b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
}

/* Project List (Top项目) */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #2f3336;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-item:hover {
    background: #3a3f44;
    transform: translateX(4px);
}

.project-rank {
    font-size: 1.2em;
    font-weight: 700;
    color: #71767b;
    width: 32px;
    text-align: center;
}

.project-rank.top3 {
    color: #f97316;
}

.project-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.project-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-desc {
    font-size: 0.8em;
    color: #71767b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-stats {
    display: flex;
    gap: 12px;
    margin-left: 12px;
}

.stat {
    text-align: right;
}

.stat-value {
    font-weight: 600;
    color: #fff;
    font-size: 0.9em;
}

.stat-value.star {
    color: #f97316;
}

.stat-value.growth {
    color: #22c55e;
    font-size: 0.8em;
}

.stat-label {
    font-size: 0.7em;
    color: #71767b;
}

/* Category Bars */
.category-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-name {
    font-size: 0.85em;
    color: #e7e9ea;
    width: 60px;
    text-align: right;
}

.category-bar {
    flex: 1;
    height: 24px;
    background: #2f3336;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.category-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-fill.agent { background: linear-gradient(90deg, #667eea, #764ba2); }
.category-fill.mcp { background: linear-gradient(90deg, #f97316, #f59e0b); }
.category-fill.coding { background: linear-gradient(90deg, #22c55e, #16a34a); }
.category-fill.rag { background: linear-gradient(90deg, #06b6d4, #0891b2); }
.category-fill.model { background: linear-gradient(90deg, #ec4899, #d946ef); }
.category-fill.other { background: linear-gradient(90deg, #64748b, #475569); }

.category-count {
    font-size: 0.8em;
    color: #71767b;
    width: 40px;
}

/* Project Table */
.project-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-header {
    display: flex;
    padding: 8px 12px;
    font-size: 0.75em;
    color: #71767b;
    border-bottom: 1px solid #2f3336;
}

.table-row {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.table-row:hover {
    background: #2f3336;
}

.table-col {
    flex: 1;
    font-size: 0.85em;
}

.table-col.name {
    flex: 3;
    font-weight: 500;
    color: #fff;
}

.table-col.stars {
    text-align: right;
    color: #f97316;
}

.table-col.growth {
    text-align: right;
    color: #22c55e;
}

.table-col.score {
    text-align: right;
}

.table-col.category {
    text-align: right;
}

.score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.score-badge.high { background: #166534; color: #22c55e; }
.score-badge.mid { background: #713f12; color: #f97316; }
.score-badge.low { background: #581c87; color: #a855f7; }

.category-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    background: #2f3336;
    color: #71767b;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1f2e;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #2f3336;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 10;
}

.modal-content {
    padding: 24px;
}

.modal-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    padding-right: 40px;
}

.modal-url {
    font-size: 0.8em;
    color: #1d9bf0;
    margin-bottom: 16px;
    word-break: break-all;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.modal-stat {
    background: #2f3336;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.modal-stat-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #fff;
}

.modal-stat-label {
    font-size: 0.7em;
    color: #71767b;
    margin-top: 4px;
}

.modal-section {
    margin-top: 16px;
}

.modal-section-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #71767b;
    margin-bottom: 8px;
}

.modal-section-content {
    font-size: 0.9em;
    color: #e7e9ea;
    line-height: 1.6;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.modal-tag {
    background: #2f3336;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8em;
    color: #e7e9ea;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.modal-btn.primary {
    background: #1d9bf0;
    color: #fff;
}

.modal-btn.secondary {
    background: #2f3336;
    color: #e7e9ea;
}

/* Filter */
.filter-group {
    display: flex;
    gap: 8px;
}

.filter-select {
    background: #2f3336;
    border: none;
    color: #e7e9ea;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #71767b;
    font-size: 0.8em;
}

/* Responsive */
@media (min-width: 481px) {
    .container {
        padding: 24px;
    }

    .index-item.main .index-value {
        font-size: 4em;
    }
}

/* Favorite Button */
.fav-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #71767b;
    transition: color 0.2s;
}
.fav-btn:hover, .fav-btn.active {
    color: #f97316;
}
