*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } :root { --bg: #ffffff; --header-bg: #f0f0f0; --border: #d0d0d0; --selected-bg: #d4e6f9; --selected-border: #2266cc; --text: #222; --row-num-bg: #f5f5f5; --row-num-width: 50px; --toolbar-height: 36px; --status-height: 24px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; } html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); } #app { display: flex; flex-direction: column; height: 100vh; } /* Toolbar / formula bar */ #toolbar { display: flex; align-items: center; height: var(--toolbar-height); border-bottom: 1px solid var(--border); background: var(--header-bg); padding: 0 4px; flex-shrink: 0; } #cell-ref { width: 80px; text-align: center; font-weight: 600; border-right: 1px solid var(--border); padding: 0 8px; line-height: var(--toolbar-height); flex-shrink: 0; font-size: 12px; color: #555; } #formula-bar { flex: 1; border: none; outline: none; padding: 4px 8px; font-size: 13px; font-family: inherit; background: var(--bg); height: 100%; } #formula-bar:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--selected-border); } /* Table container */ #table-container { flex: 1; overflow: auto; position: relative; } #csv-table { border-collapse: collapse; table-layout: fixed; min-width: 100%; } /* Header row */ #table-head th { position: sticky; top: 0; z-index: 10; background: var(--header-bg); border: 1px solid var(--border); border-top: none; padding: 4px 6px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; cursor: default; height: 26px; font-size: 12px; max-width: 150px; } #table-head th.row-number-header { width: var(--row-num-width); min-width: var(--row-num-width); max-width: var(--row-num-width); position: sticky; left: 0; z-index: 11; text-align: center; background: var(--header-bg); } /* Column resize handle */ .col-resize-handle { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 4; } .col-resize-handle:hover, .col-resize-handle.active { background: var(--selected-border); opacity: 0.3; } th .header-content { display: flex; align-items: center; position: relative; overflow: hidden; text-overflow: ellipsis; } th .header-text { flex: 1; overflow: hidden; text-overflow: ellipsis; } th .header-edit-input { width: 100%; border: 1px solid var(--selected-border); outline: none; padding: 1px 4px; font-size: 12px; font-weight: 600; font-family: inherit; } /* Data cells */ #table-body td { border: 1px solid var(--border); padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 24px; cursor: cell; font-size: 13px; max-width: 150px; } #table-body td.row-number { position: sticky; left: 0; z-index: 1; background: var(--row-num-bg); text-align: center; font-size: 11px; color: #888; width: var(--row-num-width); min-width: var(--row-num-width); max-width: var(--row-num-width); cursor: default; user-select: none; } /* Selection */ td.selected { background: var(--selected-bg) !important; } td.cursor-cell { outline: 2px solid var(--selected-border); outline-offset: -1px; } /* Status bar */ #status-bar { height: var(--status-height); line-height: var(--status-height); border-top: 1px solid var(--border); padding: 0 12px; background: var(--header-bg); font-size: 11px; color: #666; flex-shrink: 0; } /* Command Palette */ #overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 99; } #overlay.hidden, #command-palette.hidden { display: none; } #command-palette { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); width: 460px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 100; overflow: hidden; } #command-input { width: 100%; border: none; border-bottom: 1px solid var(--border); padding: 12px 16px; font-size: 15px; outline: none; font-family: inherit; } #command-list { max-height: 300px; overflow-y: auto; } .command-item { padding: 8px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; } .command-item:hover, .command-item.active { background: var(--selected-bg); } .command-item .cmd-name { font-size: 14px; } .command-item .cmd-shortcut { font-size: 11px; color: #888; background: #eee; padding: 2px 6px; border-radius: 3px; } /* Sort Advanced Modal */ #sort-modal { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); width: 460px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 100; overflow: visible; } #sort-modal.hidden { display: none; } .modal-title { padding: 12px 16px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--border); } .modal-body { padding: 12px 16px; } .modal-body label { display: block; margin-bottom: 6px; font-size: 13px; color: #555; } #sort-input-wrap { position: relative; } #sort-columns-input { width: 100%; padding: 8px 10px; font-size: 14px; font-family: inherit; border: 1px solid var(--border); border-radius: 4px; outline: none; } #sort-columns-input:focus { border-color: var(--selected-border); box-shadow: 0 0 0 2px rgba(34,102,204,0.15); } #sort-autocomplete { position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); max-height: 180px; overflow-y: auto; z-index: 110; } #sort-autocomplete.hidden { display: none; } .ac-item { padding: 6px 10px; cursor: pointer; font-size: 13px; } .ac-item:hover, .ac-item.active { background: var(--selected-bg); } .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); } .modal-btn { padding: 6px 16px; font-size: 13px; font-family: inherit; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; } .modal-btn:hover { background: #f5f5f5; } .modal-btn-primary { background: var(--selected-border); color: #fff; border-color: var(--selected-border); } .modal-btn-primary:hover { background: #1a54a9; } /* Drag over style */ #table-container.drag-over { background: var(--selected-bg); }