* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f5f5f5; color: #242424; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }
.page-shell { min-height: 100vh; width: 100%; padding-bottom: 20px; }
body.menu-open { overflow: hidden; }
.announcement { height: 34px; line-height: 34px; background: #fff8d6; color: #806b2e; overflow: hidden; white-space: nowrap; padding: 0 16px; font-size: 13px; }
.announcement-track { display: flex; width: max-content; animation: announcement-scroll 24s linear infinite; }
.announcement-track span { flex: 0 0 auto; padding-right: 64px; }
@keyframes announcement-scroll { to { transform: translateX(-50%); } }
.page-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; text-align: center; }
.results-heading { padding: 16px 16px 0; background: #f5f5f5; text-align: center; }
.search-row { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px; height: 64px; background: #fff; }
.search-row::before { content: ''; position: absolute; z-index: 1; left: 27px; top: 25px; width: 11px; height: 11px; border: 2px solid #999; border-radius: 50%; pointer-events: none; }
.search-row::after { content: ''; position: absolute; z-index: 1; left: 36px; top: 35px; width: 7px; height: 2px; background: #999; transform: rotate(45deg); transform-origin: left center; pointer-events: none; }
.search-input { min-width: 0; flex: 1; height: 40px; padding: 0 14px 0 40px; border: 1px solid #e5e5e5; border-radius: 20px; background: white; outline: none; }
.search-input:focus { border-color: #46ad6d; }
.search-button { width: 70px; height: 40px; border: 0; border-radius: 20px; color: white; background: #4caf50; }
.filter-bar { display: flex; height: 53px; padding: 12px 0; background: #fff; border-bottom: 1px solid #eee; }
.filter-button { flex: 1; min-width: 0; height: 28px; padding: 4px 12px; border: 0; border-right: 1px solid #f2f2f2; background: white; color: #444; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-button:last-child { border-right: 0; }
.filter-button::after { content: "⌄"; color: #999; margin-left: 5px; }
.filter-button.expanded::after { content: "⌃"; }
.filter-button.chosen { color: #39a866; }
.online-prompt { margin: 4px 0 0; color: #df514b; font-size: 12px; line-height: 17px; text-align: center; }
.results { padding: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.content-card { overflow: hidden; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: #fff; text-align: left; box-shadow: 0 2px 8px rgb(0 0 0 / 8%); color: inherit; }
.card-cover { display: block; width: 100%; height: 180px; object-fit: cover; background: #eee; }
.card-meta { padding: 12px; }
.card-title-row, .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.card-title-row { height: 20px; margin-bottom: 8px; }
.card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 600; }
.card-category { flex: 0 0 auto; padding: 2px 6px; border-radius: 4px; color: #4caf50; background: rgb(76 175 80 / 10%); font-size: 12px; line-height: 16px; }
.card-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0; }
.newness-mark { color: #35a866; font-size: 12px; line-height: 17px; }
.display-no { max-width: 100%; overflow: hidden; color: #999; font-size: 12px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.state-message { padding: 22px 8px; color: #999; text-align: center; font-size: 14px; }
.retry-button { margin: 4px; padding: 8px 18px; border: 0; border-radius: 4px; color: white; background: #3d9f66; }
.retry-button.secondary { color: #555; background: #eee; }
.scroll-sentinel { height: 1px; }
.menu-overlay { position: fixed; z-index: 10; top: 140px; bottom: 0; left: 0; right: 0; background: rgb(0 0 0 / 42%); }
.menu-panel { position: absolute; top: 0; left: 0; right: 0; max-height: min(65vh, 520px); overflow-y: auto; background: white; box-shadow: 0 4px 12px rgb(0 0 0 / 13%); }
.menu-option { display: block; width: 100%; min-height: 44px; padding: 10px 18px; border: 0; border-bottom: 1px solid #f1f1f1; background: white; color: #444; text-align: left; font-size: 14px; }
.menu-option.selected { color: #35a866; }
.option-check { float: right; color: #35a866; }
.menu-option:hover { color: #37a465; background: #fafafa; }
.menu-default { color: #999; }
.page-error { padding: 60px 20px; color: #777; text-align: center; }
.detail-header { position: relative; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 12px 16px; color: white; background: linear-gradient(135deg, #667eea, #764ba2); }
.detail-heading { position: absolute; left: 50%; max-width: calc(100% - 210px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); font-size: 16px; font-weight: 600; }
.detail-back, .detail-refresh { position: relative; z-index: 1; height: 36px; border: 0; color: white; background: rgb(255 255 255 / 20%); font-size: 14px; }
.detail-back { padding: 8px 12px; border-radius: 20px; }
.detail-refresh { width: 36px; padding: 0; border-radius: 50%; font-size: 20px; }
.detail-summary { min-height: 195px; margin: 16px; padding: 16px; border-radius: 8px; background: white; }
.detail-info-header { display: flex; align-items: center; justify-content: space-between; min-height: 55px; gap: 12px; margin-bottom: 12px; }
.detail-name-block { min-width: 0; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 25px; overflow-wrap: anywhere; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.detail-tag { padding: 4px 10px; border-radius: 12px; color: #4caf50; background: rgb(76 175 80 / 10%); font-size: 12px; line-height: 16px; }
.detail-info-row { display: flex; align-items: center; min-height: 47px; gap: 8px; padding: 12px 0; border-top: 1px solid #eee; }
.detail-info-label { flex: 0 0 auto; color: #999; font-size: 14px; line-height: 22px; }
.detail-info-value { color: #4caf50; font-size: 16px; font-weight: 700; line-height: 22px; overflow-wrap: anywhere; }
.copy-button { flex: 0 0 auto; padding: 6px 12px; border: 0; border-radius: 16px; color: white; background: linear-gradient(135deg, #667eea, #764ba2); font-size: 12px; line-height: 17px; }
.main-photo-panel, .more-photos-panel { margin: 16px; padding: 16px; border-radius: 8px; background: white; }
.detail-image { display: block; width: 100%; height: auto; border-radius: 8px; }
.detail-image[alt="图片加载失败"] { min-height: 60px; }
.more-photos-title { margin: 0 0 12px; color: #333; font-size: 16px; line-height: 24px; font-weight: 600; }
.more-photos-panel .detail-image + .detail-image { margin-top: 12px; }
.zoomable-image { cursor: zoom-in; }
.lightbox { position: fixed; z-index: 30; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgb(0 0 0 / 88%); }
.lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: rgb(30 30 30 / 65%); font-size: 30px; }
.gate { position: fixed; z-index: 100; inset: 0; display: grid; grid-template-rows: 56px minmax(0, 1fr) 130px 296px; background: #e2e2e2; }
.gate-header { position: relative; display: flex; align-items: center; justify-content: center; color: white; background: #4054b2; }
.gate-header strong { font-size: 18px; font-weight: 600; }
.gate-close { position: absolute; left: 13px; top: 0; height: 56px; width: 24px; padding: 0; border: 0; color: white; background: transparent; font-size: 25px; }
.gate-dim { background: #898989; }
.gate-form { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background: #fafafa; }
.gate-prompt { margin: 22px 0 19px; color: #42617b; font-size: 14px; }
.password-boxes { display: flex; gap: 12px; }
.password-box { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid #ddd; border-radius: 5px; background: white; }
.password-box.filled::after { content: "●"; color: #555; font-size: 14px; }
.gate-error { height: 20px; margin-top: 5px; color: #d94b46; font-size: 12px; }
.numeric-keyboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, 60px); gap: 8px; align-content: start; padding: 16px 17px 12px; background: #e4e4e4; }
.number-key { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: white; box-shadow: 0 2px 4px rgb(0 0 0 / 14%); }
.key-digit { color: #111; font-size: 23px; line-height: 27px; }
.number-key small { min-height: 14px; color: #999; font-size: 9px; line-height: 12px; }
.number-key.key-empty { visibility: hidden; }
.number-key.key-back { color: #536c80; background: #ddd; font-size: 28px; }
.number-key:disabled { cursor: default; opacity: .58; }
.number-key:nth-child(10) { grid-column: 1; grid-row: 4; }
.number-key:nth-child(11) { grid-column: 2; grid-row: 4; }
.number-key:nth-child(12) { grid-column: 3; grid-row: 4; }
.gate-locked { display: flex; align-items: center; justify-content: center; background: #4054b2; }
.gate-reopen { padding: 12px 18px; border: 0; border-radius: 5px; color: #4054b2; background: white; }
@media (max-width: 600px) {
  .page-shell { padding-bottom: 12px; }
  .card-grid { gap: 10px; }
  .card-cover { height: 174px; }
}
@media (max-height: 700px) {
  .gate { grid-template-rows: 56px minmax(80px, 1fr) 125px 270px; }
  .numeric-keyboard { grid-template-rows: repeat(4, 54px); }
}
@media (prefers-reduced-motion: reduce) {
  .announcement-track { animation: none; }
  .announcement-track span + span { display: none; }
}
