:root {
    --glass-bg: rgba(26, 31, 37, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: '微軟正黑體', sans-serif;
}

body {
    background: url('https://api.oha.li/img/?size=2560kb') no-repeat center center fixed;
    background-size: cover;
    color: white;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 31, 37, 0.8), rgba(42, 52, 64, 0.8));
    z-index: -1;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 3rem;
    margin: 1rem auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.glass-container:hover {
    transform: translateY(-5px);
}

.nav-container {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    width: 100%;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

header {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.section {
    max-width: 1200px;
    margin: 4rem auto;
}

.doc-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.doc-section {
    margin-bottom: 3rem;
}

.doc-section:not(:first-child) {
    margin-top: 4rem;
}

.doc-sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.doc-sidebar ul {
    list-style: none;
    margin-top: 1rem;
}

.doc-sidebar ul li {
    margin-bottom: 1rem;
}

.doc-sidebar ul li a {
    color: white;
    text-decoration: none;
    transition: 0.3s;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.doc-sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.doc-content {
    min-height: 80vh;
}

.preview-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    transition: all 0.3s ease;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

.preview-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.troubleshoot-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.troubleshoot-item h4 {
    color: #ff9800;
    margin-bottom: 1rem;
}

.solution-steps {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.solution-steps li {
    margin-bottom: 0.5rem;
}

.links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.3s;
    border: 1px solid var(--glass-border);
    font-weight: 500;
}

.link-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.steps {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.steps li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.steps li::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 0;
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    font-weight: bold;
}

.styled-list {
    list-style-type: none;
    padding: 0;
}

.styled-list li {
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: rgba(255, 165, 0, 0.2);
    color: #fff;
    padding: 12px;
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

td:nth-child(2) {
    color: #ffa500;
    font-weight: bold;
}

.info-item {
    margin-bottom: 30px;
}

.info-item h4 {
    color: #ffa500;
    margin-bottom: 15px;
    font-size: 1.2em;
}

@media (max-width: 768px) {
    .section {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    .doc-container {
        padding: 0 1rem;
    }

    .doc-sidebar {
        position: relative;
        top: 0;
        height: auto;
        margin-bottom: 2rem;
    }

    .glass-container h2 {
        margin: 0 -2rem 1.5rem -2rem;
        padding: 1.5rem 2rem;
        top: -2rem;
    }

    .glass-container {
        padding: 2rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .language-selector {
        position: fixed;
        top: 10px;
        right: 10px;
        padding: 0.3rem 0.7rem;
        font-size: 0.9rem;
    }
}

.highlight-red {
    color: #ff0000;
    font-weight: bold;
}

.highlight-blue {
    color: #0000ff;
    font-weight: bold;
}

.highlight-green {
    color: #00ff00;
    font-weight: bold;
}

.highlight-gold {
    color: #ffd700;
    font-weight: bold;
}

.highlight-orange {
    color: #ff9800;
    font-weight: bold;
}

.highlight-blue {
    color: #00bcd4;
    font-weight: bold;
}

.highlight-purple {
    color: #9c27b0;
    font-weight: bold;
}

.highlight-red {
    color: #f44336;
    font-weight: bold;
}

.highlight-mystery {
    color: #673ab7;
    font-weight: bold;
}

.highlight-white {
    color: #ffffff;
    font-weight: bold;
}

.highlight-brown {
    color: #795548;
    font-weight: bold;
}

.highlight-pink {
    color: #e91e63;
    font-weight: bold;
}

.highlight-yellow {
    color: #ffeb3b;
    font-weight: bold;
}

.version-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.version-info p {
    margin: 0.5rem 0;
    color: #ffa500;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

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

.faq-question {
    font-weight: bold;
    color: #6dc0e9;
    margin-bottom: 0.5rem;
}

.faq-answer {
    padding-left: 1rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.preview-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.preview-link {
    display: block;
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.preview-link::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.preview-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-link:hover::before,
.preview-link:hover::after {
    opacity: 1;
}

.preview-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 燈箱效果 */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preview-overlay.active {
    display: flex;
}

.preview-overlay img {
    max-width: 100%;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.preview-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.language-selector {
    position: absolute;
    top: 18px;
    right: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.2rem 1rem;
    color: white; /* 這裡設定父層文字顏色 */
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 16px 0 rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.language-selector:hover,
.language-selector:focus-within {
    background: rgba(42, 52, 64, 0.95);
}

.language-selector select {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    padding: 0.2rem 0.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.language-selector select:focus {
    outline: none;
    box-shadow: none;
}

.language-selector option {
    background: #23272f;
    color: #fff; /* 選項展開時的文字顏色 */
    font-size: 1rem;
    font-family: inherit;
    border: none; /* 新增：移除 option 的白色邊框 */
    outline: none;
}

@media (max-width: 768px) {
    .language-selector {
        position: fixed;
        top: 10px;
        right: 10px;
        padding: 0.2rem 0.7rem;
        font-size: 0.95rem;
    }
}