/* ============================================
   pages.css — 全屏翻页版块样式（高级版）
   ============================================ */

#page-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

.full-page {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: calc(var(--nav-height) + 20px) var(--page-padding) var(--page-padding);
    opacity: 0; visibility: hidden; overflow: hidden;
    pointer-events: none;
}
.full-page.active {
    opacity: 1; visibility: visible; pointer-events: auto;
}
/* Allow scroll for pages with expandable content */
.page-science.active,
.page-sharing.active {
    overflow-y: auto !important;
    overflow-x: hidden;
    justify-content: flex-start !important;
    padding-top: calc(var(--nav-height) + 12px);
    padding-bottom: 80px;
}

/* iframe pages */
.page-iframe {
    padding: 0;
    overflow: hidden;
    z-index: 2;
}
.page-iframe iframe {
    width: 100%; height: 100%; border: none;
    display: block;
}

.page-title {
    font-family: var(--font-serif); font-size: 2.5rem; font-weight: 700;
    margin-bottom: 16px; text-align: center;
}
.page-subtitle {
    font-size: 1.1rem; color: var(--color-text-secondary);
    text-align: center; margin-bottom: 40px; letter-spacing: 0.05em;
}

/* ========== PAGE 1: HOME ========== */
.page-home .hero-title {
    font-family: var(--font-serif); font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-align: center; margin-bottom: 16px;
    background: linear-gradient(135deg, #f0d060 0%, #e0c060 30%, #c89030 60%, #a87828 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.3));
}
.page-home .hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    text-align: center; margin-bottom: 40px; letter-spacing: 0.25em;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-home .hero-quote {
    max-width: 620px; text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.95rem; line-height: 2.1; font-weight: 300;
}
.page-home .hero-quote em {
    font-style: normal;
    background: linear-gradient(90deg, #ffd700, #ffaa44);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-home .entropy-toggle {
    margin-top: 40px; padding: 14px 36px; border-radius: 50px;
    border: 1.5px solid rgba(201, 168, 76, 0.4);
    background: rgba(201, 168, 76, 0.06);
    color: var(--color-accent-bright);
    font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500;
    letter-spacing: 0.12em; cursor: pointer; transition: all 0.4s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.03);
    position: relative; overflow: hidden;
}
.page-home .entropy-toggle::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.12), transparent);
    transition: left 0.6s;
}
.page-home .entropy-toggle:hover::before { left: 100%; }
.page-home .entropy-toggle:hover {
    background: rgba(201, 168, 76, 0.12);
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.25), 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-3px);
}
.page-home .entropy-toggle.ordered {
    border-color: rgba(255, 215, 0, 0.4); color: var(--color-gold-bright);
    background: rgba(255, 215, 0, 0.06);
}
.page-home .entropy-toggle.ordered::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.12), transparent);
}
.page-home .entropy-toggle.ordered:hover {
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.25), 0 4px 20px rgba(0,0,0,0.3);
}

/* ========== PAGE 2: PHILOSOPHY ========== */
.page-philosophy .philosophy-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
    max-width: 1100px; width: 100%;
}
.concept-card {
    background: rgba(14, 14, 35, 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 16px; padding: 1.8rem; cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.02);
    position: relative; overflow: hidden;
}
.concept-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0; transition: opacity 0.4s;
}
.concept-card:hover::before { opacity: 1; }
.concept-card:hover {
    border-color: rgba(201, 168, 76, 0.25);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(201, 168, 76, 0.08);
}
.concept-card h3 {
    font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #ffd700, #ffaa44);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.concept-card p {
    font-size: 0.85rem; color: var(--color-text-secondary); line-height: 1.8;
}
.concept-card .detail {
    max-height: 0; overflow: hidden; transition: max-height 0.5s ease;
    font-size: 0.85rem; color: var(--color-text); line-height: 1.9; margin-top: 0;
    border-top: 1px solid rgba(201, 168, 76, 0.06);
    padding-top: 0;
}
.concept-card.expanded .detail { max-height: 300px; margin-top: 1rem; padding-top: 1rem; }
.concept-card .card-icon { font-size: 1.5rem; margin-bottom: 0.8rem; }
.concept-card .card-tag {
    display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 0.68rem;
    background: rgba(201, 168, 76, 0.1); color: var(--color-accent-bright);
    margin-bottom: 0.8rem; letter-spacing: 0.05em; font-weight: 500;
    border: 1px solid rgba(201, 168, 76, 0.08);
}
.concept-card.gold-theme .card-tag {
    background: rgba(255, 215, 0, 0.1); color: var(--color-gold-bright);
    border-color: rgba(255, 215, 0, 0.1);
}
.concept-card.gold-theme::before {
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

/* ========== PAGE 3: SCIENCE ========== */
.page-science .science-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
    max-width: 1100px; width: 100%;
}
.science-card {
    background: rgba(14, 14, 35, 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 16px; padding: 2rem; text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.02);
    position: relative; overflow: hidden;
}
.science-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0; transition: opacity 0.4s;
}
.science-card:hover::before { opacity: 1; }
.science-card:hover {
    border-color: rgba(201, 168, 76, 0.25);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 24px rgba(201, 168, 76, 0.1);
}
.science-card .card-icon { font-size: 2.5rem; margin-bottom: 1.2rem; }
.science-card h3 {
    font-family: var(--font-serif); font-size: 1.1rem; margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #e0c868, #c8a040);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.science-card p {
    font-size: 0.8rem; color: var(--color-text-secondary); line-height: 1.7;
}
.science-card .formula {
    margin-top: 1rem; padding: 0.6rem 1rem; border-radius: 8px;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.08);
    font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--color-accent-bright); letter-spacing: 0.05em;
}

/* ========== PAGE 4: MY SHARING ========== */
.page-sharing { position: relative; }
.page-sharing .mode-toggle {
    position: absolute; top: calc(var(--nav-height) + 20px); right: 40px; z-index: 5;
    display: flex; gap: 4px; padding: 4px; border-radius: 50px;
    background: rgba(14, 14, 35, 0.7);
    border: 1px solid rgba(201, 168, 76, 0.1);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.02);
}
.mode-btn {
    padding: 8px 20px; border-radius: 50px; border: none;
    background: transparent; color: var(--color-muted);
    font-family: var(--font-sans); font-size: 0.8rem; font-weight: 500;
    cursor: pointer; transition: all 0.3s;
}
.mode-btn.active {
    background: rgba(201, 168, 76, 0.12); color: var(--color-accent-bright);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.12);
}

/* Star field mode - upgraded */
.starfield-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
/* Explore mode center hint */
.explore-hint {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; pointer-events: none; z-index: 1;
}
.explore-hint-icon {
    font-size: 2.5rem; margin-bottom: 1rem;
    animation: hintFloat 4s ease-in-out infinite;
    color: var(--color-gold-bright);
    text-shadow: 0 0 20px rgba(240,208,96,0.6), 0 0 40px rgba(201,168,76,0.3);
    filter: drop-shadow(0 0 8px rgba(240,208,96,0.4));
}
.explore-hint-text {
    font-family: var(--font-serif); font-size: 1.1rem;
    color: var(--color-gold-bright); letter-spacing: 0.3em;
    text-shadow: 0 0 16px rgba(240,208,96,0.4);
}
.explore-hint-sub {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--color-accent); margin-top: 0.6rem;
    letter-spacing: 0.15em; opacity: 0.7;
}
@keyframes hintFloat {
    0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); }
}

.star-node {
    position: absolute; width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,245,220,1), rgba(240,208,96,0.8), rgba(201,168,76,0.3), transparent);
    cursor: pointer;
    box-shadow: 0 0 30px rgba(240,208,96,1), 0 0 60px rgba(201,168,76,0.4), 0 0 90px rgba(201,168,76,0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: star-pulse 3.5s ease-in-out infinite;
    z-index: 3;
}
.star-node::before {
    content: ''; position: absolute; inset: -12px; border-radius: 50%;
    border: 1.5px solid rgba(240,208,96,0.15);
    animation: star-ring-expand 4s ease-in-out infinite;
}
.star-node::after {
    content: ''; position: absolute; inset: -24px; border-radius: 50%;
    border: 1px solid rgba(240,208,96,0.06);
    animation: star-ring-expand 4s ease-in-out infinite 0.5s;
}
.star-node:hover {
    transform: scale(3);
    box-shadow: 0 0 40px rgba(240,208,96,1), 0 0 80px rgba(201,168,76,0.4), 0 0 120px rgba(201,168,76,0.15);
    z-index: 10;
}
.star-node:hover::before { transform: scale(1.8); border-color: rgba(240,208,96,0.35); }
.star-node:hover::after { transform: scale(2); border-color: rgba(240,208,96,0.15); }
.star-node .star-label {
    position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-family: var(--font-serif); font-size: 0.9rem;
    color: var(--color-gold-bright); font-weight: 500;
    opacity: 0; transition: all 0.3s; pointer-events: none;
    text-shadow: 0 0 12px rgba(201,168,76,0.5);
    background: rgba(14,14,35,0.85); padding: 6px 16px; border-radius: 10px;
    border: 1px solid rgba(201,168,76,0.2);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.star-node .star-label::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: rgba(201,168,76,0.3);
}
.star-node:hover .star-label { opacity: 1; bottom: calc(100% + 20px); }
@keyframes star-pulse { 0%, 100% { opacity: 0.4; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes star-ring-expand { 0%, 100% { transform: scale(1); opacity: 0.2; } 50% { transform: scale(1.4); opacity: 0.5; } }

/* Star connection lines (drawn by JS) */
.star-connection {
    position: absolute; pointer-events: none;
    height: 1px; z-index: 1;
    background: linear-gradient(90deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05), transparent);
    transform-origin: left center;
}

/* Grid mode */
.grid-container {
    display: none; width: 100%; max-width: 1100px;
    overflow-y: auto; max-height: calc(100vh - var(--nav-height) - 260px);
    padding: 0 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,0.2) transparent;
}
.grid-container::-webkit-scrollbar { width: 4px; }
.grid-container::-webkit-scrollbar-track { background: transparent; }
.grid-container::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.2); border-radius: 2px; }
.grid-container.active { display: block; }
.content-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem;
    padding-bottom: 40px;
}
.content-card {
    background: rgba(14, 14, 35, 0.5);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 18px; overflow: hidden; cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.02);
    position: relative;
}
.content-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240,208,96,0.3), transparent);
    opacity: 0; transition: opacity 0.4s; z-index: 1;
}
.content-card:hover::before { opacity: 1; }
.content-card:hover {
    border-color: rgba(201, 168, 76, 0.2);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(201, 168, 76, 0.08);
}
.content-card .card-cover {
    height: 140px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    position: relative;
    overflow: hidden;
}
.content-card[data-cat="读书笔记"] .card-cover {
    background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(180,140,60,0.04));
}
.content-card[data-cat="心学感悟"] .card-cover {
    background: linear-gradient(135deg, rgba(200,120,80,0.08), rgba(180,100,60,0.04));
}
.content-card[data-cat="科学探索"] .card-cover {
    background: linear-gradient(135deg, rgba(160,168,184,0.08), rgba(140,148,164,0.04));
}
.content-card[data-cat="项目复盘"] .card-cover {
    background: linear-gradient(135deg, rgba(176,136,80,0.08), rgba(160,120,64,0.04));
}
.content-card[data-cat="代码展示"] .card-cover {
    background: linear-gradient(135deg, rgba(144,136,168,0.08), rgba(128,120,152,0.04));
}
.content-card .card-cover::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(201,168,76,0.06), transparent 60%);
}
.content-card .card-cover::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
    background: linear-gradient(transparent, rgba(14,14,35,0.6));
}
.content-card:hover .card-cover {
    background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(180,140,60,0.06)) !important;
}
.content-card .card-info { padding: 1.2rem 1.4rem; }
.content-card .card-category {
    font-family: var(--font-mono);
    font-size: 0.62rem; letter-spacing: 0.18em;
    text-transform: uppercase; margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #e0c868, #c8a040);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; font-weight: 600;
}
.content-card .card-title {
    font-family: var(--font-serif); font-size: 1.02rem;
    color: var(--color-text); margin-bottom: 0.4rem;
    line-height: 1.5;
}
.content-card .card-excerpt {
    font-size: 0.8rem; color: var(--color-text-secondary); line-height: 1.7;
}

/* Deep view overlay - upgraded */
.deep-view {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(6, 6, 15, 0.96); z-index: 200;
    display: none; align-items: center; justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(20px);
}
.deep-view.active { display: flex; }
.deep-view-content { max-width: 700px; width: 100%; text-align: center; }
.deep-view-content h2 {
    font-family: var(--font-serif); font-size: 2rem; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f0d060, #c89030, #a87828);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.deep-view-content .dv-en {
    font-family: var(--font-mono); font-size: 0.6rem;
    letter-spacing: 0.25em; color: var(--color-muted); opacity: 0.5; margin-bottom: 2rem;
}
.deep-view-content p {
    font-size: 1rem; color: var(--color-text); line-height: 2.2; margin-bottom: 1.5rem; opacity: 0;
}
.deep-view .close-deep {
    position: absolute; top: 80px; right: 40px;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.2); background: rgba(8, 8, 12, 0.5);
    color: var(--color-accent-bright); font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.deep-view .close-deep:hover {
    background: rgba(201, 168, 76, 0.1);
    box-shadow: 0 0 16px rgba(201, 168, 76, 0.25);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .page-philosophy .philosophy-grid { grid-template-columns: 1fr; }
    .page-science .science-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .page-science .science-cards { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: 1fr; }
    .page-sharing .mode-toggle { right: 10px; top: calc(var(--nav-height) + 10px); }
    .mode-btn { padding: 6px 12px; font-size: 0.7rem; }
}
