File size: 4,191 Bytes
494c9e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// 首页:从信息密度视图打开的归因侧栏(与 attribution 页右栏共用 GLTR / inspector 结构)
@use "lmf-readout" as lmf;

// 复用 `dialog.scss` 的 `.dialog-overlay`;仅提高 z-index(低于侧栏),显隐仍由 TS 切换 `--visible`
.attribution-flow-backdrop.dialog-overlay {
  z-index: 10010;

  &:not(.attribution-flow-backdrop--visible) {
    display: none;
  }

  &.attribution-flow-backdrop--visible {
    display: flex;
  }
}

.attribution-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10020;
  // 与主栏 .resizer 列对齐:左侧 8px 给拖条热区,header/body 从内容区排版,避免与 LMF 叠层
  padding-left: 8px;
  // 宽度由 TS 按主区 right_panel / 窄屏 90vw 设置;未执行脚本前略窄于全屏
  width: 90vw;
  max-width: 100vw;
  box-sizing: border-box;
  height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg, #fafafa);
  border-left: 1px solid var(--border-color, #ddd);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0.2s;

  &.attribution-side-panel--open {
    transform: translateX(0);
    visibility: visible;
  }
}

.attribution-side-panel-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 1;
  cursor: col-resize;
  touch-action: none;
  background: transparent;

  &::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: var(--border-color, #ddd);
    transition: background-color 0.2s ease;
  }

  &:hover::before,
  &:active::before {
    background: var(--resizer-hover, #999);
  }
}

.attribution-side-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-color, #ddd);
  background: var(--bg-color, #fff);
}

.attribution-side-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.attribution-side-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attribution-side-panel-link {
  font-size: 9pt;
  color: var(--link-color, #06c);
  text-decoration: none;
  white-space: nowrap;

  &:hover {
    text-decoration: underline;
  }
}

.attribution-side-panel-close {
  border: none;
  background: transparent;
  font-size: var(--font-icon-size, 20px);
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-muted, #777);

  &:hover {
    color: var(--text-color, #333);
  }
}

// 与主栏 .right_panel > #results 一致:不外圈留白,避免 --panel-bg 与 .LMF(--text-area-bg)间出现灰缝;正文边距由全局 .LMF(_responsive.scss)承担
.attribution-side-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.attribution-panel-results {
  min-height: 120px;
}

// 归因确认弹窗内文案
.dialog-attribution-confirm-hint {
  margin-bottom: 12px;
  font-size: 9pt;
  color: var(--text-muted, #666);
  line-height: 1.4;
}

.dialog-attribution-confirm-target,
.dialog-attribution-confirm-context {
  margin-bottom: 10px;
  font-size: 9pt;

  .label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted, #666);
  }

  code {
    display: block;
    padding: 6px 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    word-break: break-all;
    font-family: lmf.$mono-font-stack;
  }

  .ctx-pre {
    margin: 0;
    max-height: 160px;
    overflow: auto;
    padding: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 8.5pt;
    font-family: lmf.$mono-font-stack;
  }
}

// 与主区 Tooltip `.predictions` 同结构,紧跟 Target prediction 下方
.dialog-attribution-confirm-topk.predictions-table {
  margin-top: 10px;
  font-size: 9pt;

  .topk-chart-row--pickable:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.06));
  }
}