/* 授權界面樣式 */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.auth-header h1 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-header p {
    color: #666;
    margin: 0 0 2rem 0;
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

#auth-code-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 1px;
    transition: border-color 0.3s;
}

#auth-code-input:focus {
    outline: none;
    border-color: #4a90e2;
}

#auth-submit-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

#auth-submit-btn:hover {
    background: #357abd;
}

#auth-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.auth-message {
    min-height: 1.5rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-message.success {
    color: #28a745;
}

.auth-message.error {
    color: #dc3545;
}

.auth-help {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
}

.auth-contact {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
    font-size: 0.85rem;
    color: #666;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contact-info a {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.8rem;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* 主應用樣式 */
:root {
    --primary-bg: #f0f4f8;
    --secondary-bg: #ffffff;
    --text-color: #333;
    --primary-color: #4a90e2;
    --correct-color: #7ED321;
    --incorrect-color: #D0021B;
    --unanswered-color: #6c757d;
    --bookmark-color: #f39c12;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --button-text-color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

#app-container {
    width: 100%;
    max-width: 600px;
    margin: auto;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: none; /* 初始隱藏，由 JS 控制顯示 */
    flex-direction: column;
    transition: background-color 0.3s;
}

#header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    text-align: center;
    position: relative;
    transition: background-color 0.3s;
}

#header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 2rem;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.3rem;
    }
}
