* {
    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, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部标题栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.95;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.connection-indicator.connected .connection-dot {
    background: #4caf50;
    animation: none;
}

.connection-indicator.disconnected .connection-dot {
    background: #f44336;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.header-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-actions button:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.mobile-users-toggle {
    display: none;
}

/* 登录视图 */
.login-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    flex: 1;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    min-height: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 40px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 0.8;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-secondary:active {
    background: #d0d0d0;
}

/* 聊天视图 */
.chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.chat-view.active {
    display: flex;
}

/* 聊天主体区域 */
.chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 消息列表区域 */
.messages-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    min-height: 0;
}

.messages-container {
    flex: 1;
    min-height: 300px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
    max-width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.mine {
    align-items: flex-end;
}

.message.theirs {
    align-items: flex-start;
}

.message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message.mine .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.theirs .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.text-message-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.message-text {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    max-width: 100%;
    max-height: 400px;
    overflow-y: auto;
    padding-top: 32px;
    margin-top: -32px;
}

.message-text.collapsed {
    max-height: none;
    overflow-y: visible;
    padding-top: 0;
    margin-top: 0;
}

.expand-text-btn {
    display: block;
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.message.mine .expand-text-btn {
    background: rgba(255, 255, 255, 0.3);
}

.message.theirs .expand-text-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #666;
}

.expand-text-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.message.theirs .expand-text-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.expand-text-btn:active {
    transform: scale(0.95);
}

/* 顶部按钮容器 */
.text-top-buttons {
    position: sticky;
    top: 0;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    align-self: flex-end;
    margin-bottom: -32px;
    margin-top: 4px;
    pointer-events: none;
}

.text-top-buttons > * {
    pointer-events: auto;
}

.text-message-container:hover .text-top-buttons {
    opacity: 1;
}

.text-top-buttons:hover {
    opacity: 1 !important;
}

/* 收起按钮 */
.collapse-text-btn {
    width: 48px;
    height: 28px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.message.mine .collapse-text-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.message.theirs .collapse-text-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #666;
}

.collapse-text-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.message.mine .collapse-text-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.message.theirs .collapse-text-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* 复制按钮 */
.copy-text-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.mine .copy-text-btn {
    background: rgba(255, 255, 255, 0.25);
}

.message.theirs .copy-text-btn {
    background: rgba(0, 0, 0, 0.08);
}

.copy-text-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.message.mine .copy-text-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.message.theirs .copy-text-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.copy-text-btn:active {
    transform: scale(0.9);
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

.message-video {
    max-width: 100%;
    width: 400px;
    max-height: 300px;
    border-radius: 8px;
    background: #000;
    display: block;
}

.video-container {
    max-width: 100%;
    width: 100%;
}

.image-container {
    max-width: 100%;
    width: 100%;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    max-width: 100%;
    min-width: 0;
}

.message.theirs .message-file {
    background: rgba(0, 0, 0, 0.05);
}

.file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.file-size {
    font-size: 12px;
    opacity: 0.7;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* 系统消息样式 */
.system-message {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
    animation: fadeIn 0.3s;
}

.system-message-text {
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 12px;
    border-radius: 12px;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
}

/* 消息发送者昵称 */
.message-sender {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    padding: 0 8px;
    font-weight: 500;
}

/* 文件接收进度 */
.file-receiving {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.message.mine .progress-bar {
    background: rgba(255, 255, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.message.mine .progress-fill {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
}

.progress-text {
    font-size: 12px;
    text-align: center;
    opacity: 0.8;
    font-weight: 600;
}

/* 输入区域 */
.input-area {
    background: white;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-controls {
    display: flex;
    gap: 10px;
}

.input-controls button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.input-controls button:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.input-controls button:active {
    background: #d0d0d0;
    transform: scale(0.95);
}

#messageInput {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    overflow-y: auto;
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendButton {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#sendButton:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sendButton:active {
    transform: scale(0.95);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 侧边栏 - 用户列表 */
.sidebar {
    width: 280px;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    color: #333;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.users-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 8px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
}

.status-indicator.connected {
    background: #4caf50;
}

.status-indicator.disconnected {
    background: #9e9e9e;
}

.user-info {
    flex: 1;
}

.user-address {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.public-key {
    font-size: 11px;
    color: #999;
    font-family: 'Courier New', monospace;
}

/* 浮动按钮 */
.floating-button {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: none;
}

.floating-button.active {
    display: block;
}

.floating-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.floating-toggle:hover {
    transform: scale(1.1);
}

/* 平板设备适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
        height: 95vh;
    }

    .sidebar {
        width: 240px;
    }

    .message-video {
        width: 350px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        align-items: stretch;
    }

    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .header {
        padding: 15px;
        min-height: 60px;
    }

    .header h1 {
        font-size: 18px;
        line-height: 1.2;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .connection-indicator {
        font-size: 12px;
    }

    .connection-dot {
        width: 6px;
        height: 6px;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .header-actions button {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-users-toggle {
        display: flex;
        padding: 8px 10px;
        min-width: 36px;
    }

    .chat-main {
        position: relative;
    }

    .messages-area {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .messages-container {
        flex: 1;
        padding: 12px;
        overflow-y: auto;
    }

    .message {
        margin-bottom: 12px;
    }

    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
    }

    .message-text {
        font-size: 15px;
        line-height: 1.4;
        max-height: 300px;
    }

    .message-text.collapsed {
        max-height: none;
    }

    .message-sender {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .message-time {
        font-size: 11px;
        margin-top: 4px;
    }

    /* 文本消息按钮 */
    .text-top-buttons {
        opacity: 1; /* 移动端始终显示 */
    }

    .copy-text-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .collapse-text-btn {
        width: 52px;
        height: 32px;
        font-size: 13px;
    }

    .expand-text-btn {
        font-size: 13px;
        padding: 6px 14px;
    }

    /* 系统消息 */
    .system-message {
        margin: 8px 0;
    }

    .system-message-text {
        font-size: 11px;
        padding: 5px 12px;
        max-width: 90%;
    }

    /* 图片在移动端自适应 */
    .message-image {
        max-width: 100%;
        max-height: 250px;
        width: auto;
        height: auto;
    }

    .image-container {
        max-width: 100%;
    }

    /* 视频在移动端自适应 */
    .message-video {
        max-width: 100%;
        width: 100%;
        max-height: 220px;
    }

    .video-container {
        max-width: 100%;
    }

    /* 文件消息 */
    .message-file {
        max-width: 100%;
    }

    .file-name {
        font-size: 13px;
    }

    .file-size {
        font-size: 11px;
    }

    /* 输入区域 */
    .input-area {
        padding: 12px 15px;
        gap: 8px;
    }

    .input-controls {
        gap: 6px;
    }

    .input-controls button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    #messageInput {
        font-size: 15px;
        min-height: 36px;
        max-height: 100px;
        padding: 8px 12px;
    }

    #sendButton {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 18px;
    }

    /* 侧边栏 */
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        transform: translateX(100%);
        border-left: none;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-header h3 {
        font-size: 16px;
    }

    .user-item {
        padding: 10px 12px;
    }

    .user-address {
        font-size: 14px;
    }

    .public-key {
        font-size: 11px;
    }

    /* 登录视图 */
    .login-view {
        padding: 20px;
    }

    .login-box {
        margin: 0;
        padding: 30px 20px;
        max-width: 100%;
    }

    .login-box h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-group input {
        font-size: 16px;
        padding: 12px 15px;
        border: 2px solid #e0e0e0;
        min-height: 44px;
    }

    .form-group input:focus {
        border-color: #667eea;
    }

    .btn {
        font-size: 16px;
        padding: 12px 20px;
        min-height: 44px;
        font-weight: 500;
    }

    .button-group {
        gap: 10px;
    }

    /* 通知位置 */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }

    .floating-button {
        right: 20px;
        bottom: 20px;
        top: auto;
        transform: none;
    }
}

/* 超小屏幕适配 (iPhone SE 等) */
@media (max-width: 375px) {
    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 16px;
    }

    .header-actions button {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }

    .mobile-users-toggle {
        padding: 6px 8px;
        min-width: 32px;
    }

    .login-box {
        padding: 25px 15px;
    }

    .login-box h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group input {
        font-size: 16px;
        padding: 10px 12px;
        min-height: 42px;
    }

    .btn {
        font-size: 15px;
        padding: 10px 16px;
        min-height: 42px;
    }

    .message-bubble {
        max-width: 90%;
        padding: 10px 12px;
    }

    /* 文本消息按钮 */
    .copy-text-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .expand-text-btn {
        font-size: 12px;
        padding: 5px 12px;
    }

    .input-area {
        padding: 10px 12px;
    }

    .input-controls button {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    #messageInput {
        font-size: 16px;
        min-height: 34px;
        padding: 8px 10px;
    }

    #sendButton {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 16px;
    }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #4caf50;
    color: white;
}

.notification.error {
    background: #f44336;
    color: white;
}

.notification.info {
    background: #2196f3;
    color: white;
}

/* 图片预览模态框 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.image-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.image-preview-header {
    padding: 15px 20px;
    background: #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.image-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.image-preview-actions {
    display: flex;
    gap: 10px;
}

.image-preview-actions button {
    padding: 8px 12px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}

.image-preview-actions button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.image-preview-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: auto;
}

.image-preview-body img {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    object-fit: contain;
    border-radius: 4px;
}

/* 移动端图片预览适配 */
@media (max-width: 768px) {
    .image-preview-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .image-preview-header {
        padding: 10px 15px;
    }

    .image-preview-body {
        padding: 10px;
    }

    .image-preview-body img {
        max-height: calc(95vh - 60px);
    }
}

/* 视频预览模态框 */
.video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.video-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.video-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.video-preview-header {
    padding: 15px 20px;
    background: #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

.video-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.video-preview-actions {
    display: flex;
    gap: 10px;
}

.video-preview-actions button {
    padding: 8px 12px;
    border: none;
    background: #3a3a3a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: #fff;
}

.video-preview-actions button:hover {
    background: #4a4a4a;
    transform: scale(1.05);
}

.video-preview-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-preview-body video {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    border-radius: 4px;
}

/* 移动端视频预览适配 */
@media (max-width: 768px) {
    .video-preview-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .video-preview-header {
        padding: 10px 15px;
    }

    .video-preview-body {
        padding: 10px;
    }

    .video-preview-body video {
        max-height: calc(95vh - 60px);
    }
}

/* 文本文件预览样式 */
.text-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.text-preview-content {
    position: relative;
    background: #1e1e1e;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 900px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.text-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #2d2d2d;
    border-bottom: 1px solid #3a3a3a;
    border-radius: 12px 12px 0 0;
}

.text-preview-title {
    font-weight: 600;
    font-size: 16px;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-preview-actions {
    display: flex;
    gap: 10px;
}

.text-preview-actions button {
    padding: 8px 12px;
    border: none;
    background: #3a3a3a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: #fff;
}

.text-preview-actions button:hover {
    background: #4a4a4a;
    transform: scale(1.05);
}

.text-preview-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    background: #1e1e1e;
    border-radius: 0 0 12px 12px;
}

.text-preview-body pre {
    margin: 0;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 0 0 12px 12px;
    overflow: auto;
    max-height: calc(90vh - 80px);
}

.text-preview-body code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    display: block;
    white-space: pre;
}

/* Prism 语法高亮样式覆盖 */
.text-preview-body pre[class*="language-"] {
    background: #1e1e1e;
    margin: 0;
    padding: 20px;
    border-radius: 0 0 12px 12px;
}

.text-preview-body code[class*="language-"] {
    background: transparent;
}

/* 移动端文本预览适配 */
@media (max-width: 768px) {
    .text-preview-content {
        max-width: 95vw;
        max-height: 95vh;
        width: 95vw;
    }

    .text-preview-header {
        padding: 10px 15px;
    }

    .text-preview-title {
        font-size: 14px;
    }

    .text-preview-actions button {
        padding: 6px 10px;
        font-size: 16px;
    }

    .text-preview-body pre {
        padding: 15px;
        max-height: calc(95vh - 60px);
    }

    .text-preview-body code {
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    .text-preview-header {
        padding: 8px 12px;
    }

    .text-preview-title {
        font-size: 13px;
    }

    .text-preview-actions {
        gap: 6px;
    }

    .text-preview-actions button {
        padding: 5px 8px;
        font-size: 14px;
    }

    .text-preview-body pre {
        padding: 12px;
    }

    .text-preview-body code {
        font-size: 12px;
    }
}
