.usdfan-geo-wrap {
    --geo-bg: #f4f6f9;
    --geo-card-bg: #ffffff;
    --geo-card-border: #ebeff5;
    --geo-tile-bg: #f3f5f8;
    --geo-text: #111827;
    --geo-text-sub: #64748b;
    --geo-text-muted: #94a3b8;
    --geo-accent: #f59e0b;
    --geo-accent-hover: #ea580c;
    --geo-accent-soft: #fff7ed;
    --geo-code-bg: #eef2f6;
    --geo-code-text: #334155;
    --geo-btn-border: #dbe2ec;
    --geo-row-hover: #f8fafc;
    max-width: 1120px;
    margin: 20px auto 40px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--geo-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] .usdfan-geo-wrap {
    --geo-bg: #0f172a;
    --geo-card-bg: #1e293b;
    --geo-card-border: #334155;
    --geo-tile-bg: #0f172a;
    --geo-text: #f1f5f9;
    --geo-text-sub: #94a3b8;
    --geo-text-muted: #64748b;
    --geo-accent: #f59e0b;
    --geo-accent-hover: #fb923c;
    --geo-accent-soft: rgba(245, 158, 11, 0.14);
    --geo-code-bg: #0f172a;
    --geo-code-text: #cbd5e1;
    --geo-btn-border: #334155;
    --geo-row-hover: rgba(255, 255, 255, 0.03);
}

.usdfan-geo-wrap.is-mobile {
    margin: 12px auto 28px;
    padding: 0 12px;
    gap: 12px;
}

.geo-card {
    background: var(--geo-card-bg);
    border: 1px solid var(--geo-card-border);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.usdfan-geo-wrap.is-mobile .geo-card {
    padding: 16px;
    border-radius: 12px;
}

/* Top Hero Bar */
.geo-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.geo-hero-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--geo-text);
}

.geo-hero-title i {
    font-size: 21px;
    color: #ea580c;
}

.geo-hero-sub {
    font-size: 13px;
    color: var(--geo-text-sub);
    line-height: 1.6;
}

/* Section Headers */
.geo-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.geo-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--geo-text);
}

.geo-sec-title i {
    font-size: 17px;
    color: #f59e0b;
}

.geo-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--geo-code-bg);
    color: var(--geo-text-sub);
    font-size: 12px;
    font-weight: 600;
}

.geo-sec-note {
    font-size: 12.5px;
    color: var(--geo-text-sub);
    font-weight: 400;
}

.geo-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.geo-btn-rebuild {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.geo-btn-rebuild:hover {
    opacity: 0.92;
}

.geo-btn-rebuild:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.geo-btn-rebuild.is-busy i {
    animation: geo-spin 0.9s linear infinite;
}

@keyframes geo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.geo-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--geo-btn-border);
    border-radius: 7px;
    background: var(--geo-card-bg);
    color: var(--geo-text);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.geo-btn-ghost:hover {
    border-color: #f59e0b;
    background: var(--geo-accent-soft);
    color: #ea580c;
}

.geo-btn-icon {
    width: 30px;
    padding: 0;
}

/* 8 Metric Tiles */
.geo-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.usdfan-geo-wrap.is-mobile .geo-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.geo-tile {
    background: var(--geo-tile-bg);
    border-radius: 10px;
    padding: 13px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.geo-tile-label {
    font-size: 12px;
    color: var(--geo-text-sub);
}

.geo-tile-val {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--geo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-tile-sub {
    font-size: 11.5px;
    color: var(--geo-text-muted);
}

/* Endpoint Rows */
.geo-endpoints {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--geo-card-border);
}

.geo-ep-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--geo-card-border);
}

.usdfan-geo-wrap.is-mobile .geo-ep-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.geo-ep-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.geo-ep-icon {
    color: #ea580c;
    font-size: 16px;
    flex-shrink: 0;
}

.geo-ep-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--geo-text);
}

.geo-ep-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    background: var(--geo-code-bg);
    color: var(--geo-text-sub);
    font-size: 11.5px;
}

.geo-ep-path {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--geo-code-bg);
    color: var(--geo-code-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.geo-ep-desc {
    font-size: 12.5px;
    color: var(--geo-text-sub);
}

.geo-ep-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.geo-skip-foot {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--geo-text-sub);
}

/* Public Routes Chips */
.geo-routes-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.geo-route-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border-radius: 7px;
    background: var(--geo-tile-bg);
    color: var(--geo-code-text);
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.geo-route-chip.is-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.geo-route-chip:hover {
    background: var(--geo-accent-soft);
    color: #ea580c;
}

/* Filter Select & Content List */
.geo-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--geo-text-sub);
}

.geo-select {
    height: 32px;
    padding: 0 28px 0 12px;
    border: 1px solid var(--geo-btn-border);
    border-radius: 8px;
    background-color: var(--geo-card-bg);
    color: var(--geo-text);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.geo-select:focus {
    border-color: #f59e0b;
}

.geo-post-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--geo-card-border);
}

.geo-post-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 6px;
    border-bottom: 1px solid var(--geo-card-border);
    transition: background 0.12s ease;
}

.geo-post-row:hover {
    background: var(--geo-row-hover);
}

.usdfan-geo-wrap.is-mobile .geo-post-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.geo-post-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.geo-post-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.geo-kind-tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.geo-kind-tag.is-article {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.geo-kind-tag.is-words {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.geo-post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--geo-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-post-title:hover {
    color: #ea580c;
}

.geo-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--geo-text-muted);
}

.geo-post-ops {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.geo-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--geo-text-muted);
    font-size: 13px;
}
