/* 聊天介面樣式 — Group 7 淺綠灰，背景由 var(--bg-group-7) 提供 */
.chat-page-wrapper {
    padding: 100px 1rem 1rem 1rem; /* 增加頂部距離從 76px 到 100px */
    background: var(--bg-group-7);
    color: var(--text-on-light);
    min-height: 100vh;
    box-sizing: border-box;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-page-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(164, 180, 148, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(164, 180, 148, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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


.chat-container {
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 124px); /* 調整高度計算以適應新的頂部距離 */
    max-height: calc(100vh - 124px);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 聊天頭部 */
.chat-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
    flex-shrink: 0; /* 防止頭部被壓縮 */
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(164, 180, 148, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
}


.ai-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ai-info {
    flex: 1;
}

.ai-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    text-shadow: none;
}



.chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a4b494;
}


.status-text {
    font-size: 0.9rem;
    color: #8fa67f;
}

/* 聊天訊息區域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 2rem 2rem 2rem; /* 減少頂部空間回到 2rem */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fafbfc;
    min-height: 0; /* 重要：讓 flexbox 子元素能正常收縮 */
    scroll-behavior: smooth;
}

/* 讓第一個消息元素從底部開始顯示 */
.chat-messages > :first-child {
    margin-top: auto;
}

.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
    margin: 5px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(164, 180, 148, 0.5) 0%, rgba(164, 180, 148, 0.7) 100%);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(164, 180, 148, 0.7) 0%, rgba(164, 180, 148, 0.9) 100%);
    background-clip: content-box;
}

.chat-messages::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, rgba(164, 180, 148, 0.8) 0%, rgba(164, 180, 148, 1) 100%);
    background-clip: content-box;
}

/* 訊息樣式 */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    margin-bottom: 0.75rem;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ffffff;
    background: #a4b494;
    box-shadow: 0 2px 8px rgba(164, 180, 148, 0.4);
}

.user-message .avatar-icon {
    background: #e8976a;
    box-shadow: 0 2px 8px rgba(232, 151, 106, 0.4);
}

.message-content {
    flex: 1;
    /* flex 子元素的 min-width 預設是 auto：不能斷行的內容（程式碼區塊的長行）會把它撐到比訊息列還寬，
       下面泡泡與 pre 的寬度限制都失效，手機上整則被 .chat-messages 裁掉 */
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-bubble {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* 長網址、長英文字串要能斷行：2026-10-03 前手機上整段撐出泡泡、被裁掉（稽核 F4-10） */
    overflow-wrap: anywhere;
    min-width: 0;
}

/* 程式碼區塊是 white-space: pre，overflow-wrap 斷不了行：在區塊裡橫向捲動，不要撐開泡泡（手機上連同一則的段落一起被裁掉） */
.message-bubble pre {
    max-width: 100%;
    overflow-x: auto;
}

/* AI 訊息樣式 - 綠色背景 */
.ai-message .message-bubble {
    background: linear-gradient(135deg, #a8b99c 0%, #96a689 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(168, 185, 156, 0.3);
}

.ai-message .message-bubble p,
.ai-message .message-bubble li,
.ai-message .message-bubble strong {
    color: #ffffff;
}

/* AI 回答與歡迎訊息裡的連結（資料來源、網站問答、歡迎訊息的個人中心）：瀏覽器預設的藍色壓在綠色泡泡上幾乎讀不到 */
.ai-message .message-bubble a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #e8976a 0%, #d87c47 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(232, 151, 106, 0.3);
}

.message-bubble p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    color: #2d3748;
    font-weight: 500;
}

.user-message .message-bubble p,
.user-message .message-bubble li {
    color: #ffffff;
}

/* 使用者訊息是純文字（escapeHtml 過），保留自己打的換行（稽核 F4-10） */
.user-message .message-bubble p {
    white-space: pre-wrap;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.75rem;
    color: #718096;
    align-self: flex-start;
}

.user-message .message-time {
    align-self: flex-end;
}

/* 歡迎訊息特殊樣式 */
.welcome-message .message-bubble {
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(164, 180, 148, 0.4);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.welcome-message .message-bubble p,
.welcome-message .message-bubble li {
    color: #ffffff;
}


/* 輸入區域 */
.chat-input-container {
    border-top: 1px solid #e2e8f0;
    background: white;
    padding: 1.5rem 2rem; /* 恢復正常間距 */
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.025);
    z-index: 10;
    position: relative;
    flex-shrink: 0; /* 防止輸入區被壓縮 */
}

.chat-input-wrapper {
    max-width: 100%;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #a4b494;
    box-shadow: 0 0 0 3px rgba(164, 180, 148, 0.2);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #3d4852;
    font-size: 16px; /* 防止 iOS Safari 自動縮放 */
    line-height: 1.2;
    resize: none;
    outline: none;
    min-height: 12px;
    max-height: 60px;
    font-family: inherit;

    /* 隐藏滚动条但保留滚动功能 */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 和 Edge */
}

/* Webkit 浏览器（Chrome, Safari, Edge）隐藏滚动条 */
#messageInput::-webkit-scrollbar {
    display: none;
}

#messageInput::placeholder {
    color: #a0aec0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.send-button {
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(164, 180, 148, 0.4);
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.send-button:hover::before {
    width: 100%;
    height: 100%;
}

.send-button:hover {
    background: linear-gradient(135deg, #8fa67f 0%, #7a9370 100%);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(164, 180, 148, 0.6);
}

.send-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
}


/* 響應式設計 */
@media (max-width: 768px) {
    .chat-page-wrapper {
        padding: 90px 0.5rem 0.5rem 0.5rem; /* 增加手機版頂部距離 */
        min-height: 100vh;
    }
    
    .chat-container {
        border-radius: 15px;
        height: calc(100vh - 100px); /* 調整手機版高度計算 */
        max-height: calc(100vh - 100px);
    }
    
    .chat-header, .chat-input-container {
        padding: 1rem;
    }
    
    .chat-messages {
        padding: 1rem 1rem 1rem 1rem; /* 保持頂部空間增加的效果 */
        flex: 1;
        min-height: 0;
    }
    
    .message {
        max-width: 90%;
    }
    
    
    .ai-name {
        font-size: 1.2rem;
    }
    
    
    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }
}

@media (max-width: 480px) {
    .chat-page-wrapper {
        padding: 85px 0.25rem 0.25rem 0.25rem; /* 增加小螢幕頂部距離 */
    }
    
    .chat-container {
        height: calc(100vh - 95px); /* 調整小螢幕高度計算 */
        max-height: calc(100vh - 95px);
        border-radius: 10px;
    }
    
    .chat-header-content {
        gap: 0.75rem;
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
    }
    
    .ai-name {
        font-size: 1.1rem;
    }

    .message-bubble {
        padding: 0.6rem 0.8rem;
    }
    
    .input-container {
        padding: 0.4rem 0.8rem; /* 小螢幕進一步縮小輸入框高度 */
    }
    
    .send-button {
        width: 36px;
        height: 36px;
    }
    
    .chat-messages::-webkit-scrollbar {
        width: 4px;
    }
}

/* AI 思考消息樣式 */
.thinking-message {
    animation: fade-in 0.3s ease-in;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 發送按鈕 Loading 狀態 */
.send-button.loading {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    pointer-events: none;
}

.send-button.loading .loading-spinner {
    border-color: rgba(44, 62, 80, 0.18);
    border-top-color: var(--text-on-light);
    width: 14px;
    height: 14px;
    margin: 0;
}


/* 打字指示符樣式 */
.typing-cursor {
    display: inline;
    color: #a4b494;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}



/* 首次載入引導動畫 */
.chat-header {
    animation: slideDown 0.8s ease-out 0.2s both;
}

.chat-messages {
    animation: slideUp 0.8s ease-out 0.4s both;
}

.chat-input-container {
    animation: slideUp 0.8s ease-out 0.6s both;
}

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

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

/* 狀態指示器增強 */
.status-indicator.online {
    background: #a4b494;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(164, 180, 148, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(164, 180, 148, 0.8), 0 0 30px rgba(164, 180, 148, 0.4);
    }
}

/* 歡迎訊息動畫增強 */
.welcome-message {
    animation: welcomeAnimation 1s ease-out 0.8s both;
}

@keyframes welcomeAnimation {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 輸入框樣式 */


/* Markdown 內容樣式 */
.message-bubble strong {
    font-weight: 600;
    color: #2d3748;
}

.message-bubble ol,
.message-bubble ul {
    margin: 0.75rem 0;
    padding-left: 1.8rem;
    line-height: 1.8;
}

.message-bubble ol li,
.message-bubble ul li {
    margin-bottom: 0.6rem;
    line-height: 1.7;
    padding-left: 0.3rem;
}

.message-bubble ol {
    list-style-type: decimal;
}

.message-bubble ul {
    list-style-type: disc;
}

.user-message .message-bubble strong {
    color: var(--text-on-light);
}

.welcome-message .message-bubble strong {
    color: var(--text-on-light);
    text-shadow: none;
}

/* 歷史消息加載指示器 */
.history-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: #8fa67f;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(164, 180, 148, 0.2);
    border-top-color: #a4b494;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== 新對話按鈕 ==================== */
.new-chat-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    border: none;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.new-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(164, 180, 148, 0.4);
}

.new-chat-button:active {
    transform: translateY(0);
}

/* 回覆生成中停用（setNewChatEnabled）：2026-10-03 前停用時外觀與可按時一樣，看不出為什麼按了沒反應（稽核 X4b-3） */
.new-chat-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.new-chat-icon {
    font-size: 18px;
    font-weight: bold;
}

/* ==================== 確認對話框 ==================== */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.confirm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.confirm-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.confirm-modal-body {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-modal-body p {
    margin: 0 0 8px 0;
}

.confirm-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #f0f0f0;
    color: #555;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.ok-btn {
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    color: var(--text-on-light);
}

.ok-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(164, 180, 148, 0.4);
}

/* 響應式設計 - 新對話功能 */
@media (max-width: 480px) {
    .new-chat-text {
        display: none;
    }

    .new-chat-button {
        padding: 8px 12px;
    }

    .confirm-modal-content {
        margin: 16px;
    }
}

/* ==================== Token 用量進度條 ==================== */
.token-usage-container {
    margin-bottom: 12px;
    padding: 0 4px;
}

.token-usage-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.token-usage-progress {
    height: 100%;
    background: linear-gradient(90deg, #a4b494 0%, #8fa67f 100%);
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s ease;
}

/* 警告狀態 (80% 以上) */
.token-usage-progress.warning {
    background: linear-gradient(90deg, #f5a623 0%, #e89600 100%);
}

/* 超過限制狀態 (100%) */
.token-usage-progress.exceeded {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.token-usage-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #718096;
}

#tokenUsagePercentage {
    font-weight: 500;
}

#tokenUsageDetail {
    font-size: 11px;
    color: #a0aec0;
}

/* 警告文字顏色 */
.token-usage-text.warning #tokenUsagePercentage {
    color: #f5a623;
}

/* 超過限制文字顏色 */
.token-usage-text.exceeded #tokenUsagePercentage {
    color: #e74c3c;
}

/* ==================== Token 限制 Modal ==================== */
.token-limit-modal .confirm-modal-header {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.token-limit-modal .limit-icon {
    font-size: 32px;
}

.token-limit-modal .confirm-modal-header h3 {
    color: #e74c3c;
    text-align: center;
}

.token-limit-modal .confirm-modal-body {
    text-align: center;
}

.token-limit-modal .confirm-modal-footer {
    justify-content: center;
}

/* ==================== 輸入框禁用狀態 ==================== */
.chat-input-container.disabled .input-container {
    background: #f0f0f0;
    border-color: #ddd;
    cursor: not-allowed;
}

.chat-input-container.disabled #messageInput {
    background: transparent;
    color: #999;
    cursor: not-allowed;
}

.chat-input-container.disabled #messageInput::placeholder {
    color: #bbb;
}

.chat-input-container.disabled .send-button {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-input-container.disabled .send-button:hover {
    transform: none;
    box-shadow: none;
}

/* 響應式設計 - Token 用量 */
@media (max-width: 480px) {
    .token-usage-container {
        margin-bottom: 8px;
    }

    .token-usage-text {
        font-size: 11px;
    }

    #tokenUsageDetail {
        font-size: 10px;
    }
}

/* ==================== 聊天回饋卡 ==================== */
.feedback-card {
    align-self: center;
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin: 12px 0;
    animation: feedbackFadeIn 0.4s ease-out;
}

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

.feedback-prompt {
    text-align: center;
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 16px;
    font-weight: 500;
}

.feedback-btn-group {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 0;
}

.feedback-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.25s ease;
}

.feedback-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feedback-thumb.thumb-up:hover,
.feedback-thumb.thumb-up.active {
    border-color: #8fa67f;
    background: rgba(143, 166, 127, 0.12);
    box-shadow: 0 4px 12px rgba(143, 166, 127, 0.3);
}

.feedback-thumb.thumb-down:hover,
.feedback-thumb.thumb-down.active {
    border-color: #d87c47;
    background: rgba(216, 124, 71, 0.12);
    box-shadow: 0 4px 12px rgba(216, 124, 71, 0.3);
}

.feedback-thumb.active {
    transform: scale(1.12);
}

.feedback-comment-area {
    margin-top: 16px;
    animation: feedbackFadeIn 0.3s ease-out;
}

.feedback-comment-area textarea {
    width: 100%;
    min-height: 60px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #3d4852;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.feedback-comment-area textarea:focus {
    border-color: #a4b494;
    box-shadow: 0 0 0 3px rgba(164, 180, 148, 0.15);
}

.feedback-comment-area textarea::placeholder {
    color: #a0aec0;
}

.feedback-submit-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 0;
    background: linear-gradient(135deg, #a4b494 0%, #8fa67f 100%);
    border: none;
    border-radius: 10px;
    color: var(--text-on-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(164, 180, 148, 0.4);
}

.feedback-submit-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.feedback-card.submitted {
    text-align: center;
    padding: 20px 24px;
}

.feedback-thanks {
    font-size: 15px;
    color: #8fa67f;
    font-weight: 500;
}

/* 響應式設計 - 回饋卡 */
@media (max-width: 480px) {
    .feedback-card {
        max-width: 100%;
        padding: 16px 18px;
    }

    .feedback-thumb {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}

/* ==================== 未登入引導卡 ==================== */
/* 沿用 .feedback-card 的外框與 .feedback-submit-btn 的按鈕樣式，
   只補上引導文案的排版，維持同一頁的視覺語彙。 */
.login-prompt-card {
    text-align: center;
}

.login-prompt-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 8px;
}

.login-prompt-text {
    font-size: 14px;
    line-height: 1.7;
    color: #4a5568;
    margin: 0;
}

/* 按鈕本體是 <a>，補上連結才需要的置中與去底線 */
a.login-prompt-btn {
    margin-top: 16px;
    text-decoration: none;
    text-align: center;
}

a.login-prompt-btn:hover {
    text-decoration: none;
}
