/* ============================================================
 * 建安云控 - 科技风UI组件库 v1.0
 * 深色科技风 / Chat UI / 数字滚动 / 进度条 / 发光特效
 * ============================================================ */

/* ---------- 深色科技风主题变量 ---------- */
:root {
    --tech-bg-primary: #0a0e1a;
    --tech-bg-secondary: #111827;
    --tech-bg-card: #1a1f35;
    --tech-bg-card-hover: #222842;
    --tech-border: rgba(0, 212, 255, 0.15);
    --tech-border-glow: rgba(0, 212, 255, 0.4);
    --tech-text-primary: #e2e8f0;
    --tech-text-secondary: #94a3b8;
    --tech-text-muted: #64748b;
    --tech-accent-cyan: #00d4ff;
    --tech-accent-blue: #3b82f6;
    --tech-accent-purple: #8b5cf6;
    --tech-accent-green: #10b981;
    --tech-accent-orange: #f59e0b;
    --tech-accent-red: #ef4444;
    --tech-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --tech-glow-green: 0 0 20px rgba(16, 185, 129, 0.3);
    --tech-gradient-cyan: linear-gradient(135deg, #00d4ff, #3b82f6);
    --tech-gradient-purple: linear-gradient(135deg, #8b5cf6, #3b82f6);
    --tech-gradient-green: linear-gradient(135deg, #10b981, #00d4ff);
    --tech-font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---------- 全局深色背景 ---------- */
.tech-page {
    min-height: 100vh;
    background: var(--tech-bg-primary);
    color: var(--tech-text-primary);
    font-family: var(--tech-font);
    padding: 24px;
}
.tech-page::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08), transparent 40%);
    pointer-events: none;
    z-index: 0;
}
.tech-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ---------- 科技卡片 ---------- */
.tech-card {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.tech-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: var(--tech-gradient-cyan);
    opacity: 0.5;
}
.tech-card:hover {
    border-color: var(--tech-border-glow);
    box-shadow: var(--tech-glow-cyan);
    transform: translateY(-2px);
}
.tech-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--tech-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tech-card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--tech-gradient-cyan);
    border-radius: 2px;
}

/* ---------- 发光按钮 ---------- */
.tech-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--tech-font);
    position: relative;
    overflow: hidden;
}
.tech-btn-primary {
    background: var(--tech-gradient-cyan);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
.tech-btn-primary:hover {
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
    transform: translateY(-1px);
}
.tech-btn-secondary {
    background: var(--tech-bg-card);
    color: var(--tech-text-primary);
    border: 1px solid var(--tech-border);
}
.tech-btn-secondary:hover {
    border-color: var(--tech-border-glow);
    box-shadow: var(--tech-glow-cyan);
}
.tech-btn-success {
    background: var(--tech-gradient-green);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.tech-btn-danger {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
}

/* ---------- 数字滚动组件 ---------- */
.tech-number-roll {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--tech-accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    display: inline-block;
}
.tech-number-roll.income { color: var(--tech-accent-green); text-shadow: var(--tech-glow-green); }
.tech-number-roll.expense { color: var(--tech-accent-red); text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }

/* ---------- 进度条组件 ---------- */
.tech-progress {
    width: 100%;
    height: 8px;
    background: var(--tech-bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.tech-progress-bar {
    height: 100%;
    background: var(--tech-gradient-cyan);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}
.tech-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: tech-progress-shine 1.5s infinite;
}
@keyframes tech-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ---------- Chat UI 气泡 ---------- */
.tech-chat-bubble {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    max-width: 80%;
    animation: tech-bubble-in 0.3s ease;
    position: relative;
}
.tech-chat-bubble.ai {
    border-left: 3px solid var(--tech-accent-cyan);
}
.tech-chat-bubble.user {
    border-right: 3px solid var(--tech-accent-purple);
    margin-left: auto;
}
.tech-chat-bubble .bubble-header {
    font-size: 12px;
    color: var(--tech-text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tech-chat-bubble .bubble-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--tech-text-primary);
}
.tech-chat-bubble .bubble-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.tech-chat-bubble .bubble-suggestion {
    padding: 6px 14px;
    background: var(--tech-bg-secondary);
    border: 1px solid var(--tech-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--tech-accent-cyan);
    cursor: pointer;
    transition: all 0.2s;
}
.tech-chat-bubble .bubble-suggestion:hover {
    background: var(--tech-accent-cyan);
    color: var(--tech-bg-primary);
}
@keyframes tech-bubble-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 动态状态指示器 ---------- */
.tech-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: tech-pulse 2s infinite;
}
.tech-status-dot.active { background: var(--tech-accent-green); box-shadow: 0 0 8px var(--tech-accent-green); }
.tech-status-dot.pending { background: var(--tech-accent-orange); box-shadow: 0 0 8px var(--tech-accent-orange); }
.tech-status-dot.error { background: var(--tech-accent-red); box-shadow: 0 0 8px var(--tech-accent-red); }
@keyframes tech-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---------- 数据网格 ---------- */
.tech-grid {
    display: grid;
    gap: 16px;
}
.tech-grid-2 { grid-template-columns: repeat(2, 1fr); }
.tech-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) {
    .tech-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 标签 ---------- */
.tech-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}
.tech-tag-cyan { background: rgba(0, 212, 255, 0.15); color: var(--tech-accent-cyan); }
.tech-tag-green { background: rgba(16, 185, 129, 0.15); color: var(--tech-accent-green); }
.tech-tag-orange { background: rgba(245, 158, 11, 0.15); color: var(--tech-accent-orange); }
.tech-tag-red { background: rgba(239, 68, 68, 0.15); color: var(--tech-accent-red); }
.tech-tag-purple { background: rgba(139, 92, 246, 0.15); color: var(--tech-accent-purple); }

/* ---------- 加载动画 ---------- */
.tech-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--tech-text-secondary);
}
.tech-loading-dots {
    display: inline-flex;
    gap: 4px;
}
.tech-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tech-accent-cyan);
    animation: tech-loading-bounce 1.4s infinite ease-in-out both;
}
.tech-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.tech-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes tech-loading-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ---------- 统计卡片网格 ---------- */
.tech-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.tech-stat-card {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}
.tech-stat-card:hover {
    border-color: var(--tech-accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}
.tech-stat-number {
    font-size: 28px;
    font-weight: bold;
    color: var(--tech-text-primary);
    font-family: 'Courier New', monospace;
}
.tech-stat-label {
    font-size: 12px;
    color: var(--tech-text-muted);
    margin-top: 6px;
}
@media (max-width: 768px) {
    .tech-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 规则条目 ---------- */
.tech-rule-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.tech-rule-item:last-child { border-bottom: none; }

/* ---------- 黄色标签 ---------- */
.tech-tag-yellow { background: rgba(245, 158, 11, 0.15); color: var(--tech-accent-orange); }

/* ---------- 分隔线发光 ---------- */
.tech-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tech-accent-cyan), transparent);
    opacity: 0.3;
    margin: 20px 0;
}