:root {
    /* 主色調 - 醫療藍 */
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --primary-light: #7dd3fc;
    --primary-bg: #082f49;
    
    /* 輔助色調 */
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.2);
    --success-dark: #16a34a;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.2);
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.2);
    --warning-dark: #d97706;
    
    /* 中性色調 */
    --bg-dark: #0f172a;
    --bg-dark-2: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-light: #f1f5f9;
    --text-light-2: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-secondary-2: #64748b;
    --border-dark: #334155;
    --border-dark-2: #475569;
    
    /* 交互效果 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    transition: background-color var(--transition-speed);
}

/* 頂部導航欄 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--bg-dark-2);
    border-bottom: 1px solid var(--border-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--primary);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-light);
    line-height: 1.2;
}

.logo-subtext {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
}

/* 主要內容區域 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
}

/* 卡片使用響應式設計 */
.card, .scoring-guide {
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.section-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

.subheading {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 2rem;
    max-width: 700px;
}

/* 問題卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-dark);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--border-dark-2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 2rem;
    margin-bottom: 1rem;
    background-color: var(--bg-dark);
}

.difficulty-基礎 { 
    border: 1px solid var(--primary);
    color: var(--primary);
}

.difficulty-中級 { 
    border: 1px solid var(--warning);
    color: var(--warning);
}

.difficulty-進階 { 
    border: 1px solid var(--danger);
    color: var(--danger);
}

.scenario-card {
    background-color: var(--primary-bg);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1.5rem 0;
    white-space: pre-line;
    line-height: 1.7;
    animation: fadeIn 0.5s ease-out;
    font-size: 1.05rem;
    color: var(--text-light-2);
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 2rem 0;
    animation: slideUp 0.5s ease-out;
}

input[type="number"], input[type="text"], textarea {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-dark);
    border-radius: var(--radius);
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
    width: 100%;
}

input[type="number"] {
    width: 160px;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

button {
    background: var(--primary);
    color: var(--bg-dark);
    padding: 0.95rem 2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
}

.report-btn {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    display: inline-flex;
}

.report-btn:hover {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}

.result-panel {
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    transition: all 0.3s;
    animation: fadeIn 0.5s ease-out;
    background: var(--bg-dark);
}

.correct { 
    background: var(--success-light); 
    border: 2px solid var(--success); 
}

.incorrect { 
    background: var(--danger-light); 
    border: 2px solid var(--danger); 
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.loading::after {
    content: "...";
    animation: loadingDots 1.5s infinite;
    font-weight: bold;
}

.next-btn {
    background: var(--primary-dark);
    margin-top: 1.5rem;
    display: block;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    transition: background 0.3s, transform 0.2s;
    color: var(--text-light);
}

.next-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.clinical-notes {
    background: rgba(30, 41, 59, 0.7);
    padding: 1.75rem;
    margin-top: 1.75rem;
    border-radius: var(--radius);
    white-space: pre-line;
    line-height: 1.7;
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow);
    color: var(--text-light-2);
}

.clinical-notes h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 評分標準卡片 */
.scoring-guide {
    background: var(--bg-card);
    padding: 2rem;
    margin-top: 3rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-dark);
}

.scoring-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.scoring-guide h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scoring-guide table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    color: var(--text-light-2);
}

.scoring-guide th, .scoring-guide td {
    padding: 0.9rem;
    text-align: left;
    vertical-align: top;
}

.scoring-guide th {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-dark);
}

.scoring-guide td {
    border-bottom: 1px solid var(--border-dark);
}

.scoring-guide p {
    font-weight: 500;
    padding: 0.75rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-top: 1.25rem;
    color: var(--text-light-2);
}

/* 對話框樣式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 6, 23, 0.8);
    animation: fadeIn 0.3s;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    max-width: 650px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.4s;
    border: 1px solid var(--border-dark-2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.modal-header h3 {
    color: var(--text-light);
    margin: 0;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-modal {
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger);
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.75rem;
}

/* 頁腳 */
.footer {
    padding: 2.5rem 2rem;
    text-align: center;
    background-color: var(--bg-dark-2);
    border-top: 1px solid var(--border-dark);
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loadingDots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 發光效果 */
.glow-primary {
    box-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary-dark);
}

.glow-success {
    box-shadow: 0 0 5px var(--success), 0 0 10px var(--success-dark);
}

.glow-danger {
    box-shadow: 0 0 5px var(--danger), 0 0 10px var(--danger-dark);
}

/* 響應式設計 */
@media (max-width: 1220px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .navbar {
        padding: 1rem;
    }

    .card, .scoring-guide {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
        padding-top: 0.5rem;
    }

    .nav-link span {
        display: none;
    }

    .nav-link i {
        font-size: 1.25rem;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="number"] {
        width: 100%;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1.5rem;
    }

    .scoring-guide-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .footer-links {
        gap: 1rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .card, .scoring-guide {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.25rem;
    }
    
    .clinical-notes {
        padding: 1.25rem;
    }
    
    .btn-lg {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }
    
    .navbar {
        padding: 0.75rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .feedback-option {
        width: calc(50% - 0.5rem);
        min-width: 120px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .feedback-option {
        width: 100%;
        height: 80px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .feedback-option i {
        margin-bottom: 0;
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .scoring-guide-controls {
        margin-top: 0.5rem;
    }

    .scoring-guide-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .scoring-guide-controls {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
}

/* 意見反饋區域 */
.feedback-section {
    margin: 4rem 0;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feedback-card {
    overflow: hidden;
}

.feedback-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feedback-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(25% - 1rem);
    min-width: 140px;
    height: 120px;
    padding: 1.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-option:hover {
    transform: translateY(-5px);
    background: var(--bg-dark-2);
    border-color: var(--primary);
}

.feedback-option:active {
    transform: scale(0.95);
}

/* 點擊波紋效果 */
.feedback-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(56, 189, 248, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s;
}

.feedback-option:active::before {
    transform: translate(-50%, -50%) scale(20);
    opacity: 1;
    transition: all 0.3s;
}

.feedback-option i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.feedback-option:hover i {
    transform: scale(1.15) translateY(-3px);
}

.feedback-option span {
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.3s;
}

.feedback-option i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feedback-option span {
    font-weight: 500;
    color: var(--text-light);
}

.feedback-form {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-dark);
    transition: all 0.3s ease;
    max-height: 1000px;
    overflow: hidden;
    opacity: 1;
}

.form-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.feedback-description {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cancel-btn {
    background: var(--bg-dark-2); 
    color: var(--text-secondary);
}

.submit-btn {
    background: var(--primary);
    color: var(--bg-dark);
}

.feedback-message {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.4s ease;
}

.feedback-message i {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.feedback-message h3 {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.feedback-message p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feedback-form-expand {
    animation: expandForm 0.3s forwards;
}

.feedback-form-collapse {
    animation: collapseForm 0.3s forwards;
}

@keyframes expandForm {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        max-height: 1000px;
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes collapseForm {
    from {
        max-height: 1000px;
        opacity: 1;
        transform: translateY(0);
    }
    to {
        max-height: 0;
        opacity: 0;
        transform: translateY(-20px);
    }
}

.feedback-message {
    text-align: center;
    padding: 3rem 2rem;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* 添加評分指南摺疊功能相關樣式 */
.scoring-guide-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-btn {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

.toggle-btn:hover {
    background: var(--bg-dark);
    color: var(--primary);
    transform: translateY(0);
    border-color: var(--primary);
}

.guide-content {
    transition: max-height 0.5s ease, opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
}

.guide-content.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    margin-top: 0;
    padding-top: 0;
}

.rotate-icon {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}