:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --primary: #7c001f;
    --primary-hover: #630019;
    --text-main: #0a0a0a;
    --text-sub: #4a4a4a;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --tag-bg: #f5e6e8;
    --tag-text: #800020;
}

@font-face {
    font-family: "ZiYueYingYinSong-2";
    src: url("fonts/ZiYueYingYinSong-2.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "AaGuDianKeBenSongYouMoBan";
    src: url("fonts/AaGuDianKeBenSongYouMoBan-2.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Note-Script-SemiBold-2";
    src: url("fonts/Note-Script-SemiBold-2.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ZhengQingKeNanBeiCiGongPuSongTi-2";
    src: url("fonts/ZhengQingKeNanBeiCiGongPuSongTi-2.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

button,
input,
textarea,
select {
    font: inherit;
}

body.splash-active {
    overflow: hidden;
}

#app {
    transition: filter 0.9s ease;
}

body.splash-active #app {
    filter: blur(8px);
    pointer-events: none;
}

#backBtn {
    margin-bottom: 0;
}

.detail-top-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#nextSongBtn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.back-to-top-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(124, 0, 31, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    z-index: 50;
    display: grid;
    place-items: center;
    backdrop-filter: blur(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.back-to-top-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 0, 31, 0.35);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.back-to-top-btn.is-hiding {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(4px) scale(0.94);
}

.back-to-top-btn span {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 768px) {
    .back-to-top-btn {
        right: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }
}

.splash-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.08em;
    z-index: 100;
    cursor: pointer;
    transition: opacity 0.9s ease, filter 0.9s ease;
}

.splash-title {
    font-size: 2.6rem;
    font-family: "Note-Script-SemiBold-2", "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.splash-subtitle {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #999;
    letter-spacing: 0.04em;
}

/* 弹窗：别处指南 */
.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: min(560px, 84vw);
    max-height: 80vh;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.modal-title {
    font-family: "AaGuDianKeBenSongYouMoBan", sans-serif;
    color: var(--primary);
    font-weight: 800;
    text-align: center;
    margin: 0;
    padding: 0 44px;
}

.modal-body {
    font-family: "AaGuDianKeBenSongYouMoBan", "PingFang SC", sans-serif;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 16px 16px;
    overflow: auto;
}

.modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
}

.splash-screen.exit {
    opacity: 0;
    filter: blur(10px);
}

header {
    background: var(--card-bg);
    padding: 12px 24px 0;
    /* 调整内边距，底部为0 */
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    /* 添加底部边框 */
}

.header-bar {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    gap: 16px;
    /* 减小主区域和导航栏的间距 */
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-nav {
    display: flex;
    align-items: stretch;
    /* 让 a 元素撑满高度 */
    font-size: 0.9rem;
    padding-top: 4px;
}

.header-nav a {
    color: var(--text-sub);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px 6px 0 0;
    /* 圆角只保留顶部 */
    transition: all 0.2s ease-out;
    position: relative;
    bottom: -1px;
    /* 用于对齐边框 */
    border: 1px solid transparent;
    border-bottom: none;
    /* 默认无下边框 */
}

.header-nav a:hover {
    color: var(--primary);
    background: var(--card-bg);
    transform: translateY(-4px);
    /* 向上“突出” */
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border);
    border-bottom: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.echo-mode .header-controls {
    display: none;
}


h1 {
    font-size: 1.4rem;
    font-family: "Note-Script-SemiBold-2", "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.compact-search {
    position: relative;
    display: flex;
    gap: 6px;
}

.search-mode-btn {
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-sub);
    transition: border 0.2s, color 0.2s;
}

.search-mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.compact-search input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    width: 210px;
    outline: none;
    transition: border 0.2s;
}

.compact-search input:focus {
    border-color: var(--primary);
}

.search-btn {
    padding: 8px 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.search-btn:hover {
    opacity: 0.9;
}

.search-back-btn {
    padding: 8px 12px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.search-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.search-mode-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: flex;
    gap: 6px;
    z-index: 20;
}

.search-mode-menu button {
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.search-mode-menu button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.match-entry-btn {
    display: block;
    margin: 16px auto 0;
    padding: 10px 20px;
    background: transparent;
    border: 1px dashed var(--primary);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.match-entry-btn:hover {
    background: var(--tag-bg);
}

.layout-toggle-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.layout-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 视图容器 */
.hidden {
    display: none !important;
}

#libraryView,
#detailView,
#searchResultsView,
#albumListView,
#albumDetailView,
#infoView,
#matchPanel {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

/* 曲库列表 - 默认单列垂直布局 */
.song-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 网格布局模式 */
.song-grid.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.search-results-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.search-results-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.search-results-summary {
    margin-top: 6px;
    color: var(--text-sub);
    font-size: 0.9rem;
}

/* 匹配结果也使用相同布局 */
#matchResult .song-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#matchResult .song-grid.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.song-item {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* 网格布局下的歌曲卡片 */
.song-grid.grid-layout .song-item {
    display: flex;
    flex-direction: column;
}

.song-item:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.song-item:hover .song-title,
.song-item:hover .song-date,
.song-item:hover .song-keysentence {
    color: #fff;
}

.song-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.song-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.song-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.song-keysentence {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin-top: 6px;
    font-style: italic;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.song-keysentence .search-keyword-hit {
    color: #7c001f;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(124, 0, 31, 0.35);
}

.song-item:hover .song-keysentence .search-keyword-hit {
    color: #7c001f;
    text-shadow: 0 1px 5px rgba(124, 0, 31, 0.45);
}

.song-grid.grid-layout .song-keysentence {
    min-height: calc(1.5em * 2);
}

.song-meta {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 6px;
    margin-bottom: 4px;
}

.placeholder {
    text-align: center;
    color: var(--text-sub);
    padding: 40px 0;
    grid-column: 1 / -1;
}

/* 详情页样式 */
.detail-container {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.page-disclaimer {
    margin-top: 14px;
    color: var(--text-sub);
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: center;
    opacity: 0.92;
}

.page-disclaimer-center {
    width: min(760px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.detail-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-header-full {
    margin-bottom: 0;
}

.detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
    gap: 22px;
    align-items: start;
}

.detail-lyrics {
    min-width: 0;
    position: relative;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
    margin-top: 0;
    box-sizing: border-box;
    min-height: 0;
}

.detail-cover-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.detail-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.detail-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.detail-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.detail-keysentence {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-style: italic;
    text-align: right;
    max-width: 50%;
}

.detail-release {
    margin-top: 6px;
    color: var(--text-sub);
    font-size: 0.85rem;
}

.detail-line {
    margin-top: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.detail-credits {
    margin-top: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-lyrics {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.detail-body .detail-lyrics {
    margin-top: 0;
}

.detail-lyrics h3 {
    font-size: 1.1rem;
    margin-top: -18px;
    /* 调整标题与上方内容的间距 */
    margin-bottom: 4px;
    color: var(--primary);
}

.detail-script-toggle {
    position: absolute;
    top: -24px;
    right: 0;
    z-index: 2;
    min-width: 78px;
    justify-content: center;
}

.detail-script-toggle.secondary-btn {
    box-shadow: var(--shadow);
}

.detail-description {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-description summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    color: var(--primary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.detail-description summary::-webkit-details-marker {
    display: none;
}

.detail-description-body {
    padding: 14px;
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

.detail-related-video {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-related-video summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    color: var(--primary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.detail-related-video summary::-webkit-details-marker {
    display: none;
}

.detail-related-video-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-video-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-color);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.detail-video-link:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.detail-video-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-video-url {
    color: var(--text-sub);
    font-size: 0.82rem;
    word-break: break-all;
}

/* 专辑列表与详情 */
.album-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.album-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.album-cover-btn {
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.album-cover-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.album-cover {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-cover-btn:hover .album-cover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.album-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.album-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.album-date {
    color: var(--text-sub);
    font-size: 0.85rem;
}

.album-detail-container {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.album-detail-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.95fr) minmax(380px, 1.05fr);
    gap: 18px;
    align-items: start;
    margin-top: 16px;
}

.album-detail-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.album-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.album-detail-left .album-detail-title {
    margin-bottom: 0;
}

.album-track-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    justify-self: stretch;
}

.album-track-item .song-title {
    font-size: 1rem;
    text-align: left;
}

.album-description {
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 0.95rem;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.album-description-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.album-description-title {
    list-style: none;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px 16px;
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
}

.album-description-title::-webkit-details-marker {
    display: none;
}

.album-detail-left .album-cover {
    width: 340px;
    height: 340px;
}

/* 更多信息 */
.info-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
}

.info-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-menu button {
    text-align: left;
    padding: 6px 4px 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--text-sub);
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, border-radius 0.2s ease;
}

.info-menu button:hover {
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
    transform: translateX(-6px);
    box-shadow: 0 4px 12px rgba(124, 0, 31, 0.18);
}

.info-menu button.active {
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
    transform: translateX(-4px);
    box-shadow: 0 3px 10px rgba(124, 0, 31, 0.15);
}

.info-menu button:active {
    transform: translateX(-3px) scale(0.99);
    box-shadow: 0 2px 8px rgba(124, 0, 31, 0.12);
}

.info-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-height: 220px;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .info-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .album-grid {
        grid-template-columns: 1fr;
    }

    .album-cover {
        width: 260px;
        height: 260px;
    }

    .album-detail-left .album-cover {
        width: 240px;
        height: 240px;
    }

    .album-detail-layout {
        grid-template-columns: 1fr;
    }

    .album-track-list {
        justify-self: stretch;
    }
}

@media (max-width: 960px) {
    .detail-layout {
        gap: 18px;
    }

    .detail-body {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        margin-top: 0 !important;
        max-height: none !important;
    }
}

.lyrics-box {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 8px;
    white-space: pre-wrap;
    /* 核心：保留 JSON 中的 \n 换行 */
    font-family: "ZiYueYingYinSong-2", "ZhengQingKeNanBeiCiGongPuSongTi-2", "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", serif;
    line-height: 1.9;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* 状态匹配面板 */
#matchPanel {
    max-width: 800px;
}

#matchResultView {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.match-container {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

#matchResultView .match-container {
    width: min(920px, 100%);
    min-height: calc(100vh - 48px);
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 24px;
    justify-content: center;
}

.match-back-row {
    width: min(560px, 100%);
    display: flex;
    justify-content: flex-start;
}

.match-result-actions {
    justify-content: center;
    gap: 12px;
    margin-top: 0;
    opacity: 0;
    transform: translateY(12px);
    animation: echoRise 0.5s ease forwards;
    animation-delay: 0.4s;
}

.match-input-wrap {
    width: min(560px, 100%);
}

#matchInput {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

#matchInput:focus {
    border-color: var(--primary);
}

.match-back-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    background: #fff;
}

.match-echo-btn {
    min-width: 120px;
}

.match-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.primary-btn,
.secondary-btn {
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    border: none;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
}

.secondary-btn:hover {
    border-color: var(--text-main);
}

.result-area {
    margin-top: 20px;
    width: 100%;
}

#matchResultView .result-area {
    margin-top: 8px;
}

.echo-result-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.echo-lyric {
    font-size: 32px;
    color: #9c221f;
    font-weight: 550;
    font-family: "ZiYueYingYinSong-2", "ZhengQingKeNanBeiCiGongPuSongTi-2", "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", serif;
    letter-spacing: 0.08em;
    line-height: 1.4;
    white-space: pre-wrap;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    animation: echoRise 0.5s ease forwards;
    animation-delay: 0s;
}

.echo-title {
    font-size: 16px;
    color: #999;
    font-style: italic;
    font-family: "ZiYueYingYinSong-2", "ZhengQingKeNanBeiCiGongPuSongTi-2", "AaGuDianKeBenSongYouMoBan", "PingFang SC", "Microsoft YaHei", serif;
    letter-spacing: 0.04em;
    text-align: right;
    opacity: 0;
    transform: translateY(12px);
    animation: echoRise 0.5s ease forwards;
    animation-delay: 0.2s;
}

.echo-exhausted {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-sub);
    text-align: center;
}

.echo-history-wrap {
    margin-top: 0;
    width: min(760px, 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    max-height: 42vh;
}

.echo-history-title {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.echo-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

.echo-history-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.echo-history-lyric {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.echo-history-song {
    color: var(--text-sub);
    text-align: left;
    font-size: 0.8rem;
}

.echo-empty {
    font-size: 18px;
    color: var(--text-sub);
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    animation: echoRise 0.5s ease forwards;
}

@keyframes echoRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    .echo-history-wrap {
        width: 100%;
    }
}