:root { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: #23352e; background: #f6f7f3; font-size: 17px; }
* { box-sizing: border-box; }
body { margin: 0; }
main { margin: 0; padding: 32px 12px max(40px, env(safe-area-inset-bottom)); }
h1 { font-size: 32px; letter-spacing: 2px; margin: 0 0 24px; font-weight: 700; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #76a999; outline-offset: 3px; }
#search-form { display: flex; gap: 12px; }
#keyword { min-width: 0; flex: 1; height: 60px; border: 1px solid #b9c5bd; border-radius: 12px; padding: 0 18px; background: white; color: #23352e; font-size: 20px; -webkit-appearance: none; }
#keyword::placeholder { color: #818a83; }
#search-button { min-width: 108px; border: 0; border-radius: 12px; background: #24644e; color: white; font-weight: 600; }
#search-button:hover { background: #194d3b; }
#recent-section { margin-top: 16px; display: flex; align-items: baseline; gap: 12px; }
#recent-section[hidden] { display: none; }
.recent-label { color: #69766c; font-size: 14px; white-space: nowrap; }
#recent { display: flex; flex-wrap: wrap; gap: 4px 8px; }
#recent button { border: 0; border-radius: 8px; padding: 10px 12px; min-height: 44px; background: #e9ede7; color: #405e50; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.results-toolbar { margin: 32px 0 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#filters { display: flex; padding: 4px; gap: 4px; background: #e8ede7; border-radius: 12px; }
#filters button { min-height: 46px; border: 0; border-radius: 9px; padding: 10px 18px; color: #5a6c60; background: transparent; }
#filters button[aria-pressed="true"] { color: #1f5c46; background: white; box-shadow: 0 1px 4px #193d2410; font-weight: 600; }
#result-count { margin: 0; color: #718075; font-size: 14px; }
#status { color: #69766c; padding: 36px 18px; border: 1px dashed #cbd4ca; border-radius: 12px; text-align: center; line-height: 1.6; }
#status[hidden] { display: none; }
.notice { margin: 0 0 12px; padding: 13px 16px; background: #fff4df; border-radius: 10px; color: #795424; line-height: 1.6; font-size: 15px; }
#storage-note { margin-top: 12px; }
#results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.result { height: 550px; position: relative; min-width: 0; display: flex; flex-direction: column; background: white; border: 1px solid #e0e6de; border-radius: 12px; overflow: hidden; }
.result:hover { border-color: #80aa95; }
.result-link { flex: 0 0 168px; min-height: 0; overflow: hidden; display: block; padding: 12px 16px; color: inherit; text-decoration: none; }
.result-link::after { content: ''; position: absolute; inset: 0; }
.result-link:focus-visible { outline-offset: -4px; }
.result-text { display: block; min-width: 0; }
.result-title { display: block; font-size: 20px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { display: grid; grid-template-columns: 64px 90px minmax(0, 1fr); align-items: center; gap: 8px; height: 28px; flex-wrap: nowrap; margin-top: 8px; white-space: nowrap; font-size: 14px; color: #6f7c72; }
.result-singer, .result-info { display: block; height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; font-size: 16px; line-height: 1.5; color: #6f7c72; }
.lyrics-tag { padding: 2px 7px; border-radius: 5px; background: #e8f1e9; color: #356348; }
.unknown-tag { padding: 2px 7px; border-radius: 5px; background: #f0f1ed; color: #647064; }
.suspicious-tag { padding: 2px 7px; border-radius: 5px; background: #eeeeec; color: #686868; font-size: 12px; }
.result-preview { position: relative; flex-shrink: 0; display: block; width: 100%; height: 380px; padding: 0; border: 0; border-bottom: 1px solid #e0e6de; overflow: hidden; background: white; color: #718075; font: inherit; line-height: 1.6; text-align: center; }
.result.unavailable { opacity: .5; }
button.result-preview { z-index: 1; cursor: zoom-in; }
button.result-preview:focus-visible { outline-offset: -4px; }
.result-preview img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.preview-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; background: #f6f7f3; font-size: 16px; }
.text-preview { padding: 20px 16px; text-align: left; font-family: "PingFang SC", monospace; color: #405e50; overflow-wrap: anywhere; font-size: 20px; line-height: 1.8; }
.preview-line { display: block; white-space: pre-wrap; min-height: 1.8em; }
body.preview-open { overflow: hidden; }
#preview-dialog { width: min(1000px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #dce3d9; border-radius: 12px; color: inherit; background: #f6f7f3; }
#preview-dialog[open] { display: flex; flex-direction: column; }
#preview-dialog::backdrop { background: #14251fd1; }
.preview-toolbar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #dce3d9; background: white; }
.preview-toolbar h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-actions a, .preview-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid #c4d2c5; border-radius: 8px; color: #42634f; background: white; text-decoration: none; font-size: 16px; }
#preview-open { color: white; background: #24644e; border-color: #24644e; }
.preview-page { min-height: 0; overflow: auto; overscroll-behavior: contain; background: white; }
.preview-page img { display: block; width: 100%; height: auto; }
.preview-page .notice { margin: 16px; }
@media (min-width: 640px) { #results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { #results { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1360px) { #results { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#preview-status { color: #69766c; font-size: 14px; line-height: 1.6; }
#missing { margin-top: 26px; }
#missing summary { cursor: pointer; color: #42634f; padding: 12px 0; min-height: 44px; }
#missing-list { list-style: none; padding: 0; }
.missing-entry { padding: 18px; background: white; border: 1px solid #e0e6de; border-radius: 10px; margin-top: 10px; }
.missing-time { display: block; margin-top: 6px; font-size: 13px; color: #718075; }
.missing-entry p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
footer { margin-top: 36px; border-top: 1px solid #dce3d9; padding-top: 24px; }
h2 { font-size: 16px; margin: 0 0 14px; font-weight: 600; }
#site-links { display: flex; flex-wrap: wrap; gap: 10px; }
#site-links a { min-height: 48px; display: inline-flex; align-items: center; border: 1px solid #c4d2c5; border-radius: 10px; padding: 10px 16px; text-decoration: none; color: #42634f; font-size: 15px; background: #fdfefb; }
#site-links a[aria-disabled="true"] { opacity: .55; cursor: default; }
#links-note { color: #778277; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  main { padding: 25px 12px max(32px, env(safe-area-inset-bottom)); }
  h1 { font-size: 28px; margin-bottom: 20px; }
  #search-form { gap: 8px; }
  #search-button { min-width: 82px; }
  #keyword { height: 56px; padding: 0 12px; }
  #recent-section { display: block; }
  #recent { margin-top: 8px; }
  #filters { width: 100%; flex-wrap: wrap; }
  #filters button { flex: 1; padding: 10px 8px; font-size: 16px; }
  .result-meta { gap: 7px 10px; font-size: 13px; }
  .result-title { font-size: 18px; }
}

.result-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
