:root {
    --primary: #1d4ed8;
    --bg: #f4f6f9;
    --panel: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --dim: #64748b;
    --ok: #0f766e;
    --placeholder: #b45309;
    --partial: #ca8a04;
    --no-coord: #94a3b8;
    --no-ju: #dc2626;
    --font: 'Noto Sans SC', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.co-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 48px;
    background: #1e3a8a;
    flex-shrink: 0;
}
.co-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.co-header .logo {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.header-actions { display: flex; gap: 8px; }
.btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn:hover { border-color: #cbd5e1; }
.btn-ghost {
    background: transparent;
    border-color: rgba(255,255,255,.25);
    color: #e2e8f0;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.co-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-select, .search-input {
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    background: #fff;
}
.search-input { width: 200px; }
.chk {
    font-size: 12px;
    color: var(--dim);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.hint { font-size: 12px; color: var(--dim); }
.co-summary {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    flex-shrink: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.stat-chip {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--dim);
    cursor: pointer;
    user-select: none;
}
.stat-chip:hover { border-color: #94a3b8; }
.stat-chip.active {
    border-color: #1d4ed8;
    background: #eff6ff;
    color: #1e3a8a;
}
.stat-chip b {
    display: block;
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
}
.co-banner {
    padding: 6px 16px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.co-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 260px 1fr 320px;
}
.co-list, .co-detail {
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.co-detail { border-right: none; border-left: 1px solid var(--border); }
.list-head, .detail-title {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.list-count {
    font-size: 12px;
    color: var(--dim);
    font-weight: 500;
}
.list-body {
    flex: 1;
    overflow: auto;
}
.list-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-size: 13px;
}
.list-item:hover { background: #f8fafc; }
.list-item.active { background: #eff6ff; }
.list-item .name { font-weight: 600; }
.list-item .sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--dim);
}
.co-map-wrap {
    position: relative;
    min-width: 0;
}
.co-map { width: 100%; height: 100%; }
.map-legend {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--dim);
}
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot.ok { background: var(--ok); }
.dot.placeholder { background: var(--placeholder); }
.dot.partial { background: var(--partial); }
.dot.no_coord { background: var(--no-coord); }
.dot.no_jurisdiction { background: var(--no-ju); }
.detail-empty {
    padding: 24px 16px;
    color: var(--dim);
    font-size: 13px;
    line-height: 1.6;
}
.detail-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.detail-title h2 { font-size: 18px; font-weight: 700; }
.status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
}
.status-badge.ok { background: #ccfbf1; color: var(--ok); }
.status-badge.placeholder { background: #ffedd5; color: var(--placeholder); }
.status-badge.partial { background: #fef9c3; color: #a16207; }
.status-badge.no_coord { background: #e2e8f0; color: #475569; }
.status-badge.no_jurisdiction { background: #fee2e2; color: var(--no-ju); }
.detail-meta {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--dim);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}
.line-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.line-tab {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.line-tab.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #fff;
}
.area-panel {
    flex: 1;
    overflow: auto;
    padding: 8px 12px 16px;
}
.area-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}
.area-type {
    color: var(--dim);
}
.area-name { font-weight: 500; }
.area-full {
    grid-column: 1 / -1;
    color: #94a3b8;
    font-size: 11px;
    word-break: break-all;
}
.detail-actions {
    display: none;
}
.diff-warn {
    margin-top: 8px;
    padding: 8px;
    background: #fff7ed;
    border-radius: 8px;
    font-size: 11px;
    color: #9a3412;
}
@media (max-width: 1100px) {
    .co-main { grid-template-columns: 220px 1fr; }
    .co-detail { display: none; }
    .co-detail.open-mobile {
        display: flex;
        position: absolute;
        right: 0; top: 0; bottom: 0;
        width: min(360px, 90vw);
        z-index: 5;
        box-shadow: -8px 0 24px rgba(15,23,42,.12);
    }
}
