* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('https://ai.ccloud.asia/image/background_ai_chat.png') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    height: 100vh;
}

/* 登录页面样式 */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: rgba(0, 0, 0, 0.7);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #45a049;
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
}

/* 聊天侧边栏 */
.chat-sidebar {
    width: 280px;
    background: rgba(247, 247, 248, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.chat-sidebar.collapsed {
    margin-left: -280px;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: #374151;
    font-size: 16px;
}

.new-chat-btn {
    padding: 6px 12px;
    background: #10a37f;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.new-chat-btn:hover {
    background: #0d8f6b;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-item.active {
    background: rgba(16, 163, 127, 0.1);
    border-left: 3px solid #10a37f;
}

.chat-info {
    flex: 1;
}

.chat-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
}

.chat-time {
    font-size: 12px;
    color: #6b7280;
}

.delete-btn {
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    margin-left: 8px;
}

/* 聊天页面样式 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toggle-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 12px;
}

.chat-header h1 {
    color: #333;
    flex: 1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#modelSelect {
    padding: 8px 12px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

#logoutBtn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

#logoutBtn:hover {
    background: #dc2626;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background: #10a37f;
    color: white;
}

.ai-message {
    align-self: flex-start;
    background: #f7f7f8;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.chat-input {
    display: flex;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    background: white;
    color: #374151;
    font-size: 16px;
    outline: none;
}

#messageInput:focus {
    border-color: #10a37f;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

#messageInput::placeholder {
    color: #9ca3af;
}

#sendBtn {
    padding: 12px 24px;
    background: #10a37f;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

#sendBtn:hover {
    background: #0d8f6b;
}

#sendBtn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.error {
    color: #ef4444;
    text-align: center;
    margin-top: 1rem;
}

.hidden {
    display: none;
}

.model-tag {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message-thinking {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.message-thinking {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.thinking-header {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: background-color 0.2s;
}

.thinking-header:hover {
    background: rgba(0, 0, 0, 0.15);
}

.thinking-icon {
    font-size: 10px;
    transition: transform 0.2s;
    width: 12px;
    text-align: center;
}

.message-thinking.collapsed .thinking-header {
    border-bottom: none;
}

.thinking-content {
    padding: 8px 12px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
    white-space: pre-wrap;
    transition: all 0.3s ease;
}

.loading {
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-sidebar {
        position: absolute;
        z-index: 1000;
        height: 100%;
    }
    
    .chat-sidebar.collapsed {
        margin-left: -280px;
    }
}

/* 表格样式 */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.message-content th,
.message-content td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.message-content th {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: #1f2937;
}

.message-content td {
    color: #374151;
}

.message-content tr:last-child td {
    border-bottom: none;
}

.message-content tr:hover {
    background: rgba(0, 0, 0, 0.05);
}
/* Markdown样式 */
.message-content h2 {
    color: #1f2937;
    font-size: 1.3em;
    font-weight: 600;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid rgba(31, 41, 55, 0.3);
    padding-bottom: 5px;
}

.message-content h3 {
    color: #1f2937;
    font-size: 1.2em;
    font-weight: 600;
    margin: 12px 0 8px 0;
}

.message-content h4 {
    color: #1f2937;
    font-size: 1.1em;
    font-weight: 600;
    margin: 10px 0 6px 0;
}

.message-content strong {
    color: #1f2937;
    font-weight: 600;
}

.message-content em {
    color: #374151;
    font-style: italic;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 0;
}

.message-content li {
    color: #374151;
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
    list-style: none;
}

.message-content li:before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}
/* IC页面布局修复 */
.chat-container {
    display: flex;
    height: 100vh;
    background: #fff;
}

.chat-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.chat-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h2 {
    color: #1f2937;
    font-size: 1.2em;
    margin: 0;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: margin-left 0.3s ease;
}

.chat-main.expanded {
    margin-left: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.chat-header h1 {
    color: #1f2937;
    font-size: 1.5em;
    margin: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0.5rem;
    color: #374151;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
}

.params-form {
    padding: 1rem;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.param-group {
    margin-bottom: 1rem;
}

.param-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.param-group input,
.param-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #374151;
}

.param-group textarea {
    min-height: 80px;
    resize: vertical;
}

.param-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.param-row .param-group {
    flex: 1;
    margin-bottom: 0;
}

.send-button {
    width: 100%;
    padding: 0.75rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-button:hover {
    background: #059669;
}

.send-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.send-button:disabled .btn-text {
    display: none;
}

.send-button:disabled .btn-loading {
    display: inline;
}

.btn-loading {
    display: none;
}

/* 图片显示区域 */
.image-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: #6b7280;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.image-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}

.generated-image-container {
    text-align: center;
    margin-bottom: 1rem;
}

.generated-image-container img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.generated-image-container img:hover {
    transform: scale(1.02);
}

.image-info-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 16px;
}

.info-item {
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 14px;
}

.info-item strong {
    color: #1f2937;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.image-actions {
    text-align: center;
}

.action-button {
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.action-button:hover {
    background: #059669;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .chat-main {
        margin-left: 0;
    }
    
    .param-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ic-container {
        flex-direction: column;
    }
    
    .ic-sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ic-container {
        flex-direction: column;
    }
    
    .ic-sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
}
/* 主页样式 */
.home-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.home-header h1 {
    color: #333;
    margin: 0;
}

.logout-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background: #ff3742;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.feature-card p {
    color: #666;
    margin: 0;
    line-height: 1.5;
}
/* 头部控制按钮样式 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-controls button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    height: 40px;
    min-width: 80px;
    transition: all 0.2s ease;
}

.header-controls button:hover {
    background: #ff3742;
    transform: translateY(-1px);
}

.header-controls .home-btn {
    background: #28a745;
}

.header-controls .home-btn:hover {
    background: #218838;
}

/* 调整chat-header布局 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    flex: 1;
    text-align: center;
    margin: 0;
}

/* ASR页面样式 */
.upload-section {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.result-section {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.transcription-result {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.text-result {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.error-result {
    background: rgba(255, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 0, 0, 0.3);
}
