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

/* 基础样式 */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #1F2937;
    background-color: #ffffff;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 表单元素基础样式 */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* 导航栏样式 */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 移动菜单动画 */
#mobileMenu {
    transition: all 0.3s ease;
}

/* 按钮悬停效果 */
.btn-primary {
    background-color: #2D5BFF;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #1E3A8A;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary {
    background-color: white;
    color: #2D5BFF;
    border: 1px solid #2D5BFF;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #2D5BFF;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 图片悬停效果 */
.img-hover {
    transition: transform 0.5s ease;
}

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

/* 文本渐变 */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, #2D5BFF, #1E3A8A);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* 懒加载元素 */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 回到顶部按钮 */
#backToTop {
    transition: all 0.3s ease;
    z-index: 50;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* 表单验证样式 */
.form-error {
    border-color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* 打印样式 */
@media print {
    #navbar,
    #mobileMenu,
    #backToTop,
    .no-print {
        display: none !important;
    }
    body {
        background-color: white;
        color: black;
    }
}

/* 临时修复：强制报价表单输入/选择/文本域文字可见性（解决某些环境下文本不可见的问题） */
form#quoteForm input,
form#quoteForm select,
form#quoteForm textarea {
    color: #1F2937 !important;
    background-color: #ffffff !important;
}

/* 文章页面样式改进：更舒适的行距、首段引导、元信息与代码块样式 */
.post-article {
    font-size: 18px;
    line-height: 1.9;
    color: #111827;
}
.post-article h1 { font-size: 2.25rem; line-height: 1.15; margin-bottom: 0.5rem; }
.post-meta {
    color: #6b7280;
    font-size: 0.95rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.post-lead {
    font-size: 1.125rem;
    color: #374151;
    margin-bottom: 1rem;
}
.post-content p { margin-bottom: 1rem; color: #334155; }
.post-content img { border-radius: 8px; box-shadow: 0 6px 18px rgba(15,23,42,0.08); margin: 1rem 0; }
.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.post-tag { background: #f3f4f6; color: #374151; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.85rem; }
.post-category { background: #eef2ff; color: #3730a3; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.85rem; }

/* code block improvements */
.post-content pre { background: #0f172a; color: #e6eef8; padding: 1rem; border-radius: 8px; overflow:auto; }
.post-content pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace; color: inherit; }
.post-content code { background: #f3f4f6; padding: 0.15rem 0.35rem; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; }

@media (max-width: 768px) {
    .post-article { font-size: 16px; line-height: 1.8; }
    .post-article h1 { font-size: 1.75rem; }
}