:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-light: rgba(102, 126, 234, 0.15);
    --secondary: #64748b;
    --dark: #1e293b;
    --dark-light: #475569;
    --light: #f1f5f9;
    --white: #ffffff;
    --border: rgba(0, 0, 0, 0.06);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 50%, #e8eef3 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

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

a:hover {
    color: var(--primary-dark);
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 20px 20px 20px 320px;
}

.sidebar {
    width: 280px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: fixed;
    top: 20px;
    left: calc(50% - 680px);
    height: fit-content;
    max-height: calc(100vh - 40px);
    box-shadow: var(--shadow);
    overflow-y: auto;
}

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

.logo h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo h1 a {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 a:hover {
    opacity: 0.8;
}

.logo p {
    color: var(--secondary);
    font-size: 14px;
}

.profile {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(102, 126, 234, 0.3);
    margin-bottom: 16px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    object-fit: cover;
}

.profile h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 8px;
}

.profile p {
    color: var(--secondary);
    font-size: 14px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.sidebar-widget {
    margin-bottom: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark-light);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.nav-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.nav-list a {
    display: block;
    color: var(--dark-light);
    padding: 16px 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.1);
    text-align: center;
}

.nav-list a:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.category-tags a {
    display: inline-block;
    color: var(--dark-light);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.04);
    font-size: 13px;
}

.category-tags a:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.05);
}

.main-content-wrapper {
    flex: 1;
}

.main-content {
    padding: 0 0 0 30px;
    min-height: 100vh;
}

.post-grid {
    column-count: 3;
    column-gap: 25px;
}

.post-card {
    break-inside: avoid;
    margin-bottom: 30px;
}

.post-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
}

.read-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.post-card:hover .read-btn {
    opacity: 1;
    transform: translateY(0);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.2);
}

.post-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
}

.post-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-thumbnail {
    transform: scale(1.05);
}

.post-content {
    padding: 24px;
}

.post-category {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
    line-height: 1.4;
}

.post-title a {
    color: inherit;
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 13px;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta i {
    font-size: 12px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    color: var(--dark-light);
    font-size: 13px;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.article-header {
    margin-bottom: 40px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.article-meta a {
    color: var(--primary);
}

.article-meta a:hover {
    text-decoration: underline;
}

.article-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.article-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

.article-content h2 {
    color: var(--dark);
    font-size: 24px;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.article-content h3 {
    color: var(--dark);
    font-size: 20px;
    margin: 25px 0 12px;
}

.article-content p {
    color: var(--dark-light);
    line-height: 1.9;
    margin-bottom: 16px;
    font-size: 16px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    color: var(--dark-light);
    line-height: 1.8;
    margin-bottom: 8px;
}

.article-content code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: var(--dark);
}

.article-content pre {
    background: #1e293b;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 12px 12px 0;
}

.article-content blockquote p {
    margin-bottom: 0;
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content table th,
.article-content table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

.article-content table th {
    background: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

.article-tags {
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.article-tags span {
    color: var(--secondary);
    margin-right: 12px;
    font-weight: 500;
}

.article-tags a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-light);
    border-radius: 20px;
    color: var(--primary);
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.article-tags a:hover {
    background: var(--primary);
    color: white;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.article-nav-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.article-nav-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.article-nav-label {
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-nav-title a {
    font-size: 15px;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.5;
}

.article-nav-item.next {
    text-align: right;
}

.article-nav-item.next .article-nav-label {
    justify-content: flex-end;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 40px 0;
    padding: 20px 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

footer {
    text-align: center;
    padding: 40px;
    color: var(--secondary);
    font-size: 14px;
}

.tag-cloud-page {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 25px;
    color: var(--dark-light);
    font-size: 14px;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tag-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.tag-item:hover .tag-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Hamburger menu - hidden on desktop */
.menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.links-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.links-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.links-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(102, 126, 234, 0.2);
}

.links-card:hover::before {
    opacity: 1;
}

.links-card-avatar-wrap {
    flex-shrink: 0;
}

.links-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.links-card:hover .links-card-avatar {
    border-color: var(--primary);
    transform: scale(1.05);
}

.links-card-avatar--placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), rgba(118, 75, 162, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    border: 2px solid rgba(102, 126, 234, 0.15);
}

.links-card-body {
    flex: 1;
    min-width: 0;
}

.links-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.links-card-desc {
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.links-card-arrow {
    flex-shrink: 0;
    color: var(--secondary);
    font-size: 12px;
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all 0.3s ease;
}

.links-card:hover .links-card-arrow {
    opacity: 1;
    transform: translate(0, 0);
    color: var(--primary);
}

.links-exchange {
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px dashed rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 30px;
}

.links-exchange-content h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.links-exchange-content h3 i {
    color: var(--primary);
}

.links-exchange-content > p {
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.links-exchange-content > p a {
    color: var(--primary);
    text-decoration: underline;
}

.links-exchange-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.links-exchange-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.links-exchange-label {
    font-size: 12px;
    color: var(--secondary);
    font-weight: 500;
}

.links-exchange-value {
    font-size: 14px;
    color: var(--dark);
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    word-break: break-all;
}

.archives-list h2 {
    font-size: 24px;
    color: var(--dark);
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.archive-month-list {
    list-style: none;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.archive-item:hover {
    background: var(--primary-light);
}

.archive-item time {
    color: var(--secondary);
    font-size: 14px;
    min-width: 100px;
}

.archive-item a {
    color: var(--dark);
    font-weight: 500;
}

.archive-item a:hover {
    color: var(--primary);
}

/* Memos Page */
.heatmap-wrap {
    margin-bottom: 32px;
    overflow-x: auto;
    padding: 20px 0;
}

.heatmap-wrap table {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
    table-layout: fixed;
}

.heatmap-wrap .heatmap-cell {
    border-radius: 3px;
    height: 13px;
    cursor: default;
    transition: transform 0.2s ease;
}

.heatmap-wrap .heatmap-cell:hover {
    transform: scale(1.4);
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.heatmap-wrap td:empty {
    height: 13px;
}

.heatmap-month-label {
    font-size: 11px;
    color: var(--secondary);
    text-align: left;
    padding: 0 0 4px 0;
    line-height: 1;
}

.heatmap-day-label {
    font-size: 10px;
    color: #94a3b8;
    width: 24px;
    min-width: 24px;
    text-align: right;
    padding-right: 8px;
    line-height: 1;
}

.heatmap-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--secondary);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 3px;
}

.heatmap-legend-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.memos-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.memo-card {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
}

.memo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(102, 126, 234, 0.2);
}

.memo-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
    opacity: 0.7;
}

.memo-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 52px;
    padding-top: 4px;
}

.memo-date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.memo-date-month {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 4px;
}

.memo-card-body {
    flex: 1;
    min-width: 0;
}

.memo-content {
    color: var(--dark-light);
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 12px;
    word-break: break-word;
}

.memo-content p {
    margin-bottom: 8px;
}

.memo-content p:last-child {
    margin-bottom: 0;
}

.memo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.memo-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.memo-time {
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.memo-time i {
    font-size: 11px;
}

.memo-hide {
    display: none;
}

.memo-page-info {
    display: flex;
    align-items: center;
    color: var(--secondary);
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .container {
        padding: 20px;
        flex-direction: column;
    }
    
    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        border-right: none;
        border-radius: 0;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        max-height: 100vh;
        overflow-y: auto;
        padding-top: 70px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        backdrop-filter: blur(20px);
        border: none;
        border-radius: 14px;
        cursor: pointer;
        z-index: 1002;
        position: fixed;
        top: 20px;
        left: 20px;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        transition: all 0.3s ease;
    }
    
    .menu-toggle i {
        color: white;
        font-size: 20px;
        line-height: 1;
        transition: transform 0.3s ease;
    }
    
    .menu-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    }
    
    .menu-toggle.active i {
        transform: rotate(90deg);
    }
    
    .main-content {
        padding: 0;
        padding-top: 10px;
    }
    
    .post-grid {
        column-count: 2;
    }
    
    .article-header {
        margin-top: 60px;
    }
}

@media (max-width: 768px) {
    .post-grid {
        column-count: 1;
        column-gap: 20px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .nav-list {
        grid-template-columns: 1fr;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-nav {
        flex-direction: column;
    }
}
