
.tecdat-ai-button {
    position: fixed; top: 170px; right: 0; transform: translateY(-50%); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 12px; border: 1px solid transparent; border-right: none;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(135deg, #0033cc 0%, #2563eb 52%, #00a2f5 100%);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 51, 204, .28);
    transition: background .2s ease, box-shadow .2s ease;
}
.tecdat-ai-button:hover, .tecdat-ai-button.active {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.tecdat-ai-wordmark {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    font-weight: 700; line-height: 1.3;
    color: #fff;
}
.tecdat-ai-wordmark .w1, .tecdat-ai-wordmark .w2 { font-size: 16px; }
.tecdat-ai-stars {
    position: relative; display: inline-block; width: 20px; height: 16px;
    margin-left: 2px; vertical-align: -2px;
}
.tecdat-ai-stars i { position: absolute; display: block; background: #fff; }
.tecdat-ai-stars i, .tecdat-ai-stars .st-big::after {
    clip-path: polygon(50% 0%,65% 35%,100% 50%,65% 65%,50% 100%,35% 65%,0% 50%,35% 35%);
}
.tecdat-ai-stars .st-big { left: 0; bottom: 0; width: 11px; height: 11px; }
.tecdat-ai-stars .st-big::after { content: ''; position: absolute; top: 2px; left: 2px; width: 7px; height: 7px; background: #fff; }
.tecdat-ai-stars .st-small { top: 0; right: 0; width: 7px; height: 7px; }
/* 悬停/展开：灰底 + 蓝渐变文字（与默认态反色） */
.tecdat-ai-button:hover .tecdat-ai-wordmark, .tecdat-ai-button.active .tecdat-ai-wordmark {
    background: linear-gradient(to right, #0033cc, #00ccff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #0033cc;
}
.tecdat-ai-button:hover .tecdat-ai-stars i, .tecdat-ai-button.active .tecdat-ai-stars i {
    background: linear-gradient(to right, #0033cc, #00ccff);
}
.tecdat-ai-button:hover .tecdat-ai-stars .st-big::after,
.tecdat-ai-button.active .tecdat-ai-stars .st-big::after { background: #fff; }

#tecdatAiPanel {
    position: fixed; inset: 0; z-index: 9999; background: #fff;
    display: none; flex-direction: column;
    font-size: 16px; line-height: 1.7;
}
#tecdatAiPanel.open { display: flex; }
.tecdat-ai-head {
    position: relative; flex: none; display: flex; flex-direction: column;
    align-items: flex-start; gap: 4px;
    padding: 16px 76px 14px 28px; border-bottom: 1px solid #f0f2f5;
}
.tecdat-ai-head-name {
    display: flex; flex-direction: column; font-size: 19px; font-weight: 700; line-height: 1.2;
}
.tecdat-ai-head-name span {
    background: linear-gradient(to right, #0033cc, #00ccff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #0033cc;
}
.tecdat-ai-new {
    display: inline-flex; align-items: center; gap: 4px;
    border: none; background: none; padding: 2px 0; cursor: pointer;
    font-family: inherit; font-size: 14px; color: #5b6472;
}
.tecdat-ai-new:hover { color: #0033cc; }
.tecdat-ai-close {
    position: absolute; top: 18px; right: 22px; z-index: 5;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0;
    border: 1px solid #e3e7ee; border-radius: 50%; background: #fff; color: #3b4453;
    font-size: 24px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tecdat-ai-close:hover { background: #f2f4f8; color: #1a1a1a; border-color: #d4dae3; }
/* 首屏：品牌标题 / 副标题 / 输入框 / 热门问题 / 免责行 */
.tecdat-ai-hero { display: none; flex: 1; overflow-y: auto; padding: 0 20px; }
#tecdatAiPanel.hero .tecdat-ai-hero { display: block; }
#tecdatAiPanel.hero .tecdat-ai-head, #tecdatAiPanel.hero .tecdat-ai-chat { display: none; }
.tecdat-ai-hero-inner {
    min-height: 100%; display: flex; flex-direction: column;
    width: 100%; max-width: 1040px; margin: 0 auto;
}
.tecdat-ai-brand {
    display: flex; align-items: flex-start; justify-content: center;
    margin: clamp(20px, 6vh, 64px) 0 20px; font-size: clamp(30px, 4.4vw, 46px); font-weight: 700;
}
.tecdat-ai-brand span {
    background: linear-gradient(to right, #0033cc, #00ccff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #0033cc;
}
.tecdat-ai-brand svg { width: 30px; height: 30px; margin: -10px 0 0 2px; flex: none; }
.tecdat-ai-tagline {
    margin: 0 auto clamp(22px, 5vh, 52px); max-width: 640px;
    text-align: center; font-size: clamp(18px, 2vw, 22px); font-weight: 600; color: #1a1a1a;
}
.tecdat-ai-foot { margin: 20px 0 4px; text-align: center; font-size: 13px; color: #6b7280; }
#tecdatAiLog { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 20px 10px; }
.tecdat-ai-chat { flex: 1; min-height: 0; position: relative; display: flex; }
.tecdat-ai-down {
    position: absolute; bottom: 20px; left: 50%; width: 38px; height: 38px;
    display: none; align-items: center; justify-content: center;
    border: 1px solid #dfe3ea; border-radius: 50%; background: #fff; color: #5b6472;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .10); cursor: pointer; padding: 0;
    transform: translate(-50%, 8px); opacity: 0; transition: transform .18s ease, opacity .18s ease;
}
.tecdat-ai-down.show { display: inline-flex; transform: translate(-50%, 0); opacity: 1; }
.tecdat-ai-down:hover { color: #0033cc; border-color: #0033cc; }
.tecdat-ai-down svg { width: 18px; height: 18px; display: block; }
.tecdat-ai-feed { width: 100%; max-width: 880px; margin: 0 auto; }
.tecdat-ai-msg { margin-bottom: 22px; padding: 16px 20px; border: 1px solid #e3e7ee; border-radius: 14px; word-break: break-word; }
.tecdat-ai-msg.user { display: flex; align-items: flex-start; gap: 12px; background: #fff; color: #1a1a1a; }
.tecdat-ai-msg.user > div { flex: 1; min-width: 0; white-space: pre-wrap; }
.tecdat-ai-avatar {
    flex: none; width: 26px; height: 26px; display: inline-flex;
    align-items: center; justify-content: center; border-radius: 50%;
    background: #e8edf7; color: #5b6472;
}
.tecdat-ai-avatar svg { width: 15px; height: 15px; display: block; }
.tecdat-ai-msg.bot { background: #f7f8fd; border-color: #eceef5; color: #1a1a1a; }
.tecdat-ai-note {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    padding: 8px 12px; border-radius: 9px; background: #eef2ff;
    font-size: 13px; line-height: 1.5; color: #4b5563;
}
.tecdat-ai-note .tecdat-ai-avatar { width: 22px; height: 22px; background: linear-gradient(135deg, #0033cc, #00ccff); color: #fff; }
.tecdat-ai-note .tecdat-ai-avatar svg { width: 13px; height: 13px; }
.tecdat-ai-msg.err .tecdat-ai-note { display: none; }
.tecdat-ai-cite { font-size: 11px; font-weight: 700; color: #2563eb; vertical-align: super; }
.tecdat-ai-msg.bot .tecdat-ai-h { display: block; margin: 12px 0 6px; font-size: 17px; }
.tecdat-ai-msg.bot pre {
    margin: 8px 0; padding: 10px; overflow-x: auto; background: #1e2430; color: #e6e9ef;
    border-radius: 6px; font-size: 12.5px; line-height: 1.5; white-space: pre;
}
.tecdat-ai-msg.bot code { background: #e2e6ee; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.tecdat-ai-msg.bot pre code { background: none; padding: 0; }
.tecdat-ai-msg.bot a { color: #2563eb; text-decoration: underline; word-break: break-all; }
.tecdat-ai-msg.err { background: #fff1f0; color: #c0392b; }
.tecdat-ai-wait {
    display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
    padding: 10px 12px; border: 1px solid #e3e7ee; border-radius: 8px;
    background: #fff; font-size: 13.5px; color: #4b5563;
}
/* 等待区：只报真实状态（等待首字节 + 已用秒数），不做跳点动画、不臆造阶段 */
.tecdat-ai-wait-label { flex: 1; line-height: 1.5; }
.tecdat-ai-wait-msg { color: #3b4453; }
.tecdat-ai-wait-sub { display: block; margin-top: 2px; font-size: 12px; color: #9aa3af; }
.tecdat-ai-wait-sec {
    flex: none; min-width: 26px; text-align: right; font-size: 12.5px;
    color: #9aa3af; font-variant-numeric: tabular-nums;
}
.tecdat-ai-think {
    margin: 0 0 10px; padding: 0 10px; background: #fff;
    border: 1px solid #e3e7ee; border-radius: 8px;
}
.tecdat-ai-think summary {
    cursor: pointer; padding: 6px 0; font-size: 13px; color: #5b6472;
    list-style: none; user-select: none;
}
.tecdat-ai-think summary::-webkit-details-marker { display: none; }
.tecdat-ai-think summary::before { content: '▸ '; color: #9aa3af; }
.tecdat-ai-think[open] summary::before { content: '▾ '; }
.tecdat-ai-think-body {
    max-height: 240px; overflow-y: auto; padding: 6px 0 8px;
    border-top: 1px dashed #e2e6ee; font-size: 13px; color: #5b6472;
}
.tecdat-ai-think-none { color: #9aa3af; }
.tecdat-ai-model {
    flex: none; max-width: 210px; height: 30px; margin-right: 2px;
    border: 1px solid #dfe3ea; border-radius: 15px; background: #f7f9fc;
    padding: 0 24px 0 10px; font: inherit; font-size: 12.5px; color: #414957;
    cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 5px center; background-size: 14px;
}
.tecdat-ai-model:hover { border-color: #c6ccd8; }
.tecdat-ai-model:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,230,.08); }
.tecdat-ai-mtag {
    flex: none; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
    background: #eef2fb; color: #5a6ea8; font-size: 11.5px; white-space: nowrap;
}
.tecdat-ai-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tecdat-ai-thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; display: block; }
.tecdat-ai-docs { margin-top: 6px; font-size: 12px; opacity: .85; }

.tecdat-ai-input { flex: none; padding: 14px 20px 24px; }
.tecdat-ai-input > .tecdat-ai-feed { padding-top: 2px; }
.tecdat-ai-hero .tecdat-ai-input { padding: 0; }
.tecdat-ai-hero .tecdat-ai-input > .tecdat-ai-feed { max-width: none; }
.tecdat-ai-box {
    border: 1px solid #dfe3ea; border-radius: 16px; padding: 12px 16px 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tecdat-ai-box:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,230,.08); }
.tecdat-ai-box textarea {
    display: block; width: 100%; box-sizing: border-box; border: none; background: none;
    resize: none; min-height: 30px; max-height: 200px; overflow-y: auto;
    padding: 6px 2px; font: inherit; line-height: 1.6; color: #1a1a1a;
}
.tecdat-ai-box textarea:focus { outline: none; }
.tecdat-ai-box textarea::placeholder { color: #a4abb6; }
.tecdat-ai-bar { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; }
.tecdat-ai-icon {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 9px; background: none; color: #5b6472; cursor: pointer; padding: 0;
}
.tecdat-ai-icon:hover { background: #f2f4f8; color: #2563eb; }
.tecdat-ai-icon:disabled { color: #c3c9d2; cursor: not-allowed; background: none; }
.tecdat-ai-icon svg { width: 22px; height: 22px; display: block; }
.tecdat-ai-count { margin-left: auto; margin-right: 8px; font-size: 13px; color: #9aa3af; }
.tecdat-ai-send {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; background: #2563eb; color: #fff; cursor: pointer; padding: 0;
}
.tecdat-ai-send svg { width: 20px; height: 20px; display: block; }
.tecdat-ai-send:hover { background: #1d4fd7; }
.tecdat-ai-send:disabled { background: #e3e7ee; color: #aab2bf; cursor: not-allowed; }
.tecdat-ai-attach { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tecdat-ai-attach:empty { display: none; }
.tecdat-ai-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 8px;
    border: 1px solid #dfe3ea; border-radius: 8px; background: #f7f8fa; font-size: 13px; color: #3b4453;
}
.tecdat-ai-chip.pending { opacity: .6; }
.tecdat-ai-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; display: block; }
.tecdat-ai-chip b { font-weight: 400; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tecdat-ai-chip i { font-style: normal; cursor: pointer; color: #9aa3af; padding: 0 2px; font-size: 15px; line-height: 1; }
.tecdat-ai-chip i:hover { color: #c0392b; }
.tecdat-ai-tip { min-height: 18px; margin-top: 6px; font-size: 13px; color: #c0392b; }
.tecdat-ai-tip:empty { margin-top: 0; }
.tecdat-ai-foot-chat { display: none; margin: 10px 0 0; text-align: center; font-size: 12.5px; color: #9aa3af; }
#tecdatAiPanel:not(.hero) .tecdat-ai-foot-chat { display: block; }
.tecdat-ai-trend { margin-top: auto; padding-top: 30px; }
.tecdat-ai-trend h3 {
    display: flex; align-items: center; gap: 9px; margin: 0;
    font-size: 15px; font-weight: 700; letter-spacing: .6px; color: #1a1a1a;
}
.tecdat-ai-trend h3 svg { width: 18px; height: 18px; flex: none; }
.tecdat-ai-trend-row {
    display: flex; gap: 20px; margin-top: 14px; padding: 2px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.tecdat-ai-trend-row::-webkit-scrollbar { display: none; }
.tecdat-ai-trend-card {
    flex: 0 0 clamp(230px, 31%, 340px); min-height: 104px; scroll-snap-align: start;
    display: flex; align-items: flex-start; text-align: left; padding: 18px 20px;
    background: #fff; border: 1px solid #d9dde5; border-radius: 6px;
    font-size: 17px; line-height: 1.5; color: #1a1a1a; font-family: inherit; cursor: pointer;
}
.tecdat-ai-trend-card:hover { border-color: #0033cc; box-shadow: 0 4px 14px rgba(0, 51, 204, .12); }
.tecdat-ai-trend-bar { height: 4px; margin-top: 12px; background: #e8ebf1; border-radius: 2px; overflow: hidden; }
.tecdat-ai-trend-bar i { display: block; height: 100%; width: 40%; background: #0033cc; border-radius: 2px; }

@media (max-width: 768px) {
    .tecdat-ai-button { padding: 12px 10px; }
    .tecdat-ai-wordmark .w1, .tecdat-ai-wordmark .w2 { font-size: 14px; }
    #tecdatAiPanel { font-size: 15px; }
    .tecdat-ai-head { padding: 12px 60px 10px 16px; }
    .tecdat-ai-head-name { font-size: 17px; }
    .tecdat-ai-close { top: 12px; right: 12px; }
    #tecdatAiLog { padding: 16px 14px 8px; }
    .tecdat-ai-msg { padding: 12px 14px; margin-bottom: 18px; }
    .tecdat-ai-msg.user { gap: 9px; }
    .tecdat-ai-input { padding: 10px 14px 16px; }
    .tecdat-ai-hero { padding: 0 14px; }
    .tecdat-ai-trend { padding-top: 20px; }
    .tecdat-ai-trend-card { flex: 0 0 78%; min-height: 88px; padding: 14px 16px; font-size: 15px; }
}
