/* 1CCF · 全球要闻地球
   只负责球体舞台、标签层与侧栏的样式；弹窗外壳沿用 app.css 的 .bs-modal 体系。
   配色全部走护眼主题的 CSS 变量，四套主题不必各写一遍。 */

#globe-modal .globe-dialog {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.globe-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    /* 右上角那两颗按钮是绝对定位的，这里留出它们的位置 */
    padding-right: 4.6rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.globe-corner {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.globe-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--text-primary);
}

.globe-sub {
    font-size: .72rem;
    color: var(--text-muted);
}

.globe-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .66rem;
    font-weight: 700;
    padding: .1rem .45rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 3px;
    white-space: nowrap;
}

.globe-tools {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
}

.globe-btn {
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .38rem .55rem;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.globe-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.globe-btn.is-on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

/* 全屏态：铺满视口。选择器带 id，压得过 Tailwind 那串单类工具类（max-w-6xl / h-[88vh] …），
   不必逐个 classList.remove，退出时删掉这一个类就干净还原。 */
#globe-dialog.is-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.globe-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .3rem;
}

.globe-icon-btn svg { width: 1rem; height: 1rem; }

.globe-body {
    flex: 1;
    display: flex;
    gap: .75rem;
    min-height: 0;
    /* 抽屉在窄屏是横过来摞在球下面的，内容比分到的高度多时会溢出去盖住页脚，
       这里夹死；抽屉自己的正文区有滚动条。 */
    overflow: hidden;
    position: relative;
}

@media (max-width: 1023px) {
    .globe-body { flex-direction: column; }
}

/* ── 球体舞台 ─────────────────────────────────────────────────────────── */
.globe-field {
    flex: 1 1 auto;
    min-width: 0;
    /* 不能用 min-height:auto：舞台尺寸是 JS 按容器算的，容器再反过来被舞台撑高
       就会自激，球会一路长到把页脚挤出画面。 */
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.globe-stage {
    /* 尺寸由 globe.js 的 fitStage() 按可用宽高的短边写成 px。
       投影按正方形画布推导（project 里长宽比恒为 1），用 CSS 的 aspect-ratio
       去凑会在高度不够时被 max-height 压扁，画面直接拉变形。 */
    position: relative;
    width: 320px;
    height: 320px;
    touch-action: pan-y;
    cursor: grab;
}
.globe-stage[data-dragging] { cursor: grabbing; }

.globe-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.globe-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.globe-leaders {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.globe-leader {
    stroke: var(--accent);
    stroke-width: 1;
    opacity: .38;
    visibility: hidden;
}

.globe-label {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .16rem .4rem;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity .18s, color .15s, border-color .15s;
}
.globe-label.is-on { visibility: visible; opacity: 1; }
.globe-label:hover { color: var(--accent); border-color: var(--accent); }
.globe-label.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.globe-label i {
    font-style: normal;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .6rem;
    opacity: .6;
}

.globe-controls {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    display: flex;
    gap: .25rem;
    z-index: 5;
}

.globe-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    text-align: center;
    padding: 1rem;
    background: var(--veil);
    font-size: .76rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.globe-spinner {
    width: 1.8rem;
    height: 1.8rem;
    border: 3px solid var(--accent-line);
    border-top-color: transparent;
    border-radius: 50%;
    animation: globe-spin .9s linear infinite;
}

@keyframes globe-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .globe-spinner { animation-duration: 3s; }
}

/* ── 侧栏 ─────────────────────────────────────────────────────────────── */
.globe-drawer {
    width: 340px;
    flex: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .globe-drawer { width: 100%; flex: 0 1 auto; min-height: 0; max-height: 38vh; }
}

.globe-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .65rem;
    background: var(--accent-bg);
    color: var(--accent-fg);
    font-size: .75rem;
    font-weight: 800;
}

.globe-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: .65rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.globe-drawer-card {
    padding: .55rem .65rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 4px;
}

.globe-drawer-name { font-size: .95rem; font-weight: 800; color: var(--accent); }

.globe-drawer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .3rem;
    font-size: .68rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.globe-drawer-cap {
    display: block;
    margin-bottom: .35rem;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.globe-chips { display: flex; flex-wrap: wrap; gap: .25rem; }

.globe-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .14rem .4rem;
    font-size: .68rem;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.globe-chip:hover { color: var(--accent); border-color: var(--accent-line); }
.globe-chip i {
    font-style: normal;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .58rem;
    opacity: .6;
}

.globe-articles { display: flex; flex-direction: column; gap: .35rem; }

.globe-art {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    width: 100%;
    padding: .45rem .55rem;
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .15s;
}
.globe-art:hover { border-color: var(--accent); }

.globe-art-title {
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.globe-art-meta {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .62rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.globe-hint {
    padding: 1.2rem .5rem;
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted);
}

/* 报眉上的入口：把「全球要闻」变成可点的链接，但不要看起来像条外链 */
.masthead .sub-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dotted currentColor;
    padding-bottom: 1px;
    transition: opacity .15s;
}
.masthead .sub-link:hover { opacity: .68; }

/* Tailwind 的 .hidden 与上面这些 display:flex 同为单类选择器，谁后加载谁赢；
   CDN 版 Tailwind 是运行时注入的，顺序不可控，这里显式压一道。 */
.globe-overlay.hidden,
.globe-drawer.hidden { display: none; }
