* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: #f5f7fa;
            height: 100vh;
            height: 100dvh;
            overflow: hidden;
        }
        .chat-app {
            max-width: 800px;
            margin: 0 auto;
            height: 100vh;
            height: 100dvh;
            display: flex;
            flex-direction: column;
            background: white;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .title {
            font-size: 16px;
            font-weight: 600;
        }
        .user-id {
            font-size: 12px;
            opacity: 0.9;
            background: rgba(255,255,255,0.2);
            padding: 4px 8px;
            border-radius: 12px;
        }
        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 12px 16px;
            background: #f8f9fa;
        }
        .message {
            margin-bottom: 12px;
            max-width: 93%;
            opacity: 0;
            transform: translateY(20px);
            animation: fadeInUp 0.3s ease forwards;width: fit-content;
        }
        @keyframes fadeInUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .yemu {
            margin-right: auto;
        }
        .user {
            margin-left: auto;
        }
        .message-content-wrapper {
            padding: 10px 14px;
            border-radius: 12px;
            position: relative;
            word-break: break-word;
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        }
        .yemu .message-content-wrapper {
            background: white;
            border: 1px solid #e5e5ea;
            border-radius: 0 12px 12px 12px;user-select: all; cursor: text;
        }
        .user .message-content-wrapper {
            background: #667eea;
            color: white;
        cursor: pointer;
            border-radius: 12px 0 12px 12px;
        }
        .message-info {
            margin-top: 4px;
            font-size: 11px;
        }
        .message-time {
            color: #999;
        }
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: #999;
        }
        .empty-icon {
            font-size: 50px;
            margin-bottom: 16px;
            opacity: 0.3;
        }
        .input-area {
            padding: 12px 16px;
            background: white;
            border-top: 1px solid #e5e5ea;
            flex-shrink: 0;
        }
        .message-form {
            display: flex;
            gap: 10px;
        }
        .message-input {
            flex: 1;
            padding: 12px 18px;
            border: 2px solid #e5e5ea;
            border-radius: 25px;
            font-size: 16px;
            outline: none;
            transition: all 0.3s;
        }
        .message-input:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        .send-btn {
            background: #667eea;
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .send-btn:hover {
            background: #5a67d8;
            transform: translateY(-2px);
        }
        .send-btn:disabled {
            background: #a5b1c2;
            cursor: not-allowed;
            transform: none;
        }
        
        /* 格式化内容块样式 */
        .message-content {
            white-space: pre-wrap;
            line-height: 1.5;
        }
        
        /* 标题块 */
        .heading-block {
            margin: 2px 0 2px 0;
            font-weight: bold;
            border-left: 3px solid #667eea;
            padding-left: 10px;
        }
        .heading-block.h1 { font-size: 1.5em; color: #333; }
        .heading-block.h2 { font-size: 1.3em; color: #444; }
        .heading-block.h3 { font-size: 1.2em; color: #555; }
        .heading-block.h4 { font-size: 1.1em; color: #666; }
        .heading-block.h5 { font-size: 1em; color: #777; font-weight: 600; }
        .heading-block.h6 { font-size: 0.9em; color: #888; font-weight: 600; }
        
        /* 代码块 */
        .code-container {
            margin: 0px 0;
            border-radius: 6px;
            overflow: hidden;
            position: relative;
            background: #1e1e1e;
        }
        .code-header {
            background: #2d2d2d;
            color: #ccc;padding:5px;
            font-size: 11px;text-align:right;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
        }
        .code-language {
            font-weight: bold;color:#fff;
        }
        .code-copy-btn {
            background: #444;
            border: none;
            color: white;
            padding: 5px;
            border-radius: 4px;
            font-size: 10px;
            text-align:center;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }
        .code-copy-btn:hover {
            background: #555;
        }
        .code-copy-btn.copied {
            background: #2ed573;
        }
        .code-block {
            margin: 0;
        }
        .code-block pre {
            margin: 0;
            padding: 10px;
            overflow-x: auto;
            max-height: 250px;
            overflow-y: auto;
        }
        .code-block code {
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 12px;
            line-height: 1.4;
            display: block;
        }
        
        /* 代码块滚动条样式 */
        .code-block pre::-webkit-scrollbar {
            height: 6px;
            width: 6px;
        }
        .code-block pre::-webkit-scrollbar-track {
            background: #2d2d2d;
            border-radius: 3px;
        }
        .code-block pre::-webkit-scrollbar-thumb {
            background: #555;
            border-radius: 3px;
        }
        .code-block pre::-webkit-scrollbar-thumb:hover {
            background: #666;
        }
        
        /* 内联代码 */
        .inline-code {
            background: #f1f1f1;
            padding: 2px 4px;
            border-radius: 3px;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.85em;
            color: #e53e3e;
        }
        .yemu .inline-code {
            background: #f8f9fa;
            border: 1px solid #e5e5ea;
        }
        .user .inline-code {
            background: rgba(255,255,255,0.2);
            color: #fff;
        }
        
        /* 警告/提示/注释块 */
        .alert-block {
            margin: 6px 0;
            padding: 8px 12px;
            border-radius: 6px;
            border-left: 3px solid;
        }
        .alert-block.warning {
            background: #fff8e1;
            border-left-color: #ffc107;
            color: #856404;
        }
        .alert-block.tip {
            background: #e8f5e8;
            border-left-color: #28a745;
            color: #155724;
        }
        .alert-block.note {
            background: #e3f2fd;
            border-left-color: #2196f3;
            color: #0d47a1;
        }
        .alert-block.error {
            background: #fdeaea;
            border-left-color: #dc3545;
            color: #721c24;
        }
        .alert-block .alert-title {
            font-weight: bold;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.9em;
        }
        .alert-block .alert-content {
            font-size: 0.9em;
        }
        
        /* 数学公式块 */
        .math-block {
            margin: 8px 0;
            padding: 10px;
            background: #f9f9f9;
            border: 1px solid #e5e5ea;
            border-radius: 6px;
            font-family: 'Cambria Math', 'STIX Two Math', serif;
            font-size: 1.1em;
            text-align: center;
            position: relative;
        }
        .math-copy-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            background: #667eea;
            color: white;
            border: none;
            padding: 3px 6px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 10px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }
        .math-copy-btn:hover {
            background: #5a67d8;
        }
        .math-block .math-content {
            margin: 0 25px;
            padding: 8px 0;
        }
        
        /* 表格块 */
        .table-container {
            margin: 8px 0;
            overflow-x: auto;
            border-radius: 6px;
            border: 1px solid #e5e5ea;
            position: relative;
        }
        .table-copy-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            background: #667eea;
            color: white;
            border: none;
            padding: 3px 6px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 10px;
            z-index: 2;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }
        .table-copy-btn:hover {
            background: #5a67d8;
        }
        .table-block {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .table-block th {
            background: #f8f9fa;
            padding: 8px 10px;
            text-align: left;
            font-weight: 600;
            border-bottom: 2px solid #e5e5ea;
        }
        .table-block td {
            padding: 6px 10px;
            border-bottom: 1px solid #e5e5ea;
        }
        .table-block tr:hover {
            background: #f8f9fa;
        }
        
        /* 引用块 */
        .quote-block {
            margin: 6px 0;
            padding: 8px 12px;
            border-left: 3px solid #667eea;
            background: #f8f9fa;
            color: #666;
            font-style: italic;
        }
        
        /* 列表块 */
        .list-block {
            margin: 1px 0;
            padding-left: 16px;
        }
        .list-block ul, .list-block ol {
            margin: 1px 0;
        }
        .list-block li {
            margin: 1px 0;
        }
        
        /* 分隔线 */
        .hr-block {
            margin: 12px 0;
            border: none;
            border-top: 1px solid #e5e5ea;
        }
        
        /* 通知样式 */
        .notification {
            position: fixed;
            top: 16px;
            right: 16px;
            background: #667eea;
            color: white;
            padding: 10px 16px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            z-index: 1000;
            animation: slideIn 0.3s ease;
        }
        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        
        /* 移动端优化 */
        @media (max-width: 768px) {
            .chat-app {
                width: 100%;
                margin: 0;
            }
            .header {
                padding: 10px 12px;
            }
            .messages-container {
                padding: 10px 12px;
            }
            .message {
                max-width: 93%;
                margin-bottom: 10px;
            }
            .message-content-wrapper {
                padding: 8px 12px;
            }
            .input-area {
                padding: 10px 12px;
            }
            .message-input {
                padding: 8px 12px;
                font-size: 14px;
            }
            .send-btn {
                width: 40px;
                height: 40px;
                font-size: 14px;
            }
        }