@charset "UTF-8";

/* ==========================================================
   智能归类助手 - 对话页专属样式
   设计基线对齐 modern-ui.css：主色 #1ab394、渐变、卡片圆角阴影、系统字体栈
   本文件自带兜底变量，不依赖 main.css 的弹窗组件
   ========================================================== */

:root {
    --chat-primary: #1ab394;
    --chat-primary-dark: #148f77;
    --chat-primary-deep: #0f6b54;
    --chat-text: #333;
    --chat-text-light: #4a5561;
    --chat-muted: #98a3af;
    --chat-border: #e3e8ee;
    --chat-bg: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    --chat-green: #1e8e5a;
    --chat-orange: #ca6f1e;
    --chat-red: #e74c3c;
    --chat-red-dark: #c0392b;
    --chat-mono: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, "Courier New", monospace;
}

/* ---------- 页面骨架：占满视口（减去头尾） ---------- */

html body.chat-page,
body.chat-page {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}

.chat-page #footer {
    margin-top: 0;
    padding: 8px 0;
    font-size: 12px;
    flex: none;
}

.chat-page #footer .copyright,
.chat-page #footer .tel_support,
.chat-page #footer span {
    font-size: 12px;
}

.chat-app {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- 顶部标题栏 ---------- */

.chat-topbar {
    flex: none;
    background: #fff;
    border-bottom: 1px solid #e6ebf1;
    box-shadow: 0 2px 10px rgba(16, 42, 67, 0.05);
    padding: 10px 20px;
    position: relative;
    z-index: 20;
}

.chat-topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-topbar .sys-name {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
}

.chat-topbar .sys-name a {
    color: inherit;
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(26, 179, 148, 0.3);
}

.chat-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 12px 0 0 rgba(255, 255, 255, 0.65);
}

.chat-topbar-flex {
    flex: 1 1 auto;
}

.chat-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #cfd9e2;
    background: #fff;
    color: #34495e;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.chat-new-btn:hover {
    border-color: var(--chat-primary);
    color: var(--chat-primary-dark);
    background: rgba(26, 179, 148, 0.06);
    transform: translateY(-1px);
}

.ico-plus {
    position: relative;
    width: 12px;
    height: 12px;
    flex: none;
}

.ico-plus::before,
.ico-plus::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 1px;
}

.ico-plus::before {
    left: 0;
    top: 5px;
    width: 12px;
    height: 2px;
}

.ico-plus::after {
    left: 5px;
    top: 0;
    width: 2px;
    height: 12px;
}

/* ---------- 中部消息流 ---------- */

.chat-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.chat-main::-webkit-scrollbar {
    width: 8px;
}

.chat-main::-webkit-scrollbar-thumb {
    background: rgba(120, 140, 160, 0.3);
    border-radius: 4px;
}

.chat-main::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 140, 160, 0.5);
}

.chat-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ---------- 消息行与气泡 ---------- */

.msg {
    display: flex;
    gap: 12px;
    animation: msgIn 0.35s ease both;
}

.msg.user {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
}

.msg.assistant .msg-avatar {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    box-shadow: 0 3px 10px rgba(26, 179, 148, 0.35);
}

.msg.user .msg-avatar {
    background: linear-gradient(135deg, #5d6d7e 0%, #34495e 100%);
    box-shadow: 0 3px 10px rgba(52, 73, 94, 0.3);
}

.msg-body {
    max-width: 80%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.msg.user .msg-body {
    align-items: flex-end;
}

.msg-bubble {
    padding: 11px 16px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.msg.assistant .msg-bubble {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 12px rgba(16, 42, 67, 0.07);
    color: var(--chat-text);
}

.msg.user .msg-bubble {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 12px rgba(26, 179, 148, 0.35);
    white-space: pre-wrap;
}

/* ---------- 轻量 Markdown 渲染样式 ---------- */

.msg-bubble p {
    margin: 0 0 8px;
}

.msg-bubble > :last-child {
    margin-bottom: 0;
}

.msg-bubble ul,
.msg-bubble ol {
    margin: 4px 0 10px;
    padding-left: 1.4em;
}

.msg-bubble li {
    margin: 3px 0;
}

.msg-bubble code.md-inline-code {
    font-family: var(--chat-mono);
    font-size: 13px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(26, 179, 148, 0.1);
    color: var(--chat-primary-deep);
}

.msg.user .msg-bubble code.md-inline-code {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.msg-bubble pre.md-code {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 6px 0 10px;
}

.msg-bubble pre.md-code code {
    font-family: var(--chat-mono);
    background: none;
    padding: 0;
    color: inherit;
}

/* Markdown 标题与表格 */

.msg-bubble .md-heading {
    margin: 14px 0 6px;
    color: #1f2d3d;
    line-height: 1.4;
}

.msg-bubble h3.md-heading {
    font-size: 16px;
    font-weight: 700;
    padding-left: 8px;
    border-left: 3px solid #1ab394;
}

.msg-bubble h4.md-heading {
    font-size: 14px;
    font-weight: 700;
    color: #34495e;
}

.msg-bubble .md-heading:first-child {
    margin-top: 2px;
}

.msg-bubble .md-table-wrap {
    margin: 8px 0 12px;
    overflow-x: auto;
    border: 1px solid #e3e8ec;
    border-radius: 8px;
}

.msg-bubble table.md-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    line-height: 1.5;
    min-width: 60%;
}

.msg-bubble table.md-table th,
.msg-bubble table.md-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #edf1f4;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.msg-bubble table.md-table th {
    background: #f2f9f7;
    color: #14664f;
    font-weight: 700;
    white-space: nowrap;
}

.msg-bubble table.md-table tbody tr:last-child td {
    border-bottom: none;
}

.msg-bubble table.md-table tbody tr:nth-child(even) {
    background: #fafcfc;
}

/* 打字光标 */

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    margin-left: 3px;
    vertical-align: -2px;
    border-radius: 1.5px;
    background: var(--chat-primary);
    animation: cursorBlink 1s steps(2, start) infinite;
}

/* ---------- 工具状态条 ---------- */

.tool-track {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--chat-border);
    color: #5f6b7a;
    animation: msgIn 0.3s ease both;
}

.tool-chip.running {
    background: rgba(26, 179, 148, 0.07);
    border-color: rgba(26, 179, 148, 0.4);
    color: var(--chat-primary-dark);
}

.tool-chip.done {
    background: rgba(39, 174, 96, 0.07);
    border-color: rgba(39, 174, 96, 0.35);
    color: var(--chat-green);
}

.tool-spin {
    width: 12px;
    height: 12px;
    flex: none;
    border: 2px solid rgba(26, 179, 148, 0.25);
    border-top-color: var(--chat-primary);
    border-radius: 50%;
    animation: toolSpin 0.8s linear infinite;
}

.tool-check {
    color: var(--chat-green);
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

/* ---------- 错误 / 系统提示 ---------- */

.msg-error {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: var(--chat-red-dark);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 100%;
}

.msg-note {
    font-size: 12.5px;
    color: var(--chat-muted);
    padding: 0 4px;
}

.sys-notice {
    align-self: center;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.25);
    color: var(--chat-red-dark);
    border-radius: 16px;
    padding: 5px 16px;
    font-size: 12.5px;
}

/* ---------- 欢迎语与快捷示例 ---------- */

.welcome-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 48px;
}

.example-chip {
    padding: 7px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px dashed #9adbc9;
    color: var(--chat-primary-deep);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.example-chip:hover {
    background: var(--chat-primary);
    border: 1px solid var(--chat-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 179, 148, 0.3);
}

/* ---------- 方案卡片（核心组件） ---------- */

.plan-card {
    align-self: stretch;
    width: 100%;
    background: #fff;
    border: 1px solid #dfe9f0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(16, 42, 67, 0.09);
    overflow: hidden;
    animation: planIn 0.5s ease both;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 42, 67, 0.15);
}

.plan-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--chat-primary) 0%, #3498db 100%);
}

.plan-head {
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    background: linear-gradient(135deg, rgba(26, 179, 148, 0.07) 0%, rgba(52, 152, 219, 0.07) 100%);
    border-bottom: 1px solid #eaf0f5;
}

.plan-hscode {
    font-family: var(--chat-mono);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--chat-primary-deep);
}

.plan-goodsname {
    flex: 1 1 auto;
    min-width: 120px;
    font-size: 14px;
    font-weight: 600;
    color: #33475b;
}

.conf-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.conf-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.conf-high {
    color: var(--chat-green);
    background: rgba(30, 142, 90, 0.1);
    border: 1px solid rgba(30, 142, 90, 0.35);
}

.conf-mid {
    color: var(--chat-orange);
    background: rgba(234, 144, 42, 0.12);
    border: 1px solid rgba(234, 144, 42, 0.4);
}

.conf-low {
    color: #7f8c8d;
    background: #f0f2f4;
    border: 1px solid #d5dbe0;
}

.plan-section {
    padding: 6px 18px 14px;
}

.plan-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #7a8694;
    margin: 10px 0 8px;
}

.plan-section h4::before {
    content: '';
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--chat-primary), #3498db);
}

/* 申报要素表（同时供税率弹层复用） */

.plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.plan-table th {
    width: 38%;
    text-align: left;
    padding: 8px 12px;
    background: #f6f9fb;
    color: #57606a;
    font-weight: 500;
    border: 1px solid #e8eef3;
    word-break: break-word;
}

.plan-table td {
    padding: 8px 12px;
    border: 1px solid #e8eef3;
    color: var(--chat-text);
    word-break: break-word;
    vertical-align: top;
}

.plan-reasoning {
    font-size: 13.5px;
    color: var(--chat-text-light);
    line-height: 1.85;
    background: #f8fafc;
    border-left: 3px solid rgba(26, 179, 148, 0.45);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
}

/* 归类依据列表：纯 CSS 文档图标 */

.plan-basis {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-basis li {
    position: relative;
    padding: 6px 0 6px 32px;
    font-size: 13.5px;
    color: var(--chat-text-light);
    line-height: 1.75;
}

.plan-basis li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 13px;
    height: 17px;
    background:
        linear-gradient(var(--chat-primary), var(--chat-primary)) 3px 5px / 7px 1.5px no-repeat,
        linear-gradient(var(--chat-primary), var(--chat-primary)) 3px 9px / 7px 1.5px no-repeat,
        linear-gradient(var(--chat-primary), var(--chat-primary)) 3px 13px / 5px 1.5px no-repeat,
        #fff;
    border: 1.5px solid var(--chat-primary);
    border-radius: 2px;
    box-sizing: border-box;
}

/* 方案卡片操作按钮行 */

.plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 18px 16px;
}

.plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.5;
}

.plan-btn-tariff {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26, 179, 148, 0.3);
}

.plan-btn-tariff:hover {
    background: linear-gradient(135deg, var(--chat-primary-dark) 0%, var(--chat-primary-deep) 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(26, 179, 148, 0.4);
}

.plan-btn-search {
    background: #fff;
    border-color: #cfd9e2;
    color: #34495e;
}

.plan-btn-search:hover {
    border-color: var(--chat-primary);
    color: var(--chat-primary-dark);
    background: rgba(26, 179, 148, 0.05);
    transform: translateY(-1px);
}

.ico-doc {
    position: relative;
    width: 11px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    flex: none;
}

.ico-doc::after {
    content: '';
    position: absolute;
    left: 2.5px;
    top: 3px;
    width: 5px;
    height: 1.5px;
    background: currentColor;
    box-shadow: 0 3px 0 currentColor;
}

.ico-search {
    position: relative;
    width: 12px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex: none;
}

.ico-search::after {
    content: '';
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 5px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
}

/* ---------- 底部输入区 ---------- */

.chat-inputbar {
    flex: none;
    background: #fff;
    border-top: 1px solid #e6ebf1;
    padding: 14px 20px 10px;
    box-shadow: 0 -4px 18px rgba(16, 42, 67, 0.05);
    position: relative;
    z-index: 20;
}

.chat-inputbar-inner {
    max-width: 900px;
    margin: 0 auto;
}

.chat-inputbox {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #fff;
    border: 1px solid #dce3ea;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 4px 18px rgba(16, 42, 67, 0.07);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* 图片上传按钮与预览条 */

.chat-attach-btn {
    flex: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #eef6f4;
    color: #1ab394;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chat-attach-btn:hover {
    background: #dceeea;
}

.ico-attach {
    display: block;
    width: 18px;
    height: 18px;
    position: relative;
}

.ico-attach::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 10px;
    height: 16px;
    border: 2px solid #1ab394;
    border-radius: 5px;
}

.ico-attach::after {
    content: '';
    position: absolute;
    left: 1px;
    top: 7px;
    width: 16px;
    height: 2px;
    background: #1ab394;
    transform: rotate(-45deg);
}

.chat-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 2px 2px;
}

.upload-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e3e8ec;
}

.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

/* 消息气泡内的图片 */

.msg-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.msg.user .msg-images {
    justify-content: flex-end;
}

.msg-image {
    max-width: 180px;
    max-height: 140px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    object-fit: cover;
    cursor: zoom-in;
    display: block;
}

.chat-inputbox:focus-within {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(26, 179, 148, 0.13);
}

#chat_input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.6;
    min-height: 24px;
    max-height: 160px;
    color: var(--chat-text);
    padding: 2px 4px;
}

#chat_input::placeholder {
    color: #a8b3bf;
}

#chat_input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.chat-send-btn {
    flex: none;
    height: 40px;
    min-width: 92px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(26, 179, 148, 0.32);
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, var(--chat-primary-dark) 0%, var(--chat-primary-deep) 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(26, 179, 148, 0.4);
}

.chat-send-btn.stopping {
    background: linear-gradient(135deg, var(--chat-red) 0%, var(--chat-red-dark) 100%);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.32);
}

.chat-send-btn.stopping:hover {
    background: linear-gradient(135deg, var(--chat-red-dark) 0%, #a93226 100%);
}

.ico-send {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #fff;
}

.ico-stop {
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 2px;
}

.chat-input-hint {
    margin: 7px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--chat-muted);
}

/* ---------- 税率详情弹层 ---------- */

.chat-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-modal[hidden] {
    display: none;
}

.chat-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(23, 36, 48, 0.55);
    animation: maskFade 0.2s ease both;
}

.chat-modal-dialog {
    position: relative;
    width: 640px;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: popIn 0.25s ease both;
}

.chat-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: #fff;
    flex: none;
}

.chat-modal-title {
    font-size: 15px;
    font-weight: 600;
}

.chat-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 0 2px;
    transition: opacity 0.2s ease;
}

.chat-modal-close:hover {
    opacity: 1;
}

.chat-modal-body {
    padding: 14px 20px 18px;
    overflow-y: auto;
}

.modal-loading {
    text-align: center;
    color: var(--chat-muted);
    font-size: 13.5px;
    padding: 26px 0;
}

.modal-loading::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: -4px;
    border: 2.5px solid rgba(26, 179, 148, 0.25);
    border-top-color: var(--chat-primary);
    border-radius: 50%;
    animation: toolSpin 0.8s linear infinite;
}

.modal-error {
    text-align: center;
    color: var(--chat-red-dark);
    font-size: 13.5px;
    padding: 26px 0;
}

.reg-codes {
    font-family: var(--chat-mono);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--chat-primary-deep);
    margin-bottom: 4px;
}

.reg-item {
    font-size: 12.5px;
    color: #5f6b7a;
    line-height: 1.7;
}

/* ---------- 动画 ---------- */

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

@keyframes planIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes toolSpin {
    to { transform: rotate(360deg); }
}

@keyframes maskFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- 响应式 ---------- */

@media (max-width: 768px) {
    .chat-topbar .sys-name {
        font-size: 14px;
    }

    .msg-body {
        max-width: 88%;
    }

    .welcome-examples {
        padding-left: 0;
    }

    .plan-hscode {
        font-size: 18px;
    }

    .chat-inputbar {
        padding: 10px 12px 8px;
    }
}

@media (max-width: 480px) {
    .chat-badge {
        display: none;
    }

    .msg-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .plan-table th {
        width: 34%;
    }

    .chat-send-btn {
        min-width: 76px;
    }
}
