/**
 * 自定义样式
 * Tailwind CSS 为主，此处补充自定义样式
 */

/* CSS 变量定义 - 现代黑色主题 */
:root {
    --primary: #18181B;
    --primary-dark: #0A0A0A;
    --primary-light: #3F3F46;
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --accent-light: #FBBF24;
}

/* 全局样式 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* 导航链接高亮 */
.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* 系统卡片悬停效果增强 */
.system-card:hover .fa-arrow-right {
    transform: translateX(4px);
}

/* 文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* ===== 首页浅色 Hero：一次性入场动效（只播放一次，不循环） ===== */
@keyframes 入场上浮 {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.入场上浮 {
    animation: 入场上浮 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.入场延迟-1 { animation-delay: 0.08s; }
.入场延迟-2 { animation-delay: 0.16s; }
.入场延迟-3 { animation-delay: 0.26s; }

/* ===== 区块眉标（eyebrow 小标签） ===== */
.区块眉标 {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #b45309;
}

/* ===== 浅色网格纹理（全站浅色 Hero 使用） ===== */
.网格纹理-浅色 {
    background-image:
        linear-gradient(rgba(120, 113, 108, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 113, 108, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 15%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 15%, transparent 72%);
}

/* ===== 导航栏：滚动后的发丝线阴影（替代偏重的 shadow-md） ===== */
#navbar.navbar-scrolled {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ===== 桌面端导航当前页：文字加重 + 琥珀下划线 ===== */
.nav-link {
    position: relative;
}

@media (min-width: 768px) {
    .nav-link.active::after {
        content: '';
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 2px;
        height: 2px;
        border-radius: 2px;
        background: #f59e0b;
    }
}

/* ===== 移动端菜单：高度 + 透明度过渡（默认收起） ===== */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

#mobile-menu.is-open {
    max-height: 520px;
    opacity: 1;
}

/* ===== 内页筛选按钮（功能 / 日志 / 下载页通用，JS 仅切换 active） ===== */
.filter-btn,
.changelog-filter-btn,
.download-filter-btn {
    background-color: #ffffff;
    color: #57534e;
    border: 1px solid #e7e5e4;
}

.filter-btn:hover,
.changelog-filter-btn:hover,
.download-filter-btn:hover {
    border-color: #fcd34d;
    color: #b45309;
}

.filter-btn.active,
.changelog-filter-btn.active,
.download-filter-btn.active {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.filter-btn i,
.changelog-filter-btn i,
.download-filter-btn i {
    color: #a8a29e;
}

.filter-btn:hover i,
.changelog-filter-btn:hover i,
.download-filter-btn:hover i {
    color: #d97706;
}

.filter-btn.active i,
.changelog-filter-btn.active i,
.download-filter-btn.active i {
    color: #ffffff;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===== 下载次数 +1 弹跳动画 ===== */
@keyframes 次数弹跳 {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); color: #F59E0B; }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.download-count-num.animate-pop {
    animation: 次数弹跳 0.5s ease-out;
    display: inline-block;
}

/* ===== 文章正文排版（富文本白名单标签） ===== */
.文章正文 {
    color: #374151;
    font-size: 16px;
    line-height: 1.9;
    word-break: break-word;
}

.文章正文 > *:first-child {
    margin-top: 0;
}

.文章正文 h1,
.文章正文 h2,
.文章正文 h3,
.文章正文 h4,
.文章正文 h5 {
    color: #1f2937;
    font-weight: 700;
    line-height: 1.4;
    margin: 1.8em 0 0.8em;
}

.文章正文 h1 { font-size: 1.6em; }
.文章正文 h2 {
    font-size: 1.4em;
    padding-left: 12px;
    border-left: 4px solid #f59e0b;
}
.文章正文 h3 { font-size: 1.2em; }
.文章正文 h4 { font-size: 1.05em; }
.文章正文 h5 { font-size: 1em; }

.文章正文 p {
    margin: 0 0 1em;
}

.文章正文 a {
    color: #d97706;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

.文章正文 a:hover {
    color: #b45309;
}

.文章正文 strong {
    color: #1f2937;
    font-weight: 700;
}

.文章正文 ul,
.文章正文 ol {
    margin: 0 0 1em;
    padding-left: 1.6em;
}

.文章正文 ul { list-style: disc; }
.文章正文 ol { list-style: decimal; }

.文章正文 li {
    margin: 0.4em 0;
}

.文章正文 li::marker {
    color: #f59e0b;
}

.文章正文 blockquote {
    margin: 1.2em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid #fbbf24;
    background: #fffbeb;
    color: #78716c;
    border-radius: 0 8px 8px 0;
}

.文章正文 blockquote p:last-child {
    margin-bottom: 0;
}

.文章正文 code {
    background: #f3f4f6;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.文章正文 pre {
    margin: 1.2em 0;
    padding: 1em 1.2em;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 10px;
    overflow-x: auto;
    line-height: 1.6;
}

.文章正文 pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.9em;
}

.文章正文 img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.2em auto;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.文章正文 hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

.文章正文 table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.95em;
}

.文章正文 th,
.文章正文 td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}

.文章正文 th {
    background: #f9fafb;
    font-weight: 600;
    color: #1f2937;
}

.文章正文 figure {
    margin: 1.2em 0;
}

.文章正文 figcaption {
    text-align: center;
    font-size: 0.85em;
    color: #9ca3af;
    margin-top: 0.5em;
}

/* ===== 尊重系统"减少动态效果"设置：关闭/缩短所有动画 ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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