:root {
    --primary-color: #007aff;
    --sidebar-bg: rgba(255, 255, 255, 0.6);
    --main-bg: rgba(255, 255, 255, 0.8);
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.1);
    --active-item-bg: rgba(0, 122, 255, 0.1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8; /* Increased line height */
    color: rgba(0, 0, 0, 0.8); /* Dark grey instead of pure black */
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    /* Hide scrollbar for a cleaner Look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    min-height: 100vh;
    width: 100%;
}

body::-webkit-scrollbar {
    display: none;
}

/* App Window Wrapper */
.app-window {
    width: 100%;
    max-width: 1100px;
    min-height: 85vh;
    height: auto;
    background: transparent;
    border-radius: 20px; /* Slightly more rounded */
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3), /* Outer shadow */
        0 0 0 1px rgba(255,255,255,0.4) inset; /* Inner highlight for glass thickness */
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 50px 20px 30px 20px; /* Increased top padding for controls */
    flex-shrink: 0;
    position: relative;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-small {
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
}

.sidebar-header .avatar-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-header .author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.author-tags {
    font-size: 0.65rem; /* Reduced to prevent wrapping */
    color: #4a4a4c;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0;
    background: rgba(0, 0, 0, 0.04);
    display: inline-block;
    padding: 2px 8px; /* Slightly tighter padding */
    border-radius: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author-bio {
    font-size: 0.85rem;
    color: #3a3a3c; /* Much darker for readability */
    line-height: 1.6;
    text-align: left;
    padding: 12px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.3); /* Soft highlight background */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 10px;
    margin-bottom: 5px;
    font-weight: 500;
    transition: all 0.2s;
    gap: 12px; /* Space between icon and text */
}

.sidebar-nav a:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-nav a i {
    width: 18px;
    height: 18px;
    stroke-width: 2px; /* SF Pro style stroke thickness */
    opacity: 0.8;
    transition: all 0.2s ease;
}

.sidebar-nav a.active i {
    opacity: 1;
}

.sidebar-nav a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-nav a.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3); /* Blue glow */
}

/* Main Content */
.main-area {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 80px 40px 40px 40px; /* Increased top padding for top bar */
    position: relative;
    height: auto;
}

.window-controls {
    position: absolute;
    top: 18px;
    left: 18px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.main-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 58px; /* Slightly taller for that Safari 15+ look */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 40px; /* More side padding */
    pointer-events: none;
    z-index: 100;
}

.address-bar {
    background: rgba(255, 255, 255, 0.45); /* Lighter background like the reference */
    padding: 8px 0; /* Vertical padding, width handled by flex */
    border-radius: 10px;
    font-size: 0.85rem;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%; /* Fill the container */
    max-width: 800px; /* But don't get too crazy on huge screens */
    justify-content: center;
    border: 0.5px solid rgba(0, 0, 0, 0.1); /* Subtle but visible border */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Very soft shadow */
    backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.address-bar:hover {
    background: rgba(255, 255, 255, 0.6);
}

.address-bar span {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
}

.close { background: #ff5f56; }
.minimize { background: #ffbd2e; }
.maximize { background: #27c93f; }

.control::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.2s;
}

.window-controls:hover .control::after {
    opacity: 1;
}

.close::before { content: '×'; position: absolute; font-size: 8px; left: 3px; top: -1px; color: rgba(0,0,0,0.5); display: none; }
.minimize::before { content: '−'; position: absolute; font-size: 8px; left: 2.5px; top: -1px; color: rgba(0,0,0,0.5); display: none; }
.maximize::before { content: '+'; position: absolute; font-size: 8px; left: 2.5px; top: -1px; color: rgba(0,0,0,0.5); display: none; }

.window-controls:hover .control::before {
    display: block;
}

/* Content Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em; /* Tighter letter spacing */
    color: #1d1d1f;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.8rem; margin-bottom: 1.2rem; }
p { margin-bottom: 1.2rem; }

/* Cards for Blog List */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.post-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.post-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.4rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
    background-color: #0071eb;
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: none;
    transform: translateY(-2px);
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 25px;
}

/* Hero Section */
.hero-content {
    padding: 60px 0;
    max-width: 700px;
}

.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.hero-title {
    font-size: 2.8rem; /* Slightly smaller for longer titles */
    line-height: 1.2;
    margin-bottom: 25px;
    background: linear-gradient(to right, #1d1d1f, #434345);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem; /* Slightly smaller for better readability of longer text */
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container { padding: 10px; }
    .app-window {
        flex-direction: column;
        height: auto;
        min-height: 95vh;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
    .sidebar-header { margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
    .sidebar-header .avatar-small { margin-bottom: 0; width: 50px; height: 50px; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 10px; }
    .sidebar-nav a { margin-bottom: 0; flex: 1; justify-content: center; font-size: 0.9rem; }
    .main-area { padding: 30px 20px; }
    .window-controls { display: none; }
}

/* Image Lightbox */
.lightbox-modal {
    display: none;
    position: fixed !important;
    z-index: 999999 !important; /* 极高层级 */
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: zoom-out;
    /* 使用 flex 居中内部元素 */
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
}

/* 显式控制显示状态 */
.lightbox-modal.active {
    display: flex !important;
}

.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    cursor: default;
    user-select: none;
}

.lightbox-modal:hover .lightbox-content {
    /* 可以在这里加点悬停效果 */
}

#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-size: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: 200;
    transition: 0.3s;
    cursor: pointer;
    z-index: 100001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ccc;
    transform: scale(1.1);
}

@media only screen and (max-width: 700px){
    .lightbox-content {
        width: 100%;
    }
}


