/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #1d1d1f;
    --color-secondary: #86868b;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-background: #fbfbfd;
    --color-card: #ffffff;
    --color-border: #d2d2d7;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-card: 18px;
    --radius-button: 980px;
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--color-background);
    color: var(--color-primary);
    line-height: 1.47059;
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(251, 251, 253, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 21px;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-logo span {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-primary);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.nav-link:hover {
    opacity: 1;
}

/* Hero 区域 */
.hero {
    padding: 140px 0 80px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.hero-title {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.07143;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.16667;
    letter-spacing: 0.009em;
    color: var(--color-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 筛选标签 */
.filter-section {
    padding: 20px 0 40px;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-primary);
    background-color: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.filter-tab:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.filter-tab.active {
    background-color: var(--color-primary);
    color: white;
}

/* 工具网格 */
.tools-section {
    padding: 20px 0 120px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* 工具卡片 */
.tool-card {
    background-color: var(--color-card);
    border-radius: var(--radius-card);
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.tool-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    overflow: hidden;
}

.tool-icon svg {
    width: 32px;
    height: 32px;
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
}

.tool-name {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.16667;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.tool-category {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tool-description {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.47059;
    color: var(--color-secondary);
    margin-bottom: 24px;
    flex-grow: 1;
}

.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.tool-size {
    font-size: 13px;
    color: var(--color-secondary);
}

.detail-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: var(--color-accent);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.detail-btn:hover {
    background-color: var(--color-accent-hover);
    transform: scale(1.02);
}

.detail-btn:active {
    transform: scale(0.98);
}

/* 页脚 */
.footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 24px 0;
    font-size: 14px;
    color: #666666;
    background-color: #292929;
}

.footer-content p {
    margin: 8px 0;
    text-align: center;
}

/* 备案那一行 */
.footer-content .beian {
    display: flex;
    align-items: center;     /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    gap: 8px;                /* 元素间距 */
    flex-wrap: wrap;         /* 手机端自动换行 */
}

/* 分隔符 */
.footer-content .divider {
    color: #666666;
}

/* 公安备案链接 */
.footer-content .police {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 备案图标 */
.footer-content .police img {
    width: 16px;
    height: auto;
    vertical-align: middle;
}

.footer a {
    color: #666666;
    text-decoration: none;
}

.footer a:hover {
    color: #999999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-container {
        padding: 0 20px;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 19px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 24px;
    }

    .tool-name {
        font-size: 21px;
    }

    .filter-tabs {
        gap: 6px;
    }

    .filter-tab {
        padding: 6px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .tools-section {
        padding: 20px 0 80px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }
.tool-card:nth-child(7) { animation-delay: 0.35s; }
.tool-card:nth-child(8) { animation-delay: 0.4s; }
.tool-card:nth-child(9) { animation-delay: 0.45s; }

/* ==================== 详情页样式 ==================== */
.detail-main {
    padding-top: 92px;
    padding-bottom: 80px;
    min-height: calc(100vh - 200px);
}

.detail-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 48px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-skeleton {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 48px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.skeleton-icon,
.skeleton-line {
    background: linear-gradient(90deg, #eeeeee 25%, #f7f7f7 37%, #eeeeee 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.35s ease-in-out infinite;
}

.skeleton-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    flex-shrink: 0;
}

.skeleton-body {
    flex: 1;
    padding-top: 8px;
}

.skeleton-line {
    height: 18px;
    border-radius: 999px;
    margin-bottom: 16px;
    max-width: 620px;
}

.skeleton-line.short {
    width: 120px;
}

.skeleton-line.title {
    width: min(520px, 80%);
    height: 44px;
}

.skeleton-line.medium {
    width: min(420px, 65%);
}

.detail-loading-text {
    color: var(--color-secondary);
    font-size: 15px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

.detail-icon-large {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    flex-shrink: 0;
    overflow: hidden;
}

.detail-icon-large svg {
    width: 64px;
    height: 64px;
}

.detail-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    box-sizing: border-box;
}

.detail-header-info {
    flex: 1;
}

.detail-category-badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 980px;
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--color-accent);
    margin-bottom: 16px;
}

.detail-title {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.07143;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.detail-subtitle {
    font-size: 19px;
    font-weight: 400;
    line-height: 1.42115;
    color: var(--color-secondary);
    margin-bottom: 24px;
    max-width: 600px;
}

.detail-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-secondary);
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.download-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background-color: var(--color-accent);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.download-btn-large:hover {
    background-color: var(--color-accent-hover);
    transform: scale(1.02);
}

.download-btn-large:active {
    transform: scale(0.98);
}

/* 详情内容区域 */
.detail-section {
    margin-bottom: 48px;
}

.detail-section-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.detail-content-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-primary);
    background-color: white;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.detail-content-text p {
    margin-bottom: 16px;
}

.detail-content-text p:last-child {
    margin-bottom: 0;
}

/* 下载卡片 */
.download-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
    padding: 32px 40px;
    border-radius: 20px;
    color: white;
}

.download-card-left {
    flex: 1;
}

.download-card-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.download-card-desc {
    font-size: 15px;
    opacity: 0.9;
}

.download-card .download-btn-large {
    background-color: white;
    color: var(--color-accent);
    flex-shrink: 0;
}

.download-card .download-btn-large:hover {
    background-color: rgba(255, 255, 255, 0.95);
}

/* 详情页响应式 */
@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        gap: 24px;
        padding: 32px 0;
    }

    .detail-icon-large {
        width: 96px;
        height: 96px;
        border-radius: 22px;
    }

    .detail-icon-large svg {
        width: 48px;
        height: 48px;
    }

    .detail-title {
        font-size: 36px;
    }

    .detail-subtitle {
        font-size: 17px;
    }

    .detail-section-title {
        font-size: 24px;
    }

    .detail-content-text {
        padding: 24px;
        font-size: 15px;
    }

    .download-card {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 28px 24px;
    }

    .download-card-left {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .detail-title {
        font-size: 32px;
    }

    .detail-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==================== Markdown 渲染样式（详情页） ==================== */
.detail-content-text.markdown-body h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 28px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5ea;
}

.detail-content-text.markdown-body h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 24px 0 14px;
}

.detail-content-text.markdown-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 0 12px;
}

.detail-content-text.markdown-body p {
    margin-bottom: 16px;
    line-height: 1.8;
    font-size: 16px;
}

.detail-content-text.markdown-body p:last-child {
    margin-bottom: 0;
}

.detail-content-text.markdown-body strong {
    font-weight: 600;
}

.detail-content-text.markdown-body ul,
.detail-content-text.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.detail-content-text.markdown-body li {
    margin-bottom: 8px;
    line-height: 1.7;
    font-size: 16px;
}

.detail-content-text.markdown-body code {
    background-color: rgba(0, 0, 0, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.detail-content-text.markdown-body pre {
    background-color: #1d1d1f;
    color: #f5f5f7;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 18px;
}

.detail-content-text.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 14px;
}

.detail-content-text.markdown-body blockquote {
    border-left: 4px solid var(--color-accent);
    margin: 18px 0;
    color: var(--color-secondary);
    background-color: rgba(0, 113, 227, 0.05);
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
}

.detail-content-text.markdown-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.detail-content-text.markdown-body a {
    color: var(--color-accent);
    text-decoration: none;
}

.detail-content-text.markdown-body a:hover {
    text-decoration: underline;
}

.detail-content-text.markdown-body hr {
    border: none;
    border-top: 1px solid #e5e5ea;
    margin: 24px 0;
}

.detail-content-text.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
}

.detail-content-text.markdown-body th,
.detail-content-text.markdown-body td {
    border: 1px solid #e5e5ea;
    padding: 10px 16px;
    text-align: left;
}

.detail-content-text.markdown-body th {
    background-color: #f5f5f7;
    font-weight: 500;
}

/* ==================== 在线百宝箱 ==================== */
.online-toolbox {
    padding: 8px 0 76px;
}

.online-toolbox-heading {
    margin-bottom: 24px;
}

.online-toolbox-heading h2,
.downloads-heading h2 {
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.online-toolbox-layout {
    display: block;
}

.online-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.online-tool-card {
    min-height: 150px;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e7e7ec;
    border-radius: 22px;
    box-shadow: 0 14px 42px rgba(25, 28, 36, 0.07);
    cursor: pointer;
    transition: var(--transition);
}

.online-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.online-tool-card::after {
    content: "";
    width: 220px;
    height: 220px;
    position: absolute;
    right: -105px;
    bottom: -125px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.online-tool-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #1b8bff, #0064d2);
    border-radius: 17px;
    box-shadow: 0 12px 24px rgba(0, 113, 227, 0.18);
}

.online-tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-tool-icon--image {
    background: linear-gradient(145deg, #2499f4 0%, #0067ce 100%);
}

.online-tool-icon--qr {
    background: linear-gradient(145deg, #765ff2 0%, #4935b8 100%);
    box-shadow: 0 12px 24px rgba(76, 58, 190, 0.22);
}

.online-tool-glyph {
    width: 48px;
    height: 48px;
    display: block;
    color: #fff;
}

.online-tool-glyph--qr {
    width: 46px;
    height: 46px;
}

.online-generic-icon {
    color: #fff;
    font-size: 30px;
}

.online-tool-category {
    min-height: 28px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    color: var(--color-accent);
    background: #eef7ff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.online-card-main {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.online-card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-card-heading h3 {
    min-width: 0;
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.online-card-main > p {
    margin-top: 7px;
    color: #6e6e73;
    font-size: 14px;
    line-height: 1.55;
}

.online-card-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.online-card-footer > span {
    color: #86868b;
    font-size: 13px;
    font-weight: 620;
}

.online-card-footer .detail-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 7px 16px rgba(0, 113, 227, 0.18);
}

.downloads-heading {
    margin-bottom: 28px;
}

.filter-section {
    padding: 54px 0 34px;
    background: var(--color-background);
}

.tools-section {
    padding-top: 8px;
    background: var(--color-background);
}

.tool-card:focus-visible,
.online-tool-card:focus-visible,
.online-card-footer .detail-btn:focus-visible,
.filter-tab:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.28);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .nav-links {
        display: flex;
        gap: 14px;
    }

    .nav-link {
        font-size: 13px;
    }

    .online-toolbox {
        padding: 0 0 56px;
    }

    .online-toolbox-heading h2,
    .downloads-heading h2 {
        font-size: 30px;
    }

    .online-tools-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 480px) {
    .nav-logo span {
        font-size: 18px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-link {
        font-size: 12px;
    }

    .online-tool-card {
        min-height: 156px;
        padding: 18px;
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 14px;
    }

    .online-tool-icon {
        width: 56px;
        height: 56px;
        border-radius: 15px;
    }

    .online-tool-glyph {
        width: 42px;
        height: 42px;
    }

    .online-card-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .online-card-heading h3 {
        font-size: 19px;
    }

    .online-card-footer {
        gap: 10px;
    }

    .online-card-footer .detail-btn {
        min-height: 36px;
        padding: 8px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
