html {
    font-size: 17px;
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
}

.fj-footer {
    background: #0d0d0d;
    color: #a3a3a3;
    padding-top: 80px;
    padding-bottom: 32px;
}

.fj-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.fj-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
    padding-bottom: 56px;
    border-bottom: 1px solid #1f1f1f;
}

.fj-footer h4 {
    margin: 0 0 24px;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.2em;
    font-weight: 700;
    text-transform: uppercase;
}

.fj-footer-brand img {
    height: 82px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;
}

.fj-footer-brand p {
    margin: 0 0 8px;
    line-height: 1.9;
}

.fj-footer-tagline {
    color: #c8a870;
    font-size: 16px;
    letter-spacing: 0.14em;
    font-weight: 600;
    margin-bottom: 28px !important;
}

.fj-footer-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 1px solid #c8a870;
    color: #c8a870;
    padding: 12px 20px;
    font-size: 15px;
    letter-spacing: 0.12em;
    font-weight: 600;
    transition: all 0.25s ease;
}

.fj-footer-call:hover {
    background: #c8a870;
    color: #111;
}

.fj-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fj-footer-list a {
    color: #8f8f8f;
    text-decoration: none;
    transition: color 0.25s ease;
}

.fj-footer-list a:hover {
    color: #c8a870;
}

.fj-footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fj-footer-contact li {
    line-height: 1.7;
}

.fj-footer-contact a {
    color: #8f8f8f;
    text-decoration: none;
}

.fj-footer-contact a:hover {
    color: #c8a870;
}

.fj-footer-bottom {
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: center;
    color: #6a6a6a;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.fj-float-dock {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 65;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fj-float-item {
    position: relative;
    display: flex;
    align-items: center;
}

.fj-float-tip {
    position: absolute;
    right: 56px;
    background: #111;
    border: 1px solid #c8a870;
    color: #c8a870;
    font-size: 11px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    padding: 6px 10px;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.fj-float-item:hover .fj-float-tip {
    opacity: 1;
    transform: translateX(0);
}

.fj-float-btn {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(200, 168, 112, 0.55);
    background: rgba(17, 17, 17, 0.9);
    color: #c8a870;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s ease;
}

.fj-float-btn svg {
    width: 20px;
    height: 20px;
}

.fj-float-btn:hover {
    background: #c8a870;
    color: #111;
    border-color: #c8a870;
}

.fj-float-btn--line {
    width: 44px;
    height: 44px;
}

.fj-float-btn--line svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 767px) {
    .fj-footer-qr-wrap {
        display: none;
    }
}

@media (min-width: 768px) {
    .fj-footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 36px;
    }

    .fj-footer-bottom {
        flex-direction: row;
        text-align: left;
    }
}

/* =============================================
   AI 智慧客服聊天視窗
   ============================================= */

.fj-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 80px;
    width: 360px;
    height: 520px;
    background: #111;
    border: 1px solid rgba(200, 168, 112, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 70;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    visibility: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
    pointer-events: none;
}

.fj-chat-panel--open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0s;
    pointer-events: all;
}

/* 開啟狀態時 AI 按鈕高亮 */
.fj-float-btn--ai-active {
    background: rgba(200, 168, 112, 0.18) !important;
    border-color: #c8a870 !important;
}

/* Header */
.fj-chat-header {
    background: #1a1714;
    border-bottom: 1px solid rgba(200, 168, 112, 0.2);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.fj-chat-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.fj-chat-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(200, 168, 112, 0.18), rgba(200, 168, 112, 0.05));
    border: 1px solid rgba(200, 168, 112, 0.45);
    color: #c8a870;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fj-chat-avatar svg {
    width: 16px;
    height: 16px;
}

.fj-chat-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.fj-chat-subtitle {
    color: #c8a870;
    font-size: 10px;
    letter-spacing: 0.15em;
    margin-top: 2px;
}

.fj-chat-close {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.fj-chat-close:hover {
    color: #c8a870;
}

.fj-chat-close svg {
    width: 16px;
    height: 16px;
}

/* Messages area */
.fj-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

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

.fj-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.fj-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(200, 168, 112, 0.25);
    border-radius: 2px;
}

/* Message bubbles */
.fj-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 87%;
}

.fj-chat-msg--bot {
    align-self: flex-start;
}

.fj-chat-msg--user {
    align-self: flex-end;
}

.fj-chat-bubble {
    padding: 10px 13px;
    font-size: 13.5px;
    line-height: 1.75;
    letter-spacing: 0.02em;
    word-break: break-word;
}

.fj-chat-msg--bot .fj-chat-bubble {
    background: #1a1a1a;
    border: 1px solid rgba(200, 168, 112, 0.12);
    color: #d0d0d0;
    border-radius: 0 8px 8px 8px;
}

.fj-chat-msg--user .fj-chat-bubble {
    background: rgba(200, 168, 112, 0.13);
    border: 1px solid rgba(200, 168, 112, 0.3);
    color: #e8dcc8;
    border-radius: 8px 8px 0 8px;
}

.fj-chat-bubble a {
    color: #c8a870;
    text-decoration: underline;
}

.fj-chat-msg-time {
    font-size: 10px;
    color: #484848;
    margin-top: 4px;
    letter-spacing: 0.04em;
}

.fj-chat-msg--user .fj-chat-msg-time {
    text-align: right;
}

/* Typing indicator */
.fj-chat-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 11px 14px;
    background: #1a1a1a;
    border: 1px solid rgba(200, 168, 112, 0.12);
    border-radius: 0 8px 8px 8px;
}

.fj-chat-typing span {
    width: 6px;
    height: 6px;
    background: #c8a870;
    border-radius: 50%;
    animation: fj-typing-bounce 1.4s ease infinite;
    opacity: 0.4;
}

.fj-chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.fj-chat-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes fj-typing-bounce {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Quick replies */
.fj-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 0 4px;
}

.fj-chat-quick-btn {
    background: transparent;
    border: 1px solid rgba(200, 168, 112, 0.3);
    color: #c8a870;
    padding: 6px 11px;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-align: left;
    line-height: 1.4;
}

.fj-chat-quick-btn:hover {
    background: rgba(200, 168, 112, 0.1);
    border-color: #c8a870;
}

/* Input area */
.fj-chat-footer {
    border-top: 1px solid rgba(200, 168, 112, 0.18);
    padding: 11px 13px;
    display: flex;
    gap: 9px;
    align-items: flex-end;
    flex-shrink: 0;
    background: #0d0d0d;
}

.fj-chat-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid rgba(200, 168, 112, 0.18);
    color: #d0d0d0;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    outline: none;
    transition: border-color 0.2s;
    overflow-y: auto;
}

.fj-chat-input::placeholder {
    color: #3a3a3a;
}

.fj-chat-input:focus {
    border-color: rgba(200, 168, 112, 0.45);
}

.fj-chat-send {
    width: 40px;
    height: 40px;
    background: rgba(200, 168, 112, 0.08);
    border: 1px solid rgba(200, 168, 112, 0.35);
    color: #c8a870;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fj-chat-send:hover:not(:disabled) {
    background: #c8a870;
    color: #111;
    border-color: #c8a870;
}

.fj-chat-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.fj-chat-send svg {
    width: 17px;
    height: 17px;
}


/* Mobile: 全螢幕 */
@media (max-width: 480px) {
    .fj-chat-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100dvh;
        border: none;
        border-top: 1px solid rgba(200, 168, 112, 0.3);
    }
}
