/* CodeFlow · polish.css — 最后加载的精修层: 统一圆角/阴影/焦点/间距, 细化卡片、列表、评论、按钮 */
:root {
  --radius: 8px;
  --radius-sm: 6px;
  --ring: 0 0 0 3px rgba(242, 96, 31, .16);
  --shadow-xs: 0 1px 2px rgba(17, 17, 26, .04);
  --shadow: 0 10px 30px -6px rgba(17, 17, 26, .14), 0 2px 6px rgba(17, 17, 26, .05);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 基础 ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-feature-settings: "cv11", "ss01"; line-height: 1.55; }
::selection { background: #ffe0cf; color: var(--text); }
:focus-visible { outline: 2px solid var(--acc-2); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: #d6d6db transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d6db; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b9b9c0; }
.pill, .count, .pl-d, .pl-t, .wb-nums b, .stat b, .pf-num b, .age { font-variant-numeric: tabular-nums; }

/* ---------- 按钮 ---------- */
.btn { height: 32px; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { border-color: #d3d3d8; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--acc-2); }
.btn.sm { height: 30px; }
.btn.xs { height: 24px; box-shadow: none; }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-soft); border-color: transparent; }
.btn.primary, .btn.green, .btn.dark { box-shadow: 0 1px 2px rgba(217, 77, 16, .25), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .count { margin-left: 4px; padding-left: 8px; border-left: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.repo-actions .btn { gap: 6px; }

/* ---------- 输入框 ---------- */
input:not([type=checkbox]):not([type=radio]), select, textarea { transition: border-color .12s, box-shadow .12s; }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: #d3d3d8 !important; }
input:focus, select:focus, textarea:focus { border-color: var(--acc-2) !important; box-shadow: none !important; outline: none !important; }
::placeholder { color: #aeafb5; }

/* ---------- 顶栏与标签带 ---------- */
.hd { background: rgba(250, 250, 251, .86); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); }
.hd-search { box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
.hd-search:hover { border-color: #d3d3d8; }
.hd-nav-a { transition: color .12s, background .12s; }
.hd-nav-a.active { box-shadow: var(--shadow-xs), 0 0 0 1px var(--border-soft); }
.hd-ic { transition: background .12s, color .12s; }
.ptabs-nav a { transition: color .12s, border-color .12s; }
.ptabs-nav a:hover { border-bottom-color: var(--border); }
.ptabs-nav a.active:hover { border-bottom-color: var(--acc-2); }
.ptabs-nav a.active .pill { background: var(--peach); color: var(--acc-2); }
.hd-vis { border-radius: 10px; padding: 0 8px; }

/* ---------- 卡片 / 列表 ---------- */
.box, .file-box, .wb-list, .wb-rps, .pl, .rlist, .comment-box { border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden; }
.box-head, .file-box-head, .latest-commit, .pl-h { background: #fafafb; }
table.list th { background: #fafafb; font-weight: 500; letter-spacing: .1px; }
table.list tr.rowlink td, .issue-row, .pl-r, .wb-row, .wb-rp, .box-row { transition: background .1s; }
table.list tr.rowlink:hover td, .issue-row:hover, .pl-r:hover, .wb-rp:hover, .box-row:hover { background: #fbfbfc; }
.files td:first-child a:hover { color: var(--acc-2); }
.file-icon.dir, .files .ic { color: #8a8b92; }

/* Issue / 合并请求列表 */
.issue-row { padding: 12px 18px; gap: 12px; }
.issue-row .title { font-size: 14.5px; transition: color .1s; }
.issue-row .title:hover { color: var(--acc-2); }
.issue-row .meta { margin-top: 4px; color: var(--faint); }
.issue-row .st .ic { width: 16px; height: 16px; }

/* ---------- Issue 详情 ---------- */
.issue-title { font-size: 24px; font-weight: 600; letter-spacing: -.3px; line-height: 1.35; }
.issue-title .num { font-weight: 400; margin-left: 4px; }
.issue-sub { padding-bottom: 18px; margin-bottom: 22px; }
.state-pill { height: 28px; padding: 0 12px; font-size: 13px; font-weight: 600; gap: 6px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08); }
.state-pill.open { background: #1f883d; }

/* 时间线: 评论之间加竖线, 评论框带指向头像的小三角 */
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--border-soft); z-index: 0; }
.tl-item > .avatar { position: relative; z-index: 1; box-shadow: 0 0 0 4px #fff; }
.comment-box { position: relative; overflow: visible; border-color: var(--border); }
.comment-box::before { content: ""; position: absolute; left: -7px; top: 12px; width: 12px; height: 12px; background: #fafafb;
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.comment-head { background: #fafafb; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); padding: 9px 16px; }
.comment-box.self { border-color: #f6c9b0; }
.comment-box.self::before { background: var(--peach); border-color: #f6c9b0; }
.comment-box.self .comment-head { background: var(--peach); border-bottom-color: #fbe2d4; }
.comment-body { padding: 16px 18px; }
.tl-event { position: relative; z-index: 1; }

/* 合并框 */
.merge-box .icon-col { border-radius: 50%; width: 38px; height: 38px; box-shadow: 0 0 0 4px #fff; }
.merge-box .icon-col.ok { background: #1f883d; }

/* 右侧属性栏 */
.side-sec h4, .side-card h4 { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }

/* ---------- 工作台 ---------- */
.wb-top { background: linear-gradient(180deg, #fafafb, #f5f5f7); }
.wb-q { background: #fff; border: 1px solid var(--border-soft); box-shadow: var(--shadow-xs); padding: 18px 20px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.wb-q:hover { background: #fff; border-color: #f6c9b0; box-shadow: 0 6px 18px -8px rgba(242, 96, 31, .35); transform: translateY(-1px); }
.wb-q .ic { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 10px; background: var(--peach); order: -1; }
.wb-q > div, .wb-q > span:not(.ic) { flex: 1; min-width: 0; }
.wb-q b { font-size: 14.5px; margin-bottom: 3px; }
.wb-nums a { border: 1px solid transparent; transition: border-color .12s, background .12s; }
.wb-nums a:hover { background: #fff; border-color: var(--border-soft); color: var(--text); }
.wb-nums a b { font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
.wb-tabs a { transition: color .12s, border-color .12s; }
.wb-tabs a:hover { color: var(--text); }

/* ---------- 流水线 ---------- */
.pl-st .ic { width: 16px; height: 16px; }
.status-dot { box-shadow: 0 0 0 3px rgba(45, 164, 78, .14); }
.status-dot.failure { box-shadow: 0 0 0 3px rgba(196, 60, 47, .14); }
.status-dot.running { animation: cf-pulse 1.4s ease-in-out infinite; }
@keyframes cf-pulse { 50% { box-shadow: 0 0 0 5px rgba(242, 96, 31, .12); } }

/* ---------- 分段控件 ---------- */
.seg { border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); }
.seg a.active, .seg button.active { background: #fff; color: var(--text); box-shadow: inset 0 -2px 0 var(--acc-2); }

/* ---------- Markdown ---------- */
.md { line-height: 1.7; }
.md h1, .md h2 { padding-bottom: .3em; border-bottom: 1px solid var(--border-soft); letter-spacing: -.2px; }
.md code:not(pre code) { background: var(--bg-muted); border-radius: 4px; padding: .12em .4em; font-size: 87%; }
.md pre, .code-block { border-radius: var(--radius-sm); }
.md blockquote { border-left: 3px solid #f6c9b0; color: var(--muted); background: #fffaf7; padding: 6px 14px; border-radius: 0 6px 6px 0; }
.md table th { background: #fafafb; }

/* ---------- 浮层 ---------- */
.menu, .ref-pop { border-radius: 10px; border-color: var(--border-soft); }
.menu a, .menu button { border-radius: 6px; transition: background .1s; }
.modal { border-radius: 12px; }
.toast { border-radius: 10px; }

/* ---------- 空状态 / 页脚 ---------- */
.empty .big { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--bg-soft); align-items: center; }
.empty h3 { font-size: 16px; font-weight: 600; }
.footer { background: transparent; }
.footer-inner { color: var(--faint); }
.footer-inner a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 输入框组: 左输入框 + 右按钮拼成一体 (覆盖 flat.css 的全圆角 !important) */
.input-group > input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group > .btn { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; box-shadow: none; }

/* 切换页面时保持宽度不变: 始终保留滚动条轨道, 内容区保持最小高度, 避免左右跳动和页脚上下跳动 */
html { overflow-y: scroll; }
#app { min-height: calc(100vh - 160px); }

/* 表单控件获得焦点只改边框色, 不要外圈描边/发光 */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none !important; }
/* 只读的地址框点击时保持原样, 不高亮 */
input[readonly]:focus { border-color: var(--border) !important; }

/* ---------- 提交历史 ---------- */
.icon.flip, .flip { transform: rotate(180deg); }
.cm-h { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 6px; font-size: 15px; font-weight: 600; }
.cm-path { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--border-soft); font-size: 12.5px; max-width: 420px; }
.cm-path .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-path a { color: var(--faint); display: inline-flex; padding: 2px; border-radius: 50%; }
.cm-path a:hover { color: var(--text); background: var(--border-soft); }
.cm-day { position: relative; padding-left: 22px; margin-bottom: 18px; }
.cm-day::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: -18px; width: 1px; background: var(--border); }
.cm-day:last-of-type::before { bottom: 0; }
.cm-day-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.cm-day-h .dot { position: absolute; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--acc-2); }
.cm-day-h .faint { font-weight: 400; font-size: 12px; }
.cm-list { border: 1px solid var(--border-soft); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow-xs); }
.cm-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border-soft); transition: background .1s; }
.cm-row:first-child { border-top: 0; }
.cm-row:hover { background: #fafafb; }
.cm-row > .avatar { margin-top: 2px; }
.cm-main { flex: 1; min-width: 0; }
.cm-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.cm-title a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-more { border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); border-radius: 4px; font-size: 11px; line-height: 14px;
  padding: 0 5px; cursor: pointer; flex: none; }
.cm-more:hover, .cm-more.on { color: var(--text); border-color: var(--text); }
.cm-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cm-meta b { color: var(--text); font-weight: 500; }
.cm-body { margin: 8px 0 0; white-space: pre-wrap; font: 12.5px/1.6 var(--sans); color: var(--muted); background: var(--bg-soft);
  border-radius: var(--radius-sm); padding: 8px 12px; }
.cm-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.cm-sha { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.cm-sha > a { display: inline-flex; align-items: center; padding: 0 10px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.cm-sha > a:hover { background: var(--bg-soft); color: var(--acc-2); }
.cm-sha > .btn { border: 0 !important; border-left: 1px solid var(--border) !important; border-radius: 0 !important; box-shadow: none; }
.cm-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 4px; }
@media (max-width: 700px) { .cm-acts .btn.icon { display: none; } .cm-row > .avatar { display: none; } }

/* ---------- 提交详情 ---------- */
.cd-box .box-body { padding: 18px 20px; }
.cd-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.cd-body { margin: 12px 0 0; white-space: pre-wrap; font: 14px/1.7 var(--sans); color: var(--muted); }
.cd-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px;
  border-top: 1px solid var(--border-soft); background: #fafafb; }
.cd-author { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.cd-refs { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.cd-ref { display: inline-flex; align-items: center; gap: 6px; }
.cd-ref a { color: var(--text); }
.cd-sum { display: flex; align-items: center; gap: 12px; font-size: 13.5px; margin: 0 0 12px; }
.cd-sum .d-add { color: var(--green); font-family: var(--mono); font-weight: 600; }
.cd-sum .d-del { color: var(--danger); font-family: var(--mono); font-weight: 600; }
.cd-sum .btn { margin-left: auto; }

/* ---------- 差异视图 ---------- */
.diff-file { box-shadow: var(--shadow-xs); }
.diff-head { padding: 8px 14px !important; min-height: 0; align-items: center; cursor: pointer; user-select: none; font-weight: 500; }
.diff-head:hover { background: var(--bg-soft) !important; }
.diff-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.diff-name .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-name .chev { color: var(--faint); transition: transform .15s; flex: none; }
.diff-file.collapsed .diff-name .chev { transform: rotate(-90deg); }
.diff-file.collapsed .diff-body { display: none; }
.diff-file.collapsed .diff-head { border-bottom: 0; }
.diff-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; flex: none; }
.diff-stat .a { color: var(--green); } .diff-stat .d { color: var(--danger); }
.diff-stat .bar { display: inline-flex; gap: 1px; margin-left: 2px; }
.diff-stat .bar i { width: 7px; height: 7px; border-radius: 1px; background: var(--border); }
.diff-stat .bar i.a { background: var(--green); } .diff-stat .bar i.d { background: var(--danger); }

/* ---------- 文件列表: 每个条目最后一次提交 ---------- */
table.files td.name { white-space: nowrap; width: 30%; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
table.files td.msg { width: auto; max-width: 0; font-size: 13px; }
table.files td.msg a { color: var(--muted); text-decoration: none; }
table.files td.msg a:hover { color: var(--acc-2); text-decoration: underline; }
table.files td.size { color: var(--faint); text-align: right; white-space: nowrap; width: 90px; }
table.files td.age { color: var(--muted); text-align: right; white-space: nowrap; width: 110px; }
.skel { display: inline-block; height: 10px; width: 60%; max-width: 260px; border-radius: 3px; vertical-align: middle;
  background: linear-gradient(90deg, var(--bg-soft) 25%, #ececec 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
.skel.short { width: 56px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 700px) { table.files td.msg, table.files td.size { display: none; } }
