* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

/* 主容器 */
.main-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    height: 100vh;
}

/* 左侧面板 */
.left-panel {
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 搜索区域 */
.search-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* 机型选择器 */
.aircraft-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
}

.aircraft-selector label {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.aircraft-select {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
}

.aircraft-select:focus {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.aircraft-status {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* 结果 Tab 分页 */
.result-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: #666;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-btn .count {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.8;
}

/* 机型标签 */
.part-aircraft-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.part-aircraft-tag.boeing737 {
    background: #e3f2fd;
    color: #1976d2;
}

.part-aircraft-tag.boeing777 {
    background: #e8f5e9;
    color: #2e7d32;
}

.search-container {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    outline: none;
    background: white;
}

.search-btn {
    padding: 12px 20px;
    font-size: 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #ff5252;
}

/* 结果面板 */
.result-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.result-panel::-webkit-scrollbar {
    width: 8px;
}

.result-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.result-panel::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

/* PN 卡片 */
.part-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 5px solid #667eea;
    transition: all 0.3s;
    cursor: pointer;
}

.part-card:hover {
    box-shadow: 0 4px 20px rgba(102,126,234,0.2);
    transform: translateY(-2px);
}

.part-card.active {
    border-left-color: #f5576c;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.part-card.active .part-header {
    border-bottom-color: rgba(255,255,255,0.3);
}

.part-number {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.part-card.active .part-number {
    color: white;
}

.part-location {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.part-card.active .part-location {
    color: rgba(255,255,255,0.9);
}

.location-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.part-card.active .location-tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 描述分类区域 */
.desc-category {
    margin-top: 15px;
}

.desc-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.part-card.active .desc-label {
    color: rgba(255,255,255,0.8);
}

.desc-value {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    white-space: pre-wrap;
}

.part-card.active .desc-value {
    background: rgba(255,255,255,0.15);
    color: white;
}

.desc-reference .desc-value span {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.desc-reference .desc-value span:hover {
    background: #1976d2;
    color: white;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag-primary { background: #e3f2fd; color: #1976d2; }
.tag-success { background: #e8f5e9; color: #388e3c; }
.tag-warning { background: #fff3e0; color: #f57c00; }
.tag-info { background: #e0f7fa; color: #0097a7; }
.tag-secondary { background: #eceff1; color: #546e7a; }
.tag-danger { background: #ffebee; color: #d32f2f; }
.tag-purple { background: #f3e5f5; color: #7b1fa2; }
.tag-empty { background: #fafafa; color: #9e9e9e; }

.part-card.active .tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 有效性代码 */
.effect-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.effect-code {
    background: #ffecb3;
    color: #ff6f00;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: monospace;
}

.part-card.active .effect-code {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 父 PN 信息框 */
.parent-pn-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #388e3c;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.parent-pn-box .label {
    font-size: 11px;
    color: #388e3c;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.parent-pn-box .value {
    color: #1b5e20;
    font-weight: 600;
}

.parent-pn-box .value span {
    margin-right: 15px;
}

/* 子 PN 列表框 */
.sub-pn-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
}

.sub-pn-box .label {
    font-size: 11px;
    color: #1976d2;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.sub-pn-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sub-pn-item {
    background: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #1565c0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sub-pn-item:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-1px);
}

/* 详情弹窗中的子 PN 表格 */
.sub-pn-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sub-pn-table th {
    background: #e3f2fd;
    color: #1976d2;
    padding: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #90caf9;
}

.sub-pn-table td {
    padding: 10px;
    font-size: 13px;
    border: 1px solid #e3f2fd;
}

.sub-pn-table tr:nth-child(even) {
    background: #f5f9ff;
}

.sub-pn-table tr:hover {
    background: #e3f2fd;
}

/* 按钮组 */
.card-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.card-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.card-btn.primary {
    background: #667eea;
    color: white;
}

.card-btn.primary:hover {
    background: #5568d3;
}

.card-btn.secondary {
    background: #28a745;
    color: white;
}

.card-btn.secondary:hover {
    background: #218838;
}

/* 右侧 PDF 面板 */
.pdf-panel {
    background: white;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* PDF 工具栏 */
.pdf-toolbar {
    background: white;
    padding: 10px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pdf-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-control {
    display: flex;
    gap: 5px;
    align-items: center;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.page-input {
    width: 50px;
    padding: 3px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
}

.btn {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn:hover:not(:disabled) {
    background: #5568d3;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn.secondary {
    background: #28a745;
}

.btn.secondary:hover:not(:disabled) {
    background: #218838;
}

/* PDF 容器 */
.pdf-container {
    flex: 1;
    background: #525659;
    position: relative;
    overflow: auto;
}

#pdfCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdf-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    font-size: 15px;
    flex-direction: column;
    gap: 15px;
}

/* 模态框 */
.modal-overlay {
    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-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    width: 90%;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.detail-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.detail-box-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.detail-box-value {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.6;
}

.full-desc-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.full-desc-title {
    font-size: 14px;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 600;
}

.full-desc-content {
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.chapter-links span {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 6px;
    margin: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.chapter-links span:hover {
    background: #1976d2;
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.empty-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #6c757d;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.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); }
}
