/*
 * 付显育律师个人网站样式表 (style.css)
 * 全局样式优化版
 */

:root {
    --primary-blue: #1e40af;   /* 深蓝 */
    --secondary-blue: #3b82f6; /* 亮蓝 */
    --accent-orange: #f97316;  /* 橙色强调 */
    --light-gray: #f8fafc;
}

/* 全局基础设置 */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased; /* 让字体在 Mac 上更清晰 */
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden; /* 防止水平滚动条 */
}

/* 选中文本颜色自定义 */
::selection {
    background-color: var(--primary-blue);
    color: white;
}

/* 自定义滚动条 (Webkit) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 导航栏样式 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%; /* 从中间向两边展开 */
    transform: translateX(-50%);
    background-color: var(--accent-orange);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 按钮样式优化 */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background-color: #172554; /* deeper blue */
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.3);
}

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

.btn-secondary {
    background-color: white;
    color: var(--primary-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: 1px solid var(--primary-blue);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

/* 文本高亮 */
.highlight {
    color: var(--accent-orange);
    position: relative;
    display: inline-block;
}

/* 卡片通用样式 & 悬停效果 */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 动画定义 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    opacity: 0;
    animation: slideIn 0.8s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 浮动图片动画 */
.floating {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translate(0, 0px); }
    50% { transform: translate(0, 12px); }
    100% { transform: translate(0, -0px); }
}

/* 模态框样式 */
.modal-overlay {
    backdrop-filter: blur(4px); /* 增加毛玻璃效果 */
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* FAQ 手风琴样式 */
.faq-item {
    border: 1px solid #f1f5f9;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.faq-item:hover {
    border-color: #e2e8f0;
}

.faq-item.active {
    border-color: #bfdbfe; /* active border blue-200 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); /* 更平滑的展开动画 */
    opacity: 0;
}

.faq-item.active .faq-answer {
    opacity: 1;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in 0.2s;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--secondary-blue);
}

.faq-question i {
    transition: transform 0.3s ease, color 0.3s;
}

/* 移动端适配调整 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .about-content,
    .contact-form-grid {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    /* 移动端加大点击热区 */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 案例筛选按钮状态 */
.case-filter-btn.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
}
