* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e0e0e0;
    --secondary-color: #b0b0b0;
    --text-color: #e0e0e0;
    --bg-color: #0a0a0a;
    --border-color: #2a2a2a;
    --hover-color: #f0f0f0;
    --header-bg: #1a1a1a;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --card-bg: #1a1a1a;
    --input-bg: #2a2a2a;
    --button-bg: #c9a961;
    --button-hover: #d4af37;
    --progress-bg: #2a2a2a;
    --progress-fill: #c9a961;
    --gold-accent: #c9a961;
    --gold-accent-hover: #d4af37;
    --gold-glow: 0 0 8px rgba(201, 169, 97, 0.2);
    --gold-glow-strong: 0 0 12px rgba(201, 169, 97, 0.3);
    --gold-border: 1px solid rgba(201, 169, 97, 0.4);
    --gold-gradient: linear-gradient(135deg, #c9a961, #b8941f);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: radial-gradient(ellipse at center, #1a1a0a 0%, #0a0a0a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(10, 10, 10, 0.98));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.4)) 
            brightness(0) saturate(100%) invert(75%) sepia(30%) saturate(500%) hue-rotate(15deg) brightness(0.9);
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo:hover {
    filter: drop-shadow(0 0 15px rgba(201, 169, 97, 0.7)) 
            brightness(0) saturate(100%) invert(80%) sepia(35%) saturate(600%) hue-rotate(10deg) brightness(1.1);
    transform: scale(1.05);
}

.main-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(201, 169, 97, 0.5)) 
            brightness(0) saturate(100%) invert(75%) sepia(30%) saturate(500%) hue-rotate(15deg) brightness(0.9);
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.main-logo:hover {
    filter: drop-shadow(0 0 20px rgba(201, 169, 97, 0.8)) 
            brightness(0) saturate(100%) invert(80%) sepia(35%) saturate(600%) hue-rotate(10deg) brightness(1.1);
    transform: scale(1.05);
}

body:has(.progress-bar-container) header {
    margin-bottom: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
}

nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--hover-color);
}

.nav-link.active {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
}

.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

body:has(.progress-bar-container) .container {
    margin-top: 50px;
}

.content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

body:not(:has(.tool-content)) .content {
    padding: 3rem 4rem;
}

.logo-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

h1 {
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 2.8rem;
    border-bottom: 3px solid var(--border-color);
    padding-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

body:not(:has(.tool-content)) h1 {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
}

h2 {
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

h3 {
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3rem 0;
    opacity: 0.5;
}

.toc {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.9), rgba(26, 26, 26, 0.9));
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.toc h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.toc ul {
    list-style-type: none;
    margin-left: 0;
    padding: 0;
}

.toc > ul {
    margin-left: 0;
}

.toc ul ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.toc li {
    margin-bottom: 0.8rem;
    line-height: 1.8;
}

.toc a {
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    display: inline-block;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.toc a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--hover-color);
    padding-left: 1rem;
}

.back-to-top {
    text-align: right;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.back-to-top {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.back-to-top a {
    background: var(--gold-gradient);
    color: #000;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.back-to-top a:hover {
    background: linear-gradient(135deg, #d4af37, #c9a961);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

/* 工具頁面專用樣式 */
.progress-bar-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(10, 10, 10, 0.98));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    visibility: visible;
    opacity: 1;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    height: 12px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: var(--gold-gradient);
    transition: width 0.2s ease;
    width: 0%;
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(201, 169, 97, 0.4);
    position: relative;
}

.progress-percentage {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(26, 26, 26, 0.95);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    z-index: 10;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.sidebar-toc {
    position: fixed;
    right: 20px;
    top: 136px;
    width: 280px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

.sidebar-toc.hidden {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

.sidebar-toc h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sidebar-header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-color);
    transform: scale(1.1);
}

.sidebar-toggle-btn {
    position: fixed;
    right: 20px;
    top: 136px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    cursor: pointer;
    z-index: 99;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.95), rgba(26, 26, 26, 0.95));
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6);
}

.sidebar-toggle-btn.active {
    display: flex;
}

.toggle-icon {
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-toc li {
    margin-bottom: 0.5rem;
}

.sidebar-toc a {
    display: block;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.sidebar-toc a:hover {
    background-color: #333;
    text-decoration: none;
}

.category-progress {
    margin-top: 0.5rem;
    height: 4px;
    background-color: var(--progress-bg);
    border-radius: 2px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background-color: var(--progress-fill);
    transition: width 0.3s ease;
    width: 0%;
}

.tool-content {
    margin-right: 320px;
}

.tool-content h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tool-content > p {
    text-align: center;
    font-size: 1.05rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.7;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tag-section {
    margin-bottom: 3.5rem;
    padding: 2rem;
    background: rgba(26, 26, 26, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.tag-section:hover {
    border-color: rgba(201, 169, 97, 0.2);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.tag-section h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.tag-section h3 span {
    flex: 1;
    min-width: 200px;
}

.complete-all-button {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.complete-all-button:hover {
    background: linear-gradient(135deg, #d4af37, #c9a961);
    box-shadow: 0 3px 12px rgba(201, 169, 97, 0.4);
    transform: translateY(-2px);
}

.tag-item {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: rgba(30, 30, 30, 0.6);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.tag-item:hover {
    border-color: rgba(201, 169, 97, 0.3);
    background: rgba(35, 35, 35, 0.7);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.tag-item.completed {
    background: rgba(30, 30, 30, 0.7);
    border-color: rgba(201, 169, 97, 0.5);
    border-left: 4px solid var(--gold-accent);
}

.tag-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.tag-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--text-color);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.tag-details {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.tag-definition {
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-size: 1.05rem;
    line-height: 1.8;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 10px;
    border-left: 2px solid rgba(201, 169, 97, 0.2);
}

.tag-button {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
    min-height: 55px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.tag-button:hover {
    background: linear-gradient(135deg, #d4af37, #c9a961);
    box-shadow: 0 4px 16px rgba(201, 169, 97, 0.5);
    transform: translateY(-2px);
}

.tag-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tag-button.completed {
    background: var(--gold-gradient);
    box-shadow: 0 2px 10px rgba(201, 169, 97, 0.4);
}

.tag-button.completed:hover {
    background: linear-gradient(135deg, #d4af37, #c9a961);
    box-shadow: 0 4px 18px rgba(201, 169, 97, 0.5);
}

/* 自定義確認對話框 */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-dialog {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.95), rgba(26, 26, 26, 0.95));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-dialog-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.custom-dialog-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.custom-dialog-body {
    padding: 2rem;
}

.custom-dialog-body p {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

.custom-dialog-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

.custom-dialog-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.custom-dialog-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.custom-dialog-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-dialog-btn-confirm {
    background: var(--gold-gradient);
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.custom-dialog-btn-confirm:hover {
    background: linear-gradient(135deg, #d4af37, #c9a961);
    box-shadow: 0 4px 16px rgba(201, 169, 97, 0.5);
    transform: translateY(-2px);
}

.custom-dialog-btn:active {
    transform: translateY(0);
}

.reset-button {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: white;
    border: 2px solid #ff6b6b;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.5), 0 0 40px rgba(255, 68, 68, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.reset-button:hover {
    background: linear-gradient(135deg, #ff8888, #ff6666);
    transform: translateX(-50%) translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 68, 68, 0.7), 0 0 60px rgba(255, 68, 68, 0.4);
    border-color: #ff8888;
}

.clear-all-button {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: white;
    border: 1px solid #ff6b6b;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 68, 68, 0.4);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.clear-all-button:hover {
    background: linear-gradient(135deg, #ff8888, #ff6666);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.6);
}

@media (max-width: 1024px) {
    .sidebar-toc {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        width: 280px;
        max-height: 60vh;
        z-index: 998;
    }
    
    .tool-content {
        margin-right: 0;
    }
    
    .progress-bar-container {
        padding: 0 1.5rem;
    }
    
    .progress-percentage {
        font-size: 0.85rem;
        padding: 0.2rem 0.5rem;
    }
    
    .tag-button {
        padding: 0.9rem 1.8rem;
        font-size: 1rem;
        min-width: 120px;
    }
    
    .tag-section h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .complete-all-button {
        width: 100%;
        margin-top: 0.5rem;
    }

    .content {
        padding: 2rem;
    }

    body:not(:has(.tool-content)) .content {
        padding: 2.5rem;
    }
}

.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    background-color: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.95), rgba(26, 26, 26, 0.95));
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    background: rgba(42, 42, 42, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th:first-child {
    padding-left: 1.5rem;
}

th:last-child {
    padding-right: 1.5rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

td:first-child {
    padding-left: 1.5rem;
    font-weight: 600;
    color: var(--hover-color);
}

td:last-child {
    padding-right: 1.5rem;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(42, 42, 42, 0.6);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: rgba(30, 30, 30, 0.4);
}

tbody tr:nth-child(even):hover {
    background-color: rgba(42, 42, 42, 0.6);
}

.color-box {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 0.6rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

code {
    background-color: rgba(26, 26, 26, 0.8);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #ff6b9d;
    border: 1px solid rgba(255, 107, 157, 0.2);
    font-weight: 600;
}

section {
    margin-bottom: 4rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.6), rgba(26, 26, 26, 0.6));
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

section:target {
    scroll-margin-top: 100px;
    border-left: 4px solid var(--gold-accent);
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.8), rgba(26, 26, 26, 0.8));
}

section h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 2rem;
}

section h3 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--gold-accent);
    border-radius: 6px;
    font-size: 1.5rem;
}

section p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

section ul, section ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

section li {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

section strong {
    color: var(--hover-color);
    font-weight: 600;
}

footer {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
    opacity: 0.6;
}

footer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

footer p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-color);
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

footer p::before {
    content: '©';
    color: var(--gold-accent);
    margin-right: 0.3rem;
    font-weight: 700;
}

footer:hover::after {
    animation-duration: 1.5s;
}

/* 響應式設計 */
@media (max-width: 768px) {
    /* Header 優化 */
    header {
        padding: 0.8rem 0;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.8rem 1rem;
    }

    .logo {
        height: 40px;
    }

    nav {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    /* 容器和內容 */
    .container {
        padding: 0.5rem;
        margin-top: 0;
    }

    body:has(.progress-bar-container) .container {
        margin-top: 0;
        padding-top: 0;
        padding-bottom: 140px;
    }

    .content {
        padding: 1rem;
        border-radius: 12px;
    }

    body:not(:has(.tool-content)) .content {
        padding: 1.5rem;
    }

    /* 標題優化 */
    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.8rem;
    }

    body:not(:has(.tool-content)) h1 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }

    .tool-content h1 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.8rem;
    }

    h2 {
        font-size: 1.4rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-top: 1.2rem;
        margin-bottom: 0.8rem;
    }

    /* 工具頁面專用 */
    body:has(.progress-bar-container) header {
        padding: 0.8rem 0;
        position: relative;
        z-index: 1000;
    }

    .progress-bar-container {
        position: fixed !important;
        top: auto !important;
        bottom: 80px !important;
        left: 0 !important;
        right: 0 !important;
        height: 50px !important;
        padding: 0 1rem !important;
        display: flex !important;
        align-items: center !important;
        z-index: 1001 !important;
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(10, 10, 10, 0.98)) !important;
        -webkit-backdrop-filter: blur(5px) !important;
        backdrop-filter: blur(5px) !important;
        border-top: 1px solid var(--border-color) !important;
        border-bottom: none !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .progress-bar-wrapper {
        height: 12px;
        width: 100%;
        max-width: 100%;
    }

    .progress-bar-fill {
        height: 100%;
    }

    .progress-percentage {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        right: 8px;
        background: rgba(26, 26, 26, 0.98);
        border: 1px solid var(--border-color);
    }

    .tool-content > p {
        font-size: 0.95rem;
        padding: 1rem 1.2rem;
        margin-bottom: 2rem;
    }

    /* 標籤區塊 */
    .tag-section {
        padding: 1.2rem;
        margin-bottom: 2rem;
        border-radius: 12px;
    }

    .tag-section h3 {
        padding: 1rem;
        margin-bottom: 1.5rem;
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .tag-section h3 span {
        width: 100%;
        min-width: auto;
    }

    .complete-all-button {
        width: 100%;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        margin-top: 0;
    }

    /* 標籤項目 */
    .tag-item {
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: 12px;
        gap: 1rem;
    }

    .tag-name {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .tag-details {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        gap: 0.8rem;
        flex-wrap: wrap;
    }

    .tag-details span {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .tag-definition {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .tag-button {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        min-height: 50px;
        width: 100%;
        margin-top: 0.5rem;
    }

    /* 側邊目錄手機版 */
    .sidebar-toc {
        position: fixed;
        bottom: 140px;
        right: 10px;
        left: auto;
        top: auto;
        width: 260px;
        max-height: 50vh;
        z-index: 999;
        border-radius: 12px;
    }

    .sidebar-toc.hidden {
        transform: translateX(calc(100% + 20px));
    }

    .sidebar-toc h3 {
        font-size: 1rem;
        padding: 1rem;
    }

    .sidebar-toc ul {
        max-height: calc(50vh - 80px);
        overflow-y: auto;
    }

    .sidebar-toggle-btn {
        bottom: 140px;
        right: 10px;
        top: auto;
        width: 45px;
        height: 45px;
    }

    .tool-content {
        margin-right: 0;
    }

    /* 重置按鈕 */
    .reset-button {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 1rem 2rem;
        font-size: 0.9rem;
        width: calc(100% - 2rem);
        max-width: 400px;
        z-index: 1000;
    }

    /* 對話框優化 */
    .custom-dialog {
        width: 95%;
        max-width: none;
        margin: 1rem;
        border-radius: 12px;
    }

    .custom-dialog-header {
        padding: 1.2rem 1.5rem;
    }

    .custom-dialog-header h3 {
        font-size: 1.1rem;
    }

    .custom-dialog-body {
        padding: 1.5rem;
    }

    .custom-dialog-body p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .custom-dialog-footer {
        padding: 1.2rem 1.5rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .custom-dialog-btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    /* 介紹頁面 */
    .logo-section {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }

    .main-logo {
        max-width: 200px;
    }

    .toc {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .toc h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .toc a {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    section {
        padding: 1.5rem;
        margin-bottom: 2.5rem;
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.8rem;
    }

    section h3 {
        font-size: 1.2rem;
        padding: 0.7rem 0.9rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    section p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        line-height: 1.7;
    }

    section ul, section ol {
        margin-left: 1.5rem;
        margin-bottom: 1.2rem;
    }

    section li {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }

    .back-to-top {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .back-to-top a {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }

    /* 表格優化 */
    table {
        font-size: 0.85rem;
    }

    th {
        padding: 0.8rem 0.6rem;
        font-size: 0.8rem;
    }

    th:first-child {
        padding-left: 1rem;
    }

    th:last-child {
        padding-right: 1rem;
    }

    td {
        padding: 0.7rem 0.6rem;
        font-size: 0.85rem;
    }

    td:first-child {
        padding-left: 1rem;
        font-size: 0.9rem;
    }

    td:last-child {
        padding-right: 1rem;
    }

    .table-container {
        overflow-x: auto;
        margin: 1.5rem 0;
    }

    .color-box {
        width: 20px;
        height: 20px;
        margin-right: 0.4rem;
    }

    code {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }

    /* Footer 手機版優化 */
    footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    footer::after {
        width: 150px;
        height: 150px;
    }

    footer p {
        font-size: 0.85rem;
    }
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
}

