/* ===============================================
   可视化大屏增强样式 - 粒子效果与高级动画
   =============================================== */

/* ===============================================
   粒子背景效果
   =============================================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===============================================
   增强动画效果集合
   =============================================== */

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 缩放弹出动画 */
.pop-in {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* 滑动进入动画 */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 闪烁发光效果 */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* 边框流动动画 */
.border-flow {
    position: relative;
    overflow: hidden;
}

.border-flow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--glow-cyan), transparent);
    animation: borderFlow 2s linear infinite;
}

/* 浮动动画 */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 摇晃动画 - 用于警告 */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 旋转动画 */
.spin-slow {
    animation: spin 3s linear infinite;
}

/* 数据流动画背景 */
.data-flow-bg {
    position: relative;
    overflow: hidden;
}

.data-flow-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,210,255,0.1), transparent);
    animation: dataFlow 3s linear infinite;
}

@keyframes dataFlow {
    0% { left: -50%; }
    100% { left: 150%; }
}

/* ===============================================
   通知提示样式
   =============================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, rgba(0,255,170,0.9), rgba(0,200,150,0.9));
    border: 1px solid var(--success);
}

.notification.error {
    background: linear-gradient(135deg, rgba(255,68,68,0.9), rgba(200,50,50,0.9));
    border: 1px solid var(--danger);
}

.notification.warning {
    background: linear-gradient(135deg, rgba(255,180,0,0.9), rgba(200,150,0,0.9));
    border: 1px solid var(--warning);
}

.notification.info {
    background: linear-gradient(135deg, rgba(0,136,255,0.9), rgba(0,100,200,0.9));
    border: 1px solid var(--glow-blue);
}

/* ===============================================
   加载动画
   =============================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2,13,31,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--glow-cyan);
    border-right-color: var(--glow-blue);
    border-radius: 50%;
    animation: loadingSpin 1s linear infinite;
}

@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--text-accent);
    font-size: 14px;
    letter-spacing: 2px;
    animation: loadingText 1.5s ease-in-out infinite;
}

@keyframes loadingText {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===============================================
   数据卡片增强效果
   =============================================== */
.stat-box {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.stat-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--glow-cyan);
    transition: width 0.3s ease;
}

.stat-box:hover::after {
    width: 100%;
}

/* ===============================================
   收件箱项增强
   =============================================== */
.inbox-item {
    transition: all 0.3s ease;
}

.inbox-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(170,0,255,0.2);
}

.inbox-item.selected {
    border-color: var(--purple-light);
    background: rgba(80,0,150,0.4);
    box-shadow: 0 0 20px rgba(170,0,255,0.4);
}

/* ===============================================
   解密结果项增强
   =============================================== */
.result-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item:hover {
    transform: translateX(5px);
    border-color: var(--glow-cyan);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,210,255,0.1), transparent);
    transition: left 0.5s ease;
}

.result-item:hover::before {
    left: 100%;
}

/* ===============================================
   区块链行增强
   =============================================== */
.block-row {
    transition: all 0.3s ease;
}

.block-row:hover {
    transform: translateX(5px);
    border-color: var(--glow-cyan);
}

.tx-row {
    transition: all 0.3s ease;
}

.tx-row:hover {
    transform: translateX(5px);
    border-color: var(--glow-cyan);
}

/* ===============================================
   表格行动画
   =============================================== */
.audit-table tbody tr {
    animation: fadeIn 0.3s ease-out forwards;
}

.audit-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.audit-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.audit-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.audit-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.audit-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.audit-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.audit-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.audit-table tbody tr:nth-child(8) { animation-delay: 0.4s; }

/* ===============================================
   响应式优化
   =============================================== */
@media (max-width: 1400px) {
    .mid-cards { height: 120px; }
    .mc-v { font-size: 22px; }
    .flow-node { width: 90px; min-height: 70px; }
}

@media (max-width: 1200px) {
    .col-l, .col-r { width: 28%; flex: 0 0 28%; }
    .title-cn { font-size: 24px; letter-spacing: 4px; }
    .nav-item { padding: 6px 14px; font-size: 14px; }
}

/* ===============================================
   3D 透视效果
   =============================================== */
.perspective-container {
    perspective: 1000px;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
}

/* ===============================================
   霓虹发光效果
   =============================================== */
.neon-text {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
}

.neon-border {
    box-shadow: 
        0 0 5px var(--glow-cyan),
        inset 0 0 5px var(--glow-cyan);
}

/* ===============================================
   扫描线效果
   =============================================== */
.scan-line {
    position: relative;
    overflow: hidden;
}

.scan-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--glow-cyan), transparent);
    animation: scanMove 2s linear infinite;
}

@keyframes scanMove {
    0% { top: 0; }
    100% { top: 100%; }
}

/* ===============================================
   全息效果
   =============================================== */
.hologram {
    position: relative;
    background: linear-gradient(135deg, rgba(0,210,255,0.1), rgba(0,80,200,0.1));
    border: 1px solid rgba(0,210,255,0.3);
}

.hologram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,210,255,0.03) 2px,
        rgba(0,210,255,0.03) 4px
    );
    pointer-events: none;
}

/* ===============================================
   能量条效果
   =============================================== */
.energy-bar {
    position: relative;
    overflow: hidden;
}

.energy-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: energyFlow 1.5s linear infinite;
}

@keyframes energyFlow {
    0% { left: -50%; }
    100% { left: 150%; }
}

/* ===============================================
   表单布局兜底修复（防止配置区内容溢出遮挡）
   =============================================== */
:root {
    --page-scale: 1;
}

@media (max-width: 1920px) {
    :root { --page-scale: 0.97; }
}

@media (max-width: 1680px) {
    :root { --page-scale: 0.94; }
}

.page,
.col,
.panel,
.panel-body {
    min-height: 0;
}

.panel-body-flex-sm {
    gap: 10px;
    padding: 8px 8px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-body-flex-sm .form-group,
.panel-body-flex-sm .btn-exec {
    flex: 0 0 auto;
}

.panel-body-flex-sm .input-s,
.panel-body-flex-sm textarea.input-s,
.panel-body-flex-sm select.input-s {
    max-width: 100%;
}

textarea.input-s {
    resize: vertical;
    min-height: 72px;
    max-height: 180px;
}

#page-send .panel-body-flex-sm,
#page-send-image .panel-body-flex-sm,
#page-gan .panel-body-flex-sm,
#page-users .panel-body-flex-sm,
#page-admin .panel-body-flex-sm {
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

#send-group-members,
#admin-search-results,
#group-join-requests {
    max-width: 100%;
    overflow-x: hidden;
}

.btn-exec:hover {
    transform: translateY(-2px);
}

/* ===============================================
   表单页高度分配修复（发送/SNR/GAN/用户/管理员）
   =============================================== */
#page-send .col-l > .panel:first-child {
    flex: 1;
}

#page-send .col-l > .panel:last-child {
    flex: 1;
}

#page-send #send-message {
    min-height: 170px;
    max-height: 260px;
}

#page-send-image .col-l > .panel:first-child {
    flex: 1.2;
}

#page-send-image .col-l > .panel:last-child {
    flex: 0.85;
}

#page-gan .col-l > .panel:first-child {
    flex: 1.18;
}

#page-users .col-l,
#page-users .col-r,
#page-admin .col-l {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

#page-users .col-l > .panel,
#page-users .col-r > .panel,
#page-admin .col-l > .panel {
    flex: 0 0 auto;
}

#page-users .col-l > .panel:first-child,
#page-users .col-r > .panel:first-child {
    min-height: 312px;
}

#page-users .col-l > .panel:last-child,
#page-users .col-r > .panel:last-child {
    min-height: 198px;
}

#page-admin .col-l > .panel:nth-child(1) {
    min-height: 338px;
}

#page-admin .col-l > .panel:nth-child(2) {
    min-height: 296px;
}

#page-admin .col-l > .panel:nth-child(3) {
    min-height: 210px;
}

/* ===============================================
   可读性增强覆盖
   =============================================== */
:root {
    --text-main: #e7f4ff;
    --text-dim: #a8cff5;
    --text-accent: #7fe7ff;
}

html,
body {
    font-size: 15px;
}

.title-en {
    font-size: 11px;
    color: #9ec8f4;
}

.header-status-bar {
    font-size: 11px;
    color: #9ac3eb;
}

.nav-item {
    font-size: 15px;
    color: #b3d6f4;
}

.panel-title {
    color: #8feeff;
    font-size: 18px;
}

.text-dim {
    color: #95bee8 !important;
}

.mc-l,
.stat-l,
.form-group label,
.prog-label,
.loading-text,
.qrow,
.pagination,
.cs-label,
.block-row,
.tx-row,
.node-status,
.node-badge,
.btn-page,
.btn-filter {
    font-size: 14px;
}

.nb-title {
    font-size: 22px;
}

.mc-v {
    font-size: 32px;
}

.mc-l,
.stat-l {
    font-size: 15px;
    font-weight: 600;
}

.stat-v {
    font-size: 30px;
}

.mc-l,
.stat-l,
.prog-label,
.qrow,
.pagination,
.cs-label,
.block-row,
.tx-row,
.node-status,
.btn-page,
.btn-filter {
    color: #9ac3eb;
}

.input-s,
.terminal,
.audit-table,
.audit-table th,
.audit-table td,
.result-item,
.inbox-item,
.upload-zone {
    font-size: 14px;
}

.quality-badge,
.result-item,
.inbox-item,
.upload-zone {
    color: #dceeff;
}

.node-badge {
    color: #8feeff;
}

#page-home .panel-body.panel-body-flex > .text-dim,
#page-home .panel-body.panel-body-flex > div > .text-dim {
    font-size: 15px !important;
    font-weight: 600;
}

.prog-pct,
.blk-id,
.blk-node,
.blk-time,
.cs-val,
.file-log-entry,
.quality-badge .qrow,
.audit-table th,
.audit-table td,
.terminal,
.node-card,
.block-row,
.tx-row {
    font-size: 14px;
}

.node-status-tag,
.btn-page,
.btn-filter {
    font-size: 13px;
}

#page-history .audit-stats-panel {
    gap: 4px;
    padding: 0;
    overflow: hidden;
}

#page-history .audit-stat-box {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 48px;
    padding: 6px 10px;
    text-align: left;
    overflow: hidden;
}

#page-history .audit-stat-box .stat-v {
    flex: 0 0 34px;
    font-size: 24px;
    line-height: 1;
}

#page-history .audit-stat-box .stat-l {
    flex: 1 1 auto;
    margin-top: 0;
    min-width: 0;
    font-size: 16px;
    line-height: 1.15;
    white-space: normal;
    word-break: break-word;
}

/* 展示页面：统一提亮并放大偏灰、偏小的辅助文字 */
.title-en,
.header-status-bar,
.status-bar,
.text-dim,
.mc-l,
.stat-l,
.prog-label,
.prog-pct,
.qrow,
.pagination,
.cs-label,
.blk-time,
.blk-node,
.node-status,
.node-badge,
.node-status-tag,
.btn-page,
.btn-filter,
.loading-text,
.upload-zone,
.result-item,
.inbox-item,
.block-row,
.tx-row,
.audit-table th,
.audit-table td,
.terminal,
.file-log-entry,
.snr-idle span:last-child {
    color: #b8dcff !important;
}

.title-en,
.header-status-bar,
.status-bar,
.btn-page,
.btn-filter,
.node-status-tag {
    font-size: 14px !important;
}

.text-dim,
.prog-label,
.prog-pct,
.qrow,
.pagination,
.cs-label,
.blk-time,
.blk-node,
.node-status,
.node-badge,
.loading-text,
.upload-zone,
.result-item,
.inbox-item,
.block-row,
.tx-row,
.audit-table th,
.audit-table td,
.terminal,
.file-log-entry {
    font-size: 14px !important;
}

.fn-name {
    font-size: 14px !important;
    color: #e8f6ff !important;
}

.fn-sub {
    font-size: 12px !important;
    color: #add7ff !important;
}

#send-carrier-upload-hint,
#send-carrier-candidates,
#image-analysis-summary,
#file-send-result,
#file-recv-result,
#uc-history-list,
#group-join-requests,
#page-system .panel-body,
#page-detection .panel-body,
#page-receive-image #snr-idle span:last-child {
    color: #b6dbff !important;
    font-size: 15px !important;
}

#send-loop-summary,
#image-analysis-summary,
#file-send-log,
#file-send-result,
#file-recv-result {
    color: #deefff !important;
}

#page-users [style*="color:#7da5b4"],
#page-users [style*="color:#7da5b1"],
#page-system [style*="color:#7da5b4"],
#page-detection [style*="color:#7da5b4"],
#page-receive-image [style*="color:#7da5d1"],
#page-send [style*="color:#7da5b4"],
#page-send-image [style*="color:#7da5b4"],
#page-receive [style*="color:#7da5b4"] {
    color: #b6dbff !important;
    font-size: 15px !important;
}

.btn-secondary {
    width: 100%;
    padding: 10px 14px;
    margin-top: 4px;
    border: 1px solid rgba(77, 212, 255, 0.28);
    border-radius: 4px;
    background: rgba(4, 24, 58, 0.72);
    color: #bfefff;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: rgba(77, 212, 255, 0.58);
    background: rgba(10, 42, 92, 0.88);
}

/* ===============================================
   UI polish pass: aligned lines, unified type, overflow-safe layout
   =============================================== */
:root {
    --ui-font: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    --ui-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
    --ui-radius: 10px;
    --ui-radius-sm: 6px;
    --ui-border-soft: rgba(112, 176, 255, 0.34);
    --ui-border-strong: rgba(126, 231, 255, 0.56);
    --ui-surface: rgba(5, 21, 50, 0.78);
    --ui-surface-strong: rgba(7, 28, 64, 0.88);
    --ui-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--ui-font);
    letter-spacing: 0;
}

body {
    line-height: 1.45;
    text-rendering: geometricPrecision;
}

.font-orbitron,
.title-cn,
.num-cell,
.mc-v,
.stat-v,
.security-result-value {
    font-family: "Orbitron", var(--ui-font);
}

.header {
    border-bottom-width: 1px;
    box-shadow: 0 10px 32px rgba(3, 16, 40, 0.46);
}

.header-inner {
    gap: 14px;
    padding: 10px 18px 8px;
}

.header-title-wrap {
    flex: 0 1 360px;
    min-width: 260px;
    max-width: 420px;
}

.title-cn {
    font-size: clamp(22px, 1.55vw, 30px);
    letter-spacing: 2px;
}

.title-en {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 1.5px;
}

.nav {
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.left-nav,
.right-nav {
    justify-content: center;
}

.nav-item {
    flex: 0 1 auto;
    min-width: 78px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: clamp(12px, 0.78vw, 14px);
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0;
}

.nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-status-bar {
    min-height: 26px;
    padding: 5px 24px;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}

#user-id-display {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-wrap {
    padding: 14px 18px 16px;
}

.page.active {
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

.col {
    gap: 14px;
    min-width: 0;
}

.col-l,
.col-r {
    width: 24%;
    flex-basis: 24%;
    min-width: 280px;
}

.col-c {
    flex: 1 1 auto;
    min-width: 420px;
}

.panel,
.process-panel {
    border-radius: var(--ui-radius);
    border-color: var(--ui-border-soft);
    background: linear-gradient(180deg, var(--ui-surface-strong), var(--ui-surface));
    box-shadow: var(--ui-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.panel:hover,
.process-panel:hover {
    border-color: var(--ui-border-strong);
    transform: none;
}

.panel::before,
.process-panel::before {
    border-color: rgba(127, 231, 255, 0.22);
    box-shadow: none;
}

.panel-shine {
    height: 1px;
    opacity: 0.72;
}

.panel-title {
    min-height: 32px;
    padding: 5px 4px 9px;
    margin-bottom: 8px;
    font-size: clamp(14px, 0.9vw, 17px);
    letter-spacing: 0.5px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.panel-title::after {
    height: 1px;
    opacity: 0.8;
}

.panel-body,
.process-panel {
    min-width: 0;
}

.process-panel {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.process-panel > * {
    max-width: 100%;
}

.panel-body-flex,
.panel-body-flex-sm {
    scrollbar-gutter: stable;
}

.input-s,
.btn-exec,
.btn-secondary,
.btn-page,
.btn-filter {
    border-radius: var(--ui-radius-sm);
    font-family: var(--ui-font);
}

.input-s {
    min-height: 36px;
    padding: 9px 11px;
    border-color: rgba(114, 176, 255, 0.42);
    background-color: rgba(2, 14, 40, 0.82);
}

textarea.input-s {
    line-height: 1.5;
}

.btn-exec,
.btn-secondary {
    min-height: 38px;
    letter-spacing: 0;
}

.btn-exec:hover,
.btn-secondary:hover,
.stat-box:hover,
.mid-card:hover {
    transform: none;
}

.terminal {
    font-family: var(--ui-mono);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.audit-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.audit-table th,
.audit-table td {
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.audit-table th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.stat-box,
.mid-card,
.security-result-card,
.quality-badge,
.result-item,
.upload-zone,
.inbox-item,
.node-card,
.block-row,
.tx-row {
    border-radius: var(--ui-radius-sm);
    border-color: rgba(114, 176, 255, 0.3);
}

.stat-box,
.mid-card {
    min-width: 0;
}

.stat-v,
.mc-v,
.security-result-value {
    line-height: 1.05;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-l,
.mc-l,
.security-result-label,
.form-group label {
    letter-spacing: 0;
}

.security-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.security-result-card {
    min-width: 0;
    padding: 12px;
}

.security-result-value.small,
#sec-scenario-detail,
#send-loop-summary,
#send-carrier-candidates,
#file-send-result,
#file-recv-result,
#uc-history-list {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.security-capability-title {
    gap: 10px;
    align-items: flex-start;
}

.security-capability-title span:first-child,
.security-capability-detail {
    min-width: 0;
    overflow-wrap: anywhere;
}

.flowchart-wrapper,
.flowchart,
.send-merge-cluster,
.encrypt-cluster {
    max-width: 100%;
}

.flowchart-wrapper {
    overflow: auto;
    scrollbar-gutter: stable;
}

.flow-node,
.encrypt-label {
    min-width: 0;
}

.fn-name,
.fn-sub {
    overflow-wrap: anywhere;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(5, 21, 50, 0.28);
}

*::-webkit-scrollbar-thumb {
    background: rgba(126, 231, 255, 0.32);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 231, 255, 0.52);
}

@media (max-width: 1500px) {
    .header-inner {
        gap: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-title-wrap {
        flex-basis: 310px;
        min-width: 240px;
    }

    .nav-item {
        min-width: 66px;
        padding: 5px 8px;
    }

    .main-wrap {
        padding: 10px 12px 12px;
    }

    .page.active,
    .col {
        gap: 10px;
    }

    .panel,
    .process-panel {
        padding: 11px 12px;
    }

    .col-l,
    .col-r {
        min-width: 250px;
    }

    .col-c {
        min-width: 360px;
    }
}

@media (max-width: 1180px) {
    html,
    body {
        overflow: auto;
    }

    body {
        min-width: 960px;
    }

    .main-wrap {
        min-height: 720px;
    }
}

/* ===============================================
   主导航：左右 7 等分，避免功能入口宽度不一致
   =============================================== */
.header-inner > .left-nav,
.header-inner > .right-nav {
    flex: 1 1 0;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    align-items: center;
    justify-content: stretch;
    min-width: 0;
}

.header-inner > .nav .nav-item {
    width: 100%;
    min-width: 0 !important;
    max-width: none;
    padding: 6px 6px;
    box-sizing: border-box;
}

.header-inner > .nav .nav-item span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===============================================
   新版流程图：真实链路环节的紧凑可视化
   =============================================== */
.flowchart.modern-flow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    padding: 8px 6px;
    overflow: hidden;
}

.modern-flow .modern-flow-row {
    width: 100%;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}

.modern-flow .modern-flow-node {
    flex: 0 0 96px;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    height: 88px;
    min-height: 88px;
    max-height: 88px;
    padding: 7px 6px 6px;
    border-radius: 7px;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 20px minmax(24px, auto) 24px;
    align-items: center;
    justify-items: center;
    overflow: hidden;
}

.modern-flow .modern-flow-row-short .modern-flow-node {
    flex-basis: 96px;
    width: 96px;
}

.modern-flow .fn-icon {
    width: 18px;
    height: 18px;
    margin: 0 0 2px;
    color: #4dd4ff;
}

.modern-flow .fn-icon svg {
    width: 100%;
    height: 100%;
}

.modern-flow .fn-name {
    width: 100%;
    font-size: 10.5px;
    line-height: 1.14;
    font-weight: 600;
    letter-spacing: 0;
    white-space: normal;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.modern-flow .fn-sub {
    display: -webkit-box;
    width: 100%;
    margin-top: 2px;
    color: #7da5b4;
    font-size: 8.5px;
    line-height: 1.15;
    letter-spacing: 0;
    text-align: center;
    overflow-wrap: anywhere;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.modern-flow .modern-flow-arrow {
    flex: 0 0 14px;
    width: 14px;
    height: 2px;
    margin: 0 4px;
}

.modern-flow .modern-flow-node-shield .fn-icon svg { stroke: #00ffaa; }
.modern-flow .modern-flow-node-lock .fn-icon svg { stroke: #8feeff; }
.modern-flow .modern-flow-node-cloud .fn-icon svg { stroke: #4db8ff; }
.modern-flow .modern-flow-node-user .fn-icon svg { stroke: #f2d56b; }
.modern-flow .modern-flow-node-hash .fn-icon svg { stroke: #6cc8ff; }
.modern-flow .modern-flow-node-image .fn-icon svg { stroke: #c87dff; }
.modern-flow .modern-flow-node-gauge .fn-icon svg { stroke: #ffaa33; }
.modern-flow .modern-flow-node-embed .fn-icon svg { stroke: #d6ff6b; }
.modern-flow .modern-flow-node-split .fn-icon svg,
.modern-flow .modern-flow-node-signature .fn-icon svg { stroke: #7fffc8; }
.modern-flow .modern-flow-node-contract .fn-icon svg { stroke: #9bb6ff; }
.modern-flow .modern-flow-node-chain .fn-icon svg { stroke: #5bd0ff; }
.modern-flow .modern-flow-node-social .fn-icon svg { stroke: #ffcc66; }
.modern-flow .modern-flow-node-spark .fn-icon svg { stroke: #ff8fd7; }
.modern-flow .modern-flow-node-file .fn-icon svg { stroke: #95e7ff; }
.modern-flow .modern-flow-node-process .fn-icon svg { stroke: #89a7b8; }

@media (max-width: 1500px) {
    .modern-flow .modern-flow-node {
        flex-basis: 90px;
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        height: 84px;
        min-height: 84px;
        max-height: 84px;
        padding: 6px 5px;
    }

    .modern-flow .modern-flow-row-short .modern-flow-node {
        flex-basis: 90px;
        width: 90px;
    }

    .modern-flow .fn-name {
        font-size: 10px;
    }

    .modern-flow .fn-sub {
        font-size: 8px;
    }

    .modern-flow .modern-flow-arrow {
        flex-basis: 5px;
        width: 5px;
        margin: 0 1px;
    }
}
