/*
Theme Name: 校园恋爱物语
Description: 日式校园恋爱动漫清新风格模板
*/

/* 1. General Styles */
@import url('https://fonts.googleapis.com/css2?family=Klee+One&family=Noto+Sans+SC:wght@300;400;700&display=swap');

:root {
    --sakura-pink: #ffb7c5;
    --sky-blue: #87ceeb;
    --cream-white: #fffef2;
    --leaf-green: #90ee90;
    --sunset-orange: #ffa07a;
    --font-main: 'Noto Sans SC', sans-serif;
    --font-handwritten: 'Klee One', cursive;
}

body {
    font-family: var(--font-main);
    background-color: var(--cream-white);
    color: #555;
    margin: 0;
    padding: 0;
    line-height: 1.7;
    font-size: 16px;
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.page-fade-out {
    opacity: 0;
}

a {
    color: var(--sakura-pink);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--sunset-orange);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 2. Layout */
.main-header {
    background: #fff;
    border-bottom: 2px solid var(--sky-blue);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(135, 206, 235, 0.2);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    width: 160px;
    height: auto;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li a {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    color: var(--sky-blue);
    border-radius: 20px;
}

.main-nav li a:hover, .main-nav li.current a {
    background-color: var(--sakura-pink);
    color: #fff;
    text-decoration: none;
}

#content {
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
    padding-bottom: 30px;
}

.main-content {
    width: 73%;
}

.sidebar {
    width: 25%;
    font-family: var(--font-handwritten);
}

footer {
    background: #fff;
    border-top: 2px solid var(--sky-blue);
    padding: 30px 0;
    color: #777;
    font-size: 14px;
}

footer .container {
    display: flex;
    justify-content: space-between;
}

footer h3 {
    font-family: var(--font-handwritten);
    color: var(--sakura-pink);
    font-size: 22px;
    border-bottom: 1px dashed var(--sakura-pink);
    padding-bottom: 5px;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 8px;
}

.copyright {
    text-align: center;
    width: 100%;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* 3. Card Styles */
.section-title {
    font-family: var(--font-handwritten);
    font-size: 32px;
    color: var(--sunset-orange);
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: '🌸';
    position: absolute;
    right: -20px;
    top: 0;
    font-size: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.card-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.card-item:hover {
    box-shadow: 10px 10px 25px rgba(0,0,0,0.1);
}

.card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-info {
    padding: 20px;
}

.card-title {
    font-family: var(--font-handwritten);
    font-size: 22px;
    margin: 0 0 10px;
}

.card-title a {
    color: #333;
}

.card-meta {
    font-size: 13px;
    color: #999;
}

/* Note Style Card */
.note-style {
    background-color: #fffef2;
    border: 1px solid #f0eada;
    transform: rotate(-2deg);
}

.note-style:nth-child(even) {
    transform: rotate(1.5deg);
}

.note-style:hover {
    transform: rotate(0) scale(1.05);
    z-index: 10;
}

.note-style::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--sakura-pink);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Envelope Style Card */
.envelope-style {
    position: relative;
    background: #f9f9f9;
    transform: rotate(2.5deg);
}

.envelope-style:nth-child(even) {
    transform: rotate(-1deg);
}

.envelope-style .card-thumb {
    position: relative;
    overflow: hidden;
}

.envelope-style .card-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--sky-blue), var(--leaf-green));
    opacity: 0.2;
    transition: opacity 0.5s ease;
}

.envelope-style:hover .card-thumb::after {
    opacity: 0;
}

.envelope-style .card-info {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.envelope-style:hover .card-info {
    transform: translateY(-50px);
    opacity: 0;
}

.envelope-style::before {
    content: '💌';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.envelope-style:hover::before {
    opacity: 1;
}

/* 4. Specific Page Styles */

/* List Page */
.list-page .main-content {
    background-image: linear-gradient(to bottom, #fffef2 1px, transparent 1px);
    background-size: 100% 2.2em;
    line-height: 2.2em;
    border: 1px solid #e8e8e8;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.list-title {
    font-family: var(--font-handwritten);
    font-size: 36px;
    color: var(--sakura-pink);
    text-align: center;
    margin-bottom: 20px;
}

.list-item {
    display: flex;
    margin-bottom: 2.2em;
    border-bottom: 1px dashed var(--sky-blue);
    padding-bottom: 1em;
}

.list-item .item-thumb {
    flex: 0 0 200px;
    margin-right: 20px;
}

.item-title {
    font-size: 24px;
    margin: 0;
}

.item-meta {
    font-size: 14px;
    color: #aaa;
}

.item-summary {
    font-size: 16px;
}

.pagination ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.pagination li a {
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid var(--sakura-pink);
    border-radius: 20px;
}

.pagination li a:hover, .pagination li.active a {
    background: var(--sakura-pink);
    color: #fff;
    text-decoration: none;
}

/* Show Page */
.show-page .main-content {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-title {
    font-family: var(--font-handwritten);
    font-size: 42px;
    color: var(--sunset-orange);
    margin: 0 0 15px;
}

.post-meta {
    font-size: 14px;
    color: #999;
}

.post-meta span {
    margin: 0 10px;
}

.post-body {
    font-size: 17px;
    line-height: 1.8;
}

.post-body img {
    display: block;
    margin: 20px auto;
    max-width: 80%;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.post-navigation {
    margin-top: 40px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
}

/* 5. Widget Styles */
.widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #f0eada;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 24px;
    color: var(--leaf-green);
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sky-blue);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-list li {
    margin-bottom: 10px;
    counter-increment: rank;
    display: flex;
    align-items: center;
}

.ranking-list li i {
    font-style: normal;
    margin-right: 10px;
    font-weight: bold;
    color: var(--sakura-pink);
    font-size: 18px;
}

.random-recommendations li {
    display: flex;
    margin-bottom: 15px;
}

.random-recommendations .thumb {
    flex: 0 0 80px;
    margin-right: 15px;
}

.random-recommendations .thumb img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.random-recommendations h4 {
    font-size: 16px;
    margin: 0 0 5px;
    font-family: var(--font-main);
}

.random-recommendations p {
    font-size: 13px;
    color: #888;
    margin: 0;
    font-family: var(--font-main);
}

.category-list li a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
}

/* 6. Animations and Effects */

/* Canvas for Sakura */
#sakura-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Click Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(135, 206, 235, 0.5);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Paper Curl Shadow */
.card-item, .widget {
    position: relative;
}

.card-item::after, .widget::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50%;
    height: 20px;
    box-shadow: 0 15px 10px rgba(0, 0, 0, 0.3);
    transform: rotate(3deg);
    z-index: -1;
    transition: opacity 0.3s;
}

.card-item:hover::after, .widget:hover::after {
    opacity: 0.8;
}

/* 7. Responsive Media Queries */

/* For Tablets (<= 1024px) */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }
}

@media (max-width: 1024px) {
    #content {
        flex-direction: column;
    }

    .main-content, .sidebar {
        width: 100%;
    }

    .sidebar {
        margin-top: 30px;
    }

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

/* For Mobile Landscape (<= 768px) */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
    }

    .main-nav {
        margin-top: 15px;
    }

    .main-nav li a {
        padding: 8px 12px;
        font-size: 16px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .post-body img {
        max-width: 100%;
    }

    .list-item {
        flex-direction: column;
    }

    .list-item .item-thumb {
        margin-right: 0;
        margin-bottom: 15px;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }

    footer .links, footer .domains {
        margin-bottom: 20px;
    }
}

/* For Mobile Portrait (<= 480px) */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav li {
        margin: 5px;
    }

    .section-title {
        font-size: 28px;
    }

    .post-title {
        font-size: 32px;
    }

    .show-page .main-content, .list-page .main-content {
        padding: 20px;
    }
}

