/* 智能调解系统官网 - 动态科技风（大气版） */

:root {
    --grid-color: rgba(2, 132, 199, 0.06);
    --primary: #0284c7;
    --accent: #06b6d4;
}

html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

/* 全局排版优化 - 更大气 */
h1, h2, h3, h4 { letter-spacing: -0.02em; }
h1 { line-height: 1.15; }
h2 { line-height: 1.2; }
p { line-height: 1.75; }
.text-slate-400 { line-height: 1.8; }

/* section 间距加大 */
section { padding-top: 6rem; padding-bottom: 6rem; }
@media (min-width: 768px) {
    section { padding-top: 7rem; padding-bottom: 7rem; }
}

/* ========== 动态背景 ========== */
/* 网格背景 */
.grid-bg {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 48px 48px;
}
.grid-bg-mask {
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

/* 动态网格 - 平移 */
.grid-animated {
    background-image:
        linear-gradient(rgba(2, 132, 199, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 132, 199, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}
@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* 扫描线效果 */
.scan-line::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 4s ease-in-out infinite;
    opacity: 0.6;
    z-index: 1;
}
@keyframes scan {
    0%, 100% { transform: translateY(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100vh); }
}

/* 粒子背景 */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 8s ease-in-out infinite;
}
@keyframes particle-float {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(50px); opacity: 0; }
}

/* ========== 渐入动画 ========== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }

/* ========== 卡片效果 ========== */
.card-hover {
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.card-hover::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}
.card-hover:hover {
    transform: translateY(-4px);
    border-color: rgba(2, 132, 199, 0.5);
    background-color: rgba(17, 26, 46, 0.8);
    box-shadow: 0 10px 40px rgba(2, 132, 199, 0.15);
}
.card-hover:hover::after {
    left: 100%;
}

/* 渐变边框卡片 */
.card-glow {
    position: relative;
    background: #0b1220;
    border-radius: 8px;
}
.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--primary), transparent, var(--accent));
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card-glow:hover::before { opacity: 1; }

/* ========== 文字效果 ========== */
.text-gradient {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 打字机光标 */
.typing-cursor::after {
    content: '|';
    color: var(--primary);
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== 等宽字体 ========== */
.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b1220; }
::-webkit-scrollbar-thumb { background: #1e2a45; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #0284c7; }
::selection { background: rgba(2, 132, 199, 0.3); color: #fff; }

/* ========== 组件样式 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(2, 132, 199, 0.3);
    background: rgba(2, 132, 199, 0.1);
    color: #38bdf8;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #64748b;
    font-size: 13px;
}
.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #1e2a45, transparent);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: #0b1220;
    border: 1px solid #1e2a45;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.form-input::placeholder { color: #475569; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0284c7, #0891b2);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover { background: linear-gradient(135deg, #0369a1, #0e7490); box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3); transform: translateY(-1px); }
.btn-primary:hover::before { left: 100%; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: #e2e8f0;
    border: 1px solid #1e2a45;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    cursor: pointer;
}
.btn-outline:hover {
    border-color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    color: #fff;
}

.toast {
    position: fixed;
    top: 80px; right: 24px;
    z-index: 100;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    background: #111a2e;
    border: 1px solid #1e2a45;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: #10b981; color: #10b981; }
.toast.error { border-color: #ef4444; color: #ef4444; }

.table-pro { width: 100%; border-collapse: collapse; }
.table-pro th {
    text-align: left;
    padding: 12px 16px;
    background: #111a2e;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #1e2a45;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-pro td {
    padding: 14px 16px;
    border-bottom: 1px solid #1e2a45;
    font-size: 14px;
    color: #e2e8f0;
}
.table-pro tr:hover td { background: rgba(17, 26, 46, 0.5); }

.icon-box {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.card-hover:hover .icon-box {
    background: rgba(2, 132, 199, 0.2);
    border-color: rgba(2, 132, 199, 0.5);
    transform: scale(1.05);
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
}
@media (min-width: 768px) { .stat-num { font-size: 3rem; } }

/* ========== SVG 动画 ========== */
.svg-tech { width: 100%; height: auto; }

/* LED 闪烁 */
.led { animation: led-blink 2s ease-in-out infinite; }
.led-1 { animation-delay: 0s; }
.led-2 { animation-delay: 0.5s; }
.led-3 { animation-delay: 1s; }
@keyframes led-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 数据流线 - 流动 */
.flow-line {
    stroke-dashoffset: 0;
    animation: flow 2s linear infinite;
}
.flow-2 { animation-delay: 0.5s; }
.flow-3 { animation-delay: 1s; }
@keyframes flow {
    to { stroke-dashoffset: -16; }
}

/* 脉冲环 */
.pulse-ring {
    animation: pulse 3s ease-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}
.pulse-2 { animation-delay: 1.5s; }
@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* 旋转 */
.rotate-slow {
    transform-origin: 300px 200px;
    animation: rotate 30s linear infinite;
}
.rotate-reverse {
    transform-origin: 300px 200px;
    animation: rotate 25s linear infinite reverse;
}
@keyframes rotate {
    to { transform: rotate(360deg); }
}

/* 浮动点 */
.float-point { animation: float 4s ease-in-out infinite; }
.float-2 { animation-delay: 1s; }
.float-3 { animation-delay: 2s; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 数据包动画 - 沿线路移动 */
.data-packet {
    animation: packet-move 3s linear infinite;
}
.packet-1 { animation-delay: 0s; }
.packet-2 { animation-delay: 1s; }
.packet-3 { animation-delay: 2s; }
@keyframes packet-move {
    0% { transform: translate(300px, 200px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(150px, 100px); opacity: 0; }
}

/* 轨道粒子 */
.orbit-particle {
    transform-origin: 300px 200px;
    animation: orbit 8s linear infinite;
}
@keyframes orbit {
    to { transform: rotate(360deg) translateX(180px); }
}

/* ========== 数字滚动 ========== */
.counter { display: inline-block; }

/* ========== 渐变光晕 ========== */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orb-float 8s ease-in-out infinite;
}
.glow-orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #0284c7, transparent);
    top: -100px; left: -100px;
}
.glow-orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #06b6d4, transparent);
    bottom: -150px; right: -150px;
    animation-delay: 2s;
}
@keyframes orb-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* ========== 进度条动画 ========== */
.progress-bar {
    height: 4px;
    background: #1e2a45;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    height: 100%; width: 100%;
    background: linear-gradient(90deg, transparent, #0284c7, transparent);
    animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== 数字翻转 ========== */
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: line-scan 3s ease-in-out infinite;
}
@keyframes line-scan {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; }
    100% { transform: translateX(100%); }
}

/* ========== 顶部导航菜单 - 高级动效 ========== */
#topnav {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
#topnav.scrolled {
    background-color: rgba(11, 18, 32, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.2) !important;
}

/* 桌面菜单项 - 下划线光扫动效 */
.nav-link {
    position: relative;
    padding: 6px 2px;
    transition: color 0.3s ease;
    letter-spacing: 0.04em;
}
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.6);
}
.nav-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 28px;
    background: radial-gradient(ellipse at center, rgba(2, 132, 199, 0.15), transparent 70%);
    transition: width 0.4s ease;
    pointer-events: none;
    z-index: -1;
}
.nav-link:hover {
    color: #fff !important;
}
.nav-link:hover::before {
    width: 100%;
}
.nav-link:hover::after {
    width: 80px;
}
.nav-link.active {
    color: var(--primary) !important;
}
.nav-link.active::before {
    width: 100%;
}

/* Logo 微动效 */
.nav-logo {
    transition: transform 0.3s ease, filter 0.3s ease;
}
.nav-logo:hover {
    transform: translateY(-1px);
    filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.4));
}
.nav-logo-icon {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover .nav-logo-icon {
    transform: rotate(180deg) scale(1.05);
}

/* 顶部高亮线 - 滚动指示器 */
#topnav::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(2, 132, 199, 0.4) 20%, rgba(6, 182, 212, 0.6) 50%, rgba(2, 132, 199, 0.4) 80%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
#topnav.scrolled::before {
    opacity: 1;
}

/* ========== 标题大气排版 ========== */
h1 {
    letter-spacing: -0.025em;
}
h2 {
    letter-spacing: -0.02em;
}
.badge {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
}

/* 数字、 mono 字体加宽 */
.font-mono {
    letter-spacing: 0.02em;
}

/* 卡片内文字更舒展 */
.card-hover p,
.card-hover .text-sm {
    line-height: 1.7;
}

/* 段落最大宽度优化 - 阅读舒适度 */
.max-w-2xl p,
.max-w-xl p {
    line-height: 1.85;
}

/* Hero 标题 - 大行距，两行文字呼吸感 */
.hero-title {
    line-height: 1.35 !important;
    letter-spacing: -0.025em;
    margin-bottom: 1.75rem;
}
.hero-title br {
    display: block;
    content: '';
    margin-top: 0.4em;
}

/* Hero 标题 - 大行距 */
.hero-title { line-height: 1.35 !important; letter-spacing: -0.025em; margin-bottom: 1.75rem; }
.hero-title br { display: block; content: ""; margin-top: 0.4em; }

/* ========== 移动端适配 ========== */
/* 触屏设备：去掉 hover 位移/扫光（无 hover 语义，避免 iOS 触摸粘滞） */
@media (hover: none) {
    .card-hover:hover { transform: none; box-shadow: none; }
    .card-hover:hover::after { display: none; }
    .card-hover:active { transform: scale(0.985); transition: transform 0.15s ease; }
}

@media (max-width: 767px) {
    /* 防意外横向滚动（glow-orb 大光斑等绝对定位元素） */
    html, body { overflow-x: clip; }

    /* section 留白压缩：桌面 6/7rem 手机上太空旷 */
    section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    section.py-16, section.py-20 { padding-top: 3.5rem; padding-bottom: 3.5rem; }

    /* Hero 标题小屏收紧 */
    .hero-title { font-size: clamp(1.7rem, 8.4vw, 2.25rem); margin-bottom: 1.25rem; }

    /* 数字指标小屏再收一档（2 列布局） */
    .stat-num { font-size: 2rem; }

    /* 表单控件 16px：小于 16px 触发 iOS Safari 聚焦自动放大 */
    .form-input { font-size: 16px; }

    /* 触控目标最小 44px（Apple HIG） */
    .btn-primary, .btn-outline { min-height: 44px; padding: 12px 18px; }

    /* Toast 居中显示，避免右侧溢出 */
    .toast { left: 16px; right: 16px; top: 76px; text-align: center; }

    /* 导航高度 80px→64px，给内容留视口（同步压缩 main 顶部占位） */
    #topnav .h-20 { height: 64px; }
    main.pt-20 { padding-top: 64px; }

    /* 图标盒小屏缩小 */
    .icon-box { width: 40px; height: 40px; font-size: 16px; }

    /* 表格横滑容器：两侧渐隐提示可滑动 */
    .table-scroll-wrap { position: relative; }
    .table-scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0; right: 0; bottom: 0;
        width: 36px;
        background: linear-gradient(90deg, transparent, rgba(11, 18, 32, 0.9));
        pointer-events: none;
        border-radius: 0 8px 8px 0;
    }

    /* 底部双列栅格间距收紧 */
    footer .grid.grid-cols-2 { gap: 1.5rem; }
}

/* ========== 弹窗小屏滚动（配合 footer.php 的 consult-modal） ========== */
@media (max-width: 767px) {
    #consult-modal > div.relative {
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* iOS 安全区适配：内容不被底部小黑条遮挡 */
    #consult-modal { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
}

/* ========== 弱动效偏好：尊重系统设置 ========== */
@media (prefers-reduced-motion: reduce) {
    .grid-animated, .particle, .glow-orb, .scan-line::before { animation: none !important; }
    .fade-in { transition: none; opacity: 1; transform: none; }
}
