/* Anima 設計系統樣式 - 完全匹配原設計 */
@import url("https://cdn.jsdelivr.net/npm/reset-css@5.0.1/reset.min.css");
@import url("https://fonts.googleapis.com/css?family=Noto+Sans:900|Noto+Sans+TC:500,700");

/* 基礎樣式重置 - 與 Anima 一致 */
* {
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

html,
body {
    margin: 0px;
    height: 100%;
}

/* 按鈕焦點樣式 */
button:focus-visible {
    outline: 2px solid #4a90e2 !important;
    outline: -webkit-focus-ring-color auto 5px !important;
}

a {
    text-decoration: none;
}

/* 主容器樣式 - 完全匹配 Anima */
.anima-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 100vh;
    background: #efdfac;
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
}

/* 頂部品牌區域 - 精確匹配 Anima 設計 */
.anima-header {
    position: relative;
    width: 390px;
    height: 51px;
    background: #aeceb7;
    border-bottom: 2px solid white;
    border-bottom-style: solid;
}

.anima-logo-icon {
    position: absolute;
    top: 8px;
    left: calc(50.00% - 160px);
    width: 25px;
    height: 35px;
    background: url('/stores/12345678/templates/static/img/vector.svg') no-repeat;
    background-size: 100% 100%;
}

.anima-logo-icon .vector-1 {
    position: absolute;
    width: 36.79%;
    height: 26.20%;
    top: 23.52%;
    left: 31.27%;
}

.anima-logo-icon .vector-2 {
    position: absolute;
    width: 42.29%;
    height: 20.02%;
    top: 49.64%;
    left: 28.86%;
}

.anima-logo-text {
    position: absolute;
    top: calc(50.00% - 8px);
    left: 78px;
    font-family: 'Noto Sans', Helvetica, sans-serif;
    font-weight: 900;
    color: white;
    font-size: 14px;
    text-align: center;
    letter-spacing: 2.80px;
    line-height: 16px;
    white-space: nowrap;
}

.anima-subtitle {
    position: absolute;
    top: calc(50.00% - 8px);
    left: calc(50.00% - 16px);
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
    font-weight: 700;
    color: white;
    font-size: 12px;
    text-align: center;
    letter-spacing: 1.20px;
    line-height: 16px;
    white-space: nowrap;
}

/* 主要內容區域 - 完全匹配 Anima 設計 */
.anima-main {
    display: flex;
    flex-direction: column;
    width: 390px;
    height: 629px;
    align-items: center;
    position: relative;
    background: #efdfac;
    overflow: hidden;
}

/* 英雄圖片區域 - 精確尺寸 */
.anima-hero {
    position: relative;
    width: 390px;
    height: 130px;
    background: #cbcbcb;
    aspect-ratio: 3;
}

.anima-hero img {
    position: absolute;
    top: 0;
    left: 0;
    width: 390px;
    height: 130px;
    aspect-ratio: 2.63;
    object-fit: cover;
}

/* 狀態列 - 精確匹配 Anima 設計 */
.anima-status-bar {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 41px;
    background: white;
}

.anima-store-title {
    position: absolute;
    top: calc(50.00% - 10px);
    left: calc(50.00% - 165px);
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
    font-weight: 500;
    color: #929084;
    font-size: 16px;
    letter-spacing: 1.60px;
    line-height: normal;
    white-space: nowrap;
}

.anima-connection-status {
    position: absolute;
    top: calc(50.00% - 10px);
    left: calc(50.00% + 107px);
    width: 68px;
    height: 21px;
    background: #aeceb7;
    border-radius: 81.11px;
    overflow: hidden;
}

.anima-connection-dot {
    position: absolute;
    top: calc(50.00% - 3px);
    left: 12px;
    width: 7px;
    height: 7px;
    background: white;
    border-radius: 3.28px;
}

.anima-connection-text {
    position: absolute;
    top: calc(50.00% - 6px);
    left: calc(50.00% - 11px);
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
    font-weight: 500;
    color: white;
    font-size: 10px;
    letter-spacing: 0.50px;
    line-height: normal;
    white-space: nowrap;
}

/* 聊天區域 - 精確匹配 Anima 設計 */
.anima-chat-area {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 377px;
}

.anima-chat-box {
    position: relative;
    top: calc(50.00% - 174px);
    left: calc(50.00% - 180px);
    width: 360px;
    height: 345px;
    background: #eaeade;
    border-radius: 10px;
    border: 3px solid white;
    border-style: solid;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 消息樣式 */
.anima-message {
    margin-bottom: 12px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

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

.anima-message.assistant {
    align-self: flex-start;
}

.anima-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.anima-message.user .anima-message-content {
    background: #aeceb7;
    color: white;
    border-bottom-right-radius: 4px;
}

.anima-message.assistant .anima-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 消息内容中的链接样式 */
.anima-message-content a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.anima-message-content a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.anima-message-content a:visited {
    color: #7c3aed;
}

/* 用户消息中的链接（绿色背景上的链接） */
.anima-message.user .anima-message-content a {
    color: #dbeafe;
    text-decoration: underline;
}

.anima-message.user .anima-message-content a:hover {
    color: #bfdbfe;
}

.anima-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.anima-message.assistant .anima-message-time {
    text-align: left;
}

/* 輸入區域 - 精確匹配 Anima 設計 */
.anima-input-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
    margin-left: -1px;
    margin-right: -1px;
    border-top: 1px solid white;
    border-top-style: solid;
}

.anima-input-wrapper {
    position: relative;
    width: 169px;
    height: 44px;
    margin-top: -2px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid;
    border-style: solid;
}

.anima-input {
    position: absolute;
    top: calc(50.00% - 16px);
    left: 15px;
    width: 150px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    letter-spacing: 1.40px;
    line-height: normal;
    border: none;
    outline: none;
    background: transparent;
}

.anima-input::placeholder {
    color: #b3b3b3;
}

.anima-send-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: #e8d080;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid white;
    border-style: solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anima-send-btn img {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
}

.anima-voice-btn {
    position: relative;
    width: 124px;
    height: 40px;
    background: #aeceb7;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid white;
    border-style: solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anima-voice-btn img {
    position: absolute;
    top: 12px;
    left: 13px;
    width: 15px;
    height: 15px;
}

.anima-voice-btn-text {
    position: absolute;
    top: calc(50.00% - 9px);
    left: calc(50.00% - 29px);
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans TC', Helvetica, sans-serif;
    font-weight: 500;
    color: white;
    font-size: 14px;
    letter-spacing: 1.40px;
    line-height: normal;
}

/* 思考指示器 */
.anima-thinking {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

.anima-thinking.show {
    display: flex;
}

.anima-thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aeceb7;
    animation: thinkingBounce 1.2s infinite ease-in-out;
}

.anima-thinking-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.anima-thinking-dot:nth-child(3) {
    animation-delay: 0.3s;
}

/* 動畫 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes thinkingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* 響應式設計 - 保持 Anima 設計的完整性 */
@media (max-width: 768px) {
    .anima-container {
        padding: 0;
    }

    .anima-header {
        width: 100%;
        max-width: 100vw;
    }

    .anima-main {
        width: 100%;
        max-width: 100vw;
        height: auto;
        min-height: calc(100vh - 51px);
    }

    .anima-hero {
        width: 100%;
        height: 120px;
    }

    .anima-hero img {
        width: 100%;
        height: 120px;
    }

    .anima-chat-box {
        position: relative;
        top: 0;
        left: 0;
        width: calc(100% - 30px);
        margin: 15px;
        height: 300px;
    }

    .anima-input-area {
        padding: 15px;
        gap: 6px;
    }

    .anima-input-wrapper {
        width: 140px;
        height: 40px;
    }

    .anima-voice-btn {
        width: 100px;
        height: 36px;
    }

    .anima-voice-btn-text {
        font-size: 12px;
        left: calc(50.00% - 20px);
    }

    .anima-send-btn {
        width: 36px;
        height: 36px;
    }

    .anima-send-btn img {
        top: 9px;
        left: 9px;
        width: 16px;
        height: 16px;
    }

    .anima-voice-btn img {
        top: 10px;
        left: 10px;
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .anima-input-wrapper {
        width: 120px;
    }

    .anima-voice-btn {
        width: 80px;
    }

    .anima-voice-btn-text {
        font-size: 11px;
        left: calc(50.00% - 15px);
    }

    .anima-chat-box {
        height: 250px;
        padding: 15px;
    }
}

/* PC 大屏幕優化 - 保持 Anima 設計比例 */
@media (min-width: 1024px) {
    .anima-container {
        padding: 20px 0;
        justify-content: center;
    }

    .anima-header {
        width: 390px;
    }

    .anima-main {
        width: 390px;
        height: 629px;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    /* 保持原始尺寸以維持設計完整性 */
    .anima-hero {
        width: 390px;
        height: 130px;
    }

    .anima-hero img {
        width: 390px;
        height: 130px;
    }

    .anima-chat-box {
        width: 360px;
        height: 345px;
    }

    .anima-input-wrapper {
        width: 169px;
    }

    .anima-voice-btn {
        width: 124px;
    }
}