@font-face {
    font-family: 'MesloLGLDZ';
    src: url('fonts/MesloLGLDZ-Regular.ttf') format('truetype');
}

:root {
    --background-color: #0A0A0A;
    --primary-glow-color: #00ffff;
    --primary-text-color: #E0E0E0;
    --secondary-text-color: #888888;
    --container-bg-color: rgba(20, 25, 30, 0.5);
    --container-border-color: rgba(0, 255, 255, 0.2);
    --container-hover-shadow-color: rgba(0, 255, 255, 0.5);
    --link-color: #00ffff;
    --code-bg-color: rgba(135, 131, 120, 0.15);
    --code-text-color: #eb5757;
}

body {
    background-color: var(--background-color);
    color: var(--primary-text-color);
    font-family: 'MesloLGLDZ', monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-shadow: 0 0 1px rgba(224, 224, 224, 0.1);
}

nav {
    background-color: var(--container-bg-color);
    backdrop-filter: blur(10px);
    color: var(--primary-text-color);
    padding: 25px;
    width: 1024px;
    box-sizing: border-box;
    border: 1px solid var(--container-border-color);
    border-top: 0;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-left a,
.nav-center a {
    color: var(--link-color);
    text-decoration: none;
    text-shadow: 0 0 3px var(--link-color);
    transition: all 0.3s ease;
}

.nav-left a:hover,
.nav-center a:hover {
    text-shadow: 0 0 8px var(--link-color), 0 0 15px var(--link-color);
}

.nav-left svg {
    fill: var(--link-color) !important;
    transition: all 0.3s ease;
}

.nav-left a:hover svg {
    filter: drop-shadow(0 0 5px var(--link-color));
}

.blog-title {
    font-size: 24px;
    font-weight: bold;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1em;
}

.nav-center a.separator {
    color: var(--secondary-text-color);
    text-shadow: none;
    cursor: default;
}

.search-box {
    display: none; /* Hiding search as it might not fit the new theme well without more work */
}

.container {
    display: flex;
    flex: 1;
    max-width: 1024px;
    margin-top: 25px;
    gap: 25px;
    visibility: hidden; /* 先隱藏 */
    opacity: 0; /* 設為透明 */
    transition: opacity 0.3s ease-in-out; /* 加入淡入動畫效果 */
}
.container.loaded {
    visibility: visible; /* 讓區塊可見 */
    opacity: 1; /* 設為不透明 */
}
.box {
    background-color: var(--container-bg-color);
    border: 1px solid var(--container-border-color);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.box:hover {
    box-shadow: 0 0 10px var(--container-hover-shadow-color);
}

.about-me {
    width: 275px;
    text-align: center;
    flex-shrink: 0;
}

.about-me img {
    border-radius: 15px;
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 2px solid var(--container-border-color);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.about-me .name {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-text-color);
    margin: 10px 0 5px 0;
}

.about-me .title {
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
}

.about-me hr {
    border: none;
    height: 1px;
    background: var(--container-border-color);
    margin: 15px 0;
}

.icon-text {
    display: flex;
    align-items: center;
    text-align: left;
    margin-top: 15px;
}

.icon-container {
    background-color: rgba(0, 255, 255, 0.1);
    border-radius: 5px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.icon-container svg {
    fill: var(--link-color);
    stroke: var(--link-color);
}

.icon-plantext {
    display: flex;
    flex-direction: column;
}

.icon-plantext .label {
    font-size: 12px;
    color: var(--secondary-text-color);
}

.icon-plantext .value {
    font-size: 14px;
    color: var(--primary-text-color);
    text-decoration: none;
}

.icon-plantext .value:hover {
    text-decoration: underline;
    color: var(--link-color);
}

.page-main {
    flex-grow: 1;
}

.blog-content {
    width: 100%;
    text-align: left;
    word-break: break-word;
}

#html-output p, #html-output li {
    line-height: 1.7;
}

#html-output a {
    color: var(--link-color);
    text-decoration: underline;
    text-shadow: 0 0 2px var(--link-color);
}

#html-output h1, #html-output h2, #html-output h3, #html-output h4, #html-output h5, #html-output h6 {
    color: var(--link-color);
    text-shadow: 0 0 5px var(--link-color);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

#html-output img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--container-border-color);
    margin: 1em auto;
    display: block;
}

#html-output pre, #html-output code {
    background: var(--code-bg-color);
    font-family: 'MesloLGLDZ', monospace;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#html-output code {
    color: var(--code-text-color);
    padding: 0.2em 0.4em;
}

#html-output pre {
    padding: 1em;
    overflow-x: auto;
}

#html-output pre code {
    padding: 0;
    background: none;
    color: inherit;
}

#html-output blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 3px solid var(--link-color);
    color: var(--secondary-text-color);
}

#html-output hr {
    border: none;
    height: 1px;
    background: var(--container-border-color);
    margin: 2em 0;
}

/* Posts List Styling */
.posts-list {
    display: flex; /* This is set by main.js, but we confirm the direction */
    flex-direction: column;
    gap: 20px; /* Creates space between post cards */
}

.post-box {
    /* Apply the same base style as other boxes for consistency */
    background-color: var(--container-bg-color);
    border: 1px solid var(--container-border-color);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row; /* Image on left, content on right */
    gap: 25px;
    align-items: center;
}

.post-box:hover {
    box-shadow: 0 0 10px var(--container-hover-shadow-color);
    transform: translateY(-5px);
}

.post-image {
    width: 200px; /* Fixed width for the image */
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--container-border-color);
    flex-shrink: 0; /* Prevent image from shrinking */
}

.post-content {
    flex-grow: 1; /* Allow text content to take remaining space */
}

.post-content h2 a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.post-content h2 a:hover {
    text-shadow: 0 0 5px var(--link-color);
}

.post-content p {
    color: var(--primary-text-color);
    font-size: 1rem;
    margin: 10px 0 0 0;
    line-height: 1.6;
}

.post-date {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    display: block;
}

/* On smaller screens, stack post-box content vertically */
@media (max-width: 768px) {
    .post-box {
        flex-direction: column;
    }
    .post-image {
        width: 100%;
        max-height: 200px;
    }
}

footer {
    background-color: var(--container-bg-color);
    border: 1px solid var(--container-border-color);
    border-bottom: 0;
    width: 1024px;
    box-sizing: border-box;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    padding: 15px;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 14px;
    margin-top: 25px;
}

/* Responsive Design */
@media (max-width: 1023px) {
    nav, .container, footer {
        width: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    nav {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 15px;
    }

    .nav-center {
        position: static;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px 10px;
    }

    .nav-center .separator {
        display: none;
    }

    .container {
        flex-direction: column;
        padding: 0 15px;
        gap: 15px;
        margin-top: 15px;
    }

    .about-me, .blog-content {
        width: 100% !important;
        margin: 0;
    }

    footer {
        margin-top: 15px;
    }
}


/* Checkbox Styling */
ul.checkbox {
    list-style-type: none;
    padding-left: 0;
}

ul.checkbox li {
    display: flex;
    align-items: center;
}

input[type="radio"].checkbox-on,
input[type="radio"].checkbox-off {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--link-color);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    cursor: pointer;
}

input[type="radio"].checkbox-on::before {
    content: '✔';
    color: var(--link-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

input[type="radio"].checkbox-off {
    background-color: transparent;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid var(--container-border-color);
}

th, td {
    border: 1px solid var(--container-border-color);
    padding: 8px;
    text-align: left;
}

thead {
    background-color: rgba(0, 255, 255, 0.1);
}

th {
    color: var(--link-color);
}

tbody tr:nth-child(even) {
    background-color: rgba(20, 25, 30, 0.3);
}

.page-main.full-width {
    width: 100%;
}
