/* 有道翻译 fanyi-yodo.com.cn 全局样式
   设计令牌：主色 emerald，辅助色 teal，中性色 gray
   断点：md 768px / lg 1024px（移动端优先） */

:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --teal-50: #f0fdfa;
    --teal-200: #99f6e4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --shadow-xl: 0 20px 25px -5px rgba(17, 24, 39, 0.1), 0 8px 10px -6px rgba(17, 24, 39, 0.1);
    --header-h: 72px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    background: #fff;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--emerald-600);
    text-decoration: none;
}

a:hover {
    color: var(--emerald-700);
}

h1, h2, h3, h4 {
    margin: 0;
    color: var(--gray-900);
    font-weight: 700;
    line-height: 1.25;
}

p {
    margin: 0;
}

ul {
    margin: 0;
    padding-left: 1.25rem;
}

.container {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-narrow {
    max-width: 48rem;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--emerald-600);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 200;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    color: #fff;
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-100);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.brand:hover {
    color: var(--gray-900);
}

.brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.nav a {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-lg);
    color: var(--gray-600);
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.nav a:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

.nav a.active {
    color: var(--emerald-600);
    background: var(--emerald-50);
}

.header-cta {
    display: none;
}

.hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
}

.hamburger svg {
    width: 22px;
    height: 22px;
}

.mobile-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xl);
    padding: 0.75rem 1rem 1rem;
    display: none;
    z-index: 99;
}

.mobile-menu.is-open {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-lg);
    color: var(--gray-700);
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: var(--emerald-50);
    color: var(--emerald-600);
}

.mobile-menu .btn {
    margin-top: 0.5rem;
    width: 100%;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--emerald-600);
    color: #fff;
}

.btn-primary:hover {
    background: var(--emerald-700);
    color: #fff;
}

.btn-lg {
    border-radius: var(--radius-2xl);
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-outline {
    background: #fff;
    border-color: var(--emerald-200);
    color: var(--emerald-700);
}

.btn-outline:hover {
    border-color: var(--emerald-600);
    background: var(--emerald-50);
    color: var(--emerald-700);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--teal-50) 0%, var(--emerald-50) 45%, #fff 100%);
    padding: calc(var(--header-h) + 2rem) 0 3.5rem;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.3;
    pointer-events: none;
}

.hero::before {
    top: -6rem;
    right: -6rem;
    background: var(--emerald-400);
}

.hero::after {
    bottom: -8rem;
    left: -8rem;
    background: var(--teal-200);
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--emerald-100);
    color: var(--emerald-700);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
}

.badge svg {
    width: 14px;
    height: 14px;
}

.hero h1 {
    margin-top: 1.25rem;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-gradient {
    background: linear-gradient(90deg, var(--emerald-600), #14b8a6 60%, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    margin-top: 1.25rem;
    max-width: 34rem;
    font-size: 1.15rem;
    color: var(--gray-600);
}

.hero-actions {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-visual img {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.animate-glow {
    animation: glow 2.8s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(5, 150, 105, 0);
    }
}

/* ---------- 信任数据条 ---------- */
.stats {
    background: var(--gray-900);
    color: #fff;
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat {
    text-align: center;
}

.stat svg {
    width: 32px;
    height: 32px;
    color: var(--emerald-400);
    margin: 0 auto 0.4rem;
}

.stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat span {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* ---------- 通用区块 ---------- */
.section {
    padding: 4rem 0;
    background: #fff;
}

.section-gray {
    background: var(--gray-50);
}

.section-head {
    text-align: center;
    max-width: 44rem;
    margin: 0 auto 2.5rem;
}

.section-head h2 {
    font-size: 1.85rem;
}

.section-head p {
    margin-top: 0.85rem;
    color: var(--gray-600);
    font-size: 1.05rem;
}

.section-head-left {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    max-width: none;
    margin: 0 0 2rem;
}

.section-head-left h2 {
    font-size: 1.85rem;
}

.section-head-left p {
    margin-top: 0.6rem;
    color: var(--gray-600);
}

.section-link {
    display: none;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- 功能卡片 ---------- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-3xl);
    padding: 2rem;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.feature-card:hover {
    border-color: var(--emerald-200);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.25s;
}

.feature-icon svg {
    width: 30px;
    height: 30px;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.grad-purple { background: linear-gradient(135deg, #a855f7, #ec4899); }
.grad-cyan { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.grad-amber { background: linear-gradient(135deg, #f59e0b, #f97316); }
.grad-emerald { background: linear-gradient(135deg, var(--emerald-500), #14b8a6); }

.feature-card h3 {
    margin-top: 1.25rem;
    font-size: 1.4rem;
}

.feature-card p {
    margin-top: 0.6rem;
    color: var(--gray-600);
    font-size: 1rem;
}

/* ---------- 平台卡片 ---------- */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.platform-card {
    display: block;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-3xl);
    padding: 1.75rem 1.25rem;
    text-align: center;
    color: inherit;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.platform-card:hover {
    border-color: var(--emerald-200);
    box-shadow: var(--shadow-xl);
    color: inherit;
}

.platform-card svg {
    width: 48px;
    height: 48px;
    color: var(--gray-700);
    margin: 0 auto 0.75rem;
    transition: color 0.2s;
}

.platform-card:hover svg {
    color: var(--emerald-600);
}

.platform-card h3 {
    font-size: 1.15rem;
}

.platform-card .version {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.platform-card .platform-dl {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--emerald-600);
    opacity: 0;
    transition: opacity 0.2s;
}

.platform-card:hover .platform-dl,
.platform-card:focus-within .platform-dl {
    opacity: 1;
}

.platform-card .platform-dl svg {
    width: 14px;
    height: 14px;
    margin: 0;
    color: inherit;
}

/* ---------- 教程分类导航与分组 ---------- */
.blog-nav {
    margin: 0 0 2.5rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
    line-height: 1.9;
    color: var(--gray-500);
}

.blog-nav a {
    color: var(--emerald-700);
    font-weight: 600;
    text-decoration: none;
}

.blog-nav a:hover,
.blog-nav a:focus-visible {
    text-decoration: underline;
}

.blog-group {
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.blog-group + .blog-group {
    margin-top: 3.5rem;
}

.blog-group-head {
    margin-bottom: 1.5rem;
}

.blog-group-head h2 {
    margin: 0 0 0.5rem;
    font-size: 1.375rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.blog-group-head h2 span {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emerald-700);
    vertical-align: middle;
}

.blog-group-head p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--gray-500);
}

/* ---------- 文章卡片 ---------- */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    color: inherit;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.article-card:hover {
    border-color: var(--emerald-200);
    box-shadow: var(--shadow-xl);
    color: inherit;
}

.article-cover {
    position: relative;
    height: 11rem;
    overflow: hidden;
    background: var(--emerald-50);
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.article-card:hover .article-cover img {
    transform: scale(1.05);
}

.article-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--emerald-500);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    padding: 0.2rem 0.6rem;
}

.article-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem 1.5rem 1rem;
}

.article-body h3 {
    font-size: 1.1rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.article-card:hover .article-body h3 {
    color: var(--emerald-600);
}

.article-body .summary {
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.article-meta svg {
    width: 13px;
    height: 13px;
}

/* ---------- FAQ ---------- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: none;
    border: 0;
    text-align: left;
    font: inherit;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
}

.faq-q svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--emerald-600);
    transition: transform 0.25s;
}

.faq-q[aria-expanded="true"] svg {
    transform: rotate(45deg);
}

.faq-a {
    display: none;
    padding: 0 1.35rem 1.25rem;
    color: var(--gray-600);
}

.faq-a.is-open {
    display: block;
}

/* ---------- 内容页（下载/文章/FAQ/关于）---------- */
.page-head {
    padding: calc(var(--header-h) + 2.5rem) 0 2.5rem;
    background: linear-gradient(135deg, var(--teal-50), var(--emerald-50) 60%, #fff);
    text-align: center;
}

.page-head h1 {
    font-size: 2rem;
}

.page-head p {
    margin: 0.85rem auto 0;
    max-width: 42rem;
    color: var(--gray-600);
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: var(--gray-500);
}

.breadcrumb a:hover {
    color: var(--emerald-600);
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.download-card {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-3xl);
    padding: 2rem;
    text-align: center;
}

.download-card svg {
    width: 44px;
    height: 44px;
    color: var(--emerald-600);
    margin: 0 auto 0.75rem;
}

.download-card h2 {
    font-size: 1.3rem;
}

.download-card p {
    margin-top: 0.4rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.download-card .btn {
    margin-top: 1.25rem;
    width: 100%;
}

.note-box {
    margin-top: 2rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-2xl);
    padding: 1.25rem 1.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.prose {
    max-width: 48rem;
    margin: 0 auto;
}

.prose h2 {
    margin: 2.25rem 0 0.85rem;
    font-size: 1.4rem;
}

.prose h3 {
    margin: 1.75rem 0 0.6rem;
    font-size: 1.1rem;
}

.prose p {
    margin: 0.85rem 0;
    color: var(--gray-600);
}

.prose ul,
.prose ol {
    margin: 0.85rem 0;
    color: var(--gray-600);
}

.prose li {
    margin: 0.4rem 0;
}

.prose img {
    margin: 1.25rem 0;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-100);
}

.prose .steps li {
    margin: 0.6rem 0;
}

.article-foot {
    max-width: 48rem;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0 1.5rem;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-brand {
    grid-column: 1 / -1;
}

.footer-brand strong {
    display: block;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-col h2 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin: 0.4rem 0;
}

.footer-col a {
    color: var(--gray-400);
}

.footer-col a:hover {
    color: #fff;
}

.copyright {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-500);
    font-size: 0.8rem;
    text-align: center;
}

/* ---------- 响应式增强 ---------- */
@media (min-width: 768px) {
    .nav,
    .header-cta {
        display: flex;
    }

    .hamburger,
    .mobile-menu {
        display: none !important;
    }

    .hero {
        padding: calc(var(--header-h) + 3rem) 0 4rem;
    }

    .hero h1 {
        font-size: 3.6rem;
    }

    .hero-sub {
        font-size: 1.25rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }

    .section {
        padding: 6rem 0;
    }

    .section-head h2,
    .section-head-left h2 {
        font-size: 2.25rem;
    }

    .page-head {
        padding: calc(var(--header-h) + 3.5rem) 0 3.5rem;
    }

    .page-head h1 {
        font-size: 2.6rem;
    }
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .platforms-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .download-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .section-link {
        display: inline-flex;
    }

    .stat strong {
        font-size: 2.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .animate-glow {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
