@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;600;700&display=swap');

:root {
    --primary-color: #000000;
    --secondary-color: #d4af37; /* 金色 */
    --accent-color: #ffd700; /* 亮金色 */
    --text-color: #f5f5f5; /* 白色 */
    --text-secondary: #a9a9a9; /* 灰色 */
    --background-color: #121212; /* 接近黑色的深色 */
    --card-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
    --hover-shadow: 0 8px 16px rgba(255, 215, 0, 0.5);
}

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

body {
    font-family: 'Noto Serif TC', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 20; /* 確保標題顯示在最上層 */
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    animation: titleGlow 2s infinite alternate;
    cursor: pointer;
    transition: all 0.3s ease;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-color), transparent);
    transition: width 0.5s ease;
}

header h1:hover {
    transform: translateY(-3px);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

header h1:hover::after {
    width: 100%;
}

header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.deck-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    min-height: 350px;
    position: relative;
}

.deck {
    position: relative;
    width: 350px;
    height: 200px;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.3s ease;
    background-size: cover;
    background-position: center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.cut-counter {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif TC', serif;
    font-weight: bold;
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.card-result {
    display: none;
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--background-color);
    padding: 1rem;
    z-index: 10;
    min-height: 500px;
}

.drawn-card-container {
    margin-bottom: 1.5rem;
}

.drawn-card {
    width: 350px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.card-meaning {
    max-width: 600px;
    margin-bottom: 1.5rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--secondary-color);
}

.card-meaning h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
}

.card-meaning p {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.7;
}

#resetBtn {
    margin-top: 0;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

#resetBtn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .deck {
        width: 280px;
        height: 160px;
    }

    .drawn-card {
        width: 280px;
    }

    .card-meaning {
        padding: 1rem;
    }

    .card-meaning h2 {
        font-size: 1.4rem;
    }

    .card-meaning p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    100% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 添加設置按鈕樣式 */
.settings-link {
    position: absolute;
    top: 10px;
    right: 10px;
}

.settings-link a {
    color: #333;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.settings-link a:hover {
    opacity: 1;
}

/* 按鈕容器樣式 */
.button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* TTS按鈕樣式 */
.tts-btn {
    margin-top: 0;
    margin-bottom: 0;
    background-color: #6c5ce7;
}

.tts-btn:hover {
    background-color: #5541e0;
}

.tts-btn:disabled {
    background-color: #555;
    opacity: 0.7;
    cursor: not-allowed;
}

/* 設置頁面描述文字 - 舊樣式保留用於其他頁面 */
.description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.description a {
    color: #6c5ce7;
    text-decoration: none;
}

.description a:hover {
    text-decoration: underline;
}

/* 設置頁面專用描述樣式 */
.settings-panel .description {
    font-size: 1.1rem;
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.settings-panel .description a {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .button-container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 設置頁面樣式 */
.settings-panel {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--secondary-color);
}

.settings-panel h3 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.api-key-section, .tts-section, .info-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    background-color: rgba(212, 175, 55, 0.05);
}

.api-key-section label, .tts-voice-selection label, .tts-instructions-input label {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--text-color);
}

#api-key {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    margin-bottom: 1rem;
}

#save-api-key, #update-tts, #go-to-index {
    font-size: 1.3rem;
    padding: 0.8rem 2rem;
    display: block;
    margin: 1.5rem auto;
    min-width: 200px;
}

#tts-voice {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

#tts-instructions {
    width: 100%;
    height: 300px;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    resize: vertical;
    line-height: 1.5;
}

.navigation-buttons {
    text-align: center;
    margin-top: 3rem;
}

.primary-button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif TC', serif;
    font-weight: bold;
}

.primary-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

@media (max-width: 768px) {
    .settings-panel {
        padding: 1.5rem;
    }
    
    .settings-panel h3 {
        font-size: 1.5rem;
    }
    
    #api-key, #tts-voice, #tts-instructions {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    #save-api-key, #update-tts, #go-to-index {
        font-size: 1.1rem;
        min-width: 150px;
    }
}

/* 大圖顯示樣式 */
.full-image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.full-image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#fullImage {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.close-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.drawn-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.drawn-card:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .full-image-container {
        max-width: 95%;
    }
    
    .close-btn {
        top: -15px;
        right: -15px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}

.audio-btn {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    font-weight: bold;
    border-radius: 5px;
}

.audio-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.audio-btn:disabled {
    background-color: #555;
    opacity: 0.7;
    cursor: not-allowed;
} 