/**
 * 全局导航栏样式 - 高点击率优化版
 * 基于法律服务行业最佳实践设计
 */

/* ========== CSS变量定义 ========== */
:root {
    /* 主色调 - 深蓝灰（专业、稳重、信任）*/
    --primary: #1a2332;
    --primary-dark: #0f1520;
    --primary-light: #2a3a4d;
    
    /* 品牌强调色 - 琥珀金（高价值、专业、权威）*/
    --accent: #c9a227;
    --accent-hover: #b8941f;
    --accent-light: #e6c24a;
    
    /* 辅助色 - 现代蓝 */
    --secondary: #2563eb;
    --secondary-hover: #1d4ed8;
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 中性色 */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 顶部导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    transition: opacity 0.2s;
    letter-spacing: -0.01em;
}

.navbar-logo:hover {
    opacity: 0.85;
}

.navbar-logo img {
    height: 36px;
    margin-right: 10px;
    display: none;
}

/* 导航菜单 */
.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 0;
    transition: all 0.3s ease;
    position: relative;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
    
.navbar-link::after {
    display: none;
}

.navbar-link:hover {
    color: var(--accent);
}

/* 移动端下拉箭头 */
.navbar-item .navbar-link::before {
    content: '';
    display: none;
}

@media (max-width: 768px) {
    .navbar-item:has(.navbar-dropdown) .navbar-link::after {
        content: '\25BC';
        font-size: 0.8rem;
        margin-left: 0.5rem;
        transition: transform 0.3s ease;
        display: inline-block;
    }
    
    .navbar-item.active .navbar-link::after {
        transform: rotate(180deg);
    }
}

.navbar-link:hover::after {
    width: 80%;
}

@media (min-width: 769px) {
    .navbar-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--accent);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }
    
    .navbar-link:hover::after {
        width: 80%;
    }
}

/* 下拉菜单 */
.navbar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 0.75rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    z-index: 100;
}

.navbar-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.navbar-item:hover .navbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.85rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.05) 0%, transparent 100%);
    color: var(--accent);
    padding-left: 1.75rem;
    border-left-color: var(--accent);
}

/* 右侧操作区 */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 电话号码 */
.navbar-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.navbar-phone:hover {
    color: var(--accent);
}

.phone-icon {
    position: relative;
}

.phone-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* CTA按钮 */
.navbar-cta {
    background: var(--accent);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    border: none;
}

.navbar-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* 移动端菜单按钮 */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.toggle-bar {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    /* 防止内容溢出 */
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100vw;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    /* 隐藏桌面端导航菜单 */
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-white);
        flex-direction: column;
        padding: 2rem 1rem;
        gap: 1rem;
        transition: left 0.3s;
        overflow-y: auto;
        z-index: 999;
        display: none; /* 默认隐藏 */
    }
    
    .navbar-menu.active {
        left: 0;
        display: flex; /* 激活时显示 */
    }
    
    /* 隐藏桌面端右侧操作区 */
    .navbar-actions {
        display: none; /* 移动端默认隐藏 */
    }
    
    .navbar-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        padding-left: 0;
        margin: 0.5rem 0 0 0;
        display: none;
        width: 100%;
        min-width: auto;
        border: none;
        border-radius: 0;
        background: var(--bg-light);
        overflow: hidden;
    }
    
    .navbar-dropdown::before {
        display: none;
    }
    
    .navbar-item.active .navbar-dropdown {
        display: block;
    }
    
    .dropdown-item {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        border-left: none;
        border-bottom: 1px solid var(--border);
        display: block;
        width: 100%;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .dropdown-item:hover {
        background: var(--border);
        color: var(--accent-hover);
        padding-left: 1.5rem;
        border-left: none;
    }
    
    /* 移动端联系方式显示 */
    .navbar-mobile-contact {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--border);
    }
    
    .mobile-phone {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        color: var(--primary);
        text-decoration: none;
        font-size: 1.125rem;
        font-weight: 700;
        padding: 0.875rem;
        background: var(--bg-light);
        border-radius: 8px;
        transition: var(--transition);
    }
    
    .mobile-phone:hover {
        background: var(--border-light);
        color: var(--accent);
    }
    
    .mobile-phone i {
        font-size: 1.25rem;
    }
    
    .mobile-cta {
        display: block;
        text-align: center;
        background: var(--accent);
        color: white;
        padding: 0.875rem;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        transition: var(--transition);
        box-shadow: var(--shadow-md);
    }
    
    .mobile-cta:hover {
        background: var(--accent-hover);
        box-shadow: var(--shadow-lg);
    }
    
    .navbar-logo span {
        font-size: 1rem;
    }
    
    .navbar-logo img {
        height: 32px;
    }
    
    .navbar-container {
        height: 65px;
        padding: 0 16px;
    }
}

/* 桌面端隐藏移动端专用元素 */
@media (min-width: 769px) {
    .navbar-mobile-contact {
        display: none !important;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .navbar-container {
        height: 60px;
        padding: 0 12px;
    }
    
    .navbar-logo span {
        font-size: 0.9rem;
    }
    
    .navbar-logo img {
        height: 28px;
        margin-right: 5px;
    }
    
    .navbar-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding: 1.5rem 1rem;
    }
}

/* 极小屏幕适配 - 360px */
@media (max-width: 360px) {
    .navbar-container {
        height: 56px;
        padding: 0 8px;
    }
    
    .navbar-logo span {
        font-size: 0.8rem;
    }
    
    .navbar-logo img {
        height: 24px;
        margin-right: 4px;
    }
    
    .navbar-menu {
        top: 56px;
        height: calc(100vh - 56px);
        padding: 1rem 0.75rem;
    }
    
    .navbar-toggle {
        gap: 4px;
        padding: 4px;
    }
    
    .toggle-bar {
        width: 22px;
        height: 2.5px;
    }
}

/* ========== 页面主体间距 ========== */
body {
    padding-top: 70px;
}

/* ========== 返回导航 ========== */
.back-to-home {
    text-align: center;
    margin: 2rem 0;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--accent);
}

/* ========== 页脚样式 ========== */
.footer {
    background: var(--primary);
    color: white;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    text-align: left;
    color: var(--accent);
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent);
}

.footer-section p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
    opacity: 0.9;
}

.footer-section a {
    display: block;
    margin: 0.5rem 0;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent-light);
}

.footer-section.footer-disclaimer {
    grid-column: span 1;
}

.disclaimer-text {
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: justify;
    opacity: 0.85;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.85rem;
    margin: 0.4rem 0;
    text-align: center;
    opacity: 0.8;
}

.footer-bottom a {
    color: var(--white);
    opacity: 0.8;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.footer-bottom a:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 1rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-disclaimer {
        grid-column: span 1;
    }
}

/* ========== 浮动电话按钮 ========== */
.floating-phone {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background: var(--accent);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    animation: float 3s ease-in-out infinite;
}

.floating-phone:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating-phone::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    animation: ripple 2s infinite;
    z-index: -1;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}
