body { font-family: "Microsoft JhengHei", sans-serif; margin: 0; padding: 20px; background: #f5f5f5; display: flex; gap: 20px; } #control-panel { width: 240px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; gap: 15px; height: fit-content; } .control-group { display: flex; flex-direction: column; gap: 5px; font-size: 14px; } select, input[type="range"] { padding: 6px; border: 1px solid #ccc; border-radius: 4px; } button.action-btn { padding: 12px; background: #007bff; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; font-weight: 700; } #preview-container { display: flex; flex-grow: 1; background: #ddd; padding: 20px; overflow: auto; position: relative; } #paper-preview { background: #fff; padding: 20mm; box-sizing: border-box; width: 210mm; height: 297mm; } #editor { width: 100%; height: 100%; outline: none; writing-mode: vertical-rl; text-orient: upright; } #editor > div { min-height: 1em; display: flex !important; flex-direction: column; align-items: flex-start; margin-left: 10px; padding: 0 4px; } #editor > div:hover { background: rgba(0, 123, 255, 0.05); } #editor > div.selected-line { background: rgba(0, 123, 255, 0.1) !important; box-shadow: 0 0 0 1px #ff7675; } #line-floating-menu { display: none; position: fixed; bottom: 20px; left: 280px; background: #fff0f1; border: 2px solid #ff7675; padding: 12px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); z-index: 99999; flex-direction: column; gap: 8px; width: 210px; } #line-floating-menu h4 { margin: 0; color: #d63031; font-size: 14px; cursor: move; background: #ffe4e6; padding: 4px; border-radius: 4px; text-align: center; user-select: none; } .menu-btn-group { display: flex; gap: 4px; } .menu-btn-group button { flex: 1; padding: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; border-radius: 4px; font-weight: 700; } .menu-btn-group button.active { background: #28a745; color: #fff; border-color: #28a745; } .adjust-row { display: flex; align-items: center; gap: 5px; } .adjust-row button { padding: 4px 10px; border: 1px solid #ccc; background: #fff; cursor: pointer; border-radius: 4px; font-weight: 700; user-select: none; } .adjust-row button:hover { background: #eee; } .adjust-row input[type="range"] { flex-grow: 1; padding: 0; } @media print { #control-panel, #line-floating-menu { display: none !important; } body, #preview-container { background: #fff; padding: 0; margin: 0; } #paper-preview { width: 100% !important; height: 100% !important; box-shadow: none; /* 1. 移除原本的 flex 與置中設定,改為一般的區塊顯示 */ display: block !important; /* 2. 透過 padding 設定您需要的上邊界與右邊界 (數值可自由調整) */ padding-top: 30mm !important; /* 控制上方留白 */ padding-right: 30mm !important; /* 控制右側留白 */ padding-bottom: 0 !important; padding-left: 0 !important; /* padding: 0; display: flex !important; justify-content: center !important; align-items: center !important; */ } #editor { height: auto !important; /* width: auto !important; 加入這行,讓寬度貼合內容 */ max-height: 100% !important; } } @media print { @page { size: A4 portrait; margin: 0mm; } }