/* =========================================================
   CodeNest · 主样式
   布局：左侧栏（sticky）+ 右侧内容
   风格：干净、克制、舒展；弱化边框与装饰，突出内容本身
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

a {
    text-decoration: none;
    color: inherit;
    outline: none;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

::selection {
    background: var(--purple_text_color);
    color: #fff;
}

::-webkit-scrollbar {
    width: 0;
}

body {
    min-height: 100vh;
    width: 100%;
    position: relative;
    font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC",
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--main_bg_color);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--main_text_color);
    line-height: 1.6;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
    transition: color 0.35s ease;
}

/* ---------- 背景遮罩层 ---------- */
.filter {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--back_filter_color, transparent);
    z-index: -999;
    pointer-events: none;
}

/* ---------- 加载动画 ---------- */
#loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main_bg_color);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loading.hide {
    opacity: 0;
    visibility: hidden;
}

#loading div {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid var(--border_color);
    border-top-color: var(--purple_text_color);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 顶部主题切换 ---------- */
.themeBar {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--item_bg_color);
    border: 1px solid var(--border_color);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.themeDot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.themeDot:hover {
    transform: scale(1.25);
}

.themeDot.active {
    border-color: var(--purple_text_color);
    transform: scale(1.2);
}

.themeDot.d1 { background: linear-gradient(135deg, #eef4ef, #f8f5ef); }
.themeDot.d2 { background: linear-gradient(135deg, #f6efe5, #fbf5ee); }
.themeDot.d3 { background: linear-gradient(135deg, #e9f1f5, #f4f7f9); }
.themeDot.d4 { background: #f6f7f8; }
.themeDot.d5 { background: linear-gradient(135deg, #f0eaf3, #f7f4f9); }
.themeDot.dark { background: #1c2023; }

/* ---------- 登录区 ---------- */
.authArea {
    position: fixed;
    top: 18px;
    left: 20px;
    z-index: 900;
}

/* ---------- 主容器 ---------- */
.main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    position: relative;
}

/* ---------- 左侧栏 ---------- */
.left {
    width: 208px;
    height: 100vh;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    overflow-y: auto;
    scrollbar-width: none;
}

.left::-webkit-scrollbar {
    display: none;
}

.avatar {
    flex-shrink: 0;
    width: 126px;
    height: 126px;
    margin-top: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple_text_color), #bcd9c8);
    border: 1px solid var(--border_color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.leftName {
    margin-top: 18px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.leftBio {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
    color: var(--item_left_text_color);
}

.leftSec {
    flex-shrink: 0;
    width: 100%;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border_color);
}

.blockTitle {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 14px;
    font-weight: 700;
}

.tagWrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: flex;
    align-items: center;
    height: 25px;
    padding: 0 10px;
    font-size: 11.5px;
    border-radius: 8px;
    background: var(--left_tag_item);
    color: var(--item_left_text_color);
}

/* ---------- 时间轴 ---------- */
#timeline {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12.5px;
    padding-left: 6px;
    scrollbar-width: none;
}

#timeline::-webkit-scrollbar {
    display: none;
}

#timeline li {
    position: relative;
    padding: 0 0 16px 14px;
    border-left: 1.5px solid var(--border_color);
}

#timeline li:last-child {
    padding-bottom: 0;
}

#timeline .node {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--item_left_text_color);
    opacity: 0.35;
    position: absolute;
    left: -4px;
    top: 6px;
}

#timeline li:first-child .node {
    background: var(--purple_text_color);
    opacity: 1;
}

#timeline .tTitle {
    font-weight: 600;
    margin-bottom: 2px;
}

#timeline .tDate {
    font-size: 11.5px;
    opacity: 0.4;
}

/* ---------- 右侧主区 ---------- */
.right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 42px 26px 72px;
    position: relative;
}

/* ---------- Hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.heroAvatar {
    display: none;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple_text_color), #bcd9c8);
    margin-bottom: 26px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.heroAvatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.hello {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--item_left_text_color);
    opacity: 0.75;
}

.welcome {
    margin-top: 8px;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.welcome .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desc {
    margin-top: 12px;
    font-size: 14px;
    color: var(--item_left_text_color);
    line-height: 1.7;
}

/* ---------- 图标行 ---------- */
.iconRow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.iconItem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--item_bg_color);
    border: 1px solid var(--border_color);
    transition: transform 0.2s ease, background 0.2s ease;
}

.iconItem:hover {
    transform: translateY(-2px);
    background: var(--item_hover_color);
}

.iconItem .icon {
    width: 18px;
    height: 18px;
    fill: var(--fill);
}

/* ---------- 昼夜开关 ---------- */
.switch {
    display: flex;
    align-items: center;
    margin-left: 2px;
}

.onoffswitch {
    position: relative;
    width: 46px;
    height: 26px;
}

.onoffswitch-checkbox {
    display: none;
}

.onoffswitch-label {
    display: block;
    overflow: hidden;
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid var(--border_color);
    background: var(--item_bg_color);
    position: relative;
    width: 46px;
    height: 26px;
    transition: background 0.3s ease;
}

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

.onoffswitch-inner::before,
.onoffswitch-inner::after {
    content: "";
    display: block;
    width: 50%;
    height: 26px;
    float: left;
}

.onoffswitch-inner::before {
    background: var(--purple_text_color);
}

.onoffswitch-inner::after {
    background: #2b3330;
}

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

.onoffswitch-switch {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    right: 24px;
    transition: right 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

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

/* ---------- 区块标题 ---------- */
.title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 48px;
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.titleBar {
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: var(--purple_text_color);
}

.titleCount {
    font-size: 11px;
    font-weight: 600;
    color: var(--purple_text_color);
    background: var(--text_bg_color);
    padding: 1px 7px;
    border-radius: 999px;
}

.titleDesc {
    margin-top: 6px;
    font-size: 13px;
    color: var(--item_left_text_color);
    line-height: 1.7;
}

/* ---------- 软件卡片网格（紧凑） ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 17px;
    border-radius: 14px;
    background: var(--item_bg_color);
    border: 1px solid var(--border_color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    background: var(--item_hover_color);
}

.cardTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cardEmoji {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: var(--text_bg_color);
}

.favBtn {
    font-size: 15px;
    line-height: 1;
    opacity: 0.3;
    padding: 3px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.favBtn:hover {
    opacity: 0.85;
    transform: scale(1.15);
}

.favBtn.fav-on {
    opacity: 1;
    color: #e0a458;
}

.cardTitle {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
}

.cardText {
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--item_left_text_color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 下载按钮 */
.btnDownload {
    margin-top: 14px;
    height: 33px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--purple_text_color);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btnDownload:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

/* ---------- 资源列表（扁平） ---------- */
.resGroup {
    margin-top: 28px;
}

.resGroupHead {
    display: flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.45;
    margin-bottom: 2px;
}

.resItem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--border_color);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.resItem:hover {
    opacity: 0.7;
}

.resItem:last-child {
    border-bottom: none;
}

.resItemName {
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resItemMeta {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--item_left_text_color);
    opacity: 0.75;
}

/* ---------- 引用 / 提示 ---------- */
.quote {
    margin-top: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--text_bg_color);
    font-size: 14px;
    line-height: 1.9;
    color: var(--item_left_text_color);
}

.quote strong {
    color: var(--main_text_color);
}

.notice {
    margin-top: 26px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--text_bg_color);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--purple_text_color);
}

/* ---------- 页脚 ---------- */
footer {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border_color);
    font-size: 12px;
    line-height: 1.9;
    color: var(--footer_text_color);
}

.footBrand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--main_text_color);
}

.footLogo {
    width: 22px;
    height: 22px;
}

footer a {
    color: var(--purple_text_color);
}

/* ---------- 弹层 ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 24, 22, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

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

.modalBox {
    width: 100%;
    max-width: 540px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 30px 32px;
    border-radius: 18px;
    background: var(--main_bg_color);
    border: 1px solid var(--border_color);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.4);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.28s ease;
}

.modal.active .modalBox {
    transform: translateY(0) scale(1);
}

.modalBox h3 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 12px;
}

.modalBox p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--item_left_text_color);
}

.modalBox ul {
    margin-top: 10px;
    padding-left: 4px;
}

.modalBox li {
    position: relative;
    padding-left: 18px;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--item_left_text_color);
}

.modalBox li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple_text_color);
    opacity: 0.6;
}

.modalClose {
    display: inline-block;
    margin-top: 20px;
    font-size: 12.5px;
    color: var(--purple_text_color);
    cursor: pointer;
    opacity: 0.75;
}

.modalClose:hover {
    opacity: 1;
}

.modalDownload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    height: 44px;
    border-radius: 12px;
    background: var(--purple_text_color);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.modalDownload:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 44px;
    transform: translateX(-50%) translateY(20px);
    z-index: 2000;
    padding: 11px 22px;
    border-radius: 12px;
    background: var(--main_text_color);
    color: var(--main_bg_color);
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .main {
        flex-direction: column;
    }

    .left {
        display: none;
    }

    .right {
        width: 100%;
        padding: 24px 18px 60px;
    }

    .heroAvatar {
        display: flex;
    }

    .welcome {
        font-size: 33px;
    }

    .themeBar {
        top: 12px;
        right: 12px;
        transform: scale(0.92);
        transform-origin: top right;
    }

    .authArea {
        top: 12px;
        left: 12px;
    }
}

@media (max-width: 560px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 420px) {
    .grid {
        grid-template-columns: 1fr;
    }
}
