/* Google Fonts - Noto Sans TC */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
    --primary-color: #0077b6;
    --secondary-color: #00b4d8;
    --background-start: #ade8f4;
    --background-end: #48cae4;
    --text-color: #023047;
    --label-color: #023e8a;
    --border-color: rgba(255, 255, 255, 0.4);
    --success-color: #2a9d8f;
    --fail-color: #e63946;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px; /* 稍微提升基礎字體大小 */
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    padding: 2.5rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 700;
}

h2 {
    color: var(--label-color);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.info-section, .questions-section {
    margin-bottom: 2.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--label-color);
    font-size: 1.1rem; /* 標籤字體加大 */
}

/* --- 優化：加大輸入框 --- */
.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 1rem; /* 增加內距 */
    font-size: 1.1rem; /* 加大字體 */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.3);
}

.question-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--secondary-color);
    border-radius: 12px;
    padding: 1.75rem; /* 增加卡片內距 */
    margin-bottom: 1.75rem; /* 增加卡片間距 */
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: 0 4px 15px var(--shadow-color);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.7);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.question-text {
    flex: 1;
    font-size: 1.2rem; /* 問題文字加大 */
    font-weight: 500;
}

.question-points {
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem; /* 配分標籤加大 */
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

/* --- 優化：加大選項與間距 --- */
.answer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem; /* 大幅增加選項間距 */
    margin-bottom: 1.25rem;
    padding: 0.5rem 0; /* 增加垂直空間 */
}

.answer-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem; /* 選項文字加大 */
}

.answer-options input[type="radio"] {
    margin-right: 0.75rem;
    transform: scale(1.5); /* 將選項按鈕本身放大 */
}

.response-area {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--border-color);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- 優化：讓滑桿更好拖曳 --- */
.slider-container input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: var(--secondary-color);
    padding: 10px 0; /* 增加滑桿的垂直觸控區域 */
}


.slider-container .score-display {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px; /* 讓數字顯示區更寬 */
    font-size: 1.1rem;
    text-align: center;
}

textarea.comment-box {
    width: 100%;
    min-height: 90px;
    padding: 1rem;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    resize: vertical;
}

.actions {
    text-align: center;
    margin-top: 2.5rem;
}

/* --- 優化：最終送出按鈕加大 --- */
.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem 3.5rem; /* 大幅增加按鈕內距 */
    font-size: 1.4rem; /* 加大按鈕字體 */
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 118, 182, 0.3);
}

.submit-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --- Modal Styles (同步優化) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
    from { transform: translateY(-50px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}
.modal-close:hover {
    transform: scale(1.2);
}

#result-score {
    font-size: 3.2rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--label-color);
}

#result-status.pass { color: var(--success-color); }
#result-status.fail { color: var(--fail-color); }

#result-status {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#result-message {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: var(--text-color);
}

.modal-actions .submit-btn {
    width: 100%;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body { padding: 0.5rem; }
    .container {
        margin: 1rem auto;
        padding: 1.5rem;
    }
    header h1 { font-size: 1.8rem; }
    .question-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    body { padding: 0; font-size: 15px; }
    .container {
        margin: 0;
        padding: 1.2rem;
        border-radius: 0;
        min-height: 100vh;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 新增的分類標題樣式 --- */
.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    padding-bottom: 0.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.questions-section > .category-title:first-child {
    margin-top: 0;
}
