/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "b", "a", sans-serif;
    background: var(--main-bg-color);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--main-text-color);
    min-height: 100vh;
    transition: background 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

/* Loading Screen */
#amlx-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--main-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#amlx-loading-center {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Main Layout */
.amlx-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    position: relative;
}

/* Sidebar (Left) */
.amlx-left {
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 5px;
    /* Space for scrollbar */
}

.amlx-left::-webkit-scrollbar {
    width: 0;
    /* Hide sidebar scrollbar for cleaner look */
}

.logo {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--card-border-color);
}

.left-div {
    width: 100%;
    background: var(--sidebar-bg-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--card-border-color);
    box-shadow: var(--card-shadow);
}

.left-des-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--secondary-text-color);
}

.left-des-item svg,
.left-des-item i {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    fill: var(--fill-color);
}

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

.left-tag-item {
    padding: 6px 12px;
    background: var(--tag-bg-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--main-text-color);
    transition: transform 0.2s;
}

.left-tag-item:hover {
    transform: scale(1.05);
}

/* Timeline */
#line {
    list-style: none;
    padding-left: 10px;
    margin-top: 10px;
}

#line li {
    position: relative;
    padding-left: 20px;
    padding-bottom: 25px;
    border-left: 2px solid var(--secondary-text-color);
}

#line li:last-child {
    border-left: 2px solid transparent;
}

.focus {
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--main-bg-color);
}

#line li:first-child .focus {
    background: #00e676;
    box-shadow: 0 0 10px #00e676;
}

#line li div:nth-child(2) {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
}

#line li div:nth-child(3) {
    font-size: 12px;
    color: var(--secondary-text-color);
}

/* Main Content (Right) */
.amlx-right {
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
}

header {
    margin-bottom: 40px;
    text-align: left;
}

.index-logo {
    display: none;
    /* Only for mobile */
}

.welcome {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
}

.gradientText {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientFlow 5s ease infinite;
    font-family: "title", sans-serif;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.description {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    margin-bottom: 5px;
}

.purpleText {
    color: var(--accent-color);
    font-weight: bold;
}

.textBackground {
    background: rgba(116, 123, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Icons & Switch */
.iconContainer {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.iconItem,
.switch {
    width: 50px;
    height: 50px;
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--card-border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.iconItem svg,
.iconItem i {
    width: 30px;
    height: 30px;
    fill: var(--fill-color);
    transition: transform 0.3s;
}

.iconItem:hover {
    background: var(--card-hover-bg-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 120px;
    /* Expand on hover */
    justify-content: flex-start;
    padding-left: 15px;
}

.iconTip {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    margin-left: 0;
    white-space: nowrap;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.iconItem:hover .iconTip {
    opacity: 1;
    max-width: 100px;
    margin-left: 10px;
}

/* Switch Styling */
.onoffswitch {
    position: relative;
    width: 40px;
    height: 20px;
}

.onoffswitch-checkbox {
    display: none;
}

.onoffswitch-label {
    display: block;
    overflow: hidden;
    cursor: pointer;
    border-radius: 20px;
    height: 100%;
}

.onoffswitch-inner {
    display: block;
    width: 200%;
    margin-left: -100%;
    transition: margin 0.3s ease-in 0s;
}

.onoffswitch-inner:before,
.onoffswitch-inner:after {
    display: block;
    float: left;
    width: 50%;
    height: 20px;
    padding: 0;
    line-height: 20px;
    font-size: 14px;
    color: white;
    font-family: Trebuchet, Arial, sans-serif;
    font-weight: bold;
    box-sizing: border-box;
}

.onoffswitch-inner:before {
    content: "";
    background-color: var(--accent-color);
    color: #FFFFFF;
}

.onoffswitch-inner:after {
    content: "";
    background-color: #EEEEEE;
    color: #999999;
    text-align: right;
}

.onoffswitch-switch {
    display: block;
    width: 14px;
    height: 14px;
    margin: 3px;
    background: #FFFFFF;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 20px;
    border-radius: 50%;
    transition: all 0.3s ease-in 0s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner {
    margin-left: 0;
}

.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch {
    right: 0px;
}

/* Snake Image */
.tanChiShe {
    margin-top: 20px;
    width: 100%;
    opacity: 0.8;
}

.tanChiShe img {
    width: 100%;
}

/* Section Titles */
.title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 40px 0 20px;
    display: flex;
    align-items: center;
    color: var(--main-text-color);
}

.title svg {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    fill: var(--fill-color);
}

/* Project Grid */
.projectList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.projectItem {
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.projectItem:hover {
    background: var(--card-hover-bg-color);
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.projectItem.pressed,
.projectItem:active {
    transform: scale(0.95);
}

.projectItemLeft {
    z-index: 2;
    transition: width 0.3s;
}

.projectItemLeft h1 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--main-text-color);
}

.projectItemLeft p {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.projectItemRight {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
}

.projectItemRight img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.projectItem:hover .projectItemRight {
    transform: scale(1.1) rotate(10deg);
}

/* Skills */
.skill img {
    width: 100%;
    border-radius: var(--border-radius-sm);
}

#skillWap {
    display: none;
}

/* Footer */
footer {
    margin-top: 50px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    padding: 20px;
}

/* Live2D */
.live2d {
    position: fixed;
    bottom: 80px;
    right: 10%;
    z-index: 100;
}

/* Modal */
.tc {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tc.active {
    opacity: 1;
    visibility: visible;
}

.tc-main {
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tc-main.active {
    transform: scale(1);
}

.tc-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 900px) {
    .amlx-main {
        grid-template-columns: 1fr;
    }

    .amlx-left {
        display: none;
        /* Hide sidebar on mobile as per original design */
    }

    .index-logo {
        display: block;
        flex-shrink: 0;
        width: 100px;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        margin-bottom: 20px;
        border: 3px solid #fff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .welcome {
        font-size: 2.5rem;
    }

    .projectList {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    #skillPc {
        display: none;
    }

    #skillWap {
        display: block;
    }
}