d3ro-voice/apps/desktop/src/renderer/popups/suggestion-overlay/style.css

362 lines
7.5 KiB
CSS

/* Suggestion Overlay — 입력 인텔리전스 ghost text
*
* 팝업 스타일은 injectPopupTheme() 의 CSS 변수(--d3-*)로 테마를 따라간다.
* 토큰이 주입되지 않는 상황(개발 초기 로드)을 위해 :root 폴백을 둔다.
*
* 구조: [후보 3개 — 고정 높이] / 가는 선 / [진행률 · 출처] / [키 안내]
* 창 높이는 이 고정 치수에서 계산한다(main/windows/suggestion-overlay-geometry.ts) — 창을
* 그려진 패널 높이로 맞춰 투명 여백이 클릭을 삼키지 않게 한다. 높이에 영향을 주는 치수
* (#root/패널 패딩·테두리, .status, .suggestion-item, .candidates gap, .footer)를 바꾸면
* 그 파일도 함께 고친다. 각 줄은 내용과 무관하게 높이를 고정한다.
*/
@import '../_shared/popup-base.css';
/* 공통 바탕의 body 글자 크기·줄 높이가 고정 치수 계산을 흔들지 않도록 이 오버레이는 브라우저 기본값을 유지한다 */
body {
font-size: 16px;
line-height: normal;
}
:root {
--d3-bg-result: #111a30;
--d3-border-result: rgba(148, 180, 255, 0.12);
--d3-text-result: #eef2fb;
--d3-text-secondary: #93a4c8;
--d3-accent-main: #3b82f6;
--d3-accent-dim: rgba(59, 130, 246, 0.14);
--d3-shadow-popup: 0 8px 32px rgba(3, 7, 18, 0.5);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
[hidden] {
display: none !important;
}
html,
body {
background: transparent;
overflow: hidden;
user-select: none;
-webkit-app-region: no-drag;
font-family: var(--popup-font);
-webkit-font-smoothing: antialiased;
}
#root {
width: 100%;
height: 100%;
padding: 4px;
}
.suggestion-panel {
position: relative;
display: flex;
flex-direction: column;
padding: 6px;
border-radius: 10px;
background: var(--d3-bg-result);
border: 1px solid var(--d3-border-result);
box-shadow: var(--d3-shadow-popup);
opacity: 0;
transform: translateY(-2px);
transition: opacity 90ms ease-out, transform 90ms ease-out;
}
.suggestion-panel.visible {
opacity: 1;
transform: translateY(0);
}
/* ── 닫기 — 구석에 떠 있는 작은 버튼 (빈 헤더 줄을 두지 않는다) ── */
.close {
position: absolute;
top: 6px;
right: 6px;
z-index: 1;
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
border: 0;
border-radius: 5px;
background: transparent;
color: var(--d3-text-secondary);
cursor: pointer;
opacity: 0.7;
transition: background 90ms ease-out, color 90ms ease-out, opacity 90ms ease-out;
}
.close:hover {
background: var(--d3-accent-dim);
color: var(--d3-text-result);
opacity: 1;
}
/* ── 상태 (후보가 아직 없을 때만: 준비 중 / 생성 중) ── */
.status {
display: flex;
align-items: center;
gap: 8px;
height: 32px;
padding: 0 28px 0 8px;
}
.spinner {
width: 11px;
height: 11px;
flex: 0 0 auto;
border-radius: 50%;
border: 2px solid var(--d3-accent-dim);
border-top-color: var(--d3-accent-main);
animation: d3-spin 720ms linear infinite;
}
@keyframes d3-spin {
to {
transform: rotate(360deg);
}
}
.status-text {
color: var(--d3-text-secondary);
font-size: 12px;
}
/* 후보 없이 끝났을 때의 "제안 사항 없음" — 같은 자리에 스피너 없이 1초 */
.status.notice .spinner {
display: none;
}
.status.notice .status-text {
color: var(--d3-text-tertiary);
}
/* ── 후보 (한 페이지 = 3개, 각 최대 2줄, 고정 높이라 채워져도 창이 흔들리지 않는다) ── */
.candidates {
display: flex;
flex-direction: column;
gap: 2px;
}
.candidates:empty {
display: none;
}
.suggestion-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
height: 44px;
padding: 0 28px 0 8px;
border: 0;
border-radius: 7px;
background: transparent;
color: var(--d3-text-result);
font: inherit;
text-align: left;
cursor: pointer;
transition: background 90ms ease-out;
}
.suggestion-item:hover {
background: var(--d3-accent-dim);
}
.suggestion-item.active {
background: var(--d3-accent-dim);
box-shadow: inset 2px 0 0 var(--d3-accent-main);
}
.suggestion-num {
flex: 0 0 16px;
color: var(--d3-text-secondary);
font-size: 11px;
font-variant-numeric: tabular-nums;
text-align: right;
}
.suggestion-item.active .suggestion-num {
color: var(--d3-accent-main);
font-weight: 600;
}
.suggestion-text {
display: -webkit-box;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
font-size: 13px;
font-weight: 400;
line-height: 1.4;
word-break: keep-all;
overflow-wrap: anywhere;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.suggestion-item.active .suggestion-text {
font-weight: 500;
}
/* 첫 후보가 스트리밍으로 도착하는 중 — 도착한 만큼 보여주고 커서를 붙인다 */
.suggestion-item.streaming {
cursor: default;
opacity: 0.85;
}
.suggestion-item.streaming .suggestion-text::after {
content: '\258C';
animation: d3-caret-blink 1s steps(1) infinite;
color: var(--d3-accent-main);
}
@keyframes d3-caret-blink {
50% {
opacity: 0;
}
}
/* ── 아래쪽: 진행률·출처 한 줄 + 키 안내 한 줄 ── */
.footer {
display: flex;
flex-direction: column;
gap: 5px;
margin-top: 6px;
padding: 6px 8px 2px;
border-top: 1px solid var(--d3-border-result);
color: var(--d3-text-secondary);
font-size: 11px; /* 11px 미만 금지(v4) — 줄 높이 14px 고정이라 창 크기 계산은 그대로 */
line-height: 14px;
}
.footer-row {
display: flex;
height: 14px;
align-items: center;
justify-content: space-between;
gap: 12px;
white-space: nowrap;
}
.progress {
display: inline-flex;
align-items: center;
gap: 6px;
font-variant-numeric: tabular-nums;
}
.progress-more {
display: inline-flex;
align-items: center;
gap: 5px;
}
.progress-more .spinner {
width: 8px;
height: 8px;
border-width: 1.5px;
}
.provenance {
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.8;
}
.key-hints {
display: flex;
height: 16px;
align-items: center;
gap: 10px;
white-space: nowrap;
overflow: hidden;
}
.key-hint {
display: inline-flex;
align-items: center;
gap: 4px;
}
.key-hint.shared {
gap: 3px;
}
.key-hint.close-hint {
margin-left: auto;
}
kbd {
display: inline-flex;
align-items: center;
height: 16px;
padding: 0 4px;
border: 1px solid var(--d3-border-result);
border-bottom-width: 2px;
border-radius: 4px;
color: var(--d3-text-result);
font-family: inherit;
font-size: 11px;
line-height: 1;
min-width: 0;
}
/* ── 오타 교정 (후보와 함께 적용된다) — 지운 글자는 취소선, 고친 글자는 강조. 높이 26px 고정 ── */
.correction {
display: flex;
align-items: center;
gap: 6px;
height: 26px;
margin-bottom: 2px;
padding: 0 28px 0 8px;
overflow: hidden;
white-space: nowrap;
font-size: 12px;
color: var(--d3-text-secondary);
}
.correction-label {
flex: 0 0 auto;
padding: 1px 6px;
border-radius: 4px;
background: var(--d3-accent-dim);
color: var(--d3-accent-main);
font-size: 11px;
font-weight: 600;
}
.correction-diff {
overflow: hidden;
text-overflow: ellipsis;
}
.correction del {
color: var(--d3-status-danger);
text-decoration: line-through;
opacity: 0.85;
}
.correction ins {
color: var(--d3-accent-main);
text-decoration: none;
font-weight: 600;
}
.correction-arrow {
margin: 0 3px;
opacity: 0.7;
}
/* 후보 앞에 붙는 고친 글 — 이 글자들로 바뀐 뒤 후보가 이어진다는 표시 */
.suggestion-text .corrected {
color: var(--d3-accent-main);
font-weight: 600;
}