/* ================= 核心变量与重置 ================= */
:root {
  --primary: #0f172a;     
  --accent: #3b82f6;      
  --bg-body: #f8fafc;     
  --bg-card: #ffffff;
  --text-main: #334155;
  --text-sub: #64748b;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --trans: all 0.2s ease-in-out;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
}
a { text-decoration: none; color: inherit; transition: var(--trans); }

/* ================= 导航栏 ================= */
.navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; justify-content: space-between; align-items: center;
}
.brand { font-size: 18px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.nav-btn {
  font-size: 14px; font-weight: 500; color: var(--text-sub);
  cursor: pointer; padding: 6px 12px; border-radius: 6px;
}
.nav-btn:hover { color: var(--primary); background: #f1f5f9; }

/* ================= 主布局 ================= */
.main-container {
  max-width: 1100px; margin: 30px auto; padding: 0 20px;
  display: grid; grid-template-columns: 1.8fr 1.2fr; gap: 24px; align-items: start;
}
.left-column { display: flex; flex-direction: column; gap: 20px; }
.right-column { position: sticky; top: 90px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px;
}
.card h2, .card h3 { margin: 0 0 12px; color: var(--primary); font-weight: 600; font-size: 18px; }
.card p { margin: 0 0 16px; font-size: 14px; color: var(--text-sub); }

/* ================= 输入与解析 ================= */
.input-wrapper { position: relative; margin-bottom: 16px; }
.input-field {
  width: 100%; padding: 14px 16px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; transition: var(--trans); color: var(--primary);
}
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.btn-primary {
  width: 100%; padding: 14px; background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.3); transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 6px 10px -2px rgba(15, 23, 42, 0.4); }

.result-box {
  display: none; margin-top: 20px; padding-top: 20px;
  border-top: 1px dashed var(--border); animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }

.btn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 0; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-main); font-size: 12px; cursor: pointer;
}
.action-btn:hover { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }
.action-btn svg { width: 20px; height: 20px; stroke-width: 2; }

.notice { font-size: 13px; margin-top: 12px; min-height: 20px; text-align: center; }
.notice.success { color: #10b981; }
.notice.error { color: #ef4444; }

/* ================= 播放器样式 ================= */
.player-header { border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; margin-bottom: 12px; }
.player-title { font-size: 15px; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta { font-size: 12px; color: #94a3b8; margin-top: 2px; }
audio { width: 100%; height: 32px; border-radius: 4px; margin-top: 8px; }

/* ================= 优化后的弹窗动画 (向上/下平滑滑动) ================= */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; justify-content: center; align-items: center;
  
  /* 隐藏状态 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: #fff; width: 90%; max-width: 400px;
  padding: 30px; border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  position: relative;

  /* 初始动画状态：向下位移 40px */
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 激活后：滑动到正位 */
.modal-overlay.active .modal-window {
  transform: translateY(0);
}

.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 15px; color: var(--primary); }
.modal-text { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; line-height: 1.6; }
.modal-links { display: grid; gap: 10px; }
.link-btn { display: block; text-align: center; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.link-qq { background: #eff6ff; color: #3b82f6; }
.link-sponsor { background: #fef2f2; color: #ef4444; }
.close-modal {
  position: absolute; top: 15px; right: 15px; cursor: pointer;
  width: 24px; height: 24px; color: #94a3b8;
}

.footer { text-align: center; padding: 30px; color: #94a3b8; font-size: 13px; }

@media (max-width: 768px) {
  .main-container { grid-template-columns: 1fr; gap: 16px; }
  .right-column { position: static; }
  .btn-grid { grid-template-columns: repeat(2, 1fr); }
}
