/* --- 1. 颜色变量定义 & 基础样式 --- */
@font-face { 
  font-family: 'Noto Serif SC'; 
  src: url('https://static.tian14.com/fonts/NotoSerifSC-Regular.woff2') format('woff2'); 
  font-weight: 400; 
  font-display: swap; 
} 
@font-face { 
  font-family: 'Noto Serif SC'; 
  src: url('https://static.tian14.com/fonts/NotoSerifSC-SemiBold.woff2') format('woff2'); 
  font-weight: 600; 
  font-display: swap; 
} 
@font-face { 
  font-family: 'Noto Serif SC'; 
  src: url('https://static.tian14.com/fonts/NotoSerifSC-Bold.woff2') format('woff2'); 
  font-weight: 700; 
  font-display: swap; 
}

:root {
    --color-primary: #aaf3e5;
    --bg-image: url('../assets/light-bg.jpg');

    /* 文本颜色 */
    --color-text-header: #ffffff;
    --color-text-sidebar: rgba(255, 255, 255, 0.7);
    --color-text-sidebar-active: #ffffff;
    --color-text-card: #333;
    --color-text-card-header: #111;
    --color-navbar-text: #fff;

    /* 组件背景与边框 */
    --color-navbar-bg: rgba(10, 10, 10, 0.7);
    --color-card-bg: rgba(255, 255, 255, 0.7);
    --color-card-border: rgba(255, 255, 255, 0.2);
    --color-card-header-border: rgba(0, 0, 0, 0.1);
    --color-icon-link-bg: rgba(255, 255, 255, 0.8);
    --color-icon-link-bg-hover: rgba(255, 255, 255, 1);

    /* 按钮颜色 (浅色模式下改为半透明白) */
    --color-btt-bg: rgba(255, 255, 255, 0.6);
    --color-btt-text: #333;
    --color-btt-border: rgba(0, 0, 0, 0.1);
    --color-footer-bg: var(--color-card-bg);

    /* 阴影与特效 */
    --color-card-shadow: rgba(0, 0, 0, 0.1);
    --color-card-shadow-hover: rgba(0, 0, 0, 0.15);
    --color-primary-glow: hsla(210, 100%, 50%, 0.3);

    /* 侧边栏线条 */
    --color-sidebar-line: rgba(255, 255, 255, 0.4);
    --color-sidebar-dot: rgba(255, 255, 255, 0.5);
}

body.dark-mode {
    --bg-image: url('../assets/dark-bg.webp');

    /* 文本颜色 */
    --color-text-card: #e0e0e0;
    --color-text-card-header: #ffffff;

    /* 组件背景与边框 */
    --color-card-bg: rgba(44, 44, 44, 0.7);
    --color-card-border: rgba(255, 255, 255, 0.1);
    --color-card-header-border: rgba(255, 255, 255, 0.2);
    --color-icon-link-bg: rgba(58, 58, 58, 0.8);
    --color-icon-link-bg-hover: rgba(74, 74, 74, 1);
    --color-btt-bg: rgba(44, 44, 44, 0.7);
    --color-btt-text: #e0e0e0;
    --color-footer-bg: var(--color-card-bg);

    /* 阴影与特效 */
    --color-card-shadow: rgba(0, 0, 0, 0.3);
    --color-card-shadow-hover: rgba(0, 0, 0, 0.35);
    --color-primary-glow: hsla(210, 100%, 65%, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', serif;
    line-height: 1.6;
    /* 为了防止加载动画闪烁，初始背景设为 none，由 JS 控制加载 */
    background-color: #1a1a1a;
    background-image: none;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--color-text-card);
    /* 移除初始背景过渡，防止白屏闪烁 */
    transition: background-image 0s, background-color 0s; 
}

/* --- 2. 导航栏 & 首屏 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-navbar-bg);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    z-index: 1000;
}

.navbar .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-navbar-text);
    text-decoration: none;
}

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-header);
}

.hero-content {
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 15px;
}

.hero-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 80px;
    background-color: var(--color-primary);
    animation: growLine 1.5s ease-out;
}

@keyframes growLine {
    from { width: 0; }
    to { width: 80px; }
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    width: 50px;
    height: 50px;
    color: var(--color-text-header);
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.8;
    border: 2px solid var(--color-text-header);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.3s;
    animation: smooth-float 2s ease-in-out infinite;
}

.scroll-down:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes smooth-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* --- 3. 主体布局 & 侧边栏 --- */
.main-container {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    align-items: stretch;
    gap: 30px;
    padding: 0 20px;
}

.sidebar-wrapper {
    flex: 0 0 200px;
}

.sidebar-nav {
    position: sticky;
    top: 100px;
    transition: top 0.4s ease, transform 0.4s ease;
}

.sidebar-nav.centered-sticky {
    top: 50vh;
    transform: translateY(-50%);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0 0 0 20px;
    margin-left: 10px;
    position: relative;
    border-left: 2px solid var(--color-sidebar-line);
}

.sidebar-nav li {
    margin-bottom: 15px;
    position: relative;
}

.sidebar-nav li::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-sidebar-dot);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.sidebar-nav a {
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-text-sidebar);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar-nav a.active {
    font-weight: 700;
    color: var(--color-text-sidebar-active);
}

.sidebar-nav li:has(a.active)::before {
    background-color: var(--color-primary);
    transform: translateY(-50%) scale(1.3);
    border-color: #fff;
}

.sidebar-nav a:not(.active):hover {
    color: var(--color-text-sidebar-active);
}

/* --- 4. 内容区域 & 卡片 --- */
#main-content {
    flex: 1;
    min-width: 0;
}

.page-section {
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 12px;
    
    /* 背景色稍微调高不透明度 */
    background-color: var(--color-card-bg);
    
    /* 硬件加速与混合模式优化 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border: 1px solid var(--color-card-border);
    box-shadow: 0 8px 20px var(--color-card-shadow);
    
    /* 初始状态 */
    opacity: 0;
    transform: translateY(30px) translateZ(0); /* translateZ(0) 强制开启 GPU 加速 */
    
    --glow-color: var(--color-primary);
    
    /* 添加 will-change */
    will-change: transform, opacity;
    
    /* 优化 transition */
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
                
    scroll-margin-top: 80px;
    overflow: hidden; /* 解决变方问题 */
}

.page-section.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.page-section.visible:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--color-card-shadow-hover), 0 0 25px var(--glow-color);
    border-color: var(--glow-color);
}

.page-section h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-card-header-border);
    padding-bottom: 10px;
    font-weight: 700;
    color: var(--color-text-card-header);
}

/* --- 5. 页脚 --- */
.footer-wrapper {
    max-width: 1100px;
    margin: 40px auto 20px auto;
    padding-bottom: 146px;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.6s ease-out;
}

.site-footer.footer-visible {
    transform: translateY(0);
}

.footer-grid-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 20px 20px;
    padding: 25px 30px;
    border-radius: 12px;
    background-color: var(--color-footer-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-card-border);
    box-shadow: 0 8px 20px var(--color-card-shadow);
    color: var(--color-text-card);
    font-size: 0.9em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 100px;
}

.footer-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.footer-item-title {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--color-text-card-header);
    margin-right: 8px;
    flex-shrink: 0;
}

.footer-grid-container .footer-item:nth-child(odd) {
    justify-content: flex-end;
}

.footer-grid-container .footer-item:nth-child(even) {
    justify-content: flex-start;
}

.footer-item a {
    color: var(--color-text-card);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-item a:hover {
    color: var(--color-primary);
}

/* --- 6. 通用组件 (图标链接, 主题切换, 回到顶部) --- */
.icon-links {
    list-style: none;
    padding-left: 0;
}

.icon-links li {
    margin-bottom: 12px;
}

.icon-links a {
    display: block;
    padding: 12px 20px;
    background-color: var(--color-icon-link-bg);
    color: var(--color-text-card);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.icon-links a:hover {
    background-color: var(--color-icon-link-bg-hover);
    transform: scale(1.02);
    color: var(--color-text-card-header);
}

.icon-links i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.icon-links .fa-blog { color: #f39c12; }
.icon-links .fa-bilibili { color: #fb7299; }
.icon-links .fa-github { color: #181717; }

body.dark-mode .icon-links .fa-github { color: #ffffff; }

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-navbar-text);
    font-size: 1.2rem;
    padding: 5px;
    margin-left: 20px;
    border-radius: 5px;
    transition: color 0.3s, background-color 0.3s;
}

.theme-toggle:hover {
    color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle .fa-sun { display: none; }
body.dark-mode .theme-toggle .fa-moon { display: none; }
body.dark-mode .theme-toggle .fa-sun { display: block; }

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-btt-bg);
    backdrop-filter: blur(5px);
    color: var(--color-btt-text);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.1rem;
    z-index: 999;
    border: 1px solid var(--color-btt-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* --- 7. 可折叠面板 --- */
.collapsible-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.collapsible-section {
    background-color: var(--color-icon-link-bg);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.collapsible-section[open] {
    border-color: var(--color-card-border);
}

.collapsible-header {
    padding: 20px 25px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.collapsible-header::-webkit-details-marker { display: none; }

.collapsible-header h3 {
    margin: 0;
    color: var(--color-text-card-header);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.collapsible-header h3 i {
    width: 22px;
    text-align: center;
    font-size: 0.9em;
}

.chevron-icon {
    font-size: 1.1rem;
    color: var(--color-text-card-header);
    transition: transform 0.3s ease-in-out;
}

.collapsible-section[open]>.collapsible-header .chevron-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    overflow: hidden;
}

.collapsible-content>.carousel-wrapper {
    padding: 0 25px 30px 25px;
}

/* --- 8. 3D 轮播 --- */
.carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
    perspective: 1200px;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-container {
    position: relative;
    width: 300px;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.carousel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 200px;
    margin-top: -100px;
    margin-left: -150px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--color-card-border);
    transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    cursor: pointer;
    background-color: #333;
}

.carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s;
}

.item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.3s;
    opacity: 0;
}

.carousel-item.active {
    transform: translateZ(0) rotateY(0) scale(1.2);
    cursor: default;
    z-index: 10;
}

.carousel-item.active img { filter: brightness(1); }
.carousel-item.active .item-title { opacity: 1; }

.carousel-item.prev {
    transform: translateX(-220px) translateZ(-180px) rotateY(45deg) scale(1);
    z-index: 5;
}

.carousel-item.next {
    transform: translateX(220px) translateZ(-180px) rotateY(-45deg) scale(1);
    z-index: 5;
}

.carousel-item.prev img,
.carousel-item.next img { filter: brightness(0.6); }

.carousel-item.hide-prev {
    transform: translateX(-440px) translateZ(-350px) rotateY(60deg) scale(0.8);
    opacity: 0;
    z-index: 1;
}

.carousel-item.hide-next {
    transform: translateX(440px) translateZ(-350px) rotateY(-60deg) scale(0.8);
    opacity: 0;
    z-index: 1;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-btt-bg);
    border: 1px solid var(--color-btt-border);
    color: var(--color-btt-text);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.carousel-nav-btn:hover {
    background-color: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: calc(50% - 355px); }
.next-btn { right: calc(50% - 355px); }

/* --- 9. 技能云 --- */
.skill-cloud-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    height: 500px;
}

#skillCanvas {
    max-width: 100%;
    max-height: 100%;
}

#skillTags a {
    font-weight: 600; /* 加粗字体 */
    font-size: 20px;  /* 增大字体 */
}

/* --- 10. 加载动画层 (Loading Overlay) --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a; /* 初始深色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loading-overlay img {
    width: 80px; /* 适当的图标大小 */
    height: 80px;
    animation: spin 1.5s linear infinite;
}

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

/* --- 11. 媒体查询与响应式适配 --- */

/* 中等屏幕：调整轮播按钮位置 */
@media (max-width: 992px) {
    .prev-btn { left: calc(50% - 280px); }
    .next-btn { right: calc(50% - 280px); }
}

/* 平板/中等屏幕适配 (768px - 992px) - 侧边栏优化 */
@media (min-width: 769px) and (max-width: 992px) {
    .main-container {
        /* 增加左侧内边距，让侧边栏不贴边 */
        padding-left: 80px; 
        padding-right: 20px;
        /* 减少间隙，让内容靠近侧边栏 */
        gap: 0; 
    }

    .sidebar-wrapper {
        flex: 0 0 120px; /* 收窄侧边栏宽度 */
        padding-right: 10px;
    }

    .sidebar-nav ul {
        border-left-width: 3px; /* 加粗轴线 */
        padding-left: 15px;
    }
    
    .sidebar-nav li::before {
        left: -25px; 
        width: 12px;
        height: 12px;
    }
}

/* 手机端响应式适配 (max-width: 768px) */
@media (max-width: 768px) {
    /* 1. 隐藏侧边栏 */
    .sidebar-wrapper {
        display: none;
    }

    /* 2. 调整主容器 */
    .main-container {
        flex-direction: column;
        gap: 0;
        margin-top: 20px;
        padding: 0 15px;
    }

    /* 3. 调整首屏 */
    .hero-content h1 {
        font-size: 1.8rem;
        line-height: 1.4;
        padding: 0 20px;
    }
    
    .scroll-down {
        bottom: 80px; 
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* 4. 调整内容卡片 */
    .page-section {
        padding: 25px 20px;
        margin-bottom: 25px;
    }

    .page-section h2 {
        font-size: 1.3rem;
    }

    /* 5. 轮播图适配 */
    .carousel-wrapper {
        height: 250px;
        perspective: 800px;
    }

    .carousel-container {
        width: 200px;
    }

    .carousel-item {
        width: 100%;
        height: 140px;
        margin-top: -70px;
        margin-left: -100px;
    }
    
    .prev-btn {
        left: 5px;
        transform: translateY(-50%) scale(0.8);
    }

    .next-btn {
        right: 5px;
        transform: translateY(-50%) scale(0.8);
    }

    /* 6. 技能云 */
    .skill-cloud-container {
        height: 320px;
    }

    /* 7. 页脚适配 */
    .footer-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }

    .footer-grid-container .footer-item,
    .footer-grid-container .footer-item:nth-child(odd),
    .footer-grid-container .footer-item:nth-child(even) {
        justify-content: center;
        font-size: 0.85rem;
    }

    /* 8. 增加底部预留空间，防止页脚遮挡内容 */
    .footer-wrapper {
        padding-bottom: 320px;
    }
}

/* 1. 隐私弹窗 (固定在底部，毛玻璃风格) */
#privacy-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: var(--color-card-bg); /* 跟随主题色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--color-card-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    z-index: 9999;
    display: none; /* 默认隐藏，由JS控制 */
    text-align: center;
    color: var(--color-text-card);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

#privacy-banner p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.privacy-btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.privacy-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.privacy-btn.accept {
    background-color: var(--color-primary);
    color: #333;
}

.privacy-btn.accept:hover {
    box-shadow: 0 0 10px var(--color-primary);
}

.privacy-btn.reject {
    background-color: transparent;
    border: 1px solid var(--color-text-card);
    color: var(--color-text-card);
}

.privacy-btn.reject:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 2. 页脚：全宽居中行 (用于放置隐私设置入口) */
.footer-item.full-width {
    grid-column: 1 / -1; /* 跨越两列 */
    justify-content: center !important; /* 强制居中 */
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-card-border); /*以此与上方内容区分*/
    font-size: 0.85em;
    opacity: 0.8;
}

.privacy-trigger {
    cursor: pointer;
    margin-left: 5px;
    text-decoration: underline;
}

.privacy-trigger:hover {
    color: var(--color-primary);
}

/* --- 开关样式 (iOS 风格) --- */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: center; /* 确保整个组件居中 */
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;  /* 开关宽度 */
    height: 22px; /* 开关高度 */
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* 默认灰色（关闭） */
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; /* 圆点大小 */
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* 选中状态（绿色） */
input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(18px); /* 圆点移动距离 */
}