/* 通用样式 */
:root {
    --primary-color: #9e7777;
    --secondary-color: #f5f5f5;
    --accent-color: #d4a5a5;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-color: #f3e1e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    background-color: #000;
}

/* 星空背景效果 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #000000, #191970);
    opacity: 0.8;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4 {
    font-weight: 500;
    line-height: 1.2;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* 页眉样式 - 优化版本 */
.parallax-header {
    background: url('../images/header-bg.jpg') no-repeat center center/cover;
    background-attachment: fixed;
    position: relative;
    color: white;
    padding: 120px 0;
    text-align: center;
    overflow: hidden;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(158, 119, 119, 0.85), rgba(212, 165, 165, 0.7));
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.header-icon {
    display: inline-block;
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    margin-bottom: 20px;
    backdrop-filter: blur(3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-icon i {
    font-size: 28px;
    color: white;
    animation: heartBeat 1.5s infinite ease-in-out;
}

.parallax-header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    margin-bottom: 15px;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    color: var(--secondary-color);
    letter-spacing: 2px;
}

.parallax-header .subtitle {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    color: var(--secondary-color);
    letter-spacing: 1px;
}

.header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    margin: 20px auto 0;
}

.header-divider span {
    flex: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.6);
}

.header-divider i {
    margin: 0 15px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

/* 导航栏优化样式 */
.main-nav {
    background-color: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.main-nav.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 12px;
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-right: 30px;
    position: relative;
}

.main-nav ul li:last-child {
    margin-right: 0;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 6px 0;
    position: relative;
}

.main-nav a i {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

.main-nav a:hover i {
    transform: translateY(-2px);
}

.main-nav a:hover {
    color: var(--primary-color);
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 0.95rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.user-info i {
    margin-right: 6px;
    color: var(--primary-color);
}

#user-display {
    color: var(--primary-color);
    font-weight: 500;
}

#logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

#logout-btn:hover {
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
}

/* 添加动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.2);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.2);
    }

    70% {
        transform: scale(1);
    }
}

/* 响应式适配优化 */
@media (max-width: 768px) {
    .parallax-header {
        padding: 100px 0;
        background-attachment: scroll;
    }

    .parallax-header h1 {
        font-size: 3rem;
    }

    .parallax-header .subtitle {
        font-size: 1.2rem;
    }

    .main-nav ul li {
        margin-right: 20px;
    }

    .main-nav a i {
        margin-right: 5px;
    }
}

@media (max-width: 576px) {
    .parallax-header {
        padding: 80px 0;
    }

    .parallax-header h1 {
        font-size: 2.5rem;
    }

    .header-icon {
        width: 60px;
        height: 60px;
        line-height: 60px;
    }

    .main-nav .container {
        flex-direction: column;
        padding-top: 15px;
    }

    .main-nav ul {
        margin-bottom: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav ul li {
        margin: 5px 10px;
    }

    .user-panel {
        margin-top: 5px;
    }
}

/* 区块通用样式 */
section {
    padding: 80px 0;
    background-color: white;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* 爱的计时器样式 */
.love-timer {
    background-color: var(--secondary-color);
    padding: 50px 0;
    text-align: center;
}

.timer-container {
    max-width: 700px;
    margin: 0 auto;
}

.timer-container h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.time-block {
    min-width: 90px;
    padding: 15px 10px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.time-block span:first-child {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.time-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* 我们的故事样式 */
.story-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.story-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px var(--shadow-color);
}

.story-image img {
    display: block;
    width: 100%;
    transition: transform 0.3s ease;
}

.story-image:hover img {
    transform: scale(1.03);
}

.story-text {
    padding: 20px;
}

.story-intro {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.story-text p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* 时间线样式 - 现代版 */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    transform: translateX(-50%);
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(212, 165, 165, 0.3);
}

.timeline-item {
    position: relative;
    margin-bottom: 80px;
    width: 50%;
    box-sizing: border-box;
    perspective: 1000px;
}

.timeline-item:nth-child(odd) {
    padding-right: 50px;
    left: 0;
}

.timeline-item:nth-child(even) {
    padding-left: 50px;
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(212, 165, 165, 0.3), 0 0 8px rgba(0, 0, 0, 0.15);
    top: 10px;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -12px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -12px;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(212, 165, 165, 0.2), 0 0 12px rgba(0, 0, 0, 0.2);
}

.timeline-date {
    position: absolute;
    top: 10px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-date {
    right: -160px;
}

.timeline-item:nth-child(even) .timeline-date {
    left: -160px;
}

.timeline-item:hover .timeline-date {
    transform: scale(1.05);
}

.timeline-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content {
    border-right-color: var(--accent-color);
}

.timeline-item:nth-child(even) .timeline-content {
    border-left-color: var(--accent-color);
}

.timeline-content:hover {
    transform: translateY(-8px) rotateX(3deg);
    box-shadow: 0 15px 30px var(--shadow-color);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.timeline-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

.timeline-content p {
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 0;
}

.add-memory {
    text-align: center;
    margin-top: 60px;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 0;
        left: 0;
        margin-bottom: 60px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        border-left-color: var(--accent-color);
        border-right-color: transparent;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-date,
    .timeline-item:nth-child(even) .timeline-date {
        left: 70px;
        right: auto;
        top: -30px;
    }
}

/* 照片墙样式 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    cursor: pointer;
    height: 300px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 15px;
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.gallery-caption h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.gallery-caption p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.gallery-controls {
    text-align: center;
}

/* 特别瞬间样式 */
.moments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.moment-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease;
}

.moment-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow-color);
}

.moment-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--highlight-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
}

.moment-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.moment-card:hover .moment-icon {
    background-color: var(--primary-color);
}

.moment-card:hover .moment-icon i {
    color: white;
}

.moment-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.moment-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.add-moment {
    text-align: center;
}

/* 留言板样式 */
.message-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.message-form,
.message-list {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.message-form h3,
.message-list h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 165, 165, 0.2);
}

.message-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.message-author {
    font-weight: 500;
    color: var(--primary-color);
}

.message-time {
    font-size: 0.85rem;
    color: #777;
}

.message-body p {
    line-height: 1.7;
}

/* 页脚样式 */
footer {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-align: center;
    padding: 30px 0;
}

footer p {
    margin-bottom: 10px;
}

footer .love-quote {
    font-weight: 500;
    color: var(--primary-color);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    max-width: 550px;
    width: 90%;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    color: #333;
    transform: scale(1.1);
}

.modal h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.modal-image-container {
    text-align: center;
    max-height: 80vh;
    overflow: auto;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-note {
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* 登出消息 */
.logout-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
}

.logout-message i {
    color: #4CAF50;
    font-size: 2rem;
    margin-bottom: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.notification {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-left: 4px solid #9e7777;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    max-width: 300px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #4CAF50;
}

.notification.error {
    border-left-color: #F44336;
}

.notification.warning {
    border-left-color: #FF9800;
}

.notification.info {
    border-left-color: #2196F3;
}

.notification p {
    margin: 0;
    padding: 0;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .story-content {
        grid-template-columns: 1fr;
    }

    .timer {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .main-nav .container {
        flex-direction: column;
        padding-top: 15px;
    }

    .main-nav ul {
        margin-bottom: 15px;
    }

    .main-nav ul li {
        margin-right: 15px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-dot {
        left: 6px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline-date {
        left: 45px;
        font-size: 1rem;
    }

    .moment-card h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    header {
        padding: 80px 0;
    }

    header h1 {
        font-size: 2.3rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .story-intro {
        font-size: 1.5rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav ul li {
        margin: 5px 10px;
    }

    .time-block {
        min-width: 70px;
    }

    .time-block span:first-child {
        font-size: 2rem;
    }

    .modal-content {
        margin: 15% auto;
        padding: 20px;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-time {
        margin-top: 5px;
    }
}