/* 原创音乐工坊 —— 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: #f4f6fa; color: #2b2f36; }
header { background: linear-gradient(135deg, #4b6cb7, #182848); color: #fff; padding: 18px 32px; }
header h1 { font-size: 22px; }
header .sub { font-size: 12px; opacity: .85; margin-top: 4px; }
#steps { list-style: none; display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#steps li { padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.15); font-size: 13px; }
#steps li.active { background: #ffc861; color: #333; font-weight: bold; }
main { max-width: 1120px; margin: 22px auto; padding: 0 16px; }
section { background: #fff; border-radius: 12px; padding: 22px 26px; box-shadow: 0 2px 10px rgba(20,30,60,.08); }
h2 { font-size: 18px; margin-bottom: 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
h4 { font-size: 14px; margin-bottom: 8px; }
.hidden { display: none !important; }
.tiny { font-size: 12px; color: #6b7280; }
.tiny-btn { padding: 3px 10px; font-size: 12px; }
button, .button { display: inline-block; padding: 8px 18px; border-radius: 8px; border: 1px solid #c9d3e8;
  background: #fff; cursor: pointer; font-size: 14px; text-decoration: none; color: #2b2f36; }
button:hover, .button:hover { background: #f0f4ff; }
button.primary { background: #4b6cb7; border-color: #4b6cb7; color: #fff; }
button.primary:hover { background: #3a5aa5; }
button.ghost { border-style: dashed; }
button.big { padding: 11px 28px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.row-center { display: flex; justify-content: center; margin-top: 18px; }
.row-center.gap { gap: 12px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.grid-3 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.grid-3 input, .grid-3 select, select.mini { padding: 6px 8px; border: 1px solid #c9d3e8; border-radius: 6px; font-size: 13px; }
textarea { width: 100%; padding: 10px; border: 1px solid #c9d3e8; border-radius: 8px; font-size: 14px; line-height: 1.7; resize: vertical; font-family: inherit; }
.panel { background: #fafbfe; border: 1px solid #e3e8f2; border-radius: 10px; padding: 16px 20px; }
.panel-slim { background: #f7f9ff; border: 1px solid #dfe5f2; border-radius: 10px; padding: 12px 16px; margin-top: 10px; }
.status { margin-top: 14px; padding: 12px 16px; border-radius: 8px; background: #eef3ff; color: #3a5aa5; font-size: 13px; line-height: 1.8; }
.status.error { background: #fdeaea; color: #b3372f; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #9db1d9; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.recent { border: 1px solid #cfd9ee; background: #f7f9ff; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e3e8f2; }
.recent-item:last-child { border-bottom: none; }
.recent-item b { min-width: 140px; font-size: 14px; }
.recent-item .tiny { flex: 1; }
/* 歌词分段编辑 */
.ly-block { border: 1px solid #dfe5f2; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: #fff; }
.ly-block:focus-within { border-color: #4b6cb7; box-shadow: 0 0 0 2px rgba(75,108,183,.12); }
.ly-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ly-head .spacer { flex: 1; }
.ly-type { width: 92px; font-weight: 600; color: #3a5aa5; border: 1px solid #c9d3e8; border-radius: 6px; padding: 3px 6px; font-size: 13px; }
.ly-text { width: 100%; border: 1px dashed #dfe5f2; border-radius: 8px; padding: 8px; font-size: 14px; line-height: 1.8; }
/* 视图 */
.view-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.view-tabs .view { background: #fff; border: 1px solid #c9d3e8; }
.view-tabs .view.on { background: #4b6cb7; border-color: #4b6cb7; color: #fff; font-weight: bold; }
.view-tabs .spacer { flex: 1; }
.sheet { border: 1px solid #e3e8f2; border-radius: 10px; padding: 16px 18px; background: #fff; }
.jp-head { font-size: 15px; font-weight: bold; color: #3a5aa5; margin-bottom: 10px; }
.jp-section { margin: 14px 0 8px; font-weight: bold; color: #4b6cb7; font-size: 15px; border-left: 4px solid #ffc861; padding-left: 8px; }
.jp-line { margin-bottom: 14px; padding: 6px 10px; border-left: 3px solid #dfe5f2; }
.jp-linehead { font-size: 11px; color: #9aa3b2; margin-bottom: 6px; }
.jp-notes { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.jp-note { display: flex; flex-direction: column; align-items: center; min-width: 22px; }
.jp-oct { font-size: 11px; line-height: 8px; height: 8px; letter-spacing: -1px; }
.jp-num { font-size: 24px; line-height: 28px; font-weight: 600; padding: 0 1px; }
.jp-num.u1 { border-bottom: 2px solid #1f2430; }
.jp-num.u2 { border-bottom: 5px double #1f2430; }
.jp-num.rest { color: #9aa3b2; font-weight: 400; }
.jp-lyric { font-size: 13px; color: #1f2430; margin-top: 2px; white-space: nowrap; }
.jp-sol { font-size: 10px; color: #98a2b3; }
.jp-bar { display: inline-flex; flex-direction: column; align-items: center; margin: 0 12px 12px 0; padding: 6px 10px 8px; border-left: 2px solid #dfe5f2; min-width: 90px; vertical-align: top; }
.jp-barhead { display: flex; gap: 8px; font-size: 11px; margin-bottom: 6px; }
.jp-barno { color: #9aa3b2; }
.jp-chord { color: #4b6cb7; font-weight: bold; font-size: 12px; }
.jp-legend { margin-top: 12px; font-size: 12px; color: #6b7280; line-height: 1.8; border-top: 1px dashed #e3e8f2; padding-top: 10px; }
/* 档案 */
.archive { border: 1px solid #cfd9ee; border-radius: 10px; background: #f7f9ff; margin-bottom: 14px; }
.archive-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #e9eefb; font-weight: bold; border-radius: 10px 10px 0 0; }
.archive-body { padding: 10px 14px; font-size: 13px; line-height: 1.9; }
/* 播放控制条 */
.transport { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.transport button[disabled] { opacity: .45; cursor: not-allowed; }
.progress-wrap { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; }
.progress-wrap input[type="range"] { flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
  background: #dfe5f2; border-radius: 4px; outline: none; cursor: pointer; }
.progress-wrap input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px;
  border-radius: 50%; background: #4b6cb7; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: pointer; }
.progress-wrap input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%;
  background: #4b6cb7; border: 2px solid #fff; cursor: pointer; }
.progress-wrap .time { font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.vol { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; }
.vol input[type="range"] { width: 84px; }
.play-info { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
.state-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px;
  background: #eef1f7; color: #5b6472; border: 1px solid #e3e8f2; }
.state-pill.playing { background: #e4f6ea; color: #1c7a42; border-color: #bfe6cd; }
.state-pill.preparing { background: #fff4dd; color: #8a6100; border-color: #f2dfb4; }
.state-pill.paused { background: #eef3ff; color: #3a5aa5; border-color: #d3ddf5; }
.state-pill.error { background: #fdeaea; color: #b3372f; border-color: #f3cfcf; }
tr.track-silent td:first-child { opacity: .45; text-decoration: line-through; }
tr.track-silent { background: #fafafa; }
tr.track-solo td:first-child { font-weight: bold; color: #1c7a42; }
/* 乐器 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid #c9d3e8; background: #fff; cursor: pointer; font-size: 14px; user-select: none; }
.chip.on { background: #4b6cb7; color: #fff; border-color: #4b6cb7; }
.chip-tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; background: #ffc861; color: #5a4200; font-size: 10px; }
.tag-demo { background: #ffc861; color: #5a4200; padding: 0 4px; border-radius: 4px; font-size: 11px; }
.inst-group { margin-bottom: 10px; }
.inst-group-title { font-size: 13px; color: #3a5aa5; font-weight: 600; margin-bottom: 6px; }
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.chord-grid .cell { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: #6b7280; }
.chord-grid input { width: 100%; padding: 5px; text-align: center; border: 1px solid #c9d3e8; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
th, td { border: 1px solid #e3e8f2; padding: 6px; text-align: center; }
th { background: #f0f3fa; }
#osmdBox { border: 1px solid #e3e8f2; border-radius: 10px; padding: 12px; background: #fff; overflow-x: auto; }
footer { text-align: center; color: #9aa3b2; font-size: 12px; padding: 26px 16px; line-height: 1.8; }
@media print {
  body.printing header, body.printing footer, body.printing .view-tabs,
  body.printing .row-center, body.printing #osmdBox { display: none !important; }
  body.printing section { box-shadow: none; }
}
