/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 卡片样式 - 确保分界清晰 */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 20px;
}

/* 顶部导航 */
header {
    background: linear-gradient(to right, #e3f2fd, #bbdefb);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #42a5f5;
    cursor: pointer;
    padding: 5px 10px;
}

/* 主内容区 */
main {
    padding: 30px 0;
}

/* 标题卡片 */
.title-card h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 10px;
}

.title-card p {
    text-align: center;
    color: #666;
}

/* 解析方式选择 */
/* 解析方式选择 - 基础样式优化 */
.options-card {
    padding: 20px 20px 15px; /* 上20px，左右20px，下15px，减少底部留白 */
}

/* 标题与选项的间距增大 */
.options-card h3 {
    margin-bottom: 25px; /* 标题下方距离从20px增加到25px，拉开与选项的距离 */
    font-size: 1.2rem;
    color: #555;
    padding-left: 5px; /* 轻微左移，视觉上与选项对齐 */
}

/* 选项网格与底部的距离调整 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 保持3列横向排列 */
    gap: 15px;
    margin-bottom: 10px; /* 选项底部预留10px，确保与卡片下边缘距离适中 */
}

.parse-option {
    background: linear-gradient(145deg, #e3f2fd, #f0f7ff);
    border: 2px solid #90caf9;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
     padding: 20px 15px; /* 调整内边距，优化纵向空间 */
}

/* 响应式适配（小屏幕仍保持横向，避免换行） */
@media (max-width: 768px) {
    .options-grid {
        gap: 10px; /* 缩小间距 */
    }
    .parse-option {
        padding: 15px 10px; /* 减小内边距 */
    }
    .parse-option .option-icon {
        font-size: 2rem; /* 适当缩小图标 */
    }
    .parse-option div:last-child {
        font-size: 1rem; /* 适当缩小文字 */
    }
}

/* 超小屏幕（如手机竖屏）特殊处理（仍横向但更紧凑） */
@media (max-width: 480px) {
    .options-grid {
        gap: 8px;
    }
    .parse-option .option-icon {
        font-size: 1.8rem;
    }
    .parse-option div:last-child {
        font-size: 0.9rem;
    }
}

.parse-option .option-icon {
    font-size: 2.5rem;
    color: #42a5f5;
    margin-bottom: 15px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.parse-option div:last-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.parse-option:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 20px rgba(66, 165, 245, 0.2);
    border-color: #42a5f5;
}

.parse-option:hover .option-icon {
    transform: rotate(5deg) scale(1.1);
    color: #1976d2;
}

.parse-option:hover div:last-child {
    color: #1976d2;
}

.parse-option.active {
    background: linear-gradient(145deg, #bbdefb, #90caf9);
    border-color: #42a5f5;
    box-shadow: 0 5px 15px rgba(66, 165, 245, 0.15);
}

.parse-option.active .option-icon {
    color: #1565c0;
}

.parse-option.active div:last-child {
    color: #1565c0;
}

.parse-option::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #42a5f5, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.parse-option:hover::after {
    transform: translateX(100%);
}


.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(to right, #64b5f6, #42a5f5);
    color: white;
    width: 100%;
}

/* 下拉菜单 */
.select-container {
    position: relative;
}

.select-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 10;
    display: none;
}

.select-option {
    padding: 10px 15px;
    cursor: pointer;
}

.select-option:hover, .select-option.active {
    background: #bbdefb;
}

/* 搜索范围切换按钮（歌曲/专辑/歌单） */
.search-scope {
    display: flex;
    gap: 8px;
}

.scope-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #666;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.scope-btn:hover {
    border-color: #90caf9;
    color: #1976d2;
}

.scope-btn.active {
    background: linear-gradient(to right, #64b5f6, #42a5f5);
    border-color: #42a5f5;
    color: white;
    font-weight: 500;
}

/* 搜索结果：专辑/歌单条目 */
.search-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 10px;
    background: white;
}

.search-entry:hover {
    border-color: #bbdefb;
    background: #f7fbff;
}

.search-entry img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.search-entry .entry-main {
    flex: 1;
    min-width: 0;
}

.search-entry .entry-title {
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.search-entry .entry-sub {
    font-size: 0.88rem;
    color: #888;
    margin-top: 4px;
    word-break: break-all;
}

.search-entry .entry-actions {
    flex-shrink: 0;
}

/* 分页按钮（搜索/歌单共用） */
.page-number.active {
    background: linear-gradient(to right, #64b5f6, #42a5f5);
    color: white;
    border-color: #42a5f5;
}

/* 结果区域 */
.result-card {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.result-stats {
    color: #666;
    font-size: 0.9rem;
    margin: 10px 0 20px;
}

.result-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

/* 歌曲列表 */
.song-list {
    margin-bottom: 20px;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.song-index {
    width: 40px;
    text-align: center;
    color: #888;
}

.song-info {
    flex: 1;
    padding: 0 10px;
}

.song-info img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

.song-actions {
    padding: 0 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.page-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 3px;
    cursor: pointer;
    background: #f9f9f9;
}

.page-item.active {
    background: #42a5f5;
    color: white;
    border-color: #42a5f5;
}

.page-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 侧边栏设置 */
.settings-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 0;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.sidebar-content {
    padding: 15px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    box-sizing: border-box;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h4 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    color: #555;
}

.settings-section h4 .section-icon {
    margin-right: 10px;
    color: #42a5f5;
    font-weight: bold;
}

.settings-group {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.settings-group p {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9rem;
}

.radio-group {
    margin-bottom: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.radio-group input {
    margin-right: 10px;
}

.close-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.badge-recommend {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff8e1;
    color: #ff8f00;
}

.badge-downloading {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-failed {
    background: #ffebee;
    color: #c62828;
}

/* 单首歌曲结果样式 */
.single-result {
    display: none;
}

.song-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.song-artist {
    color: #666;
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-item {
    display: flex;
}

.info-label {
    color: #888;
    width: 70px;
}

.info-value {
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.action-buttons .btn {
    flex: 1;
}

.btn-secondary {
    background: #bbdefb;
    color: #333;
}

.back-link {
    color: #42a5f5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.back-link .back-text {
    margin-right: 5px;
}

/* 进度条样式 */
.song-progress {
    margin-top: 10px;
    display: none;
}

.progress-bar-container {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 侧边栏新增样式 */
.countdown-display {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: #42a5f5;
}

.qr-code-container {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.qr-code-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
    display: none;
}

/* 扫描结果文本框固定样式 */
#scan-result {
    resize: none;
}
/* 密码输入错误时的抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
/* 提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 300px;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #4caf50;
}

.toast.error {
    background-color: #f44336;
}

.toast.warning {
    background-color: #ff9800;
}

.toast.info {
    background-color: #2196f3;
}
#password-error {
    visibility: hidden;
    height: 1.2em;
    line-height: 1.2em;
    margin: 5px 0 0 0;
    padding: 0;
}

#password-error.visible {
    visibility: visible;
}

/* logo容器 - 确保版本号相对logo定位 */
/* logo容器：使用flex实现并排对齐 */
.logo-container {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    gap: 10px; /*  logo与版本号之间的间距 */
}

/* 版本号样式：酷炫金色+并排适配 */
.version-tag {
    /* 金色质感 */
    background: linear-gradient(135deg, #fff0c8, #ffd700); /* 温暖金色渐变 */
    color: #4a3728; /* 深棕文字，对比清晰 */
    font-weight: bold;
    font-size: 0.75rem; /* 适中尺寸，不抢镜 */
    
    /* 装饰细节 */
    padding: 3px 10px;
    border-radius: 15px; /* 圆润边角 */
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3); /* 柔和金色阴影 */
    border: 1px solid rgba(255, 215, 0, 0.2); /* 细边框增强质感 */
    
    /* 微交互 */
    transition: all 0.2s ease;
}

/* 悬停效果：增强交互感 */
.version-tag:hover {
    transform: scale(1.05); /* 轻微放大 */
    box-shadow: 0 3px 8px rgba(255, 215, 0, 0.5); /* 阴影加深 */
}

/* 响应式调整：小屏幕适配 */
@media (max-width: 768px) {
    .logo-container {
        gap: 6px; /* 缩小间距 */
    }
    .version-tag {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    .logo {
        font-size: 1.3rem; /* 适当缩小logo字体，避免拥挤 */
    }
}

/* 浮动按钮样式 */
/* 浮动按钮样式 - 圆形红色按钮 + 心型图标 */
.floating-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  /* 圆形关键样式 */
  width: 60px;
  height: 60px;
  border-radius: 50%; /* 圆形 */
  background: linear-gradient(135deg, #ff6b6b, #e5556e); /* 红色系渐变 */
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); /* 红色阴影 */
  font-size: 1.8rem; /* 心型图标大小 */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s ease;
  padding-bottom: 5px; /* 微调心型垂直位置，使其视觉上居中 */
}

.floating-btn:hover {
  transform: translateY(-3px) scale(1.05); /* hover时略微放大并上移 */
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, #e5556e, #c0392b); /* 加深的红色渐变 */
}

.floating-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .floating-btn {
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
    bottom: 20px;
    right: 20px;
    padding-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .floating-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    bottom: 15px;
    right: 15px;
    padding-bottom: 3px;
  }
}