/* 全域變數 */
:root {
    --primary-color: #D81B60;
    --primary-hover: #ff4081;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-main: #2c3e50;
    --text-sub: #5e6d7e;
    --bg-color: #f4f7f6;
    --sidebar-width: 340px;
    --nav-height: 70px;
    --bottom-player-height: 90px;
}

/* HTML設定 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', "Microsoft JhengHei", sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(216, 27, 96, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(33, 150, 243, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
.brand-logo,
.hero-title,
.mode-title,
.card-header {
    font-family: 'Poppins', sans-serif;
}

/* 背景 Canvas & 容器樣式 */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* 動畫&捲動轉場效果 */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: none;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 按鈕 */
button,
.action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 1;
}

button::after,
.action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-20deg);
    transition: 0s;
    pointer-events: none;
}

button:hover::after,
.action-btn:hover::after {
    left: 150%;
    transition: 0.6s ease-in-out;
}

.glass-btn-style {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), inset 0 2px 5px rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    border-radius: 50px;
}

.glass-btn-style:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 15px 30px rgba(216, 27, 96, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 1);
    color: var(--primary-color);
}

.generate-btn,
.btn-start-create,
.btn-render,
.btn-modal-primary {
    background: linear-gradient(135deg, rgba(216, 27, 96, 0.85), rgba(255, 64, 129, 0.85)) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 20px rgba(216, 27, 96, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 15px;
    width: 100%;
    font-weight: 600;
}

.generate-btn:hover,
.btn-start-create:hover,
.btn-render:hover,
.btn-modal-primary:hover {
    background: linear-gradient(135deg, rgba(216, 27, 96, 1), rgba(255, 64, 129, 1)) !important;
    transform: translateY(-3px) scale(1.02);
    color: white;
}

.btn-start-test {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.9), rgba(20, 20, 20, 0.95));
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 15px;
    width: 100%;
    font-weight: 600;
}

.btn-start-test:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.settings-toggle-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-toggle-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-modal-danger {
    background: rgba(255, 255, 255, 0.9);
    color: #f44336;
    border: 2px solid #f44336;
    padding: 15px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-modal-danger:hover {
    background: #f44336;
    color: white;
    transform: translateY(-2px);
}

.action-btn {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    color: #333;
    text-decoration: none;
    padding: 15px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-download {
    background: #f0f0f0;
    border: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid #ddd;
    color: #888;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
}

.btn-secondary:hover {
    border-color: #aaa;
    color: #555;
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* NAV */
.navbar {
    height: var(--nav-height);
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: fixed;
    top: 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.brand-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: transparent;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 20px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* 頁面切換&畫面容器 */
.screen {
    display: none;
    flex: 1;
    width: 100%;
    height: 100%;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: var(--nav-height);
    scroll-behavior: smooth;
}

.screen.active {
    display: flex;
}

#creations-screen.has-player {
    padding-bottom: var(--bottom-player-height);
}

.mode-card,
.dashboard-card,
.test-content,
.modal-content,
.piano-wrapper {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* 首頁 */
.hero-section {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-family: 'Poppins';
    font-weight: 700;
    margin-bottom: 15px;
    color: #111;
    line-height: 1.1;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-sub);
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.6;
}

.mode-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-card {
    padding: 30px;
    width: 320px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-card:hover {
    transform: translateY(-10px) scale(1.01);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: white;
}

.mode-title {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Poppins';
    margin: 0;
}

.mode-card>button {
    margin-top: auto;
}

.home-section-container {
    width: 100%;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-margin-top: var(--nav-height);
}

.features-header h2 {
    font-size: 42px;
    font-family: 'Poppins';
    color: #333;
    margin-bottom: 10px;
}

.features-header p {
    color: #666;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 60px auto;
}

.feature-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    width: 100%;
    margin-bottom: 80px;
    gap: 50px;
}

.feature-block:nth-child(even) {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
    text-align: left;
}

.feature-text h3 {
    font-size: 28px;
    font-family: 'Poppins';
    margin-bottom: 15px;
    color: #222;
}

.feature-text p {
    color: #555;
    line-height: 1.6;
    font-size: 16px;
    text-align: justify;
}

.feature-visual {
    flex: 1;
    height: 300px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 80px;
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 側邊欄 */
.sidebar {
    position: fixed;
    top: 0;
    left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 25px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
}

.sidebar-scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.sidebar-scroll-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sketch-select,
.sketch-input {
    width: 100%;
    padding: 12px 25px;
    padding-right: 40px;
    border: 1px solid var(--glass-border);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.sketch-select {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTIuNCIgaGVpZ2h0PSIyOTIuNCIgdmlld0JveD0iMCAwIDI5Mi40IDI5Mi40Ij48cGF0aCBmaWxsPSIjZDgxYjYwIiBkPSJNMjg3IDY5LjRhMTcuNiAxNy42IDAgMCAwLTEzLTUuNEgxOC40Yy01IDAtOS4zIDEuOC0xMi45IDUuNEExNy42IDE3LjYgMCAwIDAgMCA4Mi4yYzAgNSAxLjggOS4zIDUuNCAxMi45bDEyOCAxMjcuOWMzLjYgMy42IDcuOCA1LjQgMTIuOCA1LjRzOS4yLTEuOCAxMi44LTUuNEwyODcgOTVjMy41LTMuNSA1LjQtNy44IDUuNC0xMi44IDAtNS0xLjktOS4yLTUuNS0xMi44eiIvPjwvc3ZnPg==');
    background-repeat: no-repeat;
    background-position: right 18px top 50%;
    background-size: 10px auto;
}

.sketch-select:hover,
.sketch-input:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 38, 135, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 1);
}

.sketch-select:focus,
.sketch-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 10px 30px rgba(216, 27, 96, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 1);
    transform: translateY(-2px) scale(1.01);
}

.sketch-select option {
    background-color: #fff;
    color: #333;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.checkbox-group {
    background: var(--glass-bg);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.checkbox-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    align-items: center;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-top: 5px;
    display: block;
}

/* 展示櫃與徽章 */
.creation-showcase-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
    align-items: stretch;
}

.spotlight-card {
    position: relative;
    height: 100%;
    min-height: 250px;
    padding: 30px !important;
    transition: 0.3s ease;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.spotlight-bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 150px;
    color: var(--primary-color);
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
}

.spotlight-nav-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    z-index: 5;
    outline: none;
}

.spotlight-nav-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.spotlight-prev{
    left: 0;
    border-radius: 0 50% 50% 0;
    padding-left: 5px;
}

.spotlight-next{
    right: 0;
    border-radius: 50% 0 0 50%;
    padding-right: 5px;
}

.spotlight-counter{
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.spotlight-tag {
    background: linear-gradient(135deg, var(--primary-color), #ff4081);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
    display: inline-block;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-item {
    display: flex !important;
    align-items: center;
    padding: 15px 20px !important;
    gap: 15px;
    transition: transform 0.2s;
    cursor: pointer;
}

.recent-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.9);
}

.btn-favorite {
    background: transparent;
    border: 2px solid #ddd;
    color: #ccc;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-favorite:hover {
    border-color: #ff4081;
    color: #ff4081;
    background: rgba(255, 64, 129, 0.05);
}

.btn-favorite.active {
    background: linear-gradient(135deg, #ff4081, #f50057);
    border-color: transparent;
    color: white;
    transform: scale(1.1);
}

.spotlight-video-container {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spotlight-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.showcase-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    min-height: 160px;
    width: 100%;
}

.empty-showcase-placeholder {
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    background: rgba(255, 255, 255, 0.3);
}

.badge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    transition: transform 0.3s;
    position: relative;
}

.badge-wrapper:hover {
    transform: translateY(-10px);
}

.badge-coin {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    color: white;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
}

.badge-common {
    background: linear-gradient(135deg, #cd7f32, #8c5a2b);
    border-color: #e6a86a;
}

.badge-rare {
    background: linear-gradient(135deg, #ece9e6, #bdc3c7);
    border-color: #fff;
}

.badge-epic {
    background: linear-gradient(135deg, #ffd700, #fdb931);
    border-color: #ffed4a;
}

.badge-legendary {
    background: linear-gradient(135deg, #ff00cc, #333399);
    animation: holo 3s infinite linear;
    border-color: #ff99cc;
}

@keyframes holo {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

.badge-ribbon {
    position: absolute;
    bottom: -12px;
    background: #d32f2f;
    color: white;
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.badge-locked {
    filter: grayscale(100%) brightness(0.3);
    opacity: 0.5;
    cursor: not-allowed;
}

.manage-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 15px;
    gap: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    position: relative;
}

.manage-card:hover {
    background: white;
}

.manage-card.selected {
    border-color: var(--primary-color);
    background: rgba(216, 27, 96, 0.05);
}

.manage-card.selected::after {
    content: '✓ Displaying';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    color: var(--primary-color);
    font-weight: bold;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

#achievements-manager-modal .modal-content {
    width: 800px;
    max-width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

/* 工作區&創作預覽 */
.workspace-header {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.workspace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 40px 40px 40px;
    overflow-y: auto;
}

.canvas-area {
    width: 100%;
    max-width: 1000px;
    height: 50vh;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border: 2px dashed #ddd;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.canvas-area.has-result {
    border: none;
    background: #000;
}

#result-dashboard {
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card-preview {
    grid-column: span 2;
}

.card-header {
    font-weight: 700;
    font-family: 'Poppins';
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.player-circle-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #111);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.player-circle-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary-color), #ff4081);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 5px 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type=range]:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

/* 測驗&鋼琴介面 */
.test-content {
    width: 95%;
    max-width: 1200px;
    text-align: center;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.piano-wrapper {
    width: 100%;
    margin-top: 20px;
    padding: 5px;
    background: #222;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    border: 4px solid #444;
    overflow: hidden;
}

.piano-container {
    position: relative;
    height: 220px;
    display: flex;
    width: 100%;
    min-width: auto;
}

.key {
    position: relative;
    cursor: pointer;
    border-radius: 0 0 6px 6px;
    user-select: none;
    transition: transform 0.1s;
}

.key.white {
    flex: 1;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
    border: 1px solid #aaa;
    border-top: none;
    margin: 0 1px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    color: #777;
    font-size: clamp(8px, 1.2vw, 12px);
    font-weight: 600;
    z-index: 1;
}

.key.white:active,
.key.white.active {
    background: linear-gradient(180deg, #e0e0e0 0%, #ccc 100%);
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.key.black {
    width: 2.2%;
    height: 60%;
    background: linear-gradient(180deg, #444 0%, #111 100%);
    position: absolute;
    top: 0;
    z-index: 2;
    border-radius: 0 0 5px 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.key.black:active {
    background: #000;
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.key.correct {
    background: #4caf50 !important;
    color: white;
    box-shadow: 0 0 20px #4caf50, inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.key.wrong-fade::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f44336;
    opacity: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 5;
    animation: flashFade 0.5s ease-out forwards;
}

@keyframes flashFade {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* 彈出視窗 */
#result-modal,
#quit-modal,
#clear-history-modal,
#delete-single-modal,
#video-playback-modal,
#achievements-manager-modal,
#help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    width: 400px;
    max-width: 90%;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid white;
}

.modal-btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
}

.modal-btn-group button {
    flex: 1;
    justify-content: center;
}

/* 懸浮播放器&底部播放器 */
#floating-back-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(216, 27, 96, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    transition: 0.3s;
}

#floating-back-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(216, 27, 96, 0.4);
}

.floating-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    padding: 15px;
    z-index: 2100;
    transition: transform 0.3s;
    cursor: default;
}

.floating-player:hover {
    transform: translateY(-2px);
}

.fp-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 0;
}

.fp-info {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 15px;
    transition: 0.2s;
}

#fp-title {
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

#fp-title:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.fp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.fp-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 16px;
    width: 30px;
    display: flex;
    justify-content: center;
}

.creation-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), #ff4081);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(216, 27, 96, 0.3);
    flex-shrink: 0;
}

.bottom-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-player-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bottom-player-container.active {
    transform: translateY(0);
}

.bp-left-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 25%;
    min-width: 150px;
}

.bp-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    text-align: left;
}

.bp-track-title {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bp-track-subtitle {
    font-size: 11px;
    color: #888;
}

.bp-center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 500px;
}

.bp-buttons-row {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 5px;
}

.bp-right-spacer {
    width: 25%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.bp-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100px;
}

.bp-select {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    outline: none;
    transition: 0.2s;
    max-width: 120px;
}

.bp-select:hover {
    background: rgba(0, 0, 0, 0.1);
}

.bp-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.bp-btn.active,
.fp-btn.active {
    color: #4caf50;
    position: relative;
}

.bp-btn.active::after,
.fp-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 4px;
    height: 4px;
    background: #4caf50;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
}

.bp-play-btn {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white !important;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.bp-play-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(216, 27, 96, 0.4);
}

.bp-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
}

.bp-range {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.bp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.bp-range:hover::-webkit-slider-thumb {
    transform: scale(1.3);
}

/* === 15. 提示訊息 (Toast) 與載入動畫 === */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: rgba(30, 30, 30, 0.9);
    color: #fff;
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-left: 5px solid #4CAF50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.info {
    border-left-color: #2196f3;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.queue-status-box {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #ddd;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.queue-info-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.queue-val {
    font-weight: bold;
    color: var(--primary-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(216, 27, 96, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Help FAB, 懸浮視窗, 按鈕 */
#help-fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    cursor: pointer;
    z-index: 2000;
    transition: all 0.3s;
    display: none;
    align-items: center;
    justify-content: center;
}

#help-fab-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 25px rgba(216, 27, 96, 0.3);
}

#piano-trigger-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 15px 10px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1900;
    transition: 0.3s;
    display: none;
}

#piano-trigger-btn:hover {
    padding-right: 15px;
    background: var(--primary-color);
    color: white;
}

.studio-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.studio-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.studio-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: move;
}

.studio-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.studio-close-btn {
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.studio-close-btn:hover {
    background: #ff4757;
    color: white;
    transform: rotate(90deg);
}

.studio-body {
    padding: 30px;
    background: linear-gradient(to bottom, #fff, #f9f9f9);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#creation-piano-keys {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
}

/* RWD */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    .workspace-header {
        padding: 15px;
    }

    .workspace-content {
        padding: 15px;
    }

    .hero-section {
        min-height: auto;
        height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
        justify-content: flex-start;
    }

    .hero-title {
        font-size: 32px;
        margin-top: 20px;
    }

    .mode-container {
        gap: 20px;
        margin-bottom: 20px;
    }

    .mode-card {
        padding: 20px;
        height: auto;
        gap: 10px;
    }

    .mode-title {
        font-size: 18px;
    }

    .mode-card>button {
        margin-top: 15px;
    }

    .creation-showcase-wrapper {
        grid-template-columns: 1fr;
    }

    .feature-block,
    .feature-block:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .feature-text {
        text-align: center;
    }

    #result-dashboard {
        grid-template-columns: 1fr;
    }

    .card-preview {
        grid-column: span 1;
    }

    .navbar {
        padding: 0 15px;
    }

    .brand-logo {
        font-size: 18px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .glass-btn-style {
        padding: 15px !important;
    }

    .glass-btn-style>div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .glass-btn-style>div>div:first-child {
        width: 100%;
    }

    .glass-btn-style>div>div:last-child {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 100px;
    }

    .bottom-player-container {
        padding: 10px 20px 30px 20px;
        height: auto;
        min-height: 120px;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
    }

    .bp-progress-container {
        order: 1;
        width: 100%;
        margin-bottom: 2px;
    }

    .bp-left-info {
        order: 2;
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .bp-text-group {
        text-align: center;
    }

    .bp-center-controls {
        order: 3;
        width: 100%;
        max-width: none;
        flex: none;
    }

    .bp-buttons-row {
        margin-bottom: 0;
        justify-content: center;
        gap: 35px;
    }

    .bp-right-spacer {
        display: none;
    }

    .floating-player {
        bottom: 30px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 85%;
        max-width: 350px;
    }

    .floating-player:hover {
        transform: translateX(-50%) translateY(-2px);
    }

    .mac-window {
        width: 95%;
        height: auto;
        transform-origin: center bottom;
        bottom: 60px;
        top: auto;
    }

    #piano-trigger-btn {
        display: flex !important;
        top: auto !important;
        bottom: 160px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        align-items: center;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        background: white;
        color: var(--primary-color);
        z-index: 2000;
    }

    .piano-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .piano-container {
        width: auto !important;
        min-width: 800px !important;
    }

    .key.white {
        font-size: 10px;
    }

    .glass-btn-style>.history-card-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .history-info-group {
        width: 100%;
        gap: 15px;
    }

    .history-text-col {
        width: 100%;
    }

    .history-title {
        white-space: normal;
        font-size: 15px;
    }

    .history-actions-group {
        width: 100%;
        justify-content: space-between;
        padding-top: 15px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        align-items: center;
    }

    .history-download-col {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex: 1;
        justify-content: center;
    }

    .history-divider {
        display: none;
    }

    .history-actions-group .player-circle-btn {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .history-delete-btn {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        background: white !important;
        border: 1px solid #ffcdd2 !important;
        color: #f44336 !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 5px rgba(244, 67, 54, 0.1) !important;
    }

    .history-delete-btn:active {
        background: #ffebee !important;
        border-color: #f44336 !important;
        transform: scale(0.95);
    }

    .guide-modal-content {
        height: 100vh;
        width: 100%;
        border-radius: 0;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .guide-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .guide-list-icon {
        display: none;
    }

    .presentation-float-btn {
        padding: 10px 15px;
        font-size: 12px;
    }

    .presentation-float-btn span {
        display: none;
    }

    .app-footer {
        padding: 15px 20px;
        flex-direction: row;
        gap: 15px;
    }

    .footer-text {
        font-size: 10px;
        text-align: right;
    }
}

/* 其他動畫效果 */
@keyframes auto-shine {
    0% {
        left: -150%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

button::after,
.action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: auto-shine 8s infinite;
}

button:hover::after,
.action-btn:hover::after {
    left: 150%;
    transition: 0.6s ease-in-out;
    animation: none;
}

/* My Creations History */
.history-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.history-info-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.history-text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
}

.history-title {
    margin: 0 0 5px 0;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.history-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.history-divider {
    width: 1px;
    height: 30px;
    background: #eee;
    margin: 0 5px;
}

.history-download-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

/* 互動式導覽 */
#tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tour-overlay.active {
    opacity: 1;
}

#tour-spotlight {
    position: fixed;
    z-index: 10001;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    border-radius: 50px;
    pointer-events: none;
    display: none;
    border: 2px solid var(--primary-color);
    transition: all 0.1s ease-out;
}

#tour-spotlight.active {
    display: block;
}

.tour-tooltip {
    position: fixed;
    z-index: 10005 !important;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: none;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.tour-active-parent,
.app-container.tour-active-parent,
.sidebar-scroll-content.tour-active-parent {
    z-index: auto !important;
    overflow: visible !important;
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.tour-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.tour-step-counter {
    font-size: 12px;
    color: #999;
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
}

.tour-content {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tour-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.tour-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.tour-btn-skip {
    background: transparent;
    color: #888;
}

.tour-btn-skip:hover {
    color: #555;
}

.tour-btn-next {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
}

.tour-btn-next:hover {
    transform: translateY(-2px);
    background: var(--primary-hover);
}

/* Guide */
.btn-guide-trigger {
    width: 100%;
    background: rgba(33, 150, 243, 0.05);
    color: #2196f3;
    border: 1px dashed rgba(33, 150, 243, 0.3);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-guide-trigger:hover {
    background: rgba(33, 150, 243, 0.15);
    border-color: #2196f3;
    transform: translateY(-1px);
}

.btn-guide-trigger i {
    font-size: 12px;
}

.header-guide-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(33, 150, 243, 0.08);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    margin-left: 12px;
}

.header-guide-pill:hover {
    background: #2196f3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.2);
}

.guide-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.guide-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.guide-modal-content {
    background: #fff;
    width: 900px;
    max-width: 95%;
    height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.guide-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: start;
    background: #fafafa;
}

.guide-close-btn {
    background: #eee;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.guide-close-btn:hover {
    background: #ff4757;
    color: white;
    transform: rotate(90deg);
}

.guide-scroll-area {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.guide-section-title {
    color: #333;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
    font-size: 18px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.guide-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.guide-card:hover:has(.major) {
    border-top: 4px solid #ff9800;
}

.guide-card:hover:has(.minor) {
    border-top: 4px solid #607d8b;
}

.guide-card:hover:has(.blues) {
    border-top: 4px solid #3f51b5;
}

.guide-card:hover:has(.penta) {
    border-top: 4px solid #4caf50;
}

.guide-card:hover:has(.penta-m) {
    border-top: 4px solid #ff5722;
}

.guide-card h4 {
    margin: 15px 0 8px 0;
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
}

.guide-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.guide-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.guide-icon.major {
    background: #fff3e0;
    color: #ff9800;
}

.guide-icon.minor {
    background: #eceff1;
    color: #607d8b;
}

.guide-icon.blues {
    background: #e8eaf6;
    color: #3f51b5;
}

.guide-icon.penta {
    background: #e8f5e9;
    color: #4caf50;
}

.guide-icon.penta-m {
    background: #fbe9e7;
    color: #ff5722;
}

.guide-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-list-item {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.2s;
}

.guide-list-item:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.guide-list-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.guide-label {
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 4px;
}

.guide-desc {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* 簡報 & footer */
.presentation-float-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 15px 20px 15px 25px;
    border-radius: 30px 0 0 30px;
    text-decoration: none;
    box-shadow: -5px 0 15px rgba(216, 27, 96, 0.3);
    z-index: 1900;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
}

.presentation-float-btn:hover {
    padding-right: 35px;
    background: var(--primary-hover);
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -8px 0 20px rgba(216, 27, 96, 0.5);
}

.presentation-float-btn i {
    font-size: 18px;
}

.app-footer {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), #ff4081);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 -10px 30px rgba(216, 27, 96, 0.15);
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 40%);
    pointer-events: none;
}

.footer-logo-circle {
    width: 40px;
    height: 40px;
    background: #222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.footer-logo-circle:hover {
    transform: rotate(180deg) scale(1.1);
}

.footer-text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}