/* --- START OF FILE text/css --- */

/**
 * ==========================================================================================
 * [ARCH: ARISTIA TAG PROTOCOL v3.1]
 * [FILE: main.css]
 * [DESC: 中央样式表 - 包含核心变量、UI组件与动画引擎]
 * ==========================================================================================
 */

/* ==========================================================================
 * [MODULE: Core.Variables]
 * ========================================================================== */
:root {
    /* Palette */
    --bg-core: #0f1115;
    --bg-card: #161b22;
    --border-dim: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-dim: #484f58;
    
    /* Factions */
    --faction-dragon: #da3633; 
    --faction-loying: #238636; 
    --faction-uda: #d29922;    
    --faction-neutral: #58a6ff;
    --faction-empire: #ffffff;
    --faction-unknown: #7d8a96;

    /* [新增] Faction RGB Variants for rgba() */
    --faction-dragon-rgb: 218, 54, 51;
    --faction-loying-rgb: 35, 134, 54;
    --faction-uda-rgb: 210, 153, 34;
    --faction-neutral-rgb: 88, 166, 255;
    --faction-empire-rgb: 255, 255, 255;
    --faction-unknown-rgb: 125, 138, 150;

    /* Motion */
    --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-tactical: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Card Visuals */
    --main-bar-width-dormant: 3px;
    --main-bar-width-active:  4px;
    --main-corner-size-dormant: 24px;
    --main-corner-size-active:  26px;
    --main-corner-opacity-dormant: 60%; 
    --main-corner-opacity-active: 0%;

    --sub-bar-width-dormant: 2px;
    --sub-bar-width-active:  4px;
    --sub-corner-size-dormant: 11px;
    --sub-corner-size-active:  12px;
    --sub-corner-opacity-dormant: 20%;
    --sub-corner-opacity-active:  0%;
    
    /* Filters */
    --card-dormant-opacity: 0.75;
    --card-dormant-saturate: 0.3;
    --card-active-opacity: 1;
    --card-active-saturate: 1.1;
    --card-dormant-border: 0.4;
}

/* ==========================================================================
 * [MODULE: Core.Base]
 * ========================================================================== */
* { box-sizing: border-box; }

body {
    background-color: var(--bg-core);
    background-image: 
        radial-gradient(circle at 50% 20%, #1b2028 0%, transparent 80%),
        radial-gradient(#30363d 1.5px, transparent 1.5px);
    background-size: 100% 100%, 50px 50px; 
    background-attachment: scroll, fixed; 
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Segoe UI', monospace; 
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-core); }
::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--faction-neutral); }

.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px;
    border-left: 1px dashed rgba(255, 255, 255, 0.03);
    border-right: 1px dashed rgba(255, 255, 255, 0.03);
    min-height: 100vh; 
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

.system-loader {
    color: var(--text-secondary);
    font-family: monospace;
    padding: 20px;
}

/* ==========================================================================
 * [MODULE: UI.Header]
 * ========================================================================== */
.federal-header {
    background: rgba(15, 17, 21, 0.95);
    border-bottom: 1px solid var(--border-dim);
    padding: 0 40px; 
    height: 70px;    
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 右侧工具栏容器 (Filter + Menu) */
.header-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0; /* 禁止被压缩 */
}

.logo-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 200px; 
}

.logo-block h1 {
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.logo-block .status-line {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--faction-loying);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--faction-loying);
    animation: blink 2s infinite;
}

/* PC Navigation */
.nav-group {
    display: flex;
    align-items: stretch; 
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 0;
    height: 40px; 
    overflow: hidden; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); 
}

.nav-btn {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-dim); 
    color: var(--text-secondary);
    padding: 0 24px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:last-child { border-right: none; }

.nav-btn:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--text-primary);
    color: #000; 
    text-shadow: none;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0; 
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #000;
}

.mobile-nav-toggle { display: none; }

/* ==========================================================================
 * [MODULE: UI.CardSystem]
 * ========================================================================== */
/* ...Cards样式与之前保持一致，为节省空间，此处省略未修改部分... */
/* 请保留原来的 CardSystem 代码 */

.data-card {
    background-color: var(--bg-card);
    border: none;
    background-image: 
        linear-gradient(135deg, color-mix(in srgb, var(--faction-color), transparent var(--main-corner-opacity-dormant)) 50%, transparent 50.5%),
        linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03));
    background-size: var(--main-corner-size-dormant) var(--main-corner-size-dormant), cover;
    background-position: top left, center;
    background-repeat: no-repeat, no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); 
    --faction-color: var(--faction-neutral); 
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    opacity: 0; 
    filter: saturate(var(--card-dormant-saturate)) opacity(var(--card-dormant-opacity));
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-size 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, box-shadow 0.3s ease;
}

.data-card:hover {
    transform: translateY(-4px);
    filter: saturate(var(--card-active-saturate)) opacity(var(--card-active-opacity));
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.2);
    background-color: #1c2128;
    z-index: 10;
    background-image: 
        linear-gradient(135deg, color-mix(in srgb, var(--faction-color), transparent var(--main-corner-opacity-active)) 50%, transparent 50.5%),
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06));
    background-size: var(--main-corner-size-active) var(--main-corner-size-active), cover;
}

.data-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; 
    background: var(--faction-color);
    z-index: 2;
    opacity: var(--card-dormant-border);
    width: var(--main-bar-width-dormant);
    transition: all 0.3s var(--ease-out-back);
}
.data-card:hover::before { opacity: 1; width: var(--main-bar-width-active); box-shadow: 0 0 15px var(--faction-color); }

.data-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 25px; height: 25px;
    border-top: 2px solid var(--faction-color);
    border-right: 2px solid var(--faction-color);
    pointer-events: none;
    z-index: 2;
    opacity: var(--card-dormant-border);
    background: transparent;
    transition: all 0.4s ease;
}
.data-card:hover::after {
    opacity: 1; transform: translate(-3px, 3px); 
    border-color: color-mix(in srgb, var(--faction-color), #fff 50%);
    filter: drop-shadow(0 0 2px var(--faction-color));
}

.card-bg-abbr {
    position: absolute; top: -18px; right: -5px; 
    font-size: 5.5rem; font-weight: 900; font-family: 'Impact', sans-serif;
    color: rgba(255,255,255,0.03); pointer-events: none; z-index: 0;
    letter-spacing: 2px; line-height: 1; transition: all 0.5s;
}
.data-card:hover .card-bg-abbr { opacity: 0.08; transform: scale(1.1) translateX(-10px); }

.card-header {
    padding: 12px 24px; border-bottom: 1px dashed rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1; opacity: 0.9;
}
.id-code {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.85rem;
    color: var(--faction-color); filter: brightness(0.8); transition: all 0.3s ease;
}
.data-card:hover .id-code { filter: brightness(1.2) drop-shadow(0 0 5px var(--faction-color)); letter-spacing: 1px; }
.clearance-tag { font-family: 'JetBrains Mono', monospace; color: var(--text-dim); font-size: 0.7rem; }

.card-body {
    padding: 10px 24px; flex-grow: 1; display: flex; flex-direction: column; position: relative;
}
.card-main-row {
    display: flex; justify-content: space-between; align-items: center; 
    gap: 15px; margin-bottom: 12px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1); min-height: 80px; 
}
.card-text-group { flex: 1; min-width: 0; align-self: flex-end; padding-bottom: 4px; }

.entity-name {
    font-size: 1.4rem; color: var(--text-primary); opacity: 0.85; margin: 0;
    line-height: 1; font-weight: 800; letter-spacing: 0.5px; 
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); transform: translateZ(0);
}
.data-card:hover .entity-name {
    opacity: 1; color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateX(4px) scale(1.02); 
}

.entity-name-en {
    font-size: 0.75rem; color: var(--text-secondary); margin: 6px 0 12px 0;
    font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-transform: uppercase; opacity: 0.5; transition: all 0.4s ease;
    display: block; transform-origin: left center;
}
.data-card:hover .entity-name-en {
    opacity: 1; color: var(--faction-color); transform: translateX(4px);
    text-shadow: 0 0 5px var(--faction-color);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tag {
    font-size: 0.65rem; padding: 2px 6px; background: rgba(255,255,255,0.05);
    border: 1px solid color-mix(in srgb, var(--faction-color), transparent 70%);
    color: color-mix(in srgb, var(--faction-color), #fff 60%);
    border-radius: 2px; opacity: 0.7; transition: opacity 0.3s;
}
.data-card:hover .tech-tag { opacity: 1; }

.card-logo-container {
    flex-shrink: 0; width: 100px; height: 80px; 
    display: flex; align-items: center; justify-content: flex-end; padding: 1px 0;
}
.card-logo-container img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.8)) contrast(1.1);
}
.logo-text-fallback {
    font-size: 3.5rem; font-weight: 50; color: rgba(255,255,255,0.06);
    font-family: 'Impact', sans-serif; line-height: 0.8; transform: translateX(10px); 
}

.card-desc-box {
    font-size: 0.85rem; line-height: 1.6; margin-top: 15px;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-secondary); opacity: 0.6; filter: blur(0.6px);
    transform: translateZ(0); transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.data-card:hover .card-desc-box { opacity: 1; color: var(--text-primary); filter: blur(0); }

.card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px 0 24px; background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1); z-index: 1;
    height: 14px; overflow: hidden; 
    transition: height 0.4s var(--ease-tactical), background 0.3s ease, padding 0.3s ease;
}
.data-card:hover .card-footer {
    height: 42px; padding: 12px 40px 12px 24px; 
    background: color-mix(in srgb, var(--faction-color), #050607 90%);
    border-top: 1px solid color-mix(in srgb, var(--faction-color), transparent 50%);
}

.card-footer .leader-info, .card-footer > div > span:not(.child-indicator) { 
    opacity: 0; transform: translateY(20px); 
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 0.75rem; font-weight: 500; margin-right: -5px; 
}
.data-card:hover .card-footer .leader-info, .data-card:hover .card-footer > div > span:not(.child-indicator) {
    opacity: 1; transform: translateY(0); transition-delay: 0.05s;
}

.child-indicator {
    position: relative; color: var(--faction-color); margin-left: 5px; margin-right: -10px;
    font-size: 0.5rem; opacity: 0.4; animation: none; transform-origin: center right;
    transition: all 0.4s var(--ease-out-back);
}
.child-indicator.has-data { opacity: 1; }
.data-card:hover .child-indicator { opacity: 1; animation: blink 2s infinite; transform: translateX(0); }

.data-card:not(.focus-children-grid .data-card) .child-indicator {
    font-size: 0.9rem !important; margin-right: 0px !important; margin-left: 8px !important;
}
.data-card:not(.focus-children-grid .data-card):hover .child-indicator { font-size: 1.1rem !important; }

/* ==========================================================================
 * [MODULE: UI.FocusSystem]
 * ========================================================================== */
.focus-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
    background-color: rgba(10, 12, 16, 0.85); 
    background-image: 
        radial-gradient(circle at center, transparent 50%, #000 120%),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 3px; 
    backdrop-filter: blur(8px); padding: 40px; overflow-y: auto; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease; display: flex; flex-direction: column; align-items: center;
}
.focus-overlay.active { opacity: 1; pointer-events: auto; }

.focus-header-card {
    width: 100%; max-width: 1000px;
    background-image: 
        linear-gradient(135deg, var(--faction-color) 50%, transparent 50.5%),
        radial-gradient(circle at 12px 12px, color-mix(in srgb, var(--faction-color), transparent 90%) 0%, transparent 35px),
        linear-gradient(180deg, #1c2128 0%, #161b22 100%);
    background-size: 26px 26px, 100px 100px, cover; 
    background-position: top left, top left, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    box-shadow: inset 0 0 0 1px var(--border-dim), 0 40px 80px rgba(0,0,0,0.6);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    padding: 0; margin-bottom: 40px; position: relative; transform: translateY(-20px);
    transition: transform 0.4s var(--ease-out-back); filter: none; opacity: 1;
}
.focus-overlay.active .focus-header-card { transform: translateY(0); }

.focus-header-card::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 0;
    background: var(--faction-color); z-index: 10; width: 4px; box-shadow: 0 0 10px var(--faction-color);
}
.focus-header-card::after {
    content: ''; position: absolute; top: 0; right: 0; width: 40px; height: 40px;
    border-top: 3px solid var(--faction-color); border-right: 3px solid var(--faction-color);
    z-index: 10; pointer-events: none; opacity: 0.6;
}

.focus-top-bar {
    display: flex; justify-content: flex-end; padding: 10px 15px 10px 40px; 
    background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border-dim);
}
.focus-close-mini {
    background: transparent; border: 1px solid transparent; color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; cursor: pointer;
    padding: 6px 12px; letter-spacing: 1px; transition: all 0.2s; border-radius: 2px;
}
.focus-close-mini:hover { color: #fff; background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }

.focus-content-layout { display: flex; padding: 40px 50px; gap: 50px; align-items: flex-start; }
.focus-text-col { flex: 1; }
.focus-title { font-size: 2.5rem; margin: 0; color: #fff; line-height: 1.1; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.focus-subtitle { font-size: 1rem; color: var(--text-secondary); margin: 8px 0 25px 0; text-transform: uppercase; letter-spacing: 0.5px; font-family: monospace; }
.focus-desc { font-size: 1.05rem; line-height: 1.8; color: #ccc; padding-left: 25px; border-left: 2px solid var(--border-dim); margin-top: 25px; }

.focus-logo-col { 
    flex-shrink: 0; width: 200px; display: flex; flex-direction: column;
    justify-content: flex-end; align-items: flex-end; opacity: 0.9;
}
.focus-logo-fallback {
    font-size: 5rem; font-weight: 50; font-family: 'Impact', 'Arial Black', sans-serif;
    color: var(--faction-color); opacity: 0.15; line-height: 0.8; letter-spacing: 2px;
    -webkit-text-stroke: 1px rgba(255,255,255,0.1);
}
.focus-logo-img { width: 100%; object-fit: contain; filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6)); }

.focus-meta-row {
    padding: 20px 50px; background: rgba(0,0,0,0.25); border-top: 1px solid var(--border-dim);
    display: flex; justify-content: flex-start; gap: 60px; font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem; color: var(--text-secondary); padding-right: 60px; 
}
.meta-item { display: flex; align-items: center; gap: 10px; }
.meta-item strong { color: var(--text-primary); font-weight: 600; }
.focus-meta-row strong[style*="color"] { opacity: 0.8; }


/* ==========================================================================
 * [MODULE: Engine.Animation]
 * ========================================================================== */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes tactical-deploy { 0% { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(4px); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes tactical-retreat { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px) scale(0.95); filter: blur(2px); } }

.anim-enter { animation: tactical-deploy 0.5s var(--ease-tactical) forwards; transform-origin: center top; }
.anim-leave { animation: tactical-retreat 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important; }

/* ==========================================================================
 * [MODULE: UI.FilterSystem]
 * ========================================================================== */
.filter-btn-main {
    height: 40px; padding: 0 20px; display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.4); border: 1px solid var(--faction-neutral); color: var(--faction-neutral);
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.filter-btn-main::before {
    content: ''; display: block; width: 12px; height: 12px; background-color: currentColor;
    clip-path: polygon(0 0, 100% 0, 60% 60%, 60% 100%, 40% 100%, 40% 60%);
}
.filter-btn-main:hover {
    background: rgba(88, 166, 255, 0.1); box-shadow: 0 0 15px rgba(88, 166, 255, 0.2); transform: translateY(-1px);
}
.filter-btn-main.active {
    background: var(--faction-uda); border-color: var(--faction-uda); color: #000;
    box-shadow: 0 0 20px rgba(210, 153, 34, 0.4); animation: pulse-border 2s infinite;
}
.filter-count:not(:empty)::before { content: '['; }
.filter-count:not(:empty)::after { content: ']'; }

.filter-count {
    background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 2px; font-size: 0.7rem;
}
.filter-btn-main.active .filter-count { background: rgba(0,0,0,0.6); color: #fff; }

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(210, 153, 34, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(210, 153, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(210, 153, 34, 0); }
}

.filter-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 2000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}
.filter-overlay.active { opacity: 1; pointer-events: auto; }

.filter-panel {
    width: 90%; max-width: 500px; background: rgba(15, 17, 21, 0.95);
    border: 1px solid var(--border-dim); box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
    transform: translateY(20px); transition: transform 0.3s var(--ease-out-back); display: flex; flex-direction: column;
}
.filter-overlay.active .filter-panel { transform: translateY(0); }

.filter-header {
    padding: 15px 20px; border-bottom: 1px solid var(--border-dim); display: flex;
    justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02);
}
.filter-header h3 { margin: 0; font-size: 0.9rem; color: var(--text-primary); letter-spacing: 1px; }
.filter-close {
    background: none; border: none; color: var(--text-dim); cursor: pointer; font-family: inherit; font-size: 0.8rem;
}
.filter-close:hover { color: #fff; }

.filter-body { padding: 25px; display: flex; flex-wrap: wrap; gap: 10px; min-height: 100px; }

.filter-option-btn {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border-dim); color: var(--text-secondary);
    padding: 8px 16px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
    font-family: inherit; position: relative; overflow: hidden;
}
.filter-option-btn.selected {
    background: color-mix(in srgb, var(--faction-neutral), transparent 85%); border-color: var(--faction-neutral);
    color: var(--faction-neutral); box-shadow: 0 0 8px color-mix(in srgb, var(--faction-neutral), transparent 80%);
}
.filter-option-btn.selected::after {
    content: ''; position: absolute; top: 0; right: 0; width: 6px; height: 6px;
    background: var(--faction-neutral); clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.filter-actions {
    padding: 15px 20px; border-top: 1px solid var(--border-dim); display: flex;
    justify-content: flex-end; gap: 10px; background: rgba(0,0,0,0.2);
}
.action-btn {
    padding: 8px 20px; font-size: 0.8rem; cursor: pointer; font-family: inherit; font-weight: 600;
    transition: all 0.2s; border-radius: 2px;
}
.action-btn.reset { background: transparent; border: 1px solid transparent; color: var(--text-dim); }
.action-btn.reset:hover { color: var(--text-secondary); }

.action-btn.apply { background: var(--text-primary); border: 1px solid var(--text-primary); color: #000; }
.action-btn.apply:hover { background: #fff; box-shadow: 0 0 15px rgba(255,255,255,0.3); }

/* ==========================================================================
 * [MODULE: UI.Mobile]
 * @Desc:    移动端适配 (Handheld Device Protocol)
 * @Type:    UI
 * @Deps:    None
 * ========================================================================== */

/* [新增] 移动端菜单遮罩层 */
.mobile-menu-overlay {
    display: none; /* 默认隐藏 */
    position: fixed;
    /* [关键] 从 Header 下方开始遮挡 (70px 是 Header 的高度) */
    /* 这样用户点击 Header 区域(如Logo)时不会被遮罩挡住，体验更自然 */
    /* 如果你想全屏遮挡，就保持 top: 0 */
    top: 70px; 
    left: 0; right: 0; bottom: 0;
    
    background: rgba(0,0,0,0.5); /* 半透明遮罩 */
    z-index: 90; /* 放在 Header(100) 之下，但内容(1)之上 */
    backdrop-filter: blur(2px);
    
    /* [关键] 确保拦截点击事件 */
    touch-action: none; 
}
.mobile-menu-overlay.active { display: block; }

@media screen and (max-width: 768px) {
    .main-container { padding: 20px 10px; }
    .card-grid { grid-template-columns: 1fr; gap: 15px; }
    .data-card { min-width: 0; width: 100%; }
    
    .federal-header {
        flex-wrap: wrap;     
        padding: 15px;
        align-items: center;
        /* [关键修复] 强制两端对齐，Logo在左，工具栏在右 */
        justify-content: space-between; 
        height: auto; 
    }
    
    .logo-block { 
        min-width: 0; /* 允许压缩 */
        flex: 1; /* 占据剩余空间 */
        margin-right: 10px;
    }
    
    .mobile-nav-toggle {
        display: block;
        margin-left: 0; /* 不需要 auto，因为外层容器已经flex处理了 */
        background: transparent;
        border: 1px solid var(--faction-neutral);
        color: var(--faction-neutral);
        padding: 8px 12px;
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.8rem;
        cursor: pointer;
        text-transform: uppercase;
        transition: all 0.3s ease;
    }
    .mobile-nav-toggle:active { background: var(--faction-neutral); color: #000; }

    /* Reset PC "Tactical Bar" */
    .nav-group {
        width: 100%;
        order: 3;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        
        /* --- 关闭状态 (Exit State) --- */
        max-height: 0; 
        opacity: 0;
        margin-top: 0;
        
        /* 1. 减少位移距离 (-20px -> -5px)，减少视觉上的"上浮"感 */
        transform: translateY(-5px); 
        
        overflow: hidden; 
        pointer-events: none;
        
        /* Reset Container Styles */
        background: transparent;
        border: none;
        box-shadow: none;
        height: auto;
        padding: 0;

        /* 2. [关键] 关闭时的动画：要快！线性！不要回弹！ */
        /* Opacity 最快，Height 其次，Transform 几乎不重要 */
        transition: 
            max-height 0.3s ease-out,
            opacity 0.2s ease-out,
            margin-top 0.3s ease,
            transform 0.3s ease;
    }

    .nav-group.active {
        /* --- 打开状态 (Enter State) --- */
        max-height: 300px; 
        opacity: 1;
        margin-top: 15px;
        transform: translateY(0);
        pointer-events: auto;

        /* 3. [关键] 打开时的动画：保持之前的战术回弹质感 */
        /* 这里重写了 transition，会覆盖掉上面的关闭动画设置 */
        transition: 
            max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.4s ease,
            margin-top 0.4s ease,
            transform 0.4s var(--ease-out-back);
    }
    
    .nav-btn {
        width: 100%; border: 1px solid var(--border-dim); background: rgba(0,0,0,0.5);
        border-radius: 4px; min-height: 45px; color: var(--text-secondary);
        font-size: 0.75rem; padding: 10px; display: flex; align-items: center; justify-content: center;
    }

    .nav-btn:last-child { border-right: 1px solid var(--border-dim); }
    .nav-btn.active::after { display: none; }
    
    .nav-btn.active {
        background: var(--bg-card); color: var(--text-primary); border-color: var(--text-primary); box-shadow: none;
    }

    

    /* Mobile Focus & Filter Adjustments */
    .focus-overlay { padding: 10px; backdrop-filter: blur(15px); }
    .focus-header-card { 
        clip-path: 
            polygon(20px 0, 100% 0, 100% 
            calc(100% - 15px), 
            calc(100% - 15px) 100%, 0 100%, 0 20px); 
        margin-bottom: 20px; }
    .focus-top-bar { padding: 10px 10px 10px 30px; }
    .focus-content-layout { 
        flex-direction: column; 
        padding: 25px 20px; /* 这个padding导致了问题 */
        gap: 10px; 
    }
    .focus-logo-col { 
        width: 100%; 
        flex-direction: row; 
        justify-content: flex-end; 
        align-items: center; 
        order: -1; 
        margin-bottom: 5px; 
        border-bottom: 1px dashed rgba(255,255,255,0.1); 
        padding-bottom: 10px;
        
        /* [最终修正] 强制重置高度，让其自适应内容 */
        height: auto; 
        margin-top: -20px
    }
    .focus-logo-img { max-height: 70px; margin-right: 5px; }
    .focus-logo-fallback { font-size: 5rem; text-align: right; width: 100%; display: block; }
    .focus-text-col {
        width: 100%;
        /* [新增] 重置flex属性，使其高度由内容决定，不再拉伸 */
        flex: initial;
    }

    
    .focus-title { font-size: 1.8rem; word-wrap: break-word; }
    .focus-subtitle { font-size: 0.85rem; margin-bottom: 15px; }
    .focus-desc { font-size: 0.9rem; padding-left: 15px; margin-top: 15px; border-left-width: 2px; }
    .focus-meta-row { flex-direction: column; gap: 12px; padding: 20px; padding-right: 30px; align-items: stretch; }
    .meta-item { justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 5px; }
    .meta-item:last-child { border-bottom: none; }
    .filter-panel { width: 95%; }
    .focus-children-grid { grid-template-columns: 1fr; gap: 20px; }
    .focus-children-grid .data-card { min-height: auto; }
    .focus-children-grid .data-card:hover { transform: none; }
}

/* ==========================================================================
 * [MODULE: UI.Mobile] - END
 * ========================================================================== */

 /* ==========================================================================
 * [MODULE: UI.SubSystem]
 * @Desc:    聚焦模式下的子卡片样式覆盖 (Sub-Entity Cards)
 * @Type:    UI
 * @Deps:    UI.CardSystem
 * ========================================================================== */

/* 子卡片网格容器 */
.focus-children-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px; 
    width: 100%; 
    max-width: 1000px;
}

/* 1. 子卡片基础样式重置 */
.focus-children-grid .data-card {
    min-height: 160px; /* 子卡片较矮 */
    
    /* [核心还原] 背景样式：静态、暗淡、细纹理 */
    background-image: 
        linear-gradient(135deg, color-mix(in srgb, var(--faction-color), transparent var(--sub-corner-opacity-dormant)) 50%, transparent 50.5%),
        linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03)) !important; /* 强制覆盖主卡片背景 */
    
    /* 使用子系统变量定义的尺寸 (11px/12px) */
    background-size: var(--sub-corner-size-dormant) var(--sub-corner-size-dormant), cover !important;
    
    /* 边框更细淡 */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none; 
    
    /* 切角更小 (10px) */
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    
    /* 动画参数覆盖 */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
            background-image 0.3s, 
            background-size 0.3s ease-out, 
            border-color 0.3s !important;
    
    /* 滤镜参数覆盖：更暗 */
    --card-dormant-opacity: 0.6;
    --card-dormant-saturate: 0.1;
}

/* 2. 子卡片悬停状态 */
.focus-children-grid .data-card:hover,
.focus-children-grid .data-card.mobile-touch-active {
    transform: translateX(5px); /* 仅横向位移，不再上浮 */
    
    /* 悬停背景：变亮 */
    background-image: 
        linear-gradient(135deg, color-mix(in srgb, var(--faction-color), transparent var(--sub-corner-opacity-active)) 50%, transparent 50.5%),
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)) !important;
        
    background-size: var(--sub-corner-size-active) var(--sub-corner-size-active), cover !important;
    border-color: rgba(255, 255, 255, 0.2);
}

/* 3. 装饰元素覆盖 (Before/After) */

/* 左侧条：变细，且增加顶部小横杠效果 */
.focus-children-grid .data-card::before {
    width: var(--sub-bar-width-dormant); /* 2px */
    opacity: 0.7;
    box-shadow: 2px 0 10px var(--faction-color); /* 弱光 */
    transition: width 0.3s var(--ease-out-back), opacity 0.3s ease;
}
.focus-children-grid .data-card:hover::before {
    width: var(--sub-bar-width-active); /* 4px */
    box-shadow: 0 0 8px var(--faction-color);
}

/* 顶部横线：完全重写 After 伪元素 */
.focus-children-grid .data-card::after {
    display: block; 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px; 
    /* 渐变横线 */
    background: linear-gradient(90deg, var(--faction-color), transparent 60%);
    border: none; /* 移除主卡片的直角标 */
    width: 100%;
    opacity: 0.5;
    filter: none;
    transform: none; 
}
.focus-children-grid .data-card:hover::after {
    opacity: 1;
    box-shadow: 0 0 10px var(--faction-color);
}

/* 4. 内容排版覆盖 */

/* 头部：简化 */
.focus-children-grid .card-header {
    padding: 8px 15px;
    background: transparent;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.65rem;
    opacity: 0.7;
}

/* 主体：紧凑 */
.focus-children-grid .card-body { padding: 12px 15px; }
.focus-children-grid .card-main-row { margin-bottom: 8px; padding-bottom: 8px; min-height: auto; }

/* 标题：变小，加粗 */
.focus-children-grid .entity-name {
    font-size: 1.1rem; 
    opacity: 0.95; 
    color: #c7c7c7;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
}
.focus-children-grid .data-card:hover .entity-name {
    transform: translateX(4px) scale(1.02);
    text-shadow: 0 0 8px var(--faction-color);
}

/* 英文名：更淡 */
.focus-children-grid .entity-name-en { opacity: 0.7; font-size: 0.7rem; }

/* Logo：大幅缩小 */
.focus-children-grid .card-logo-container { width: 50px; height: 50px; opacity: 0.8; }
.focus-children-grid .logo-text-fallback { font-size: 2rem; }

/* 背景大水印：隐藏 */
.focus-children-grid .card-bg-abbr { display: none; }

/* 描述文本：只显示摘要 */
.focus-children-grid .card-desc-box {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    line-clamp: 2; 
    margin-top: 8px;
    color: var(--text-primary);
    border-top: none;
    padding-top: 0;
    opacity: 0.4; 
    transition: opacity 0.3s ease;
}
.focus-children-grid .data-card:hover .card-desc-box { opacity: 1; color: var(--text-primary); }

/* 5. 底部栏 (Footer) 覆盖 - 解决对齐问题 */

.focus-children-grid .card-footer {
    padding: 0 15px 0 15px !important; 
    background: rgba(0,0,0,0.2);
    font-size: 0.65rem;
}
.focus-children-grid .data-card:hover .card-footer {
    padding: 6px 15px 6px 15px !important;
}

/* 6. 指示器符号 (>>>) 覆盖 */
/* 必须重置 margin，因为主卡片有负 margin */
.focus-children-grid .child-indicator {
    margin-left: 4px !important; 
    margin-right: 0px !important;
    font-size: 0.8rem !important; 
}
.focus-children-grid .data-card:hover .child-indicator { font-size: 1.0rem !important; }

/* 重置状态文字的 margin */
.focus-children-grid .card-footer > div > span:not(.child-indicator) { margin-right: 0 !important; }

.focus-children-grid .card-footer .leader-info { font-size: 0.7rem; }

/* [PATCH] 防止关闭时的动画闪烁 */
#focus-overlay:not(.active) .data-card { transition: none !important; }

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .focus-children-grid { grid-template-columns: 1fr; gap: 20px; }
    .focus-children-grid .data-card { min-height: auto; }
    .focus-children-grid .data-card:hover { transform: none; }
}

/* [文件: main.css] */

/* ==========================================================================
 * [MODULE: UI.Component.ExternalLink]
 * @Desc:    聚焦模式下的外部链接按钮
 * @Type:    UI
 * ========================================================================== */

.focus-external-link {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    
    background: rgba(var(--faction-color-rgb), 0.1); /* 使用RGB变体以支持透明度 */
    border: 1px solid var(--faction-color);
    color: var(--faction-color);

    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.focus-external-link:hover {
    background: var(--faction-color);
    box-shadow: 0 5px 15px rgba(var(--faction-color-rgb), 0.3);
    color: #000;
    transform: translateY(-2px);
}

/* 在按钮文字后添加一个 ">>>" 符号，增强视觉效果 */
.focus-external-link::after {
    content: '>>>';
    margin-left: 10px;
    opacity: 0.6;
    transition: all 0.2s ease-out;
}

.focus-external-link:hover::after {
    opacity: 1;
    transform: translateX(3px);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .focus-external-link {
        /* 在移动端，logo列在顶部，按钮自然在logo下方，只需调整边距 */
        position: static;
        margin: 15px 0 0 0; /* 仅保留上边距 */
        width: 100%; /* 宽度占满父容器 */
        justify-content: center; /* 文本居中 */
    }
}