/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 图表样式 */
.chart-container {
    margin: 30px 0;
    padding: 15px 15px 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.chart-container h4 {
    text-align: center;
    margin-bottom: 15px;
    color: #8b4513;
}

.line-chart {
    height: 330px;
    position: relative;
    padding: 20px 10px 30px;
    min-width: 600px;
}

.chart-area {
    position: relative;
    height: 250px;
    margin-left: 50px;
    margin-bottom: 50px;
}

/* 数据点样式 */
circle {
    cursor: pointer;
    transition: r 0.2s ease;
}

/* 数据提示样式 */
.data-tooltip {
    position: absolute;
    font-size: 10px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    text-align: center;
}

/* 线图路径样式 */
path {
    transition: stroke-width 0.2s ease;
}

path:hover {
    stroke-width: 3px;
}

/* 图例样式 */
.chart-legend {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

.legend-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 3px;
}

.legend-text {
    font-size: 14px;
}

/* Y轴样式 */
.y-axis {
    position: absolute;
    left: 40px;
    bottom: 30px;
    width: 1px;
    height: 250px;
    background-color: #ccc;
}

body {
    font-family: "SimHei", "黑体", sans-serif;
    background-color: #f9f5e9;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* 确保花瓣动画不会导致水平滚动条 */
    position: relative; /* 为花瓣容器提供定位上下文 */
}

/* 花瓣动画样式 */
.petals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none; /* 确保花瓣不会干扰用户交互 */
    z-index: 10;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 60px;
    height: auto;
    opacity: 0;
    transform: translate(-100px, -100px) rotate(0deg);
    z-index: 10;
}

.petal-1 {
    animation: floatPetal1 15s ease-in-out infinite;
    animation-delay: 0s;
}

.petal-2 {
    animation: floatPetal2 18s ease-in-out infinite;
    animation-delay: 3s;
}

.petal-3 {
    animation: floatPetal3 20s ease-in-out infinite;
    animation-delay: 6s;
}

@keyframes floatPetal1 {
    0% {
        opacity: 0;
        transform: translate(-100px, -50px) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw - 100px), calc(100vh - 100px)) rotate(360deg);
    }
}

@keyframes floatPetal2 {
    0% {
        opacity: 0;
        transform: translate(-80px, -30px) rotate(45deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw - 150px), calc(100vh - 50px)) rotate(405deg);
    }
}

@keyframes floatPetal3 {
    0% {
        opacity: 0;
        transform: translate(-120px, -80px) rotate(90deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw - 50px), calc(100vh - 150px)) rotate(450deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 125px 1fr;
    grid-template-areas:
        "header header"
        "bubble bubble"
        "timeline main"
        "conclusion conclusion";
    gap: 20px;
}

/* 标题部分样式 */

header {
    grid-area: header;
    display: block;
    text-align: center;
    border-bottom: 2px solid #d4b95e;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

/* 带图片的标题样式 */
.header-with-image {
    background-image: url('黄玫瑰图片.png');
    background-size: cover;
    background-position: center;
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0;
}

.header-content {
    text-align: left;
    padding-left: 50px;
    width: 100%;
}

.header-with-image h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    display: block;
    width: auto;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-with-image .subtitle {
    font-size: 1.2rem;
    color: white;
    display: block;
    width: auto;
    margin: 0;
    text-align: left;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
/* 标题部分样式 */



h1 {
    font-size: 2.5rem;
    color: #8b4513;
    margin-bottom: 10px;
    display: block;
    width: 75%;
    margin: 0 auto 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    display: block;
    width: 75%;
    margin: 0 auto;
    text-align: center;
}

/* 气泡部分样式 */
.bubbles .square-bubble {
    color: #8B4513; /* 经典的褐色值 */
    /* 或使用颜色名：color: saddlebrown; */
}
.bubble-container {
    grid-area: bubble;
    padding: 20px;
    margin-bottom: 20px;
    background: none;
    border: none;
    box-shadow: none;
}

.bubble-intro {
    margin-bottom: 15px;
    font-style: italic;
    color: #666;
}

.bubbles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  
    gap: 15px;
}

.bubble {
    background-color: #ffde59;
     aspect-ratio: 1/1; /* 宽高比1:1 */
    height: auto;   
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem; 
    text-align: center;
    box-sizing: border-box;
}

.square-bubble {
    border-radius: 8px;
}
.special-square-bubble{
    background-color: white !important;
    border: 15px solid;
    border-color:#90624c;
    border-radius: 8px;
}

.photo-bubble {
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
}

#photo-bubble-1 {
    background-image: url('气泡1.png');
}

#photo-bubble-2 {
    background-image: url('气泡2.png');
}

#photo-bubble-3 {
    background-image: url('气泡3.png');
}

.bubble:hover {
    background-color: #fff2bd;
    transform: scale(1.05);
}

.photo-bubble:hover {
    transform: scale(1.05);
    border: 2px solid #ffde59;
}
/* 主要内容部分样式 */
main {
    grid-area: main;
}

section {
    margin-bottom: 30px;
    padding: 20px;
}

/* 信件部分样式 */
.letters-container {
    margin: 20px 0;
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.letter-item {
    background-color: #f5e8c9; /* 更改为米黄色 */
    border: 1px solid #d3c7a7;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.letter-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-width: 0 20px 20px 0;
    border-style: solid;
    border-color: #d3c7a7 #f0f0f0; /* 改为页面背景色 */
    box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.1);
}

.letter-header {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #d3c7a7;
    color: #8b4513;
}

.letter-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: #333;
}

.quote-text {
    display: block;
    margin: 10px 0;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-left: 3px solid #d3c7a7;
    font-style: italic;
    line-height: 1.6;
}

h2 {
    color: #8b4513;
    border-bottom: 2px solid #d4b95e;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: left;
}

h3 {
    color: #8b4513;
    margin: 25px 0;
    text-align: center;
    font-size: 1.5rem;
    padding: 15px 0;
    background-color: transparent;
    border: none;
}

h4 {
    color: #8b4513;
    margin: 20px 0 10px;
    font-size: 1.2rem;
    text-align: left;
    padding-left: 1em;
}

ul {
    list-style-type: none;
    margin-left: 20px;
}

ul li {
    margin-bottom: 8px;
    position: relative;
}

ul li::before {
    content: "•";
    color: #d4b95e;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.vertical-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-content, .human-content {
    width: 100%;
}

.hero-item, .human-item {
    padding: 15px;
}

.cement-factory-content p, .danish-flag-content p, .bio-content p, .medical-aid-content p, .photo-evidence-content p, .friendship-content p, .work-content p, .japan-strategy-content p, .conclusion-content p {
    margin-bottom: 15px;
    text-indent: 2em;
    line-height: 1.8;
}

.cement-factory-content blockquote, .danish-flag-content blockquote, .bio-content blockquote, .medical-aid-content blockquote, .photo-evidence-content blockquote, .friendship-content blockquote, .work-content blockquote, .japan-strategy-content blockquote, .conclusion-content blockquote {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0e6cc;
    border-left: 4px solid #d4b95e;
    font-style: italic;
}

.cement-factory-content blockquote p, .danish-flag-content blockquote p, .bio-content blockquote p, .medical-aid-content blockquote p, .photo-evidence-content blockquote p, .friendship-content blockquote p, .work-content blockquote p, .japan-strategy-content blockquote p, .conclusion-content blockquote p {
    text-indent: 0;
    font-size: 1.1rem;
    color: #8b4513;
    text-align: center;
}

.cement-factory-content blockquote footer, .danish-flag-content blockquote footer, .bio-content blockquote footer, .medical-aid-content blockquote footer, .photo-evidence-content blockquote footer, .friendship-content blockquote footer, .work-content blockquote footer, .japan-strategy-content blockquote footer, .conclusion-content blockquote footer {
    text-align: right;
    margin-top: 10px;
    color: #666;
}

.cement-factory-content ol, .danish-flag-content ol, .bio-content ol, .medical-aid-content ol, .photo-evidence-content ol, .friendship-content ol, .work-content ol, .japan-strategy-content ol, .conclusion-content ol {
    margin-left: 2em;
    list-style-type: decimal;
}

.cement-factory-content ol li, .danish-flag-content ol li, .bio-content ol li, .medical-aid-content ol li, .photo-evidence-content ol li, .friendship-content ol li, .work-content ol li, .japan-strategy-content ol li, .conclusion-content ol li {
    margin-bottom: 10px;
    padding-left: 10px;
}

.cement-factory-content ol li::before, .danish-flag-content ol li::before, .bio-content ol li::before, .medical-aid-content ol li::before, .photo-evidence-content ol li::before, .friendship-content ol li::before, .work-content ol li::before, .japan-strategy-content ol li::before, .conclusion-content ol li::before {
    content: none;
}

.note, .section-intro {
    font-style: italic;
    color: #666;
    margin-top: 20px;
    padding: 10px;
    background-color: #f9f5e9;
    border-left: 3px solid #d4b95e;
}

.section-intro {
    text-align: center;
    margin: 0 auto 20px;
    max-width: 80%;
    border: none;
    background: none;
}

.quote {
    font-style: italic;
    font-size: 1.2rem;
    color: #8b4513;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f5e9;
    border-left: 3px solid #d4b95e;
}

/* 年表侧边栏样式 */
.timeline {
    grid-area: timeline;
    padding: 20px;
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    box-shadow: none;
}

.timeline-point:hover .point-content {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* 确保重要事件的方形标记在悬停时保持方形 */
.point-circle.important:hover {
    border-radius: 5px;
    transform: scale(1.1);
    background-color: #d4b95e;
    color: #fff;
}

.point-circle.important:hover small {
    color: #fff;
}

.point-content {
    display: none;
    position: absolute;
    left: 80px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    z-index: 3;
    width: 250px;
    font-size: 1rem;
    border: 1px solid #d4b95e;
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.3s;
    line-height: 1.5;
}

.timeline h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #8b4513;
    background-color: transparent;
    border-top: 2px solid #d4b95e;
    border-bottom: 2px solid #d4b95e;
    padding: 10px 0;
}

.timeline-line {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.timeline-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #d4b95e;
    z-index: 1;
}

.timeline-point {
    position: relative;
    margin: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.point-circle {
    width: 80px;
    height: 80px;
    background-color: #ffffff;
    border: 2px solid #d4b95e;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #8b4513;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    padding: 5px;
    line-height: 1.1;
}

.point-circle.important {
    width: 80px;
    height: 100px;
    font-size: 0.9rem;
    font-weight: bold;
    border-width: 3px;
    border-radius: 5px;
    background-color: #ffffff;
    padding: 8px 5px;
}

.point-circle.important small {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #d4b95e;
    font-weight: bold;
}

.point-circle:hover {
    transform: scale(1.1);
    background-color: #d4b95e;
    color: #fff;
}

.conclusion {
    grid-area: conclusion;
    width: 100%;
    margin-top: 40px;
    padding: 30px;
    background: none;
    border: none;
    box-shadow: none;
    text-align: center;
}

.conclusion-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.conclusion-content p {
    text-indent: 2em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.conclusion-content blockquote {
    font-style: italic;
    color: #8b4513;
    border-left: 3px solid #d4b95e;
    padding-left: 20px;
    margin: 20px 0;
    background: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "bubble"
            "main"
            "conclusion";
    }

    .timeline {
        display: none;
    }

    header {
        justify-content: center;
    }

    .header-right {
        text-align: center;
        padding-left: 0;
    }

    h1, .subtitle {
        writing-mode: horizontal-tb;
        height: auto;
    }

    .hero-content, .human-content {
        grid-template-columns: 1fr;
    }
}
.conclusion-with-image {
    background-image: url('结语图片.png');
    background-size: cover;
    background-position: center;
    padding: 50px 30px;
    position: relative;
    border-radius: 8px;
    margin-top: 40px;
}

.conclusion-with-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.conclusion-with-image .conclusion-content {
    position: relative;
    z-index: 1;
}

.conclusion-with-image .conclusion-content p {
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.conclusion-with-image .conclusion-content blockquote {
    color: white;
    border-left: 3px solid #ffffff;
}

.conclusion-with-image .conclusion-content blockquote p {
    color: white;
}
