/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 登录页面 - 居中设计，自适应大小 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px 48px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    margin: 20px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group .hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

/* 按钮样式 */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    padding: 10px 20px;
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* 大按钮样式 - 用于重要操作 */
.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}

.btn-danger {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-danger {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 8px;
}

.btn-small:hover {
    background: #e0e0e0;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-page {
    padding: 8px 16px;
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-page:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-send:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 消息提示 */
.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    min-height: 20px;
}

.success-message {
    color: #27ae60;
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    min-height: 20px;
}

.message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

/* 应用布局 */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #333;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Tab导航 */
.tab-nav {
    display: flex;
    background: white;
    padding: 0 24px;
    border-bottom: 2px solid #e1e5eb;
}

.tab-btn {
    padding: 16px 32px;
    background: transparent;
    color: #666;
    border: none;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.main-content {
    flex: 1;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 搜索区域 - 满屏宽度 */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    width: 100%;
}

.search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-select {
    padding: 10px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.search-select:focus {
    outline: none;
    border-color: #667eea;
}

/* 表格区域 - 满屏宽度 */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
}

.ship-table {
    width: 100%;
    border-collapse: collapse;
}

.ship-table th,
.ship-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5eb;
}

.ship-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #333;
}

.ship-table tbody tr:hover {
    background: #f7fafc;
}

.ship-table td:last-child {
    white-space: nowrap;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

#page-info {
    color: #666;
    font-size: 14px;
}

/* 知识库聊天界面 - 自适应高度 */
.kb-container {
    display: flex;
    height: calc(100vh - 180px);
    gap: 16px;
    width: 100%;
}

.kb-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-width: 0;
}

.kb-sidebar {
    width: 220px;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    flex-shrink: 0;
}

.quick-questions-sidebar h4 {
    margin-bottom: 16px;
    color: #333;
}

.quick-tags-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-tag-sidebar {
    padding: 10px 12px;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.quick-tag-sidebar:hover {
    background: #667eea;
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.welcome-message h3 {
    color: #333;
    margin-bottom: 12px;
}

.chat-message {
    margin-bottom: 16px;
    max-width: 90%;
}

.chat-message.user {
    margin-left: auto;
    text-align: right;
}

.chat-message.assistant {
    margin-right: auto;
    text-align: left;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.chat-message.assistant .message-bubble {
    background: #f0f4ff;
    color: #333;
    border-radius: 12px 12px 12px 4px;
}

/* 输入区域 */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e1e5eb;
    display: flex;
    gap: 12px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
}

#chat-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-content.modal-detail {
    max-width: 95vw;
    width: 95vw;
    max-height: 90vh;
}

.modal-content.modal-detail .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 20px;
}

/* 大屏幕下弹框优化 */
@media (min-width: 1400px) {
    .modal-content.modal-detail {
        max-width: 90vw;
        width: 90vw;
    }
}

@media (min-width: 1920px) {
    .modal-content.modal-detail {
        max-width: 85vw;
        width: 85vw;
    }
}

.modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e5eb;
}

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-body p {
    color: #666;
}

.detail-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e1e5eb;
}

.detail-label {
    width: 120px;
    color: #888;
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.modal-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e1e5eb;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 配置页面 - 满屏自适应 */
.config-page {
    max-width: 100%;
    width: 100%;
}

.config-section {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    width: 100%;
}

.config-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-section-icon {
    font-size: 28px;
}

.config-section-header h2 {
    margin: 0;
    color: white;
    font-size: 20px;
}

.config-section > p.config-desc {
    padding: 16px 24px;
    color: #666;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e1e5eb;
}

.config-section form {
    padding: 24px;
}

.config-section .quick-questions-edit {
    padding: 24px;
}

.config-desc {
    color: #666;
    margin-bottom: 24px;
}

.db-section {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5eb;
}

.db-section:last-child {
    border-bottom: none;
}

.db-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 快捷问答编辑区域样式 */
.quick-questions-edit {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-questions-edit textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
}

.quick-questions-edit textarea:focus {
    outline: none;
    border-color: #667eea;
}

.quick-questions-edit button {
    align-self: flex-end;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.db-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.db-status {
    color: #27ae60;
}

.db-status-info {
    margin-top: 12px;
}

.file-input-label {
    cursor: pointer;
    display: inline-block;
}

.import-result {
    margin-top: 12px;
}

.schema-display {
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.schema-display h4 {
    margin-bottom: 12px;
    color: #333;
}

.schema-display pre {
    font-size: 12px;
    color: #666;
    white-space: pre-wrap;
}

/* 导入结果样式 */
.import-result-dialog {
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
}

.import-result-dialog h4 {
    margin-bottom: 12px;
    color: #333;
}

.import-result-dialog p {
    margin: 8px 0;
    color: #666;
}

.failed-reasons {
    margin-top: 12px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 6px;
}

.failed-reasons ul {
    margin: 8px 0 0 16px;
    color: #856404;
    font-size: 12px;
}

.success-box {
    border: 2px solid #27ae60;
    border-radius: 8px;
}

.error-box {
    border: 2px solid #e74c3c;
    border-radius: 8px;
}

/* 高级检索样式 */
.advanced-search-panel {
    margin-top: 16px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e1e5eb;
}

.advanced-search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

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

.advanced-item label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.advanced-item input {
    padding: 8px 12px;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    font-size: 14px;
}

.advanced-item input:focus {
    outline: none;
    border-color: #667eea;
}

.advanced-search-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 详情页面网格布局 */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.detail-card {
    background: #f7fafc;
    padding: 12px 16px;
    border-radius: 8px;
}

.detail-card-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.detail-card-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 详情页面分组美化样式 */
.detail-section {
    margin-bottom: 24px;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    overflow: hidden;
}

.detail-section-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section-icon {
    font-size: 18px;
}

.detail-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
}

.detail-card-enhanced {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e8ecef;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.detail-card-enhanced:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.detail-card-enhanced.wide {
    grid-column: span 2;
}

.detail-card-label-enhanced {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-card-label-enhanced::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    opacity: 0.6;
}

.detail-card-value-enhanced {
    font-size: 15px;
    color: #1f2937;
    font-weight: 600;
    word-break: break-all;
}

.detail-card-value-enhanced.primary {
    color: #667eea;
    font-size: 17px;
}

.detail-card-value-enhanced.highlight {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 4px 8px;
    border-radius: 4px;
    color: #4c51bf;
}

.detail-card-value-enhanced.number {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: #059669;
    font-size: 16px;
}

/* 响应式 - 更好的屏幕适配 */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header h1 {
        font-size: 18px;
    }

    .main-content {
        padding: 16px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-input,
    .search-select {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 16px;
    }

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

    .kb-container {
        flex-direction: column;
        height: calc(100vh - 180px);
    }

    .kb-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 150px;
        overflow-y: auto;
    }

    .quick-questions {
        flex-direction: column;
        align-items: flex-start;
    }

    .advanced-search-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-card-enhanced.wide {
        grid-column: span 1;
    }

    .result-table-wrapper {
        max-height: 300px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1400px) {
    .main-content {
        padding: 32px;
    }

    .search-section {
        padding: 24px;
    }

    .kb-sidebar {
        width: 280px;
        min-width: 280px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1920px) {
    .header {
        padding: 20px 48px;
    }

    .header h1 {
        font-size: 28px;
    }

    .tab-btn {
        padding: 20px 48px;
        font-size: 18px;
    }

    .main-content {
        padding: 40px;
    }

    .kb-sidebar {
        width: 320px;
        min-width: 320px;
    }
}

/* 知识库查询结果样式 */
.query-result {
    width: 100%;
}

.query-loading {
    color: #667eea;
    font-size: 14px;
}

/* SQL折叠样式 */
.sql-section-mini {
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.sql-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #334155;
    cursor: pointer;
}

.sql-header-mini:hover {
    background: #3d4a5c;
}

.sql-toggle-icon {
    color: #94a3b8;
    font-size: 14px;
    transition: transform 0.2s;
}

.sql-toggle-icon.expanded {
    transform: rotate(180deg);
}

.sql-label {
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sql-label::before {
    content: '📊';
}

.sql-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sql-content-wrapper.expanded {
    max-height: 200px;
}

.copy-sql-btn {
    background: #475569;
    color: #e2e8f0;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.copy-sql-btn:hover {
    background: #64748b;
}

.sql-code {
    color: #4ade80;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    padding: 12px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-summary {
    color: #22c55e;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 4px 8px;
    background: #dcfce7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-summary::before {
    content: '✅';
}

/* 结果表格单元格截断样式 */
.result-table-wrapper {
    max-height: 400px;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid #e1e5eb;
}

.result-table {
    border-collapse: collapse;
    font-size: 13px;
    min-width: 100%;
}

.result-table th {
    background: #f1f5f9;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e1e5eb;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.result-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #e1e5eb;
    color: #475569;
    white-space: nowrap;
    position: relative;
}

/* 可点击行样式 */
.result-table tbody tr.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.result-table tbody tr.clickable-row:hover {
    background: #f0f4ff;
}

/* 图片缩略图样式 */
.result-table .ship-image-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid #e1e5eb;
    transition: all 0.2s;
}

.result-table .ship-image-thumb:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.result-table td.truncated {
    cursor: pointer;
}

.result-table td.truncated:hover {
    background: #e0e7ff;
}

.result-table tbody tr:hover {
    background: #f8fafc;
}

/* 悬浮提示框样式 */
.cell-tooltip {
    position: fixed;
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 400px;
    word-break: break-all;
    white-space: normal;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
    pointer-events: none;
}

.cell-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1e293b;
}

.no-data {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

.query-error {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-icon {
    font-size: 24px;
}

.error-text {
    color: #dc2626;
    font-size: 14px;
}

.error-detail {
    color: #94a3b8;
    font-size: 12px;
}

/* 快捷问答标签样式 */
.quick-tag {
    padding: 10px 12px;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 1px solid transparent;
}

.quick-tag:hover {
    background: #667eea;
    color: white;
    border-color: #5a6fd6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 图片相关样式 */

/* 图片缩略图 - 用于列表显示 */
.ship-image-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid #e1e5eb;
    transition: all 0.2s;
}

.ship-image-thumb:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

/* 无图片占位 */
.no-image-placeholder {
    width: 60px;
    height: 60px;
    background: #f0f4ff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 24px;
}

/* 统一的弹框样式 */
.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.custom-modal.show {
    opacity: 1;
    visibility: visible;
}

.custom-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

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

.custom-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5eb;
    background: #f8fafc;
}

.custom-modal-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-modal-icon.success {
    background: #dcfce7;
    color: #16a34a;
}

.custom-modal-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.custom-modal-icon.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.custom-modal-icon.info {
    background: #dbeafe;
    color: #3b82f6;
}

.custom-modal-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    color: #333;
}

.custom-modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.custom-modal-close:hover {
    color: #333;
}

.custom-modal-body {
    padding: 24px;
    color: #666;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.custom-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e1e5eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 图片预览弹窗 */
.image-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.preview-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.preview-controls {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border-radius: 8px;
}

.preview-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.preview-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.preview-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preview-index {
    font-size: 14px;
}

.preview-zoom-controls {
    display: flex;
    gap: 8px;
}

.preview-zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.preview-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.preview-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 详情页图片展示 - 图片画廊 */
.image-gallery {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 8px;
}

.image-gallery-item {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #e1e5eb;
    transition: all 0.2s;
}

.image-gallery-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

/* 编辑页图片上传区域 */
.image-upload-area {
    border: 2px dashed #e1e5eb;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-hint {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12px;
}

/* 编辑页已有图片展示 */
.edit-image-gallery {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.edit-image-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.edit-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e1e5eb;
}

.edit-image-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.edit-image-delete-btn:hover {
    background: #c0392b;
}

/* 表单全宽度样式 */
.form-group.full-width {
    width: 100%;
}

/* 编辑页面输入框样式 - 在卡片内显示 */
.edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.edit-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-input:hover {
    border-color: #94a3b8;
}

/* 编辑卡片内输入框的布局调整 */
.detail-card-enhanced .edit-input {
    margin-top: 4px;
}

/* 编辑页面下拉框样式 */
.edit-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.edit-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 4L10 8H2z'/%3E%3C/svg%3E");
}

/* 字典管理样式 */
.dict-section {
    padding: 24px;
}

.dict-type-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dict-type-selector label {
    font-weight: 500;
    color: #333;
}

.dict-select {
    padding: 10px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 180px;
}

.dict-select:focus {
    outline: none;
    border-color: #667eea;
}

.dict-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.dict-list {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.dict-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e1e5eb;
    transition: all 0.2s;
}

.dict-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.dict-item:last-child {
    margin-bottom: 0;
}

.dict-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dict-item-value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.dict-item-label {
    color: #666;
    font-size: 13px;
}

.dict-item-badge {
    padding: 4px 8px;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 4px;
    font-size: 12px;
}

.dict-item-badge.default {
    background: #dcfce7;
    color: #16a34a;
}

.dict-item-actions {
    display: flex;
    gap: 8px;
}

.dict-item-actions button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: none;
}

.dict-edit-btn {
    background: #f0f4ff;
    color: #667eea;
}

.dict-edit-btn:hover {
    background: #667eea;
    color: white;
}

.dict-delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.dict-delete-btn:hover {
    background: #dc2626;
    color: white;
}

.dict-empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

/* ==================== 用户/角色/权限管理 ==================== */

.user-management-section,
.role-management-section,
.permission-management-section {
    padding: 24px;
}

.user-actions,
.role-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* 用户/角色表格 */
.user-table,
.role-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5eb;
}

.user-table th,
.user-table td,
.role-table th,
.role-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5eb;
    font-size: 14px;
}

.user-table th,
.role-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.user-table tbody tr:hover,
.role-table tbody tr:hover {
    background: #f7fafc;
}

.user-table td:last-child,
.role-table td:last-child {
    white-space: nowrap;
}

/* 操作按钮 */
.user-edit-btn,
.role-edit-btn {
    padding: 6px 12px;
    background: #f0f4ff;
    color: #667eea;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
    transition: all 0.2s;
}

.user-edit-btn:hover,
.role-edit-btn:hover {
    background: #667eea;
    color: white;
}

.user-delete-btn,
.role-delete-btn {
    padding: 6px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
    transition: all 0.2s;
}

.user-delete-btn:hover,
.role-delete-btn:hover {
    background: #dc2626;
    color: white;
}

.user-status-btn {
    padding: 6px 12px;
    background: #fef3c7;
    color: #d97706;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-status-btn:hover {
    background: #d97706;
    color: white;
}

.role-permission-btn {
    padding: 6px 12px;
    background: #dcfce7;
    color: #16a34a;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-permission-btn:hover {
    background: #16a34a;
    color: white;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

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

/* 空状态 */
.user-empty,
.role-empty,
.permission-empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-size: 14px;
}

/* 列表容器 */
.user-list,
.role-list {
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px;
}

/* 权限树（显示页） */
.permission-tree {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.permission-tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.permission-tree-level-0 {
    margin: 0;
    padding: 0;
}

.permission-tree-level-1,
.permission-tree-level-2,
.permission-tree-level-3,
.permission-tree-level-4,
.permission-tree-level-5 {
    padding-left: 24px;
}

.permission-item {
    margin: 2px 0;
}

.permission-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e5eb;
    transition: all 0.2s;
}

.permission-info:hover {
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.1);
}

.permission-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.permission-code {
    color: #94a3b8;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.permission-desc {
    color: #666;
    font-size: 12px;
    margin-left: auto;
}


/* ==================== 头部用户信息与操作按钮 ==================== */

.header-user-name {
    font-size: 14px;
    color: #1e293b;
    padding: 6px 14px;
    background: #eef2ff;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.header-user-name::before {
    content: '\1f464';
    margin-right: 6px;
    font-size: 13px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 6px;
    display: inline-block;
    align-self: center;
}

.btn-header-action {
    padding: 8px 16px;
    background: transparent;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn-header-action:hover {
    color: #667eea;
    border-color: #667eea;
    background: #f8faff;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.12);
}

.btn-header-logout {
    padding: 8px 18px;
    background: #fff;
    color: #ef4444;
    border: 1.5px solid #fecaca;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn-header-logout:hover {
    background: #fef2f2;
    border-color: #ef4444;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

/* ==================== 权限复选框树 ==================== */

.perm-tree-container {
    max-height: 400px;
    overflow-y: auto;
}

.perm-tree-node {
    margin: 2px 0;
}

.perm-checkbox-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.15s;
}

.perm-checkbox-label:hover {
    background: #f1f5f9;
}

.perm-checkbox {
    cursor: pointer;
}

.perm-code {
    color: #94a3b8;
    font-size: 12px;
}

/* ==================== 弹窗尺寸扩展 ==================== */

.modal-medium .modal-content {
    max-width: 560px;
}

.modal-medium .modal-body {
    max-height: 500px;
    overflow-y: auto;
}

/* ==================== 表单错误提示 ==================== */

.error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

/* ==================== 修改密码弹窗 ==================== */

#password-change-modal .custom-modal-content {
    max-width: 420px;
}

#password-change-modal .form-group {
    margin-bottom: 12px;
}

#password-change-modal .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: #475569;
}

#password-change-modal .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    font-size: 14px;
}

#password-change-modal .form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* ==================== 字段脱敏样式 ==================== */

/* 脱敏字段 - 可点击的 *** */
.masked-field {
    display: inline-block;
    color: #ef4444;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fef2f2;
    border: 1px dashed #fca5a5;
    transition: all 0.2s;
    user-select: none;
}

.masked-field:hover {
    background: #fee2e2;
    border-color: #ef4444;
    transform: scale(1.05);
}

/* ==================== 脱敏解锁弹窗 ==================== */

.mask-qr-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.mask-qr-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
}

.mask-qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.mask-qr-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.mask-qr-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.mask-qr-close:hover {
    color: #333;
}

.mask-qr-body {
    padding: 24px;
    text-align: center;
}

.mask-qr-hint {
    font-size: 15px;
    color: #555;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.mask-qr-images {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.mask-qr-img-wrapper {
    text-align: center;
}

.mask-qr-img-wrapper img {
    max-width: 160px;
    max-height: 160px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    object-fit: contain;
}

.mask-qr-footer {
    display: flex;
    justify-content: center;
    padding: 14px 24px 20px;
    border-top: 1px solid #f0f0f0;
}

/* ==================== 脱敏配置管理 ==================== */

.mask-config-section {
    max-width: 600px;
}

.qr-upload-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.qr-preview {
    max-width: 160px;
    max-height: 160px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    object-fit: contain;
}

/* ==================== 用户编辑-字段脱敏设置 ==================== */

.field-masking-section {
    margin-top: 4px;
}

.field-masking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.field-masking-header:hover {
    background: #f1f5f9;
}

.masking-toggle-icon {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.field-masking-grid {
    margin-top: 8px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    max-height: 280px;
    overflow-y: auto;
}

#masked-fields-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.field-masking-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: background 0.15s;
    white-space: nowrap;
}

.field-masking-checkbox:hover {
    background: #eef2ff;
}

.field-masking-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}