/* ========================================================= */
/* 针对 ID="chat-submit" 的精准修改 */
/* ========================================================= */

#chat-submit {
    /* 1. 强制修改按钮背景色 (例如：纯黑) */
    background-color: #000000 !important;
    
    /* 2. 强制修改图标颜色 */
    /* 因为 SVG 设置了 fill="currentColor"，所以改 color 等于改图标色 */
    color: #ffffff !important; /* 这里设为白色 */
    
    /* 3. (可选) 去掉边框或阴影，保持极简 */
    border: none !important;
    box-shadow: none !important;
}

/* 4. 鼠标悬停时的效果 (可选) */
#chat-submit:hover {
    background-color: #333333 !important; /* 悬停时稍微变灰 */
    opacity: 0.9 !important;
}

/* ========================================================= */
/* 如果你想改“停止”按钮 (通常在同一个位置出现) */
/* ========================================================= */
#chat-stop {
    background-color: #000000 !important;
    color: #ffffff !important;
}









/* ========================================================= */
/* 针对 "确认" (Confirm) 按钮的黑白极简定制 */
/* ID: #confirm */
/* ========================================================= */

/* --- 1. 默认情况 (亮色模式 Light Mode) --- */
/* 策略：黑底白字 */
#confirm {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #000000 !important; /* 加个边框防边缘模糊 */
}

/* 亮色模式下的悬停效果 (稍微变灰) */
#confirm:hover {
    background-color: #333333 !important;
    opacity: 1 !important;
}


/* --- 2. 暗色模式 (Dark Mode) --- */
/* 策略：白底黑字 (必须反转，否则看不清) */
/* Chainlit 切换到暗色时，通常会在 body 或 html 上加 data-theme="dark" 或 class="dark" */
[data-theme="dark"] #confirm,
.dark #confirm {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
}

/* 暗色模式下的悬停效果 (稍微变灰) */
[data-theme="dark"] #confirm:hover,
.dark #confirm:hover {
    background-color: #e0e0e0 !important;
    color: #000000 !important;
}

#readme-button {
    display: none !important;
}

button[aria-label="说明"],
button[aria-label="Readme"],
button[aria-label="README"] {
    display: none !important;
}

.cl-ai-disclaimer {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    font-size: 12px;
    line-height: 1;
    opacity: 0.7;
    white-space: nowrap;
}

[data-theme="dark"] .cl-ai-disclaimer,
.dark .cl-ai-disclaimer {
    opacity: 0.8;
}

/* ========================================================= */
/* 登录页面极简黑白样式 */
/* ========================================================= */

/* 登录表单整体样式 */
[data-testid="login-form"] {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

/* 输入框样式 - 黑色边框 */
[data-testid="login-form"] input {
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #000 !important;
}

[data-testid="login-form"] input:focus {
    border-color: #000 !important;
    box-shadow: 0 0 0 1px #000 !important;
}

/* 暗色模式输入框 */
[data-theme="dark"] [data-testid="login-form"] input,
.dark [data-testid="login-form"] input {
    border: 1px solid #fff !important;
    background: #1a1a1a !important;
    color: #fff !important;
}

[data-theme="dark"] [data-testid="login-form"] input:focus,
.dark [data-testid="login-form"] input:focus {
    border-color: #fff !important;
    box-shadow: 0 0 0 1px #fff !important;
}

/* 登录按钮 - 黑底白字 */
[data-testid="login-form"] button[type="submit"] {
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
}

[data-testid="login-form"] button[type="submit"]:hover {
    background-color: #333 !important;
}

[data-testid="login-form"] button[type="submit"]:disabled {
    background-color: #999 !important;
    cursor: not-allowed !important;
}

/* 暗色模式登录按钮 - 白底黑字 */
[data-theme="dark"] [data-testid="login-form"] button[type="submit"],
.dark [data-testid="login-form"] button[type="submit"] {
    background-color: #fff !important;
    color: #000 !important;
}

[data-theme="dark"] [data-testid="login-form"] button[type="submit"]:hover,
.dark [data-testid="login-form"] button[type="submit"]:hover {
    background-color: #e0e0e0 !important;
}

[data-theme="dark"] [data-testid="login-form"] button[type="submit"]:disabled,
.dark [data-testid="login-form"] button[type="submit"]:disabled {
    background-color: #666 !important;
    color: #999 !important;
}

/* 协议勾选区域样式 */
.agreement-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    font-size: 12px;
    color: #333;
}

.agreement-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #000;
}

.agreement-checkbox label {
    line-height: 1.4;
    white-space: nowrap;
}

.agreement-checkbox a {
    color: #000;
    text-decoration: underline;
    cursor: pointer;
}

.agreement-checkbox a:hover {
    opacity: 0.7;
}

/* 暗色模式协议区域 */
[data-theme="dark"] .agreement-checkbox,
.dark .agreement-checkbox {
    color: #ccc;
}

[data-theme="dark"] .agreement-checkbox input[type="checkbox"],
.dark .agreement-checkbox input[type="checkbox"] {
    accent-color: #fff;
}

[data-theme="dark"] .agreement-checkbox a,
.dark .agreement-checkbox a {
    color: #fff;
}

/* 协议弹窗样式 */
.agreement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.agreement-modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: #000;
}

.agreement-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

.agreement-modal-content pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.agreement-modal-content button {
    margin-top: 16px;
    padding: 8px 24px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.agreement-modal-content button:hover {
    background: #333;
}

.agreement-modal--fullscreen {
    align-items: stretch;
    justify-content: stretch;
}

.agreement-modal-content--fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agreement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.agreement-modal-content--fullscreen h3 {
    margin: 0;
}

.agreement-modal-content--fullscreen .agreement-modal-close {
    margin: 0;
}

.agreement-modal-iframe {
    display: block;
    width: 100%;
    flex: 1;
    border: 0;
    background: #fff;
}

/* 暗色模式弹窗 */
[data-theme="dark"] .agreement-modal-content,
.dark .agreement-modal-content {
    background: #1a1a1a;
    color: #fff;
}

[data-theme="dark"] .agreement-modal-content button,
.dark .agreement-modal-content button {
    background: #fff;
    color: #000;
}

[data-theme="dark"] .agreement-modal-content button:hover,
.dark .agreement-modal-content button:hover {
    background: #e0e0e0;
}

[data-theme="dark"] .agreement-modal-header,
.dark .agreement-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .agreement-modal-iframe,
.dark .agreement-modal-iframe {
    background: #1a1a1a;
}

/* ========================================================= */
/* 登录页面布局调整 */
/* ========================================================= */

/* 1. 隐藏右侧背景区域 */
.relative.bg-muted,
.bg-muted.lg\:block,
div[class*="bg-muted"][class*="lg:block"] {
    display: none !important;
}

/* 直接隐藏 favicon 图片 */
img[src*="/favicon"] {
    display: none !important;
}

/* 2. 覆盖2列网格为1列，让登录区域占满宽度 */
.grid.min-h-svh.lg\:grid-cols-2,
.grid[class*="lg:grid-cols-2"] {
    grid-template-columns: 1fr !important;
}

/* 3. 隐藏原来的 Logo 容器（Logo 会通过 JS 移动到表单内） */
.flex.justify-center.gap-2.md\:justify-start,
div[class*="md:justify-start"][class*="gap-2"] {
    display: none !important;
}

/* 4. 表单内的 Logo 样式 */
img.logo[src*="/logo"] {
    width: 300px !important;
    max-width: 80% !important;
    height: auto !important;
}

form img.logo {
    display: block !important;
    margin: 0 auto 32px auto !important;
    object-fit: contain;
}

/* 5. 登录页底部版权 */
.login-page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 12px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 12px;
    color: #666;
    z-index: 9998;
    pointer-events: none;
}

[data-theme="dark"] .login-page-footer,
.dark .login-page-footer {
    color: #999;
}
