/* 打印优化的CSS样式 */

/* 基本页面设置 */
@page {
    size: A4;
    margin: 1cm;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    font-size: 10pt;
    line-height: 1.3;
    background: white;
    color: black;
}

/* 隐藏不必要的打印元素 */
.navbar, 
.mobile-menu, 
.back-to-top,
.modal-overlay,
.image-viewer,
.social-connections,
.footer,
.btn-link:not(.print-only),
.btn-secondary:not(.print-only),
#contact .contact-form,
.form-submit,
.animate__animated,
.animate-in,
.animated-item,
.achievement-item:hover,
.more-projects {
    display: none !important;
}

/* 容器控制 */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* 重置简历头部样式 */
.resume-header {
    padding: 15pt 0;
    background: none;
    box-shadow: none;
    page-break-after: avoid;
}

.resume-header::before {
    display: none;
}

.resume-header .container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 15pt;
}

.avatar-wrap {
    width: 80pt;
    height: 80pt;
}

/* 标题样式 */
h1, h2, h3, h4 {
    page-break-after: avoid;
    margin-top: 15pt;
    margin-bottom: 5pt;
}

.section-title {
    font-size: 14pt;
    margin-bottom: 10pt;
    border-bottom: 1pt solid #1E88E5;
    color: #1E88E5;
}

.section-title::after {
    display: none;
}

/* 确保分节打印不被截断 */
.resume-section {
    page-break-inside: avoid;
    padding: 10pt 0;
    border-bottom: none;
}

/* 卡片元素调整 */
.education-card, 
.project-card, 
.ai-card,
.certificate,
.skill-category {
    background: none;
    box-shadow: none;
    border: 1pt solid #ddd;
    break-inside: avoid;
}

/* 技能进度条 */
.skill-bar {
    border: 1pt solid #ccc;
}

.skill-progress {
    background-color: #ddd;
}

/* 确保所有图表和项目卡片布局合理 */
.education-grid,
.skills-container,
.project-grid,
.ai-applications,
.certificates,
.photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10pt;
}

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

/* 工作经历时间线优化 */
.timeline::before,
.timeline::after,
.timeline-item::after,
.timeline-end {
    display: none;
}

.timeline-item {
    width: 100%;
    left: 0 !important;
    padding: 5pt 0;
}

.timeline-content {
    box-shadow: none;
    border: 1pt solid #ddd;
}

.timeline-content::after {
    display: none;
}

/* 联系方式部分调整 */
.contact-card {
    box-shadow: none;
    border: 1pt solid #ddd;
    display: block;
}

.contact-item {
    padding-bottom: 5pt;
    margin-bottom: 5pt;
}

.contact-icon {
    width: 20pt;
    height: 20pt;
    min-width: 20pt;
}

/* 添加打印时的URL注释 */
a[href]:after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
}

/* 改善较宽表格和图片的适应性 */
img, table {
    max-width: 100% !important;
}

/* 添加QR码打印支持 */
.print-qrcode {
    display: block !important;
    text-align: center;
    margin: 10pt 0;
}

.print-qrcode img {
    width: 80pt;
    height: 80pt;
}

/* 确保页面底部不会意外断页 */
p, .info-item, .contact-item {
    orphans: 3;
    widows: 3;
}

/* 移除所有动画和转换效果 */
* {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* 链接样式 */
a {
    color: black;
    text-decoration: none;
}

/* 改善表格打印 */
table {
    border-collapse: collapse;
}

table, th, td {
    border: 1pt solid #ddd;
}

th, td {
    padding: 3pt;
}

/* 确保博客文章区域在打印时展示良好 */
.blog-container {
    display: block;
}

.blog-sidebar {
    display: none;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10pt;
}

.article-image {
    max-height: 50pt;
}

/* 添加打印时的页脚 */
@page {
    margin-bottom: 2cm;
}

body::after {
    content: "刘亮 - 个人简历 - 联系电话: 13938195869 - https://www.liuliangliang.top";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #999;
    margin-top: 20pt;
} 