/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 20px 0 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
}

/* 语言切换器样式 */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.lang-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.lang-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

.lang-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* RTL支持（阿拉伯语） */
[dir="rtl"] .language-switcher {
    left: 30px;
    right: auto;
}

[dir="rtl"] .user-message .message-content {
    margin-right: auto;
    margin-left: 0;
    border-radius: 18px 18px 18px 4px;
}

[dir="rtl"] .ai-message .message-content {
    border-radius: 18px 18px 4px 18px;
}

[dir="rtl"] .export-button {
    left: 8px !important;
    right: auto !important;
}

[dir="rtl"] .event-filters-inline,
[dir="rtl"] .event-filters {
    direction: rtl;
}

[dir="rtl"] .quick-actions,
[dir="rtl"] .stats-preview {
    text-align: right;
}

[dir="rtl"] .stat-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .event-list-header h3 {
    text-align: right;
}

/* 移动端RTL调整 */
@media (max-width: 768px) {
    [dir="rtl"] .language-switcher {
        left: auto;
        right: auto;
    }
}

.title {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

/* 主体布局 */
.main {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* 左侧事件列表区域 */
.event-list-sidebar {
    width: 380px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.event-list-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.event-list-header h3 {
    color: #2563eb;
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.event-filters-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.event-filters-inline select {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
    min-width: 80px;
}

.sidebar-event-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: calc(100vh - 280px);
}

.sidebar-event-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-event-item:hover {
    background: #f1f5f9;
    border-color: #2563eb;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.sidebar-event-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 13px;
}

.sidebar-event-meta {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 11px;
    margin-bottom: 6px;
}

.sidebar-event-address {
    color: #4b5563;
    font-size: 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-event-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.sidebar-event-tag {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

.sidebar-event-tag.status-handled {
    background: #dcfce7;
    color: #166534;
}

.sidebar-event-tag.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.sidebar-event-tag.status-expired {
    background: #fee2e2;
    color: #dc2626;
}

.sidebar-event-tag.type {
    background: #ede9fe;
    color: #6b46c1;
}

/* 右侧内容区域 */
.right-content {
    flex: 1;
    display: flex;
    gap: 20px;
    min-height: 0;
}

.chat-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 400px;
    max-height: 600px;
}

.message {
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 16px 20px;
    border-radius: 12px;
    line-height: 1.6;
    max-width: 85%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

.system-message .message-content {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border: 1px solid #0ea5e9;
    color: #0c4a6e;
}

.user-message .message-content {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    margin-left: auto;
    border-radius: 18px 18px 4px 18px;
}

.ai-message .message-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 18px 18px 18px 4px;
    position: relative;
}

/* 导出按钮样式 */
.export-button {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: all 0.2s ease !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    backdrop-filter: blur(4px) !important;
}

.ai-message .message-content:hover .export-button,
.system-message .message-content:hover .export-button {
    opacity: 1 !important;
}

.export-button:hover {
    background: rgba(249, 250, 251, 0.98) !important;
    border-color: #9ca3af !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

.export-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

.export-button svg {
    width: 12px !important;
    height: 12px !important;
    stroke-width: 2.5 !important;
}

.ai-message .message-content.streaming::after {
    content: '|';
    color: #2563eb;
    animation: blink 1s infinite;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Markdown 样式 */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.4;
}

.message-content h1 {
    font-size: 1.5em;
    color: #2563eb;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.message-content h2 {
    font-size: 1.3em;
    color: #3b82f6;
}

.message-content h3 {
    font-size: 1.1em;
    color: #4f46e5;
}

.message-content p {
    margin: 8px 0;
    line-height: 1.6;
}

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

.message-content li {
    margin: 5px 0;
    line-height: 1.5;
}

.message-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.message-content code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.85em;
    line-height: 1.4;
}

.message-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    white-space: pre;
    word-wrap: normal;
}

/* 表格容器 - 添加滚动功能 */
.message-content .table-container {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
    position: relative;
}

.message-content .table-container::-webkit-scrollbar {
    height: 6px;
}

.message-content .table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.message-content .table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.message-content .table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 添加渐变提示用户可以滚动 */
.message-content .table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-content .table-container:hover::after {
    opacity: 1;
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    min-width: 400px;
    margin: 0;
    font-size: 0.9em;
}

.message-content th,
.message-content td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-content th {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.message-content tbody tr:nth-child(even) {
    background: #f8fafc;
}

.message-content tbody tr:hover {
    background: #f1f5f9;
}

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

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

.message-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 24px 0;
}

.message-content a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.message-content a:hover {
    border-bottom-color: #2563eb;
}

/* Mermaid 图表样式 */
.message-content .mermaid-container {
    margin: 16px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-content .mermaid {
    display: inline-block;
    max-width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.message-content .mermaid svg {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Mermaid图表在移动端的优化 */
@media (max-width: 768px) {
    .message-content .mermaid-container {
        padding: 12px;
        margin: 12px 0;
    }

    .message-content .mermaid svg {
        max-width: 100%;
        width: auto !important;
        height: auto !important;
    }
}

/* 响应式表格和内容 */
@media (max-width: 768px) {
    .message-content {
        max-width: 95%;
        padding: 12px 16px;
    }

    .message-content table {
        font-size: 0.8rem;
        min-width: 300px;
    }

    .message-content th,
    .message-content td {
        padding: 6px 8px;
        max-width: 120px;
        font-size: 0.75em;
    }

    .message-content pre {
        font-size: 0.75em;
        padding: 8px;
        max-height: 200px;
    }

    .message-content h1 {
        font-size: 1.2em;
    }

    .message-content h2 {
        font-size: 1.1em;
    }

    .message-content h3 {
        font-size: 1.05em;
    }
}

/* 输入区域 */
.input-container {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.8);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

#messageInput:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.875rem;
    color: #64748b;
}

/* 侧边栏样式 */
.quick-actions, .stats-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
}

.quick-actions h3, .stats-preview h3 {
    color: #2563eb;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
}

.quick-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

.stat-value {
    color: #2563eb;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-value:hover {
    color: #1d4ed8;
    transform: scale(1.05);
}


/* 响应式设计 */
@media (max-width: 1200px) {
    .right-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        gap: 15px;
    }

    .quick-actions, .stats-preview {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .main {
        flex-direction: column;
        gap: 15px;
    }

    .event-list-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .event-filters-inline {
        flex-direction: column;
        gap: 6px;
    }

    .event-filters-inline select {
        flex: none;
    }

    .sidebar-event-list {
        max-height: 200px;
    }

    .right-content {
        flex-direction: column;
        gap: 15px;
    }

    .sidebar {
        width: 100%;
        flex-direction: column;
        gap: 15px;
    }

    .quick-actions, .stats-preview {
        margin-bottom: 15px;
    }

    .title {
        font-size: 2rem;
    }

    .chat-messages {
        max-height: 400px;
    }

    .message-content {
        max-width: 95%;
    }

    /* 移动端语言切换器样式 */
    .language-switcher {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 15px;
    }

    .lang-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .title {
        font-size: 1.8rem;
    }

    .event-list-sidebar {
        max-height: 250px;
    }

    .sidebar-event-item {
        padding: 8px;
        font-size: 12px;
    }

    .sidebar-event-title {
        font-size: 12px;
    }

    .sidebar-event-meta {
        font-size: 10px;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .send-button {
        align-self: flex-end;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar,
.sidebar-event-list::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar-event-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-event-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-event-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 弹框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-list-modal {
    width: 90%;
    max-width: 1000px;
}

.event-detail-modal {
    width: 90%;
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.close:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 事件列表样式 */
.event-filters {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.event-filters select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.events-stats {
    background: #f1f5f9;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #475569;
}

.stats-text strong {
    color: #2563eb;
    font-weight: 600;
}

.stats-time {
    color: #64748b;
    font-size: 12px;
}

.event-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.event-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-item:hover {
    background: #f1f5f9;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.event-item-main {
    flex: 1;
}

.event-item-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 16px;
}

.event-item-meta {
    display: flex;
    gap: 15px;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}

.event-item-address {
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 8px;
}

.event-item-tags {
    display: flex;
    gap: 8px;
}

.event-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.event-tag.status-handled {
    background: #dcfce7;
    color: #166534;
}

.event-tag.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.event-tag.status-expired {
    background: #fee2e2;
    color: #dc2626;
}

.event-tag.type {
    background: #ede9fe;
    color: #6b46c1;
}

.event-item-actions {
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 12px;
}

/* 事件详情样式 */
.event-detail-container {
    padding: 30px;
    overflow-y: auto;
    max-height: 70vh;
}

.event-detail-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.event-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.event-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.event-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.event-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-detail-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.event-detail-value {
    font-size: 16px;
    color: #1f2937;
    word-break: break-all;
}

.event-detail-value.highlight {
    color: #2563eb;
    font-weight: 600;
}

.event-detail-value.success {
    color: #059669;
    font-weight: 600;
}

.event-detail-value.warning {
    color: #d97706;
    font-weight: 600;
}

.event-detail-value.danger {
    color: #dc2626;
    font-weight: 600;
}

.event-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
}

.event-status-badge.handled {
    background: #dcfce7;
    color: #166534;
}

.event-status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.event-status-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

/* 图片展示 */
.event-images {
    margin-top: 16px;
}

.event-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.event-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.event-image:hover {
    transform: scale(1.05);
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.event-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 20px;
}

.event-image:hover .event-image-overlay {
    opacity: 1;
}

/* 图片预览弹框 */
.image-preview-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.image-preview-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* 地图相关样式 */
.location-item {
    grid-column: 1 / -1;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.coordinates {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #475569;
}

.map-toggle-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.map-toggle-btn.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.location-map {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.map-info {
    background: #f8fafc;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}

.map-address {
    font-weight: 500;
}

/* 地图备用方案样式 */
.map-fallback {
    width: 100%;
    min-height: 300px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    overflow: hidden;
}

.static-map-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.map-info-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    backdrop-filter: blur(5px);
}

.map-info-overlay p {
    margin: 2px 0;
    font-weight: 500;
}

.map-fallback-content {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

.map-fallback-content p {
    margin: 8px 0;
    font-size: 14px;
}

.map-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.map-link {
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-link:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 5% 5%;
        width: 90%;
    }

    .modal-header,
    .event-filters,
    .event-detail-container {
        padding: 15px 20px;
    }

    .event-list-container {
        padding: 15px 20px;
    }

    .event-detail-grid {
        grid-template-columns: 1fr;
    }

    .event-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .event-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .event-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    /* 地图移动端优化 */
    .location-info {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .coordinates {
        text-align: center;
        font-size: 12px;
    }

    .map-toggle-btn {
        align-self: center;
    }

    .map-container {
        height: 250px;
    }

    .map-links {
        flex-direction: column;
        gap: 8px;
    }

    .map-link {
        justify-content: center;
    }
}