/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f0f2f5;
    overflow-x: hidden;
}

:root {
    --qa-surface: #ffffff;
    --qa-surface-muted: #F5F7FA;
    --qa-text: #333333;
    --qa-muted: #64748B;
    --qa-border: #FFCDD2;
    --qa-primary: #D32F2F;
    --qa-shadow: 0 6px 24px rgba(211, 47, 47, 0.1);
    --qa-shadow-hover: 0 8px 28px rgba(211, 47, 47, 0.15);
    --qa-ring: 0 0 0 3px rgba(211, 47, 47, 0.15);
    --qa-separator: #FFCDD2;
    --qa-separator-soft: rgba(255, 205, 210, 0.5);
    /* 交界处分隔阴影（亮色主题） */
    --qa-split-shadow-right: 2px 0 4px rgba(211, 47, 47, 0.05);
    --qa-split-shadow-left: -2px 0 4px rgba(211, 47, 47, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --qa-surface: #0f172a;
        --qa-surface-muted: #0b1322;
        --qa-text: #e5e7eb;
        --qa-muted: #9aa5b1;
        --qa-border: #334155;
        --qa-primary: #EF5350;
        --qa-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
        --qa-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.45);
        --qa-ring: 0 0 0 3px rgba(239, 83, 80, 0.25);
        --qa-separator: #333333;
        --qa-separator-soft: rgba(51,51,51,0.6);
        /* 交界处分隔阴影（暗色主题） */
        --qa-split-shadow-right: 2px 0 4px rgba(0,0,0,0.4);
        --qa-split-shadow-left: -2px 0 4px rgba(0,0,0,0.4);
    }
}

/* 企业系统主界面样式 */
.enterprise-system {
    width: 100%;
    min-height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* 顶部导航栏 */
.system-header {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.system-header__left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.system-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #ff5722;
}

.system-header__logo i {
    color: #ff5722;
}

.system-header__nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-header__nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.system-header__nav-item:hover {
    background-color: #f5f5f5;
    color: #333;
}

.system-header__nav-item--more {
    gap: 4px;
}

.system-header__nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #ffffff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.system-header__nav-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.system-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-header__user {
    color: #333;
    font-weight: 500;
}

.system-header__btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.system-header__btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.system-header__icons {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
}

/* 设置菜单容器 */
.system-header__settings-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.system-header__settings-container i {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.system-header__settings-container i:hover {
    transform: rotate(30deg);
    color: #333;
}

/* 设置下拉菜单 */
.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 240px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.settings-dropdown--show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-dropdown__header {
    padding: 12px 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.settings-dropdown__item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-dropdown__label {
    font-size: 14px;
    color: #666;
}

/* 开关控件样式 */
.settings-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.settings-switch__slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.settings-switch input:checked + .settings-switch__slider {
    background-color: var(--qa-primary);
}

.settings-switch input:focus + .settings-switch__slider {
    box-shadow: 0 0 1px var(--qa-primary);
}

.settings-switch input:checked + .settings-switch__slider:before {
    transform: translateX(20px);
}

/* 主要内容区域 */
.system-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    background-color: #f0f2f5;
    gap: 12px;
    padding: 12px;
}

/* 主导航栏 */
.system-sidebar {
    height: 50px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.sidebar-nav__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    height: 36px;
    border: none;
    font-size: 14px;
}

.sidebar-nav__item:hover {
    background-color: #f0f2f5;
    color: #333;
    border-radius: 4px;
}

.sidebar-nav__item--active {
    background-color: var(--qa-primary);
    color: #ffffff;
    font-weight: 500;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.2);
}

.sidebar-nav__item--active:hover {
    background-color: #B71C1C;
    color: #ffffff;
}

.sidebar-nav__item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* 左侧边栏 */
.system-sidebar-left {
    width: 320px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 中间内容区 */
.system-content {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 右侧快捷入口 */
.system-shortcuts {
    width: 320px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 用户信息卡片 */
.user-info-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column; /* 改为纵向布局 */
    gap: 12px;
}

.user-info-card__top {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.user-info-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #1976d2;
}

.user-info-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-card__avatar i {
    font-size: 40px;
    color: #1976d2;
}

.user-info-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-info-card__greeting {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.user-info-card__level {
    font-size: 14px;
    color: #666;
}

.user-info-card__stat {
    font-size: 14px;
    color: #666;
}

.user-info-card__btn {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--qa-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
    max-width: 100%;
    align-self: center; /* 水平居中 */
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.1);
}

.user-info-card__btn:hover {
    background-color: #B71C1C;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.25);
}

.user-info-card__btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(211, 47, 47, 0.1);
}

.user-info-card__btn i {
    font-size: 14px;
}

/* 主要内容 */
.content-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 图片轮播 */
.banner {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.banner__icon {
    font-size: 64px;
    color: #1976d2;
    opacity: 0.3;
    animation: scrollAnimation 10s linear infinite;
    position: absolute;
}

@keyframes scrollAnimation {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.banner__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

/* 内容布局 */
.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
}

.content-grid__item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 日历样式 */
.calendar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.calendar__title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.calendar__btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #ffffff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar__btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.calendar__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.calendar__day:first-child,
.calendar__day:last-child {
    color: var(--qa-primary);
}

.calendar__dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar__date {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.calendar__date:hover {
    background-color: #f0f2f5;
}

.calendar__date--other-month {
    color: #bdbdbd;
}

.calendar__date--today {
    background-color: var(--qa-primary);
    color: #ffffff;
    font-weight: 500;
}

.calendar__date--highlight {
    color: #dc3545;
    font-weight: 500;
}

.calendar__footer {
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* 通知区域 */
.notifications {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notifications__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.notifications__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.notifications__btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #ffffff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notifications__btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.notifications__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background-color: #f5f5f5;
}

.notification-item__icon {
    width: 32px;
    height: 32px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-item__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-item__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.notification-item__subject {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    min-width: 0;
}

.notification-item__type {
    font-size: 12px;
    color: #666;
    opacity: 0.8;
    margin-left: 12px;
    white-space: nowrap;
}

.notification-item__time {
    font-size: 12px;
    color: #9e9e9e;
    margin-top: 2px;
    margin-left: 0;
}

/* 待批文件 */
.approval-files {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.approval-files__tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.approval-files__tab {
    padding: 8px 16px;
    background-color: transparent;
    color: #666;
    border: none;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.approval-files__tab:hover {
    background-color: #f5f5f5;
    color: #333;
}

.approval-files__tab--active {
    color: #1976d2;
    font-weight: 500;
    border-bottom-color: #1976d2;
}

.approval-files__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.approval-file-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #f0f2f5;
}

.approval-file-item:hover {
    background-color: #f5f5f5;
    border-color: #e3f2fd;
}

.approval-file-item__title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.approval-file-item__time {
    font-size: 12px;
    color: #9e9e9e;
}

/* To Do List */
.todo-list {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.todo-list__title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.todo-list__input {
    display: flex;
    gap: 8px;
}

.todo-list__input-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.todo-list__input-field:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.todo-list__input-btn {
    padding: 10px 16px;
    background-color: #1976d2;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-list__input-btn:hover {
    background-color: #1565c0;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.todo-list__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #fafafa;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.todo-list__item:hover {
    background-color: #f5f5f5;
}

.todo-list__item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.todo-list__item-label {
    flex: 1;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.todo-list__item-checkbox:checked + .todo-list__item-label {
    text-decoration: line-through;
    color: #9e9e9e;
}

/* 右侧快捷入口 */
.system-shortcuts {
    width: 320px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
    justify-content: center;
}

.shortcut-item:hover {
    background-color: #f0f2f5;
    border-color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcut-item__icon {
    font-size: 20px;
    color: #1976d2;
    margin-bottom: 2px;
}

.shortcut-item__title {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: auto;
    min-height: 28px;
    padding: 0 4px;
    text-align: center;
}

/* 本周生日 */
.birthdays {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.birthdays__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.birthdays__header h3 {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.birthdays__count {
    font-size: 12px;
    color: #666;
    background-color: #f0f2f5;
    padding: 2px 8px;
    border-radius: 12px;
}

.birthdays__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.birthday-item:hover {
    background-color: #f5f5f5;
}

.birthday-item__avatar {
    width: 40px;
    height: 40px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.birthday-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.birthday-item__name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.birthday-item__date {
    font-size: 12px;
    color: #9e9e9e;
}

/* 右侧快捷入口 */
.system-shortcuts {
    width: 320px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
    justify-content: center;
}

.shortcut-item:hover {
    background-color: #f0f2f5;
    border-color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcut-item__icon {
    font-size: 20px;
    color: #1976d2;
    margin-bottom: 2px;
}

.shortcut-item__title {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: auto;
    min-height: 28px;
    padding: 0 4px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 20px;
    text-align: center;
}

.main-content h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.main-content p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 问答助手样式 */
.qa-assistant {
    position: fixed;
    bottom: 50px;
    right: 10px;
    z-index: 1000;
}

/* 悬浮图标样式 */
.qa-assistant__icon {
    width: 50px; /* 稍微减小尺寸 */
    height: 50px; /* 稍微减小尺寸 */
    background: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 4px 20px rgba(211, 47, 47, 0.3);
    /* 移除 transition: all，分别控制，避免干扰拖拽 */
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease, width 0.3s ease;
    animation: slideInUp 0.5s ease-out;
    color: white;
    font-size: 20px; /* 减小图标字体大小 */
    user-select: none;
    z-index: 1001;
    pointer-events: auto;
    position: relative; /* 确保子元素绝对定位相对于此元素 */
    overflow: visible;
}

/* 吸附过渡类：用于吸附动画 */
.qa-assistant__icon--snapping {
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* 吸附状态类：通用 */
.qa-assistant__icon--snapped {
    opacity: 0.9; /* 稍微提高不透明度，因为形状变小了 */
    /* 移除阴影，或者改小一点，使其看起来更贴合 */
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.2);
}

/* 左侧吸附样式 */
.qa-assistant__icon--snapped-left {
    border-radius: 0 50px 50px 0; /* 适配新的高度 */
    width: 32px; /* 进一步减小宽度，让图标嵌入更深 */
    justify-content: flex-start; /* 图标内容左对齐 */
    padding-left: 6px; /* 调整内边距 */
}

/* 右侧吸附样式 */
.qa-assistant__icon--snapped-right {
    border-radius: 50px 0 0 50px; /* 适配新的高度 */
    width: 32px; /* 进一步减小宽度，让图标嵌入更深 */
    justify-content: flex-end; /* 图标内容右对齐 */
    padding-right: 6px; /* 调整内边距 */
}

/* 吸附时隐藏关闭按钮，防止误触且保持视觉简洁 */
.qa-assistant__icon--snapped .qa-assistant__close-icon {
    display: none;
}

/* 吸附时图标稍微缩小一点 */
.qa-assistant__icon--snapped i.fa-robot {
    transform: scale(0.75); /* 稍微再缩小一点，适配更窄的容器 */
}

/* 吸附视觉反馈动画 */
@keyframes snapPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.qa-assistant__icon--snap-feedback {
    animation: snapPulse 0.3s ease;
}

.qa-assistant__icon i {
    pointer-events: none;
}

/* 关闭按钮样式 */
.qa-assistant__close-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #f44336; /* 红色背景 */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 1002;
    border: 2px solid white; /* 增加白色边框提升对比度 */
}

/* 鼠标悬停显示关闭按钮 */
.qa-assistant__icon:hover .qa-assistant__close-icon {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* 即使鼠标移出，只要在关闭按钮上，或者通过JS控制类名保持显示 */
/* 根据需求：鼠标移出 div 时保持关闭按钮可见。这意味着一旦触发hover，可能就需要保持？
   或者仅仅是常规hover行为？通常 'keep visible' 意味着 hover 状态下的持久性。
   但在纯CSS hover中，移出 parent 就会消失。
   如果用户意图是“移出icon但移入close button时保持可见”，这在 nesting 结构中是自然支持的。
   如果用户意图是“移出icon后仍然一直显示”，则需要JS。
   鉴于标准交互习惯，这里先实现标准 Hover，并确保 transition 平滑。
*/

.qa-assistant__close-icon:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

.qa-assistant__icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 30px rgba(211, 47, 47, 0.4);
}

.qa-assistant__icon:active {
    transform: translateY(-2px) scale(1.05);
}

/* 对话框样式 */
.qa-assistant__dialog {
    position: fixed; /* 改为 fixed 以支持自由拖动 */
    bottom: auto; /* 清除默认 bottom */
    right: auto; /* 清除默认 right */
    /* 初始位置由 JS 控制，或者使用默认值 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95); /* 初始居中 */
    width: 800px;
    min-width: 200px; /* 最小宽度限制 */
    min-height: 150px; /* 最小高度限制 */
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: visible; /* 允许伪元素溢出，用于扩大点击区域 */
    z-index: 950;
    touch-action: none; /* 防止触摸设备上的默认滚动 */
}

/* 扩大拖拽点击区域 */
.qa-assistant__dialog::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    z-index: -1;
    /* 关键：pointer-events: auto 允许点击，但 z-index: -1 可能会被 body 遮挡？
       不，它是 dialog 的子元素。如果 dialog 建了层叠上下文(fixed/opacity/transform)，
       z-index: -1 会放在 dialog 背景后面。
       为了能点击，我们需要它在最上面但透明，或者...
       如果它在背景后面，鼠标在 dialog 外部时，点击的是 body。
       只有当它是正 z-index 且延伸出去时才能捕获。
       
       修正：为了简单且有效，让它 z-index: 10 但 pointer-events: none (中间穿透)？
       CSS不支持中间穿透。
       
       既然我们已经修正了 JS 的 Math 逻辑，且用户的主要抱怨是"无法向内"，
       这通常是 Math 错误。
       "向外拖动"已经证明 resize 功能是激活的。
       所以这里我们只保持 overflow: visible 以防万一，但不要过度 engineered 伪元素
       以免造成点击穿透问题。
    */
    pointer-events: none; 
}

.qa-assistant__dialog--open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1); /* 打开时状态 */
}

/* 对话框内容区 - 接管 overflow: hidden */
.qa-assistant__dialog-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    border-radius: 0 0 16px 16px; /* 底部圆角 */
}

/* 当通过 JS 设置了具体位置时，移除 transform 的位移部分 */
.qa-assistant__dialog--moved {
    transform: scale(1) !important;
}

.qa-assistant__dialog--maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0;
    z-index: 9999 !important; 
    transform: none !important;
}

@media (max-width: 576px) {
    .qa-assistant__dialog--maximized {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0;
    }
}

/* 对话框头部 */
.qa-assistant__dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--qa-primary);
    color: white;
    border-radius: 16px 16px 0 0;
}

.qa-assistant__dialog-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.qa-assistant__dialog-title i {
    font-size: 20px;
}

.qa-assistant__dialog-actions {
    display: flex;
    gap: 8px;
}

.qa-assistant__btn-container {
    position: relative;
    width: 32px;
    height: 32px;
}

.qa-assistant__btn-container .qa-assistant__btn {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
}

/* 按钮样式 */
.qa-assistant__btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.qa-assistant__btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.qa-assistant__btn:active {
    transform: scale(0.95);
}

/* 左侧历史会话列表 */
.qa-assistant__history {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid var(--qa-separator-soft);
    box-shadow: var(--qa-split-shadow-right);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 历史容器：统一包裹操作区、标题区和列表区，保持纵向排布与响应式一致 */
.qa-assistant__history-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    background: #E8EBF0;
}

/* 功能按钮区 */
.qa-assistant__history-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.qa-assistant__history-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: none;
}

.qa-assistant__history-action-btn:hover {
    background: #e5e6eb;
    color: #495057;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.qa-assistant__history-action-btn i {
    font-size: 14px;
}

.qa-assistant__history-action-btn--new {
    border-left: 3px solid #dc3545;
}

.qa-assistant__history-action-btn--translate {
    border-left: 3px solid #17a2b8;
}

/* 历史会话区域 */
.qa-assistant__history-section {
    background: inherit;
    border-top: none;
}

/* 历史会话标题区 */
.qa-assistant__history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    margin: 0;
    border-bottom: none;
    background: inherit;
}

.qa-assistant__history-title {
    font-size: 12px;
    font-weight: 500;
    color: #adb5bd;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.qa-assistant__btn--clear {
    background: transparent;
    color: #6c757d;
    width: 28px;
    height: 28px;
}

.qa-assistant__btn--clear:hover {
    background: #e9ecef;
    color: #dc3545;
}
/* 历史会话列表 */
.qa-assistant__history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: inherit;
}

/* 历史会话项 */
.qa-assistant__history-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 60px;
    overflow: hidden;
}

.qa-assistant__history-item-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}

/* 全局 Tooltip 样式 */
.qa-assistant__global-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    z-index: 10000;
    pointer-events: none;
    max-width: 240px;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.qa-assistant__history-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    transition: all 0.2s ease;
    line-height: 1.4;
    cursor: default;
    position: relative;
}
/* 移除旧的伪元素 tooltip 样式 */

.qa-assistant__history-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qa-assistant__history-item:hover .qa-assistant__history-item-actions {
    opacity: 1;
}

.qa-assistant__history-item-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: #f1f3f4;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.qa-assistant__history-item-btn:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.qa-assistant__history-item-btn--rename:hover {
    background: #ffebee;
    color: #dc3545;
}

.qa-assistant__history-item-btn--delete:hover {
    background: #ffebee;
    color: #dc3545;
}



.qa-assistant__history-item:hover {
    background: #f2f3f5;
    border-color: #e5e7eb;
    transform: none;
}

.qa-assistant__history-item--active {
    background: white;
    border-color: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 右侧消息区域 */
.qa-assistant__messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #F5F7F9;
    position: relative;
    transition: all 0.3s ease;
    border-left: 1px solid var(--qa-separator);
    /* 仅在左侧边缘投影，与左侧功能区形成分隔 */
    box-shadow: var(--qa-split-shadow-left);
}

/* 居中模式：当进入默认首页状态时，将右侧容器切换为居中对齐。
   原理：父容器使用 Flex，纵向对齐使用 align-items，主轴居中使用 justify-content。*/
.qa-assistant__messages-container--center {
    justify-content: center;
    align-items: center;
}

/* 消息展示区域 */
.qa-assistant__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    padding-bottom: 8rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 90%;
    max-width: 800px;
    max-height: 0;
    opacity: 0;
    transition: all 300ms ease;
    margin: 0 auto;
}

/* 消息展示区域 - 扩展状态 */
.qa-assistant__messages--expanded {
    max-height: 100%;
    opacity: 1;
}

/* 默认页：居中输入与预设问题 */
.qa-assistant__home {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 320px;
    padding: 20px 0;
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.qa-assistant__home-input {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.qa-assistant__home .qa-assistant__input {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    height: 50px;
    min-height: 50px;
    resize: none;
}

.qa-assistant__home-suggestions {
    width: 100%;
}

.qa-assistant__home-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: var(--qa-muted);
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
}

.qa-assistant__home-title::before,
.qa-assistant__home-title::after {
    content: "";
    display: block;
    height: 1px;
    width: clamp(48px, 12vw, 160px);
    background: linear-gradient(to left, transparent, var(--qa-separator));
    background: -webkit-linear-gradient(left, var(--qa-separator), transparent);
}

.qa-assistant__home-title::after {
    background: linear-gradient(to right, transparent, var(--qa-separator));
    background: -webkit-linear-gradient(right, var(--qa-separator), transparent);
}

@media (max-width: 576px) {
    .qa-assistant__home-title { gap: 8px; font-size: 13px; }
    .qa-assistant__home-title::before,
    .qa-assistant__home-title::after { width: clamp(32px, 20vw, 96px); }
}
.qa-assistant__home-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    text-align: center;
}

.qa-assistant__home-welcome-title {
    font-size: 18px;
    line-height: 1.5;
    color: #333;
    font-weight: 600;
}

.qa-assistant__home-welcome-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: #64748B;
    font-weight: 500;
}

/* 预设问题样式 */
.qa-assistant__preset-questions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
    padding: 8px;
    background-color: transparent;
    border-radius: 12px;
    border: none;
    width: 100%;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.qa-assistant__preset-item {
    padding: 6px 10px;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.45;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.qa-assistant__preset-item:hover {
    background-color: #f5f7fa;
    transform: translateX(4px);
}

/* 消息动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qa-assistant__message {
    animation: messageSlideIn 300ms ease forwards;
}

/* 元素层级控制 */
.qa-assistant__icon {
    z-index: 1000;
}

.qa-assistant__overlay {
    z-index: 900;
}

.qa-assistant__dialog {
    z-index: 950;
}

/* 输入框固定在底部 */
.qa-assistant__input-container {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

/* 返回初始状态动画 */
.qa-assistant__messages--fadeout {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qa-assistant__home--hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.qa-assistant__home--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 切换模式时的过渡状态 */
.qa-assistant__home--switching {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 消息样式 */
.qa-assistant__message {
    display: flex;
    gap: 0.75rem;
    animation: messageIn 0.3s ease both;
    margin-bottom: 0.25rem;
}

.qa-assistant__message--user {
    flex-direction: row-reverse;
}

.qa-assistant__message-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qa-assistant__message--user .qa-assistant__message-avatar {
    background: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
    color: white;
}

.qa-assistant__message--ai .qa-assistant__message-avatar {
    background: linear-gradient(135deg, #FF8A80 0%, #E57373 100%);
    color: white;
}

.qa-assistant__message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qa-assistant__message--user .qa-assistant__message-content {
    align-items: flex-end;
}

.qa-assistant__message-text {
    padding: 1rem 1.25rem;
    border-radius: 1.125rem;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.qa-assistant__message--user .qa-assistant__message-text {
    background: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.2);
}

.qa-assistant__message--ai .qa-assistant__message-text {
    background: white;
    color: #495057;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 消息来源引用样式 */
.qa-assistant__message-source {
    margin-top: 12px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.5;
    font-style: italic;
    border-left: 3px solid var(--qa-primary);
    word-break: break-word;
}

/* 消息操作按钮 */
.qa-assistant__message-actions {
    display: flex;
    gap: 4px;
    opacity: 1;
    transition: none;
}

.qa-assistant__message--user .qa-assistant__message-actions {
    justify-content: flex-end;
}

.qa-assistant__action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #e9ecef;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.qa-assistant__action-btn:hover {
    background: #dee2e6;
    color: #495057;
    transform: scale(1.1);
}

/* 操作按钮分割线样式 */
.qa-assistant__action-divider {
    font-size: 12px;
    color: #adb5bd;
    margin: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
}

/* 中韩互译按钮特殊样式 */
.qa-assistant__action-btn--translate {
    background: #FFEBEE;
    color: #D32F2F;
}

/* 激活状态 */
.qa-assistant__action-btn--active {
    background: #dee2e6 !important;
    color: #495057 !important;
    transform: scale(1.1);
}

.qa-assistant__action-btn--like.qa-assistant__action-btn--active {
    color: #FF0000 !important;
    transition: color 0.3s ease;
}

.qa-assistant__action-btn--dislike.qa-assistant__action-btn--active {
    color: #00FF00 !important;
    transition: color 0.3s ease;
}

.qa-assistant__action-btn:active {
    transform: scale(0.95);
}

.qa-assistant__action-btn--copy:hover {
    color: #28a745;
}

.qa-assistant__action-btn--regenerate:hover {
    color: #17a2b8;
}

.qa-assistant__action-btn--like:hover {
    color: #FF0000;
    transition: color 0.3s ease;
}

.qa-assistant__action-btn--dislike:hover {
    color: #00FF00;
    transition: color 0.3s ease;
}

.qa-assistant__action-btn--feedback:hover {
    color: #ffc107;
}

/* 消息时间戳 */
.qa-assistant__message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.qa-assistant__message--user .qa-assistant__message-time {
    text-align: right;
}

/* 输入区域 */
.qa-assistant__input-container {
    padding: 8px 12px;
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 28px;
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 20px;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    z-index: 100;
    box-shadow: var(--qa-shadow);
    transition: all 0.3s ease;
}

/* 新对话模式：水平布局，发送按钮在输入框后面 */
.qa-assistant__input-container--normal {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qa-assistant__input-container--normal .qa-assistant__input-content {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

.qa-assistant__input-container--normal .qa-assistant__input {
    border-radius: 20px;
    background: transparent;
    border: none;
    padding: 8px 4px 8px 12px;
}

.qa-assistant__input-container--normal .qa-assistant__input-functions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0;
    gap: 12px;
}

.qa-assistant__input-container--normal .qa-assistant__send-btn {
    border-radius: 22px;
    height: 44px;
    min-height: 44px;
    width: 44px;
}

/* 上区域：输入内容区 */
.qa-assistant__input-content {
    margin-bottom: 8px;
}

.qa-assistant__input {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.qa-assistant__input::placeholder {
    text-align: left;
    color: #94A3B8;
    font-size: 14px;
}

/* 下区域：功能按钮区 */
.qa-assistant__input-functions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    justify-content: flex-start;
}

/* 翻译会话特有的功能区 */
.qa-assistant__translation-features {
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    margin: 0;
    flex-grow: 1;
    overflow: visible;
}

/* 语言切换器样式 */
.qa-assistant__language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.qa-assistant__language-item {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.qa-assistant__language-switch-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.qa-assistant__language-switch-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

/* 附件上传按钮 */
.qa-assistant__attach-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: #F1F5F9;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    flex-shrink: 0;
}

.qa-assistant__attach-btn:hover {
    background: #E2E8F0;
    color: #475569;
}

/* 隐藏原生文件输入 */
.qa-assistant__file-input {
    display: none;
}

/* 发送按钮 */
.qa-assistant__send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: var(--qa-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    flex-shrink: 0;
}

.qa-assistant__send-btn:hover {
    background: #B71C1C;
}

.qa-assistant__language-switch-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.qa-assistant__translation-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qa-assistant__translation-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    color: #495057;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.qa-assistant__translation-btn:hover {
    background: #f8f9fa;
    border-color: var(--qa-primary);
    color: var(--qa-primary);
}

.qa-assistant__translation-btn i {
    font-size: 14px;
}

.qa-assistant__input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.qa-assistant__input-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    width: 100%;
}

/* 隐藏原生文件输入 */
.qa-assistant__file-input {
    display: none;
}

.qa-assistant__input:focus {
    border: none;
    box-shadow: none;
}

.qa-assistant__input::placeholder {
    color: #adb5bd;
}

.qa-assistant__input-hint {
    text-align: center;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 8px;
}

/* 滚动条样式 */
.qa-assistant__history-list::-webkit-scrollbar,
.qa-assistant__messages::-webkit-scrollbar {
    width: 6px;
}

/* 历史为空占位 */
.qa-assistant__history-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--qa-muted);
    font-size: 13px;
}
.qa-assistant__history-empty-text { opacity: 0.8; }

.qa-assistant__history-list::-webkit-scrollbar-track,
.qa-assistant__messages::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.qa-assistant__history-list::-webkit-scrollbar-thumb,
.qa-assistant__messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.qa-assistant__history-list::-webkit-scrollbar-thumb:hover,
.qa-assistant__messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画定义 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.qa-assistant__home--hidden { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.qa-assistant__messages--fadeout { transition: opacity 0.2s ease; opacity: 0; }

/* 响应式设计 */
@media (max-width: 768px) {
    .qa-assistant__dialog {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 10px;
    }

    .qa-assistant__history {
        width: 200px;
    }

    .qa-assistant__message-content {
        max-width: 85%;
    }
}

@media (max-width: 576px) {
    .qa-assistant {
        bottom: 50px;
        right: 10px;
    }

    .qa-assistant__icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .qa-assistant__dialog {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        bottom: 60px;
        right: 10px;
    }

    .qa-assistant__history {
        display: none;
    }

    .qa-assistant__message-content {
        max-width: 90%;
    }
    .qa-assistant__input-bar--home .qa-assistant__input { --qa-input-height: 44px; }
}

/* 加载状态 */
.qa-assistant__loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    color: #6c757d;
    font-size: 14px;
}

.qa-assistant__loading-dot {
    width: 8px;
    height: 8px;
    background: var(--qa-primary);
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out both;
}

.qa-assistant__loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.qa-assistant__loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 建议问题样式 - 优化为垂直列表 */
.qa-assistant__suggestion-questions {
    margin: 0 12px 16px 52px; /* 与 AI 消息内容左对齐 (头像宽+间距)，向上移动减少间距 */
    /* 移除背景和边框，去卡片化 */
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
}

.qa-assistant__suggestion-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    padding-left: 0; /* 确保左对齐 */
    display: none; /* 确保标题不显示 */
}

.qa-assistant__suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qa-assistant__suggestion-item {
    font-size: 13px;
    color: #000000; /* 纯黑色字体 */
    cursor: pointer;
    padding: 8px 12px;
    background: #f5f5f5; /* 轻微的背景区分 */
    border-radius: 4px; /* 保持圆角 */
    border: none; /* 移除边框 */
    transition: all 0.2s ease;
    text-align: left; /* 强制左对齐 */
    width: fit-content; /* 宽度自适应内容，不占满全宽 */
    max-width: 100%;
}

.qa-assistant__suggestion-item:hover {
    background: #ffebee;
    color: #b71c1c;
    transform: translateX(4px); /* 悬停时轻微右移交互 */
}

/* 辅助类 */
.qa-assistant__hidden {
    display: none;
}

/* 拖拽样式 */
.qa-assistant__icon--dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(1.1);
}
.qa-assistant__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 900;
    cursor: default; /* 明确不显示手型，或者可以根据需求改为 pointer */
    touch-action: none; /* 防止触摸穿透滚动 */
}

.qa-assistant__overlay--show {
    opacity: 1;
    visibility: visible;
}
.qa-assistant__input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    box-shadow: var(--qa-shadow);
    border-radius: 28px;
    padding: 8px 12px;
    will-change: box-shadow, transform, border-color;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.qa-assistant__input-bar:hover { box-shadow: var(--qa-shadow-hover); }
.qa-assistant__input-bar:active { transform: translateY(1px); }
.qa-assistant__input-bar:focus-within { box-shadow: var(--qa-shadow-hover), var(--qa-ring); border-color: var(--qa-primary); }

.qa-assistant__input-bar--home .qa-assistant__input {
    --qa-input-height: 50px;
    --qa-input-vpad: 16px;
    flex: 1;
    padding: 8px 4px 8px 12px;
    border: none;
    border-radius: 20px;
    background: transparent;
    transition: box-shadow 0.2s ease;
    height: var(--qa-input-height);
    min-height: var(--qa-input-height);
    line-height: calc(var(--qa-input-height) - var(--qa-input-vpad));
    text-align: left;
    color: var(--qa-text);
    overflow-y: hidden;
}

.qa-assistant__input-bar--home .qa-assistant__input:focus {
    box-shadow: inset 0 0 0 2px rgba(211, 47, 47, 0.15);
}

.qa-assistant__input-bar-attach {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.qa-assistant__input-bar-attach:hover { background: #F1F5F9; color: #334155; }

.qa-assistant__send-btn {
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: #cbd5e1;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.qa-assistant__send-btn:hover { background: #b8c4d3; }
.qa-assistant__send-btn:active { transform: scale(0.98); }
.qa-assistant__send-btn:focus-visible { box-shadow: var(--qa-ring); outline: none; }

.qa-assistant__send-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.qa-assistant__send-btn--pulse {
    animation: sendPulse 0.3s ease;
}

@keyframes sendPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .qa-assistant__input-bar { padding: 0; }
    .qa-assistant__input-bar--home .qa-assistant__input { --qa-input-height: 48px; }
}
.qa-assistant__input-bar--home .qa-assistant__input:hover {
    border: none;
    box-shadow: none;
}

.qa-assistant__input-bar--home .qa-assistant__input::placeholder { line-height: calc(var(--qa-input-height) - var(--qa-input-vpad)); text-align: left; }
.qa-assistant__input-bar--home .qa-assistant__input::-webkit-input-placeholder { line-height: calc(var(--qa-input-height) - var(--qa-input-vpad)); text-align: left; }
.qa-assistant__input-bar--home .qa-assistant__input::-moz-placeholder { line-height: calc(var(--qa-input-height) - var(--qa-input-vpad)); text-align: left; }
.qa-assistant__input-bar--home .qa-assistant__input:-ms-input-placeholder { line-height: calc(var(--qa-input-height) - var(--qa-input-vpad)); text-align: left; }
.qa-assistant__input-bar--home .qa-assistant__input:-moz-placeholder { line-height: calc(var(--qa-input-height) - var(--qa-input-vpad)); text-align: left; }