/**
 * 音乐搜索器 - CSS
 * 目标：更清爽、信息更聚焦、不过度“AI风”
 */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --brand: #2563eb;
  --brand-2: #0ea5e9;
  --surface: rgba(255, 255, 255, 0.60);
  --field-bg: #ffffff;
  --footer-bg: #0b1220;
  --footer-text: rgba(255, 255, 255, 0.86);
  --btn-ghost: rgba(15, 23, 42, 0.03);
  --btn-ghost-hover: rgba(37, 99, 235, 0.10);
}

/* 暗黑模式：仅通过变量切换，不改原功能 */
html.theme-dark {
  --bg: #0b1020;
  --card: rgba(17, 24, 39, 0.82);
  --text: #e5e7eb;
  --muted: rgba(229, 231, 235, 0.68);
  --border: rgba(148, 163, 184, 0.22);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
  --surface: rgba(17, 24, 39, 0.55);
  --field-bg: rgba(2, 6, 23, 0.35);
  --footer-bg: #050814;
  --footer-text: rgba(229, 231, 235, 0.84);
  --btn-ghost: rgba(148, 163, 184, 0.10);
  --btn-ghost-hover: rgba(37, 99, 235, 0.22);
}

html.theme-dark body {
  background: radial-gradient(1200px 600px at 20% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(14, 165, 233, 0.14), transparent 55%),
    var(--bg);
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "WenQuanYi Micro Hei", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Fira Sans", "Droid Sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(37, 99, 235, 0.10), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(14, 165, 233, 0.10), transparent 50%),
    var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

a {
  transition: all 0.2s ease;
}

/* 页面骨架 */
.about {
  background: transparent;
  color: var(--muted);
}

.about-color {
  color: var(--text);
}

.about-title {
  font-size: 34px;
  letter-spacing: 0.3px;
  text-align: center;
  margin: 0;
}

.about-subtitle {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px 18px 18px;
}

.about-topbar {
  display: flex;
  justify-content: flex-end; /* 移除左侧badge后，按钮靠右 */
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

/* 顶部左侧 badge 已移除（保留样式占位，避免旧缓存HTML时错乱） */
.about-topbar .about-badge {
  display: none;
}

.about-topbar a {
  color: var(--muted);
  text-decoration: none;
}

.about-topbar a:hover {
  color: var(--text);
}

.about-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.about-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap; /* 避免按钮内部文字被挤成竖排 */
}

.about-action-text {
  line-height: 1;
}

.about-action:hover {
  background: var(--btn-ghost-hover);
  color: var(--text);
}

html.theme-dark .about-action:hover {
  color: #e5e7eb;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* 搜索区域 */
.music-tabs > li > a {
  padding: 0.55em 1em;
  cursor: pointer;
  border-radius: 999px;
}

.music-tabs > li.am-active > a {
  background: rgba(37, 99, 235, 0.10);
  color: var(--text);
}

.music-main {
  display: none;
}

#j-input {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  height: 52px;
  box-shadow: var(--shadow-soft);
}

#j-input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), var(--shadow-soft);
}

.music-type .am-radio-inline,
.music-type label {
  color: var(--muted);
}

.music-type .am-icon-unchecked,
.music-type .am-icon-checked {
  color: var(--brand);
}

#j-submit {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
}

#j-submit:hover {
  filter: brightness(1.03);
}

#j-back {
  border-radius: 14px;
}

.music-main input {
  text-overflow: ellipsis;
}

.music-main input:focus,
.music-main input:hover {
  background: #f3f4f6;
  border-color: rgba(15, 23, 42, 0.18);
  color: #111827;
}

/* 帮助与示例 */
.music-tips {
  margin-top: 40px;
}

.music-tips blockquote {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 13px;
  margin-top: 18px;
  border-left: 4px solid rgba(37, 99, 235, 0.25);
}

.music-tips p span {
  display: inline-block;
  min-width: 66px;
  color: var(--muted);
}

.music-tips p b {
  font-weight: 600;
  color: #be123c;
}

.music-overflow {
  max-height: 200px;
  overflow: hidden;
}

.music-more {
  padding: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.05);
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  cursor: pointer;
}

.music-more:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--text);
}

/* 弹窗（公告/免责声明）
 * 注意：AmazeUI 的弹窗样式可能覆盖颜色，所以这里使用更高优先级 + 必要的 !important
 */
.am-popup .am-popup-inner {
  border-radius: 16px;
  overflow: hidden;
  background: var(--card) !important;
  color: var(--text) !important;
}

/* AmazeUI 默认弹窗是白底：暗黑模式下强制跟随主题 */
html.theme-dark .am-popup .am-popup-inner {
  background: var(--card) !important;
  color: var(--text) !important;
}

/* 更精确：确保公告/免责声明一定生效 */
#site-notice .am-popup-inner,
#copr-info .am-popup-inner {
  background: var(--card) !important;
  color: var(--text) !important;
}

.am-popup-hd {
  background: rgba(15, 23, 42, 0.03) !important;
  border-bottom: 1px solid var(--border) !important;
}

html.theme-dark .am-popup-hd {
  background: rgba(148, 163, 184, 0.10) !important;
}

.am-popup-title {
  font-weight: 700;
  color: var(--text) !important;
}

/* 公告/免责声明关闭按钮精修：更清晰、更好点 */
.am-popup-hd .am-close {
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  opacity: 0.75;
  color: var(--text) !important;
}

.am-popup-hd .am-close:hover {
  opacity: 1;
}

html.theme-dark .am-popup-hd .am-close {
  color: #e5e7eb !important;
}

.am-popup-bd {
  height: 100%;
  color: var(--muted) !important;
}

html.theme-dark .am-popup-bd {
  color: rgba(229, 231, 235, 0.82) !important;
}

/* 公告/免责声明弹窗：内容文字固定蓝色（后续你改内容也默认蓝色） */
#site-notice .am-popup-bd,
#copr-info .am-popup-bd {
  color: #2563eb !important; /* blue-600 */
}

html.theme-dark #site-notice .am-popup-bd,
html.theme-dark #copr-info .am-popup-bd {
  color: #60a5fa !important; /* blue-400 */
}

/* 强制正文内所有元素跟随弹窗正文颜色 */
#site-notice .am-popup-bd *,
#copr-info .am-popup-bd * {
  color: inherit !important;
}

.disclaimer {
  margin: 0;
  padding-left: 18px;
}

.disclaimer li {
  margin: 8px 0;
  line-height: 1.7;
  color: inherit !important; /* 跟随免责声明弹窗正文蓝色 */
}

.disclaimer strong {
  color: inherit !important;
  font-weight: 700;
}

/* 页脚 */
.footer {
  position: relative;
  left: 0;
  bottom: 0;
  width: 100%;
  overflow: hidden;
  margin-top: 24px;
}

.footer p {
  color: var(--footer-text);
  margin: 0;
  padding: 16px;
  text-align: center;
  background: var(--footer-bg);
}

.footer p a {
  color: rgba(255, 255, 255, 0.75);
}

.footer p a:hover {
  color: #ffffff;
}

.footer a {
  text-decoration: underline;
}

.am-alert {
  display: none;
}

/* 结果信息区（你截图的位置） */
.music-main .am-input-group {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: var(--card);
}

.music-main .am-input-group-label {
  background: rgba(15, 23, 42, 0.03);
  border-right: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(31, 41, 55, 0.85);
}

.music-main .am-input-group-label i {
  color: rgba(37, 99, 235, 0.85);
}

.music-main .am-form-field[readonly] {
  background: var(--field-bg);
  color: #111827;
}

.music-main .am-input-group-btn .am-btn {
  border: 0;
  background: var(--btn-ghost);
  color: rgba(31, 41, 55, 0.85);
}

html.theme-dark .music-main .am-input-group-btn .am-btn {
  color: rgba(229, 231, 235, 0.82);
}

.music-main .am-input-group-btn .am-btn:hover {
  background: var(--btn-ghost-hover);
  color: #111827;
}

html.theme-dark .music-main .am-input-group-btn .am-btn:hover {
  color: #e5e7eb;
}

.music-main .am-input-group-btn .am-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

/* 让两列更均衡，移动端也更紧凑 */
@media (max-width: 640px) {
  .music-main .am-input-group {
    border-radius: 12px;
  }
}

/* APlayer 微调 */
.aplayer {
  padding: 12px !important;
  margin: 0 !important;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.aplayer .aplayer-info .aplayer-music .aplayer-title,
.aplayer .aplayer-info .aplayer-music .aplayer-author {
  font-size: 16px !important;
  color: #374151 !important;
}

.aplayer .aplayer-list ol li .aplayer-list-index {
  display: inline-block;
  width: 20px;
  text-align: right;
}

.aplayer .aplayer-lrc p {
  color: var(--brand) !important;
}

.aplayer .aplayer-more {
  position: relative;
  font-size: 12px;
  padding: 8px 10px;
  margin-top: 10px;
  text-align: center;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

.aplayer .aplayer-more:hover,
.aplayer .aplayer-more:active {
  color: var(--brand);
}

.aplayer.aplayer-withlrc .aplayer-pic {
  width: 120px !important;
  height: 120px !important;
  box-shadow: inset 0 0 3px 0 rgba(0, 0, 0, 0.5);
}

.aplayer.aplayer-withlrc .aplayer-info {
  margin-left: 120px !important;
  height: 120px !important;
}

.aplayer.aplayer-withlist .aplayer-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 0 !important;
}

.aplayer.aplayer-withlist .aplayer-list {
  height: auto !important;
  padding-top: 18px;
  transition: none;
}

.aplayer.aplayer-withlist .aplayer-list-hide {
  padding: 0;
}

@media (max-width: 640px) {
  .about-title {
    font-size: 28px;
  }
  .about-card {
    padding: 18px 12px 12px;
    border-radius: 16px;
  }

  /* 手机端顶部：按钮独占一行且可换行，避免挤压 */
  .about-topbar {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .about-actions {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .about-action {
    padding: 7px 12px;
  }
}

@media (max-width: 420px) {
  /* 极小屏：只显示图标，文字隐藏，避免“主/题”“公/告”被挤成竖排 */
  .about-action {
    padding: 7px 10px;
  }

  .about-action-text {
    display: none;
  }

  .about-action i {
    margin-right: 0;
  }

  /* badge更紧凑 */
  .about-topbar .about-badge {
    padding: 6px 10px;
  }
}
