
:root {
    --background-color: #050505;
    --card-bg: #111111;
    --text-color: #ffffff;
    --border-color: #333;
    --nav-hover-bg: rgba(255, 255, 255, 0.06);
    --text-secondary: #b9b9b9;
    --panel-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
    --panel-border: rgba(255, 255, 255, 0.09);
    --accent-gradient: linear-gradient(120deg, #7dd3fc 0%, #a78bfa 45%, #f0abfc 100%);
}

[data-theme="light"] {
    --background-color: #eef1f7;
    --card-bg: #fcfdff;
    --text-color: #111111;
    --border-color: #dadde5;
    --nav-hover-bg: #f3f5fa;
    --text-secondary: #4e5562;
    --panel-shadow: 0 28px 65px rgba(17, 24, 39, 0.08);
    --panel-border: rgba(17, 24, 39, 0.08);
    --accent-gradient: linear-gradient(120deg, #0284c7 0%, #7c3aed 48%, #db2777 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at 20% 0%, rgba(125, 211, 252, 0.1), transparent 45%),
        radial-gradient(circle at 80% 100%, rgba(167, 139, 250, 0.12), transparent 40%),
        var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 0 20px 20px 20px;
}

nav {
    display: flex;
    padding: 14px 18px;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
    border: 1px solid var(--panel-border);
    background: color-mix(in srgb, var(--card-bg) 85%, transparent);
    border-radius: 14px;
    margin-top: 14px;
    backdrop-filter: blur(8px);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    text-transform: lowercase;
    transition: opacity 0.3s ease, color 0.3s ease, background-color 0.2s ease;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 999px;
}

nav a:hover {
    opacity: 1;
    background-color: var(--nav-hover-bg);
}

.random-quote {
    max-width: min(44vw, 420px);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.92;
    font-size: 14px;
    font-weight: 500;
    font-style: normal;
    line-height: 1.2;
}

.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease, background-color 0.2s ease;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: var(--nav-hover-bg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: clamp(28px, 5vw, 60px);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
    margin-top: 18px;
}

#homepage-text {
    font-size: clamp(2.3rem, 6.5vw, 4.4rem);
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: -1.4px;
    text-align: center;
}

#changing-word {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    transition: opacity 0.3s ease;
}

#changing-word.fade {
    opacity: 0;
}

.content {
    opacity: 0;
    transition: opacity 0.5s ease-in;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content.visible {
    opacity: 1;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    body {
        padding: 0 10px 10px 10px;
    }

    #homepage-text {
        font-size: 2.5em;
    }

    nav {
        padding: 15px 5px;
    }

    .nav-links {
        gap: 20px;
    }

    main {
        padding: 20px;
    }
}

/* Homepage Sections */
.homepage-sections {
    width: 100%;
    max-width: 900px;
    margin-top: clamp(42px, 9vh, 90px);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.homepage-section {
    width: 100%;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: clamp(18px, 2vw, 28px);
    background: color-mix(in srgb, var(--card-bg) 86%, transparent);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.homepage-section:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--text-secondary) 40%, var(--panel-border));
}

.section-header {
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.section-header a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.section-header a:hover {
    opacity: 0.7;
}

.about-text {
    line-height: 1.6;
    opacity: 0.95;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .homepage-sections {
        margin-top: 60px;
        gap: 40px;
    }

    .section-header {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
}

/* Page Content Styles */
.page-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-header h1 {
    font-weight: 400;
    font-size: 2em;
    letter-spacing: 1px;
}

.collection-list {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.collection-item {
    display: flex;
    gap: 20px;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-radius: 10px;
}

.collection-item:hover {
    background-color: var(--nav-hover-bg);
    transform: translateX(3px);
}

.collection-item .date {
    opacity: 0.75;
    font-size: 0.9em;
    min-width: 84px;
    color: var(--text-secondary);
}

.collection-item .main-info {
    font-weight: 500;
}

.collection-item .sub-info {
    opacity: 0.8;
}

/* Photo Grid Styles */
.photo-grid {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.photo-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 3/2;
    background-color: var(--nav-hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-placeholder {
    opacity: 0.8;
}

.photo-item .caption {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Today Page Styles */
.today-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding-bottom: 60px;
}

.today-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.8;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* Media Card (Song & Film) */
.media-card {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.media-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    background-color: var(--nav-hover-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8em;
    opacity: 0.5;
    border-radius: 4px;
    overflow: hidden;
}

.media-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 5px;
}

.media-title {
    font-size: 1.4em;
    font-weight: 500;
}

.media-artist,
.media-meta {
    font-size: 1em;
    opacity: 0.8;
}

.media-note {
    margin-top: 10px;
    font-size: 0.95em;
    opacity: 0.7;
    line-height: 1.5;
    font-style: italic;
}

/* Photo of the Day */
.photo-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.photo-frame {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: var(--nav-hover-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.5;
    border-radius: 4px;
    overflow: hidden;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-caption {
    font-size: 0.95em;
    opacity: 0.7;
    text-align: center;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 30px;
}

.book-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: var(--nav-hover-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.5;
    border-radius: 2px;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    text-align: center;
}

.book-title {
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 4px;
}

.book-author {
    font-size: 0.85em;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .media-card {
        flex-direction: column;
        gap: 15px;
    }

    .media-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 200px;
    }
}

/* Film Collection */
.film-collection {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px;
    padding: 20px 0;
}

.film-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background-color: var(--nav-hover-bg);
}

.poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.film-card:hover .add-btn {
    opacity: 1;
}

.rank-badge {
    position: absolute;
    bottom: -1px;
    left: -1px;
    background-color: #e50914;
    color: white;
    padding: 4px 8px;
    font-size: 0.9em;
    font-weight: bold;
    border-top-right-radius: 4px;
}

.film-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.film-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.meta-row,
.rating-row,
.actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dot {
    opacity: 0.5;
}

.rating-row .star {
    color: #f5c518;
    font-size: 1.2em;
}

.rate-link {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.rate-link:hover {
    opacity: 1;
}

.actions-row {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.mark-watched {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mark-watched:hover {
    color: var(--text-color);
}

.description {
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
