@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Noto+Sans+JP:wght@300;400;500;700&family=Shippori+Mincho:wght@400;500;600&display=swap');

:root {
    /* Premium Light Palette */
    --c-white: #ffffff;
    --c-offwhite: #fcfcfc;
    --c-bg: #f2f6f9; /* Pale Blue-Grey */
    
    --c-primary: #7ea8be; /* Muted Deep Sea Blue */
    --c-primary-light: #a8d0e6;
    --c-primary-dark: #2c4c64;
    
    --c-accent: #d4af37; /* Classic Gold */
    --c-accent-light: #f3e5ab;
    
    --c-text: #2f3542;
    --c-text-muted: #747d8c;
    --c-text-light: #a4b0be;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(16px);
    
    /* Layout */
    --header-h: 70px;
    --max-w: 900px; /* Text-centered approach */
    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 8px;
}

/* Base Reset & Typography */
* { margin: 0; padding: 0; box-sizing: border-box; }

body.eco-body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--c-text);
    background-color: var(--c-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(168, 208, 230, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 40%);
    background-attachment: fixed;
    line-height: 1.8;
    min-height: 100vh;
    padding-top: var(--header-h); /* Compensate fixed header */
}

a { text-decoration: none; color: inherit; transition: opacity 0.3s, color 0.3s; }
a:hover { opacity: 0.7; }

/* Font Utilities */
.font-mincho { font-family: 'Shippori Mincho', serif; }
.font-cinzel { font-family: 'Cinzel', serif; }

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}
.section { margin-bottom: 80px; }

/* Components: Glass Panel */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-l);
}

/* --- Hero Section (Minimal) --- */
.hero {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

.hero-sub {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--c-primary);
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    display: block;
    opacity: 0; 
    animation: fadeUp 1s ease forwards 0.2s;
}

.hero-title {
    font-family: 'Shippori Mincho', serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--c-primary-dark);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.4s;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
}

.hero-desc {
    color: var(--c-text-muted);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.6s;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Story List --- */
.chapter-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.chapter-item a {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 0;
    color: var(--c-text);
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    text-decoration: none;
    transition: 0.3s;
}

.chapter-item a:hover {
    color: var(--c-primary);
    padding-left: 5px;
}

.chapter-num {
    color: var(--c-primary);
    margin-right: 15px;
    font-family: 'Cinzel', serif;
}

.chapter-title {
    flex: 1;
}

.chapter-date {
    font-size: 0.8rem;
    color: var(--c-text-light);
}

.story-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Story Card (Redesigned) */
.story-card {
    display: flex;
    gap: 30px;
    padding: 30px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255,255,255,0.75); /* Slightly more opaque */
    border-radius: var(--radius-m);
    box-shadow: var(--glass-shadow);
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.story-num {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: rgba(212, 175, 55, 0.2);
    line-height: 1;
    min-width: 80px;
    text-align: right;
    user-select: none;
}

.story-content { flex: 1; }

.story-meta {
    display: flex;
    gap: 15px;
    font-size: 0.75rem;
    color: var(--c-text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.story-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.75rem;
    color: var(--c-primary-dark);
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s;
}

.story-card:hover .story-title {
    color: var(--c-primary);
}

.story-summary {
    font-size: 0.95rem;
    color: var(--c-text-muted);
    line-height: 1.8;
}

/* --- Reader View --- */
.reader-container {
    /* Main wrapper for the story content */
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.85); /* Readability priority */
    margin-bottom: 80px;
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
}

/* Novel Controller (Minimal Pill) */
.novel-controller {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 1px dotted rgba(0,0,0,0.1);
}

.nc-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--c-text-muted);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.nc-btn:hover, .vt-controler-active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

/* Dream Form (Settings Card Style) */
.dream-form-container {
    background: #fff;
    border-radius: var(--radius-m);
    padding: 30px;
    margin-bottom: 60px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.dream-section-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    color: var(--c-primary-dark);
    margin-bottom: 25px;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--c-bg);
    padding-bottom: 10px;
}

.dream-input-group { margin-bottom: 20px; }
.dream-input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--c-text-light);
    margin-bottom: 8px;
    margin-left: 5px;
}

.dream-input-row { display: flex; gap: 15px; }

.dream-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #eee;
    background: var(--c-bg);
    border-radius: var(--radius-s);
    color: var(--c-text);
    font-family: inherit;
    transition: 0.3s;
}
.dream-input:focus {
    outline: none;
    border-color: var(--c-primary-light);
    background: #fff;
}

.dream-btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.dream-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 30px;
    background: var(--c-primary);
    color: #fff;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(126, 168, 190, 0.4);
}
.dream-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(126, 168, 190, 0.5);
}
.dream-btn.delete {
    background: #eee;
    color: var(--c-text-muted);
    box-shadow: none;
}
.dream-btn.delete:hover { background: #ddd; }

/* Novel Controller Functional Classes (Ported from base-style) */
.vertical-text {
    -ms-writing-mode: tb-rl;
    writing-mode: vertical-rl;
    width: 100%;
    height: 70vh; /* Fixed height for scrolling */
    text-orientation: upright;
    overflow-x: auto;
    overflow-y: hidden;
    line-height: 2em;
    margin: 0 auto;
}

.horizontal-text {
    writing-mode: horizontal-tb;
    width: 100%;
    height: auto;
    overflow-x: visible;
    overflow-y: visible;
}

/* Hide default controller injected by system (prevents duplication) */
.vt-controler-ctl,
.vt-controler,
.vt-cover {
    display: none !important;
}

/* Utility Classes */
.hide {
    display: none !important;
}

/* Markdown Content (Novel Body) */
.story-body {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.1rem; /* 17.6px */
    line-height: 2.2; /* Comfortable reading */
    color: var(--c-text);
}

.story-body p { margin-bottom: 2em; text-align: justify; }

/* Header & Menu */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: block; /* Visible by default (Mobile priority) */
    width: 40px; /* Slightly larger clickable area */
    height: 40px;
    position: fixed;
    top: 15px;
    right: 20px;
    cursor: pointer;
    z-index: 10002; /* Above Admin Bar (9999) */
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex; /* Center spans */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--c-primary-dark);
    position: absolute; /* Keep absolute for animation simplicity, but relative to button center */
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) { transform: translateY(-7px); }
.menu-toggle span:nth-child(2) { transform: translateY(0); }
.menu-toggle span:nth-child(3) { transform: translateY(7px); }

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--c-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-overlay ul {
    list-style: none;
    text-align: center;
}

.nav-overlay li {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.nav-overlay.active li {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger delays for items */
.nav-overlay.active li:nth-child(1) { transition-delay: 0.1s; }
.nav-overlay.active li:nth-child(2) { transition-delay: 0.2s; }
.nav-overlay.active li:nth-child(3) { transition-delay: 0.3s; }
.nav-overlay.active li:nth-child(4) { transition-delay: 0.4s; }

/* Home Menu Styles (Mobile Overlay Override) */
.nav-overlay .home_menu {
    padding: 0;
    margin: 20px 0;
    width: 100%;
    list-style: none;
}
/*.nav-overlay .home_menu ul { list-style: none; padding: 0; }  <-- Removed incorrect nested selector */
.nav-overlay .home_menu li {
    margin: 15px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.3s; /* Delayed appearance */
}
.nav-overlay.active .home_menu li {
    opacity: 1;
    transform: translateY(0);
}
.nav-overlay .home_menu a {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem; /* Slightly smaller than main links */
    color: var(--c-primary-dark);
}

.nav-overlay a {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--c-primary-dark);
    text-decoration: none;
    position: relative;
}

.nav-overlay a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--c-accent);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-overlay a:hover::after {
    width: 100%;
    left: 0;
}

.site-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--c-primary-dark);
}

/* PC Menu (Sidebar behavior) */
@media (min-width: 1200px) {
    .pc-menu-container {
        position: fixed;
        top: 120px;
        left: calc(50% - var(--max-w)/2 - 280px); /* Positioning to the left of content */
        width: 240px;
        background: transparent;
        z-index: 90;
    }
    .accordion-header {
        font-family: 'Cinzel', serif;
        font-size: 0.9rem;
        color: var(--c-text-muted);
        padding: 10px 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        transition: 0.3s;
        /* Button Reset */
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        width: 100%;
        text-align: left;
    }
    .accordion-header:hover { color: var(--c-primary); }
    .accordion-content { padding: 10px 0 20px 0; font-size: 0.85rem; }
    .accordion-content ul li { margin-bottom: 8px; }
    .accordion-content a { color: var(--c-text-muted); }
    .accordion-content a:hover { color: var(--c-primary); padding-left: 5px; }

    /* Home Menu Styles (PC Sidebar Override) */
    .accordion-content .home_menu {
        list-style: none;
        padding: 0;
        margin-top: 10px;
        border-top: 2px solid rgba(0,0,0,0.05); /* Slightly darker/thicker to separate */
        padding-top: 10px;
    }
    .accordion-content .home_menu li {
        margin-bottom: 8px;
    }
    
    /* Hide Inline TOC (Body) on PC */
    #eco-toc-container { display: none !important; }

    /* Hide Mobile Menu Toggle on PC */
    .menu-toggle { display: none !important; }
}

/* Mobile Adjustments */
@media (max-width: 1199px) {
    body.eco-body { padding-top: 60px; }
    .story-card {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    .story-num {
        text-align: left;
        font-size: 2.5rem;
    }
    .reader-container { padding: 40px 20px; }
    .pc-menu-container { display: none; } /* Use bottom nav or burger for mobile */
    
    /* .menu-toggle is block by default now */
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.8rem;
    color: var(--c-text-muted);
    font-family: 'Cinzel', serif;
    opacity: 0.6;
}
