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

body {
    min-height: 100vh;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ebebeb;
    background-attachment: fixed;
    color: #333333;
    padding: 0;
    margin: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    overflow-x: hidden;
}

body.dark-mode {
    background: #1f1f1f;
    color: #e0e0e0;
}

/* 頂部導航欄 */
.top-nav {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* ========== 液態玻璃按鈕樣式 ========== */

/* 中間導航 - 液態玻璃 iOS 風格 */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px;
    position: relative;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}





.nav-link {
    padding: 9px 19px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    opacity: 0.6;
}

.nav-link:hover {
    opacity: 1;
}

.nav-link.active {
    color: #666666;
    opacity: 0.6;
}

.nav-link.active:hover {
    opacity: 1;
}

/* 主題切換 - 液態玻璃 iOS 風格 */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: visible;
    z-index: 1000;
    pointer-events: auto;
}

/* iOS 風格玻璃滑塊 - 圓潤矩形 */
.theme-slider {
    position: absolute;
    width: 52px;
    height: 36px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.85) 100%);
    border-radius: 18px;
    top: 6px;
    left: 6px;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s ease;
    z-index: 0;
    pointer-events: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.5);
}

/* 滑塊位置由 JavaScript 動態控制 */







.theme-btn {
    width: 52px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: none;
    background: transparent;
    color: #666666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.theme-btn:active .theme-slider {
    transform: scale(0.95);
}



.theme-btn img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.3s ease;
    filter: grayscale(100%);
    will-change: filter, opacity;
}

.theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-btn:hover img {
    opacity: 0.8;
}

.theme-btn.active {
    background: rgba(99, 102, 241, 0.1);
}

.theme-btn.active img {
    opacity: 1;
    filter: grayscale(0%);
}

/* 左上角返回按鈕 - 液態玻璃 iOS 風格 */
.back-button {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
}





.back-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 -1px 2px rgba(255, 255, 255, 0.15),
        0 12px 32px rgba(0, 0, 0, 0.2);
}

.back-button:active {
    transform: translateY(0);
}

.back-icon {
    font-size: 24px;
    font-weight: 600;
    color: #333333;
    line-height: 1;
    position: relative;
    z-index: 1;
}

/* 滑出動畫 */
.back-button.slide-out-left {
    animation: slideOutLeft 0.4s cubic-bezier(0.4, 0, 1, 1) forwards !important;
    transition: none !important;
}

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-100px);
    }
}

/* 從左邊滑入動畫（帶煞車回彈效果） */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-80px);
    }

    50% {
        opacity: 1;
        transform: translateX(2px);
    }

    75% {
        transform: translateX(-1px);
    }

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

.back-button.slide-in-left {
    animation: slideInFromLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 漂移動畫 */
@keyframes drift {
    0% {
        transform: translate(-2%, -3%) scale(1);
    }

    50% {
        transform: translate(3%, 2%) scale(1.03);
    }

    100% {
        transform: translate(-1%, 3%) scale(1.05);
    }
}

/* 暗色模式樣式 */
body.dark-mode .nav-links {
    background: rgba(40, 40, 40, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .theme-toggle {
    background: rgba(40, 40, 40, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .theme-slider {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.dark-mode .nav-links::before {
    background: radial-gradient(120px 80px at 20% 30%, rgba(255, 255, 255, 0.15), transparent 60%),
        radial-gradient(140px 90px at 80% 40%, rgba(255, 255, 255, 0.1), transparent 65%),
        radial-gradient(180px 110px at 40% 85%, rgba(255, 255, 255, 0.08), transparent 70%);
}

body.dark-mode .theme-toggle::before {
    background: radial-gradient(100px 70px at 25% 35%, rgba(255, 255, 255, 0.15), transparent 60%),
        radial-gradient(120px 80px at 75% 45%, rgba(255, 255, 255, 0.1), transparent 65%);
}

body.dark-mode .nav-links {
    background: rgba(40, 40, 40, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .back-button {
    background: rgba(40, 40, 40, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .back-button:hover {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5),
        inset 0 -1px 2px rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.5);
}

body.dark-mode .theme-toggle {
    background: rgba(40, 40, 40, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .theme-slider {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}



body.dark-mode .nav-link {
    color: #e0e0e0;
    opacity: 0.6;
}

body.dark-mode .nav-link:hover {
    opacity: 1;
}

body.dark-mode .nav-link.active {
    color: #e0e0e0;
    opacity: 0.6;
}

body.dark-mode .nav-link.active:hover {
    opacity: 1;
}

body.dark-mode .theme-btn img {
    filter: invert(1) grayscale(100%);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.3s ease;
    will-change: filter, opacity;
}

body.dark-mode .theme-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .theme-btn:hover img {
    opacity: 0.8;
}

body.dark-mode .theme-btn.active {
    background: rgba(129, 140, 248, 0.15);
}

body.dark-mode .theme-btn.active img {
    opacity: 1;
    filter: invert(0) grayscale(0%) brightness(1.2);
}

body.dark-mode .back-icon {
    color: #e0e0e0;
}

/* ========== 內容樣式 ========== */

.about-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 160px 20px 100px;
    animation: fadeIn 0.6s ease;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 60px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}

.content-section {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e5e5;
}

.content-section:last-of-type {
    border-bottom: none;
    margin-bottom: 32px;
}

.content-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    transition: color 0.4s ease;
}

.content-section p {
    font-size: 16px;
    color: #555555;
    line-height: 1.8;
    margin-bottom: 12px;
    transition: color 0.4s ease;
}

.content-section code {
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.content-section ol {
    margin-left: 24px;
    color: #555555;
    font-size: 16px;
    line-height: 1.8;
}

.content-section ol li {
    margin-bottom: 10px;
}

.faq-item {
    margin-bottom: 28px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.faq-item p {
    font-size: 15px;
    color: #666666;
    line-height: 1.7;
    margin-bottom: 0;
}

.contact-section {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
}

.contact-link {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    color: #333333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 內部液體效果 */
.contact-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(100px 70px at 30% 40%, rgba(255, 255, 255, 0.25), transparent 60%),
        radial-gradient(120px 80px at 70% 50%, rgba(255, 255, 255, 0.18), transparent 65%);
    filter: blur(12px) saturate(140%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}



.contact-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 12px 32px rgba(0, 0, 0, 0.2);
}

.contact-link span {
    position: relative;
    z-index: 1;
}



/* 暗色模式內容樣式 */
body.dark-mode .content-section {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode h1,
body.dark-mode .content-section h2 {
    color: #e0e0e0;
}

body.dark-mode .content-section p,
body.dark-mode .content-section ol {
    color: #b0b0b0;
}

body.dark-mode .faq-item h3 {
    color: #d0d0d0;
}

body.dark-mode .faq-item p {
    color: #a0a0a0;
}

body.dark-mode .content-section code {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}



body.dark-mode .contact-link {
    background: rgba(40, 40, 40, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #e0e0e0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .contact-link::before {
    background: radial-gradient(100px 70px at 30% 40%, rgba(255, 255, 255, 0.15), transparent 60%),
        radial-gradient(120px 80px at 70% 50%, rgba(255, 255, 255, 0.1), transparent 65%);
}

body.dark-mode .contact-link:hover {
    background: rgba(40, 40, 40, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.5);
}



/* 響應式 - 平板 */
@media (max-width: 768px) {
    .about-container {
        padding: 140px 20px 80px;
    }

    h1 {
        font-size: 24px;
    }

    .content-section h2 {
        font-size: 18px;
    }

    .back-button {
        top: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
    }

    .back-icon {
        font-size: 22px;
    }

    .top-nav {
        top: 20px;
    }

    .theme-toggle {
        top: 20px;
        right: 20px;
    }
}

/* 響應式 - 手機端 */
@media (max-width: 600px) {
    /* 返回按鈕 - 統一高度 40px */
    .back-button {
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
        border-radius: 20px;
        z-index: 1001;
    }

    .back-icon {
        font-size: 20px;
    }

    /* 導航欄 - 統一高度 40px */
    .top-nav {
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-links {
        padding: 4px;
        gap: 3px;
        height: 40px;
        display: flex;
        align-items: center;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 11px;
        border-radius: 16px;
        height: 32px;
        display: flex;
        align-items: center;
    }

    /* 主題切換按鈕 - 統一高度 40px */
    .theme-toggle {
        top: 16px;
        right: 16px;
        padding: 4px;
        gap: 4px;
        border-radius: 20px;
        height: 40px;
    }

    .theme-btn {
        width: 40px;
        height: 32px;
        border-radius: 16px;
    }

    .theme-btn img {
        width: 16px;
        height: 16px;
    }

    .theme-slider {
        width: 40px;
        height: 32px;
        top: 4px;
        left: 4px;
        border-radius: 16px;
    }

    /* 內容區域 */
    .about-container {
        padding: 90px 20px 60px;
        max-width: 100%;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 28px;
    }

    .content-section {
        margin-bottom: 32px;
        padding-bottom: 28px;
    }
    
    /* 聯繫部分增加上邊距 */
    .contact-section {
        margin-top: 48px;
        padding-top: 32px;
    }

    .content-section h2 {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .content-section p,
    .content-section ol {
        font-size: 14px;
        line-height: 1.7;
    }

    .content-section code {
        font-size: 13px;
        padding: 3px 10px;
    }

    .faq-item h3 {
        font-size: 15px;
    }

    .faq-item p {
        font-size: 14px;
    }

    .contact-link {
        padding: 10px 24px;
        font-size: 14px;
    }
}

/* 小屏手機優化 */
@media (max-width: 375px) {
    /* 統一高度 38px */
    .back-button {
        width: 38px;
        height: 38px;
        top: 14px;
        left: 14px;
        border-radius: 19px;
    }

    .back-icon {
        font-size: 18px;
    }

    .top-nav {
        top: 14px;
    }

    .nav-links {
        padding: 4px;
        gap: 2px;
        height: 38px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 10px;
        height: 30px;
    }

    .theme-toggle {
        top: 14px;
        right: 14px;
        padding: 4px;
        gap: 3px;
        height: 38px;
    }

    .theme-btn {
        width: 38px;
        height: 30px;
    }

    .theme-btn img {
        width: 15px;
        height: 15px;
    }

    .theme-slider {
        width: 38px;
        height: 30px;
        top: 4px;
        left: 4px;
    }

    .about-container {
        padding: 80px 16px 50px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .content-section {
        margin-bottom: 28px;
        padding-bottom: 24px;
    }

    .content-section h2 {
        font-size: 16px;
    }

    .content-section p,
    .content-section ol {
        font-size: 13px;
    }
    
    /* 小屏聯繫部分增加上邊距 */
    .contact-section {
        margin-top: 40px;
        padding-top: 28px;
    }
}