* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #f6f7f9; color: #1f2329; font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef0f3; padding: 1px 6px; border-radius: 4px; }
button { font: inherit; padding: 6px 14px; border: 1px solid #cfd4db; background: #fff; color: #1f2329; border-radius: 6px; cursor: pointer; }
button:hover { background: #f0f2f5; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
button.primary:hover { background: #185ac0; }
button.danger { color: #c62828; border-color: #e6b3b3; }
button.ok { background: #1a7f37; border-color: #1a7f37; color: #fff; }
button.link { border: 0; background: none; color: #1f6feb; padding: 0 4px; }
input { font: inherit; padding: 7px 10px; border: 1px solid #cfd4db; border-radius: 6px; background: #fff; color: #1f2329; }
.hidden { display: none !important; }
.muted { color: #667085; }
.small { font-size: 12px; }
.err { color: #c62828; min-height: 1.4em; }
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 16px; }

.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 20px; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: #fff; border-bottom: 1px solid #e3e6ea; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 16px; }
.prod { flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions { display: flex; gap: 8px; }

.tabs { display: flex; gap: 4px; padding: 8px 18px 0; background: #fff; border-bottom: 1px solid #e3e6ea; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; white-space: nowrap; }
.tab.active { border-bottom-color: #1f6feb; color: #1f6feb; font-weight: 600; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #d93025; color: #fff; font-size: 12px; text-align: center; }

.notice { margin: 10px 18px 0; padding: 10px 14px; border-radius: 8px; background: #e8f3ff; border: 1px solid #b6d4fe; }
.notice.bad { background: #fdecea; border-color: #f5c2c0; }
.notice.good { background: #e7f5ea; border-color: #b7e0c0; }
.banner { margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; background: #fff7e0; border: 1px solid #f2d98a; }

main { padding: 14px 18px 90px; }
.editor-wrap { display: flex; gap: 12px; height: calc(100vh - 250px); min-height: 420px; }
.files { width: 240px; flex-shrink: 0; overflow-y: auto; background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 8px 0; }
.files .grp { padding: 8px 14px 2px; font-size: 12px; color: #667085; }
.files .f { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; padding: 6px 14px; background: none; }
.files .f.active { background: #e8f0fe; color: #1f6feb; }
.files .f.dirty::after { content: " ●已改"; color: #d97706; font-size: 12px; }
.editor { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #e3e6ea; flex-wrap: wrap; }
#text { flex: 1; width: 100%; border: 0; padding: 12px 14px; resize: none; font: 14px/1.75 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2329; background: #fff; outline: none; }

.deploy-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 18px; background: #fff; border-top: 1px solid #e3e6ea; flex-wrap: wrap; }
.deploy-bar input { flex: 1; min-width: 200px; }

.item { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.item .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item .acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #eef0f3; color: #475467; }
.tag.pending { background: #fff4e5; color: #b45309; }
.tag.approved, .tag.live { background: #e7f5ea; color: #1a7f37; }
.tag.rejected { background: #fdecea; color: #c62828; }
.tag.superseded { background: #eef0f3; color: #667085; }
.note { white-space: pre-wrap; margin: 6px 0; }
.chg { font-size: 13px; color: #475467; }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-card { background: #fff; border-radius: 12px; width: min(1000px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.modal-head, .modal-foot { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-head { border-bottom: 1px solid #e3e6ea; }
.modal-foot { border-top: 1px solid #e3e6ea; justify-content: flex-end; }
.modal-body { padding: 12px 16px; overflow-y: auto; }
.diff-file { margin-bottom: 14px; border: 1px solid #e3e6ea; border-radius: 8px; overflow: hidden; }
.diff-file h4 { margin: 0; padding: 6px 10px; background: #f6f7f9; font-size: 13px; }
.diff { margin: 0; padding: 6px 0; font: 13px/1.6 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
.diff div { padding: 0 10px; }
.diff .add { background: #e6ffec; }
.diff .del { background: #ffebe9; }
.diff .hunk { color: #667085; background: #f6f8fa; }
.issues { margin: 0 0 12px; padding-left: 18px; }
.issues .error { color: #c62828; }
.issues .warn { color: #b45309; }
.full-text { white-space: pre-wrap; font-size: 13px; background: #f6f7f9; border-radius: 8px; padding: 10px; }

@media (max-width: 760px) {
  .editor-wrap { flex-direction: column; height: auto; }
  .files { width: 100%; max-height: 180px; }
  #text { min-height: 60vh; }
  main { padding-bottom: 150px; }
}
