/* Listissima Help Center widget 样式
 * 品牌对齐生产 index.html：主色 #008060 / hover #006147，白卡 12px 圆角。
 * 零依赖、无字体引入，跟随页面字体栈。
 * 挂载：生产 index.html 引一行 <link>（见 DEPLOY.md），JS 自动建 DOM。
 */

/* ---- 启动按钮（右下浮动） ---- */
#hc-launcher {
    position: fixed; right: 20px; bottom: 20px; z-index: 9990;
    width: 54px; height: 54px; border-radius: 50%;
    background: #008060; color: #fff; border: none; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 64, 46, 0.35);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
#hc-launcher:hover { background: #006147; transform: translateY(-1px); }
#hc-launcher svg { width: 26px; height: 26px; fill: currentColor; }

/* ---- 面板 ---- */
#hc-panel {
    position: fixed; right: 20px; bottom: 86px; z-index: 9991;
    width: 360px; max-width: calc(100vw - 24px);
    height: min(560px, 72vh);
    background: #fff; border-radius: 12px;
    border: 1px solid #e3e3e3;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
    display: none; flex-direction: column; overflow: hidden;
    font-size: 14px; line-height: 1.55;
}
#hc-panel.hc-open { display: flex; }

/* 小屏：接高接满，留状态栏余量 */
@media (max-width: 480px) {
    #hc-panel {
        right: 8px; left: 8px; bottom: 80px;
        width: auto; height: min(70vh, 560px);
    }
    #hc-launcher { right: 14px; bottom: 14px; }
}

/* ---- 头部 ---- */
#hc-panel .hc-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: #008060; color: #fff; flex: 0 0 auto;
}
#hc-panel .hc-head .hc-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #7ff0c8;
    flex: 0 0 auto;
}
#hc-panel .hc-head .hc-title { font-weight: 600; flex: 1 1 auto; }
#hc-panel .hc-head .hc-close {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px;
    opacity: 0.85;
}
#hc-panel .hc-head .hc-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

/* ---- 消息区 ---- */
#hc-panel .hc-body {
    flex: 1 1 auto; overflow-y: auto; padding: 14px;
    background: #f7f8f8; display: flex; flex-direction: column; gap: 10px;
}
.hc-msg {
    max-width: 84%; padding: 9px 12px; border-radius: 12px;
    white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word;
}
.hc-msg.hc-bot {
    align-self: flex-start; background: #fff; border: 1px solid #e3e3e3;
    border-bottom-left-radius: 4px; color: #303030;
}
.hc-msg.hc-user {
    align-self: flex-end; background: #008060; color: #fff;
    border-bottom-right-radius: 4px;
}
.hc-note {
    align-self: stretch; text-align: center; font-size: 12px; color: #005c44;
    background: #e3f2ed; border: 1px solid #c3e6d8; border-radius: 8px;
    padding: 6px 10px;
}
.hc-note.hc-err { color: #8a5a00; background: #fff4e5; border-color: #f0c98a; }

/* 打字指示器 */
.hc-typing { display: flex; gap: 4px; padding: 12px 14px; align-self: flex-start;
    background: #fff; border: 1px solid #e3e3e3; border-radius: 12px;
    border-bottom-left-radius: 4px; }
.hc-typing i {
    width: 7px; height: 7px; border-radius: 50%; background: #9aa5a0;
    animation: hc-bounce 1.2s infinite ease-in-out;
}
.hc-typing i:nth-child(2) { animation-delay: 0.15s; }
.hc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hc-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ---- 输入区 ---- */
#hc-panel .hc-input {
    flex: 0 0 auto; display: flex; gap: 8px; padding: 10px;
    border-top: 1px solid #e3e3e3; background: #fff;
}
#hc-panel .hc-input textarea {
    flex: 1 1 auto; resize: none; border: 1px solid #d5d5d5;
    border-radius: 8px; padding: 8px 10px; font: inherit;
    max-height: 108px; min-height: 38px; outline: none;
    color: #303030; background: #fff;
}
#hc-panel .hc-input textarea:focus { border-color: #008060; }
#hc-panel .hc-input button {
    flex: 0 0 auto; align-self: flex-end; background: #008060; color: #fff;
    border: none; border-radius: 8px; padding: 9px 14px; font: inherit;
    font-weight: 500; cursor: pointer;
}
#hc-panel .hc-input button:hover { background: #006147; }
#hc-panel .hc-input button:disabled { background: #b5c8c1; cursor: default; }
#hc-panel .hc-input textarea:disabled { background: #f5f5f5; }

/* 无障碍：键盘焦点可见 */
#hc-launcher:focus-visible,
#hc-panel .hc-input button:focus-visible,
#hc-panel .hc-head .hc-close:focus-visible {
    outline: 2px solid #008060; outline-offset: 2px;
}
