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

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --level-0: #161b22;
    --level-1: #0e4429;
    --level-2: #006d32;
    --level-3: #26a641;
    --level-4: #39d353;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.header-text {
    flex: 1;
}

.status-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-text {
    color: var(--text);
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 0.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Activity Grid */
.activity-section {
    margin-bottom: 4rem;
    overflow: visible;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 3px;
    margin-bottom: 1rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 3rem 7rem;
}

.activity-day {
    aspect-ratio: 1;
    background: var(--level-0);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 12px;
}

.activity-day:hover {
    outline: 1px solid var(--text-muted);
    transform: scale(1.1);
}

.activity-day[data-level="1"] {
    background: var(--level-1);
}

.activity-day[data-level="2"] {
    background: var(--level-2);
}

.activity-day[data-level="3"] {
    background: var(--level-3);
}

.activity-day[data-level="4"] {
    background: var(--level-4);
}

.activity-day:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    z-index: 10;
    margin-bottom: 5px;
}

.activity-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-colors {
    display: flex;
    gap: 3px;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-box[data-level="0"] {
    background: var(--level-0);
}

.legend-box[data-level="1"] {
    background: var(--level-1);
}

.legend-box[data-level="2"] {
    background: var(--level-2);
}

.legend-box[data-level="3"] {
    background: var(--level-3);
}

.legend-box[data-level="4"] {
    background: var(--level-4);
}

/* Blog List */
.blog-section {
    margin-bottom: 4rem;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-item {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.blog-item h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--accent);
}

.blog-preview {
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.modal-content {
    background: var(--bg);
    margin: 5% auto;
    padding: 3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 800px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

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

#blogDetail h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#blogDetail .blog-meta {
    margin-bottom: 2rem;
}

#blogDetail .blog-content {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text);
}

/* Admin Panel */
.auth-section {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.auth-section input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
}

.auth-section button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

.auth-section button:hover {
    opacity: 0.9;
}

.error {
    color: #f85149;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.admin-panel {
    max-width: 800px;
    margin: 0 auto;
}

.admin-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
}

button:hover {
    opacity: 0.9;
}

button[type="button"] {
    background: var(--border);
}

.admin-blog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-blog-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.admin-blog-info h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.admin-blog-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-blog-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-blog-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.delete-btn {
    background: #f85149 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .header-content {
        gap: 1rem;
    }

    .profile-pic {
        width: 60px;
        height: 60px;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .social-links a {
        padding: 0.4rem;
    }

    .social-links svg {
        width: 18px;
        height: 18px;
    }

    .activity-section {
        margin-bottom: 3rem;
    }

    .activity-grid {
        grid-template-columns: repeat(18, 1fr);
        gap: 4px;
        padding: 2rem 2rem;
        overflow-x: auto;
        overflow-y: visible;
    }

    .activity-day {
        min-width: 10px;
    }

    .activity-day:hover::after {
        font-size: 0.65rem;
        padding: 0.4rem;
    }

    .blog-item {
        padding: 1.25rem;
    }

    .blog-item h3 {
        font-size: 1.1rem;
    }

    .modal-content {
        margin: 10% 1rem;
        padding: 2rem 1.5rem;
    }

    #blogDetail h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .profile-pic {
        width: 50px;
        height: 50px;
    }

    .status-section {
        display: none !important;
    }

    .activity-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 2px;
        padding: 2rem 2rem;
        overflow-y: visible;
    }

    .activity-day {
        min-width: 8px;
    }

    .activity-legend {
        font-size: 0.7rem;
    }

    .legend-box {
        width: 10px;
        height: 10px;
    }
}