/* --- Retro Cozy Digital Garden Style --- */
:root {
    --bg-color: #fdfcf0;    /* Creamy beige background */
    --text-color: #5d574f;  /* Deep coffee-brown text */
    --accent-color: #a8dadc; /* Soft blue accent */
    --border-color: #8b7d6b; /* Border color */
    --sidebar-bg: #f5f1e3;   /* Sidebar background */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Courier New", Courier, monospace; /* Typewriter-style font */
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Main layout container */
.container {
    display: flex;
    max-width: 900px;
    margin: 40px auto;
    border: 2px dashed var(--border-color); /* 虚线边框 */
    background: white;
    min-height: 80vh;
}

/* Sidebar navigation */
aside {
    width: 200px;
    border-right: 2px dashed var(--border-color);
    background-color: var(--sidebar-bg);
    padding: 20px;
}

aside h1 {
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    margin: 15px 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    display: block;
    padding: 5px;
}

nav ul li a:hover {
    background-color: var(--accent-color);
    color: white;
}

.visitor-counter {
    margin: 24px 0 0;
    padding: 12px 14px;
    border: 1px dashed var(--border-color);
    background: linear-gradient(135deg, #fffdf8 0%, #f6efe4 100%);
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-color);
    line-height: 1.5;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.visitor-counter::before {
    content: "✧";
    position: absolute;
    top: 6px;
    left: 8px;
    color: var(--accent-color);
    font-size: 0.85rem;
    opacity: 0.8;
}

.visitor-counter::after {
    content: "✧";
    position: absolute;
    bottom: 6px;
    right: 8px;
    color: var(--accent-color);
    font-size: 0.85rem;
    opacity: 0.8;
}

.visitor-counter__label {
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
    font-weight: bold;
}

.visitor-counter strong {
    font-size: 1rem;
    color: #4d7f81;
}

/* Main content area */
main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

h2 {
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    margin-bottom: 20px;
}

/* Image placeholder */
.img-box {
    border: 0px solid var(--border-color);
    background: #fafafa;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    width: 100%;
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.gallery-card {
    border: 1px dashed var(--border-color);
    padding: 12px;
    background: #fffdf8;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15)),
        repeating-linear-gradient(0deg, rgba(139,125,107,0.04) 0 1px, transparent 1px 10px);
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.gallery-card::before {
    content: "✧";
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--accent-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

.gallery-card::after {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(139, 125, 107, 0.2);
    pointer-events: none;
}

.gallery-card img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 10px;
    border: 1px solid rgba(139, 125, 107, 0.25);
    border-radius: 4px;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.7);
}

.gallery-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--text-color);
    padding-right: 18px;
}

.gallery-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #6e6357;
    border-top: 1px dashed rgba(139, 125, 107, 0.3);
    padding-top: 8px;
}

.album-toolbar {
    margin: -4px 0 12px;
    padding: 8px 10px;
    border: 1px dashed var(--border-color);
    display: inline-block;
    background: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    color: #7a6b57;
}

.gallery-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project-card {
    border: 1px dashed var(--border-color);
    padding: 15px;
    background: #fffdf8;
    position: relative;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.card-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--accent-color);
    font-size: 1rem;
}

.repo-count {
    margin: -8px 0 14px;
    font-size: 0.9rem;
    color: #7a6b57;
    font-style: italic;
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--text-color);
}

.project-card p {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.repo-link {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid var(--accent-color);
}

.repo-link:hover {
    color: #4d7f81;
}

/* Carousel images */
 .carousel {
      position: relative;
      width: 100%;
      max-width: 600px;
      height: 250px;
      margin: 0 auto;
      overflow: hidden;
      border-radius: 12px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    .carousel img {
      position: absolute;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0;
      transition: opacity 0.8s ease;
    }
    .carousel img.active {
      opacity: 1;
    }
    .indicators {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 8px;
      z-index: 2;
    }
    .indicator {
      width: 10px;
      height: 10px;
      background: rgba(255,255,255,0.6);
      border-radius: 50%;
      cursor: pointer;
      border: none;
      padding: 0;
      transition: background 0.3s;
    }
    .indicator.active {
      background: #fff;
    }

.window {
    max-width: 820px;
    margin: 30px auto;
    padding: 22px;
    border: 2px dashed var(--border-color);
    background: #fbf8ef;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.window-body {
    display: grid;
    gap: 18px;
}

.window-body .intro {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.section-heading {
    margin: 0 0 18px;
    color: #5d574f;
    font-size: 1.6rem;
    letter-spacing: 0.04em;
}

.profile-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.profile-list div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    align-items: baseline;
}

.profile-list dt {
    margin: 0;
    font-weight: bold;
    color: #5d574f;
}

.profile-list dd {
    margin: 0;
    color: var(--text-color);
    word-break: break-word;
}

.section-title {
    margin-top: 10px;
    font-weight: bold;
    color: #5d574f;
}

.link-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
    display: grid;
    gap: 8px;
}

.link-list a {
    color: var(--text-color);
    text-decoration: none;
}

.link-list a:hover {
    text-decoration: underline;
}

.icon-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding-top: 10px;
}

.icon-row figure {
    margin: 0;
    text-align: center;
    font-size: 0.75rem;
    color: #7a6b57;
}

.icon-row img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 6px;
    border: none;
    background: transparent;
}

/* Mobile responsive layout */
@media (max-width: 700px) {
    .container { flex-direction: column; margin: 10px; }
    aside { width: auto; border-right: none; border-bottom: 2px dashed var(--border-color); }
    .window {
        margin: 20px 10px;
        padding: 18px;
    }
    .profile-list div {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}