* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #333; padding: 10px 16px; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-shrink: 0; }
header h1 { font-size: 20px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select { padding: 6px 8px; font-size: 13px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; }

button { padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; cursor: pointer; font-size: 14px; white-space: nowrap; }
button:hover { border-color: #1890ff; color: #1890ff; }
button.danger { color: #ff4d4f; border-color: #ff4d4f; }
button.danger:hover { background: #ff4d4f; color: #fff; }
button.small { padding: 4px 10px; font-size: 13px; }
button.secondary { color: #666; }
button.primary { background: #1890ff; color: #fff; border-color: #1890ff; }
button.primary:hover { background: #40a9ff; color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.filter-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; flex-shrink: 0; }
.filter-bar select { padding: 4px 8px; }
.msg { font-size: 13px; } .msg.success { color: #52c41a; }
.toggle-auto { font-size: 13px; cursor: pointer; user-select: none; }
.toggle-auto input { vertical-align: middle; }

/* LP 单面板 */
.lp-panel { flex: 1; background: #fff; border-radius: 6px; padding: 6px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; flex-direction: column; min-height: 0; margin-bottom: 8px; }
.lp-panel h2 { font-size: 15px; margin-bottom: 4px; flex-shrink: 0; }
.count { font-weight: normal; color: #999; font-size: 14px; }

.table-wrap { overflow: auto; flex: 1; min-height: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { padding: 4px 8px; border-bottom: 1px solid #f0f0f0; text-align: left; }
th { background: #fafafa; font-weight: 600; position: sticky; top: 0; z-index: 1; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #e6f7ff; }
tbody tr.selected { background: #bae7ff; }
tbody tr.matched { opacity: 0.4; }

/* 已钩稽 */
.reconciled-section { background: #fff; border-radius: 6px; padding: 6px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); flex: 0 0 38%; display: flex; flex-direction: column; min-height: 0; }
.reconciled-section h2 { font-size: 15px; margin-bottom: 4px; flex-shrink: 0; }
.reconciled-section .table-wrap { flex: 1; min-height: 0; }
.reconciled-section th:nth-child(6) { text-align: center; }
#table-r tbody tr.auto { background: #fff; }
#table-r tbody tr.manual { background: #e6ffed; }
#table-r tbody tr:hover { background: #e6f7ff; }
#table-r tbody tr.auto.hidden { display: none; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: #fff; border-radius: 8px; padding: 24px; width: 1800px; max-width: 90vw; max-height: 80vh; overflow: auto; }
.modal-content h2 { margin-bottom: 16px; }
.upload-row { display: flex; flex-direction: column; gap: 8px; }
.upload-row input[type="text"], .upload-row input[type="password"] { padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }

.notes-cell { min-width: 120px; max-width: 300px; font-size: 12px; color: #666; word-break: break-word; cursor: text; border: 1px solid transparent; border-radius: 2px; padding: 2px 6px; }
.notes-cell:focus { border-color: #1890ff; outline: none; background: #fff; color: #333; }

.hidden { display: none; }

.about-body { font-size: 14px; line-height: 2; }
.about-body ul { padding-left: 20px; }
.about-body li { margin-bottom: 4px; }
.about-body hr { margin: 12px 0; border: none; border-top: 1px solid #f0f0f0; }
.about-body h3 { font-size: 15px; margin-bottom: 8px; }

.search-row { cursor: pointer; }
.search-row.selected { background: #bae7ff; }

.drag-handle { cursor: move; }
.drag-handle:active { cursor: grabbing; }
