/* ========================================
   CYBER CRM - 赛博朋克增强版样式表
   ======================================== */

:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --primary: #00f3ff;      /* 电光蓝 */
    --secondary: #ff00ff;    /* 霓虹紫 */
    --accent: #39ff14;      /* 矩阵绿 */
    --warning: #ff6b35;     /* 警示橙 */
    --text-main: #e0e0e0;
    --text-dim: #666;
    --border: rgba(0, 243, 255, 0.3);
    --glow-primary: 0 0 10px rgba(0, 243, 255, 0.8), 0 0 20px rgba(0, 243, 255, 0.5), 0 0 30px rgba(0, 243, 255, 0.3);
    --glow-secondary: 0 0 10px rgba(255, 0, 255, 0.8), 0 0 20px rgba(255, 0, 255, 0.5), 0 0 30px rgba(255, 0, 255, 0.3);
    --glow-accent: 0 0 10px rgba(57, 255, 20, 0.8), 0 0 20px rgba(57, 255, 20, 0.5);
    --font-main: 'Courier New', 'Microsoft YaHei', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== 动态网格背景 ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -2;
}

/* ===== 扫描线效果 ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1000;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ===== 粒子效果容器 ===== */
.hud-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* ===== 容器 ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ===== 标题样式 ===== */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

h1 {
    color: var(--primary);
    font-size: 2rem;
    text-shadow: var(--glow-primary);
    position: relative;
    display: inline-block;
}

h1::before {
    content: '// ';
    color: var(--secondary);
    opacity: 0.7;
}

h2 {
    color: var(--primary);
    text-shadow: var(--glow-primary);
    font-size: 1.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 25px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

/* ===== 导航栏 ===== */
.navbar {
    padding: 25px 0;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== 按钮 ===== */
.btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 25px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    font-family: var(--font-main);
    font-size: 0.85rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-danger:hover {
    background: var(--secondary);
    color: #fff;
    box-shadow: var(--glow-secondary);
}

/* ===== 状态提示框 ===== */
.status-msg {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary);
    border-left: 4px solid var(--primary);
    color: var(--primary);
    padding: 15px 20px;
    margin-bottom: 25px;
    font-family: var(--font-main);
    box-shadow: var(--glow-primary);
    animation: statusPulse 2s ease-in-out infinite;
    position: relative;
}

.status-msg::before {
    content: '>';
    margin-right: 10px;
    animation: blink 1s step-end infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 243, 255, 0.3); }
    50% { box-shadow: var(--glow-primary); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, textarea, select {
    width: 100%;
    padding: 15px;
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3), inset 0 0 15px rgba(0, 243, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-dim);
}

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border);
    position: relative;
}

table::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

table:hover::before {
    opacity: 1;
}

th, td {
    padding: 18px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

th {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--primary);
}

tr {
    transition: all 0.3s ease;
}

tr:hover {
    background: rgba(0, 243, 255, 0.05);
    transform: scale(1.01);
}

tr:hover td {
    color: #fff;
}

/* ===== 网格布局 ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ===== 卡片效果 ===== */
.cyber-card {
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.cyber-card::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: var(--primary);
    animation: scanBar 2s ease-in-out infinite;
}

@keyframes scanBar {
    0%, 100% { left: 0; width: 30%; }
    50% { left: 70%; width: 30%; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border: none;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: var(--glow-primary);
}

/* ===== 链接 ===== */
a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    text-shadow: var(--glow-primary);
    color: #fff;
}

/* ===== 霓虹文字效果 ===== */
.neon-text {
    color: #fff;
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
    animation: neonFlicker 3s infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px var(--primary),
            0 0 10px var(--primary),
            0 0 20px var(--primary),
            0 0 40px var(--primary);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ===== 故障效果 ===== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite linear alternate-reverse;
    color: var(--primary);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 3s infinite linear alternate-reverse;
    color: var(--secondary);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 0); }
    20% { clip-path: inset(10% 0 70% 0); }
    40% { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); }
    60% { clip-path: inset(70% 0 10% 0); }
    80% { clip-path: inset(30% 0 50% 0); transform: translate(-1px, 0); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(60% 0 20% 0); transform: translate(2px, 0); }
    20% { clip-path: inset(70% 0 10% 0); }
    40% { clip-path: inset(30% 0 50% 0); transform: translate(-2px, 0); }
    60% { clip-path: inset(10% 0 70% 0); }
    80% { clip-path: inset(50% 0 30% 0); transform: translate(1px, 0); }
}

/* ===== 脉冲动画 ===== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 打字机效果 ===== */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typing 3s steps(30) 1s forwards, blink-caret 0.75s step-end infinite;
    width: 0;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== 科技边框 ===== */
.tech-border {
    position: relative;
}

.tech-border::before,
.tech-border::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
}

.tech-border::before {
    top: -2px;
    left: -2px;
    border-top: 3px solid var(--primary);
    border-left: 3px solid var(--primary);
}

.tech-border::after {
    bottom: -2px;
    right: -2px;
    border-bottom: 3px solid var(--secondary);
    border-right: 3px solid var(--secondary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar div {
        margin-top: 15px;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.75rem;
    }
}

/* ===== 标签样式 ===== */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 0, 255, 0.2);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--secondary);
    color: #000;
    box-shadow: var(--glow-secondary);
}

.tag.active {
    background: var(--secondary);
    color: #000;
}

/* ===== 输入框聚焦动画 ===== */
input:focus, textarea:focus {
    animation: inputGlow 1.5s ease-in-out infinite;
}

@keyframes inputGlow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.3), inset 0 0 5px rgba(0, 243, 255, 0.1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.5), inset 0 0 10px rgba(0, 243, 255, 0.2);
    }
}

/* ===== 错误提示 ===== */
.error-msg {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    padding-left: 40px;
}

.error-msg::before {
    content: '!';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 1px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
