/* ===============================================
   可视化大屏增强样式 - 粒子效果与高级动画
   =============================================== */

/* ===============================================
   粒子背景效果
   =============================================== */
#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: 12px; }
}

/* ===============================================
   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;
}
