body { font-family: sans-serif; margin: 0; display: flex; flex-direction: column; height: 100vh; }
.navbar { background-color: #222; color: #fff; display: flex; padding: 0 20px; height: 45px; align-items: center; font-size: 14px; user-select: none; }
.nav-brand { font-weight: bold; margin-right: 30px; font-size: 15px; }
.nav-item { position: relative; padding: 0 15px; cursor: pointer; height: 100%; display: flex; align-items: center; }
.nav-item:hover { background-color: #444; }
.dropdown { display: none; position: absolute; top: 45px; left: 0; background-color: #fff; box-shadow: 0 4px 8px rgba(0,0,0,0.2); z-index: 2000; min-width: 180px; flex-direction: column; border: 1px solid #ccc; }
.nav-item:hover .dropdown { display: flex; }
.dropdown a { color: #333; padding: 12px 15px; text-decoration: none; font-size: 13px; }
.dropdown a:hover { background-color: #0074d9; color: white; }
.header { display: flex; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid #eee; background: #fff; }
.controls { display: flex; gap: 10px; align-items: center; }
.search-box { display: flex; gap: 5px; }
.mode-btn { padding: 5px 15px; border: 1px solid #0074d9; background: white; color: #0074d9; cursor: pointer; border-radius: 4px; transition: 0.2s; }
.mode-btn.active { background: #0074d9; color: white; }
.btn-danger { border-color: #ff4136; color: #ff4136; }
.btn-danger.active { background: #ff4136; color: white; }
.mode-btn:disabled { border-color: #ccc; color: #999; cursor: not-allowed; background: #f9f9f9; }
#edge-type-select { padding: 4px; border: 1px solid #0074d9; border-radius: 4px; color: #0074d9; display: none; }
.main-container { display: flex; flex: 1; gap: 15px; min-height: 0; min-width: 0; overflow: hidden; box-sizing: border-box; padding: 15px 20px 20px 20px; }
.db-container { display: none; flex-direction: column; flex: 1; padding: 20px; background: #fff; overflow-y: auto; }
.db-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #333; padding-bottom: 10px; margin-bottom: 15px; }
#filter-panel, #info-panel { flex-shrink: 0; padding: 15px; background: #eee; border: 1px solid #ccc; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; transition: width 0.3s ease, padding 0.3s ease; position: relative; box-sizing: border-box; }
#filter-panel.collapsed, #info-panel.collapsed { width: 40px !important; padding: 15px 5px; cursor: pointer; overflow: hidden; }
#filter-panel.collapsed > :not(.collapsed-label), #info-panel.collapsed > :not(.collapsed-label) { display: none !important; }
.resizer-right, .resizer-left { position: absolute; top: 0; width: 6px; height: 100%; cursor: ew-resize; z-index: 10; background: transparent; transition: background 0.2s; }
.resizer-right { right: 0; } .resizer-left { left: 0; }
.resizer-right:hover, .resizer-left:hover { background: #0074d9; }
#filter-panel.collapsed .resizer-right, #info-panel.collapsed .resizer-left { display: none; }
.no-transition { transition: none !important; }
.collapsed-label { display: none; writing-mode: vertical-rl; text-orientation: mixed; font-weight: bold; color: #555; align-items: center; justify-content: center; height: 100%; width: 100%; font-size: 14px; letter-spacing: 2px; user-select: none; }
#filter-panel.collapsed .collapsed-label, #info-panel.collapsed .collapsed-label { display: flex; }
.panel-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ccc; padding-bottom: 5px; margin-bottom: 5px; }
.panel-header h3 { margin: 0; font-size: 16px; }
.toggle-btn { background: none; border: none; font-size: 12px; cursor: pointer; color: #666; padding: 2px 5px; border-radius: 3px; }
.toggle-btn:hover { background: #ddd; color: #000; }
.filter-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 5px; }
.filter-group label { font-size: 13px; font-weight: bold; color: #333; }
.btn-reset { margin-top: 5px; padding: 8px; background: #333; color: white; border: none; border-radius: 4px; cursor: pointer; }
.choices[data-type*="select-multiple"] .choices__inner { padding: 2px 4px; min-height: 35px; border-radius: 4px; }
.choices__list--multiple .choices__item { padding: 2px 5px; font-size: 12px; margin: 2px; background-color: #0074d9; border: 1px solid #005bb5; }
.choices__input { font-size: 12px; }
.is-disabled .choices__inner { background-color: #e9ecef; cursor: not-allowed; }
#cy { flex: 1; min-width: 0; border: 1px solid #ccc; background-color: #fafafa; position: relative; }
.cover-img { max-width: 100%; height: auto; border: 1px solid #ddd; display: none; }
.info-link { color: #0074d9; text-decoration: none; border-bottom: 1px dashed #0074d9; cursor: pointer; transition: background-color 0.2s; }
.info-link:hover { background-color: #e6f2ff; }
#modal-overlay, #csv-modal-overlay, #edge-modal-overlay, #edge-change-overlay, #relation-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1005; }
#csv-modal-overlay { z-index: 2005; }
#edge-modal-overlay, #edge-change-overlay, #relation-overlay { z-index: 2505; }
#modal, #csv-duplicate-modal, #edge-modal, #search-modal, #relation-setup-modal, #edge-change-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px; border-radius: 8px; z-index: 1010; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
#modal { width: 500px; max-height: 80vh; overflow-y: auto; }
#csv-duplicate-modal, #relation-setup-modal, #edge-change-modal { width: 350px; }
#edge-modal { width: 300px; }
#search-modal { width: 320px; }
.book-item { display: flex; gap: 15px; padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: background 0.2s; }
.book-item:hover { background-color: #f0f0f0; }
.book-item img { width: 60px; height: 85px; object-fit: cover; border: 1px solid #ddd; }
.book-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.table-container { flex: 1; overflow-y: auto; margin-bottom: 15px; border: 1px solid #ddd; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { border: 1px solid #ddd; padding: 6px; text-align: left; }
.data-table th { background-color: #f4f4f4; position: sticky; top: 0; z-index: 1; }
.data-table input, .data-table select { width: 95%; padding: 4px; font-size: 12px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box; }
.table-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.close-btn { padding: 8px 15px; cursor: pointer; border: none; background: #333; color: white; border-radius: 4px; }
.save-btn { padding: 8px 15px; cursor: pointer; border: none; background: #0074d9; color: white; border-radius: 4px; }
#loading { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5000; background: rgba(255,255,255,0.9); padding: 20px; border-radius: 8px; border: 1px solid #ccc; font-weight: bold; }
.context-menu-item:hover { background-color: #f0f0f0; }