/* 全局重置与变量 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a3a5c;
    --primary-light: #2c5f8a;
    --primary-dark: #0f1f33;
    --accent: #c8a84e;
    --accent-light: #dbbd6e;
    --bg: #f0f4f8;
    --bg-card: rgba(255,255,255,0.85);
    --text: #1a1a2e;
    --text-secondary: #4a4a5a;
    --border: rgba(26,58,92,0.12);
    --shadow: 0 8px 32px rgba(26,58,92,0.08);
    --shadow-hover: 0 16px 48px rgba(26,58,92,0.15);
    --gradient-banner: linear-gradient(135deg, #1a3a5c 0%, #2c5f8a 50%, #4a7c9e 100%);
    --glass-bg: rgba(255,255,255,0.2);
    --glass-border: rgba(255,255,255,0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 暗色模式 */
[data-theme="dark"] {
    --primary: #0f1f33;
    --primary-light: #1a3a5c;
    --primary-dark: #080f1a;
    --bg: #0d1117;
    --bg-card: rgba(22,27,34,0.9);
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.6);
    --gradient-banner: linear-gradient(135deg, #0f1f33 0%, #1a3a5c 50%, #2c5f8a 100%);
    --glass-bg: rgba(0,0,0,0.3);
    --glass-border: rgba(255,255,255,0.1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 通用动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 滚动观察动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 通用样式 */
a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}
h2 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 8px;
}
h3 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 0.8rem;
}
h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.4rem;
}

/* 容器 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 4rem 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* 头部导航 */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: background var(--transition);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

header nav a[aria-label="返回首页"] {
    flex-shrink: 0;
}

header nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

header nav ul li a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    transition: all var(--transition);
    position: relative;
}

header nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition);
}

header nav ul li a:hover::after,
header nav ul li a:focus::after {
    transform: scaleX(1);
}

header nav ul li a:hover {
    background: rgba(200,168,78,0.1);
    color: var(--accent);
}

header nav button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all var(--transition);
    flex-shrink: 0;
}

header nav button:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
    transform: scale(1.05);
}

/* 首屏Banner */
section[aria-label="首屏介绍"] {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
    background: var(--gradient-banner);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 -1.5rem;
    position: relative;
    overflow: hidden;
}

section[aria-label="首屏介绍"]::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
    background-size: 200% 200%;
}

section[aria-label="首屏介绍"] h1 {
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease;
}

section[aria-label="首屏介绍"] p {
    color: rgba(255,255,255,0.9);
    max-width: 700px;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease 0.2s both;
}

section[aria-label="首屏介绍"] a {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: #1a1a2e;
    font-weight: 700;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease 0.4s both;
    box-shadow: 0 8px 24px rgba(200,168,78,0.3);
}

section[aria-label="首屏介绍"] a:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(200,168,78,0.4);
    background: var(--accent-light);
}

section[aria-label="首屏介绍"] div[role="img"] {
    margin-top: 2rem;
    position: relative;
    z-index: 1;
    animation: scaleIn 0.8s ease 0.6s both;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* 面包屑 */
nav[aria-label="面包屑导航"] {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

nav[aria-label="面包屑导航"] ol {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    padding: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

nav[aria-label="面包屑导航"] ol li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

/* 卡片通用 */
.card, article, details {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover, article:hover, details:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* 关于我们 */
#about {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

#about > * {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

#about > *:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

#about h2 {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

/* 服务领域 */
#services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

#services > h2 {
    grid-column: 1 / -1;
}

#services article {
    display: flex;
    flex-direction: column;
}

#services article h3 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#services article h3::before {
    content: '⚖️';
    font-size: 1.4rem;
}

#services article ul {
    margin-top: auto;
}

/* 解决方案 */
#solutions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#solutions > h2 {
    grid-column: 1 / -1;
}

#solutions article {
    background: var(--gradient-banner);
    color: #fff;
    border: none;
}

#solutions article h3 {
    color: var(--accent);
}

#solutions article p {
    color: rgba(255,255,255,0.9);
}

/* 案例 */
#cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#cases > h2 {
    grid-column: 1 / -1;
}

#cases article {
    position: relative;
    overflow: hidden;
}

#cases article::before {
    content: '📋';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.15;
}

blockquote {
    grid-column: 1 / -1;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    font-style: italic;
}

blockquote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    color: var(--accent);
    opacity: 0.5;
}

blockquote p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* 法律资讯 */
#articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#articles > h2 {
    grid-column: 1 / -1;
}

#articles article {
    display: flex;
    flex-direction: column;
}

#articles article time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

#articles article a {
    margin-top: auto;
    align-self: flex-start;
    padding: 0.4rem 1rem;
    background: var(--primary-light);
    color: #fff;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all var(--transition);
}

#articles article a:hover {
    background: var(--accent);
    color: #1a1a2e;
}

/* FAQ */
#faq details {
    cursor: pointer;
    padding: 1.2rem 1.8rem;
}

#faq details summary {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#faq details summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform var(--transition);
    color: var(--accent);
}

#faq details[open] summary::after {
    transform: rotate(180deg);
}

#faq details p {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* HowTo */
#howto {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

#howto ol {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

#howto ol li {
    counter-increment: step;
    padding: 1rem 1rem 1rem 3rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

#howto ol li:last-child {
    border-bottom: none;
}

#howto ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1rem;
    width: 2rem;
    height: 2rem;
    background: var(--accent);
    color: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

#howto ol li:hover {
    background: rgba(200,168,78,0.05);
}

/* 联系我们 */
#contact {
    background: var(--gradient-banner);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
}

#contact h2::after {
    margin-left: auto;
    margin-right: auto;
}

#contact p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.5rem;
}

#contact strong {
    color: var(--accent);
}

/* 网站地图 */
#sitemap ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    padding: 0;
}

#sitemap ul li a {
    display: block;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

#sitemap ul li a:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* 友情链接 */
section[aria-label="友情链接"] ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0;
}

section[aria-label="友情链接"] ul li a {
    padding: 0.4rem 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all var(--transition);
}

section[aria-label="友情链接"] ul li a:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
}

/* 页脚 */
footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

footer nav {
    margin-top: 1rem;
}

footer nav a {
    color: var(--accent);
    margin: 0 0.5rem;
    font-size: 0.9rem;
}

footer nav a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* 返回顶部 */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1a2e;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(200,168,78,0.3);
    transition: all var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 24px rgba(200,168,78,0.4);
}

/* 响应式 */
@media (max-width: 768px) {
    header nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    header nav ul {
        width: 100%;
        justify-content: center;
        gap: 0.3rem;
    }

    header nav ul li a {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }

    section[aria-label="首屏介绍"] {
        min-height: 60vh;
        padding: 4rem 1rem;
    }

    #services {
        grid-template-columns: 1fr;
    }

    #solutions {
        grid-template-columns: 1fr;
    }

    #cases {
        grid-template-columns: 1fr;
    }

    #articles {
        grid-template-columns: 1fr;
    }

    #about {
        grid-template-columns: 1fr;
    }

    #sitemap ul {
        grid-template-columns: repeat(2, 1fr);
    }

    section[aria-label="友情链接"] ul {
        flex-direction: column;
        align-items: center;
    }

    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 1rem;
    }

    section {
        padding: 2.5rem 0;
    }

    header nav ul li a {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .card, article, details {
        padding: 1.2rem;
    }
}

/* 打印样式 */
@media print {
    header, footer, #back-to-top, nav[aria-label="面包屑导航"] {
        display: none;
    }
    body {
        background: #fff;
        color: #000;
    }
    section {
        page-break-inside: avoid;
    }
}