.announcement-banner {
    background-color: #ffc107;
    color: #111;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
    font-weight: bold;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 101;
    direction: ltr;
}

.announcement-banner p {
    margin: 0;
}

.search-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-container.visible {
    opacity: 1;
    visibility: visible;
}

#search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 10px;
    font-size: 16px;
    outline: none;
    width: 250px;
}

#search-button {
    background: #ffc107;
    border: none;
    color: #111;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* بۇ ئەڭ مۇھىم قۇر! تور بەتنىڭ ئۆزى سىيرىلىپ كەتمەيدۇ */
    font-family: 'NUR Tor', sans-serif; /* ئورتاق خەت نۇسخىسىنى بېكىتەيلى */
}

@font-face {
    font-family: 'NUR Tor';
    src: url('/nur_mob_tor.ttf') format('woff2');
}

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

body, html {
  font-family: 'NUR Tor', sans-serif; /* ئورتاق خەت نۇسخىسىنى بېكىتەيلى */
    background-color: #121212;
    height: 100%;
    overflow: hidden;
    direction: rtl;
    color: #fff;
}

.swiper-wrapper {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-out;
}

.player-view {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #2a2a2a, #1a1a2a);
    text-align: center;
}

/* 修改阅读模式样式 */
.player-view.read-mode {
    background: #f5f5dc; /* 羊皮纸颜色 */
    color: #333;
    display: block;
    height: 100vh;
    overflow: hidden;
    padding-top: 40px; /* Make space for banner */
    box-sizing: border-box;
}

/* 在阅读模式下，即使屏幕区域可见，也允许subtitle-area显示 */
.player-view.read-mode .subtitle-area {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: 100%;
    max-height: none; /* 移除高度限制 */
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    opacity: 1;
    transform: none;
    color: #333;
}

.player-view.read-mode .current-line-text {
    color: #333;
    font-size: 18px;
    line-height: 1.8;
    text-align: justify; /* 维吾尔语可能更适合两端对齐 */
    padding: 0; /* 内部 p 标签自己有 padding */
    margin: 0;
    /* 移除 max-height 和 overflow-y，让 subtitle-area 控制滚动 */
}

.player-view.read-mode .ug-text {
    direction: rtl;
    text-align: justify;
    display: block;
}

.player-view.read-mode .zh-text {
    direction: ltr;
    text-align: left;
    display: block;
}

/* 阅读模式下每行内容的容器 */
.read-mode-paragraph-wrapper {
    display: flex;
    align-items: flex-start; /* 顶部对齐 */
    margin-bottom: 15px; /* 行间距 */
    direction: rtl; /* 从右到左布局 */
    position: relative;
}

/* 阅读模式下的段落样式 */
.player-view.read-mode .current-line-text .read-mode-paragraph {
    margin: 0 0 0.5em 20px; /* 减小段落间距 */
    line-height: 1.6; /* 减小行高 */
    margin-right: 20px;
    color: #333;
    text-align: justify;
    flex-grow: 1;
    padding: 6px 10px; /* 减小内边距 */
    position: relative;
    text-indent: 2em;
    transition: background-color 0.3s ease;
}

.player-view.read-mode .current-line-text .read-mode-paragraph.highlighted-line {
    background-color: rgba(255, 255, 0, 0.3);
}

/* 删除重复的高亮样式定义 */

/* 喇叭按钮样式 - 缩小版 */
.read-line-audio-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    color: #555; /* 按钮颜色 */
    font-size: 0.9em; /* 缩小字体 */
    cursor: pointer;
    margin-right: 6px; /* 缩小间距 */
    margin-left: 6px; /* 添加左边距 */
    padding: 5px;
    width: 28px; /* 缩小宽度 */
    height: 28px; /* 缩小高度 */
    display: inline-flex; /* 改为行内flex */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    vertical-align: middle; /* 垂直居中对齐 */
}

.read-line-audio-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #ff4757; /* 鼠标悬停颜色 */
    transform: scale(1.05); /* 缩小悬停效果 */
}

/* 播放状态下的按钮样式 */
.read-line-audio-btn.playing {
    background: rgba(255, 193, 7, 0.2);
    color: #ff6b35;
}

/* 加载状态下的按钮样式 */
.read-line-audio-btn.loading {
    color: #aaa;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态下的按钮样式 */
.read-line-audio-btn.error {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

/* 阅读模式下每行内容的容器 */
.read-mode-line-wrapper {
    display: flex;
    align-items: flex-start; /* 顶部对齐 */
    margin-bottom: 0px; /* 行间距 */
    position: relative;
}

/* 阅读模式下的段落样式 - 针对普通p标签 */
.player-view.read-mode .current-line-text p:not(.read-mode-paragraph) {
    margin: 0 0 1em 0; /* 段落间距 */
    line-height: 1.8;
    color: #333;
    text-align: justify;
    flex-grow: 1; /* 占据剩余空间 */
    padding: 5px; /* 段落内边距 */
}

/* 删除重复的高亮样式定义 */

.player-view.read-mode .read-mode-nav {
    display: none; /* 阅读模式下隐藏翻页按钮 */
}

.player-view.read-mode .current-line-text span {
    color: #333;
}

.player-view.read-mode .current-line-text span.highlighted {
    color: #333;
    background-color: rgba(255, 255, 0, 0.3);
}

.player-view.read-mode .book-title,
.player-view.read-mode .book-author {
    color: #333;
}

.player-view.read-mode .progress-container {
    background-color: rgba(0, 0, 0, 0.2);
}

.player-view.read-mode .progress-bar {
    background-color: #333;
}

.player-view.read-mode .control-btn,
.player-view.read-mode .side-btn {
    color: #333;
}

.player-view.read-mode .side-btn:hover {
    color: #ff4757;
}

/* 添加翻书动画效果 */

/* --- كىتاب مۇقاۋىسى ۋە ماۋزۇ --- */
.screen-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.screen-area.hidden {
    opacity: 0;
    pointer-events: none;
}

.book-title {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.3;
    color: #ffffff; /* White */
}

.book-author {
    font-size: 1.2em;
    color: #00bcd4; /* Cyan */
    margin-bottom: 25px;
    line-height: 1.4;
}

.book-description {
    font-size: 1em;
    color: #9e9e9e; /* Grey */
    line-height: 1.6;
    max-width: 80%;
    margin: 0 auto;
}

/* --- خەتكۈچ رايونى (قۇرمۇ-قۇر ئۆزگىرىدىغان يېڭى ئۇسۇل) --- */
.subtitle-area {
    position: absolute;
    top: 0;
    right: 20px;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    padding: 10px 30px 10px 30px;
    box-sizing: border-box;
}

.player-view:not(.read-mode) .screen-area.hidden + .subtitle-area {
    opacity: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
}

/* خەتكۈچ تېكىستىنى ساقلايدىغان قاپ */
.current-line-text {
    font-size: 18px;
    line-height: 1.7;
    text-align: justify;
    overflow-y: visible; /* Let parent handle scrolling */
    padding: 5px;
}

/* ھەر بىر سۆزنى ئورىغان span نىڭ ئۇسلۇبى */
.current-line-text span {
    color: yellow; /* دەسلەپكى رەڭ */
    transition: color 0.3s ease; /* رەڭ ئۆزگىرىشنى سىلىق قىلىش */
}

/* رەڭگى ئۆزگەرگەن سۆزنىڭ ئۇسلۇبى (ئاكتىپ ھالەت) */
.current-line-text span.highlighted {
    color: #ff4757; /* قىزىل رەڭ */
}

.zh-text {
    direction: ltr;
    text-align: left;
}

/* --- كونترول كۇنۇپكىلىرى ۋە قويۇش بالدىقى --- */
.playback-controls-wrapper {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
}

.progress-container {
    width: 90%;
    height: 0px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 auto 15px;
    cursor: pointer;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #fff;
    border-radius: 3px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-bottom: 20px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.control-btn.play-pause-btn {
    font-size: 45px;
}

.side-controls { 
    position: absolute; 
    top: 50%; 
    right: 15px; 
    transform: translateY(-50%); 
    display: flex; 
    flex-direction: column; 
    gap: 25px; 
    z-index: 10; 
}

.side-btn { 
    background: none; 
    border: none; 
    color: rgba(255, 255, 255, 0.7); 
    font-size: 35px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}

.side-btn:hover { 
    color: #ffc107; 
    transform: scale(1.15); 
}

.playlist { 
    position: absolute; 
    top: 50%;
    left: 50%;
    width: 80%;
    max-width: 400px;
    height: 60%;
    max-height: 300px;
    background-color: rgba(20, 20, 20, 0.95); 
    backdrop-filter: blur(8px); 
    z-index: 100; 
    display: flex; 
    flex-direction: column; 
    transition: opacity 0.3s ease, transform 0.3s ease; 
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
}

.playlist.hidden { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(1.1); 
    pointer-events: none; 
}

.playlist-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}

.playlist-header h3 { 
    margin: 0; 
    font-size: 20px; 
}

.close-playlist-btn { 
    background: none; 
    border: none; 
    color: white; 
    font-size: 30px; 
    cursor: pointer; 
}

.playlist-content { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 10px; 
}

.playlist-item { 
    padding: 15px 20px; 
    border-radius: 8px; 
    margin-bottom: 5px; 
    cursor: pointer; 
    transition: background-color 0.2s ease; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.playlist-item span { 
    font-weight: bold; 
    margin-left: 10px; 
    color: #ffc107; 
}

.playlist-item:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
}

.playlist-item.active { 
    background-color: #ffc107; 
    color: #111; 
}

.playlist-item.active span { 
    color: #111; 
}

/* 添加背景音乐选择样式 */
.bg-music-selector {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    max-width: 400px;
    height: 60%;
    max-height: 300px;
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1);
    pointer-events: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bg-music-selector.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.bg-music-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-music-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-bg-music-btn {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.bg-music-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.bg-music-item {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-music-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.bg-music-item.active {
    background-color: #ffc107;
    color: #111;
}

/* 添加设置面板样式 */
.settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    max-width: 250px; /* 进一步减小最大宽度 */
    height: 40%; /* 进一步减小高度 */
    max-height: 250px; /* 进一步减小最大高度 */
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    pointer-events: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.settings-panel.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px; /* 进一步减小内边距 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    margin: 0;
    font-size: 16px; /* 进一步减小字体大小 */
}

.close-settings-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px; /* 进一步减小关闭按钮字体大小 */
    cursor: pointer;
}

.settings-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px; /* 进一步减小内边距 */
}

.setting-group {
    margin-bottom: 15px; /* 进一步减小外边距 */
}

.setting-group h4 {
    margin-bottom: 8px; /* 进一步减小外边距 */
    color: #ffc107;
    font-size: 14px; /* 进一步减小字体大小 */
}

.speed-control, .font-size-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* 进一步减小间距 */
    margin-bottom: 8px; /* 进一步减小外边距 */
}

.speed-adjust-btn, .font-size-btn {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    width: 30px; /* 进一步减小按钮尺寸 */
    height: 30px; /* 进一步减小按钮尺寸 */
    border-radius: 50%;
    font-size: 1em; /* 进一步减小字体大小 */
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-adjust-btn:hover, .font-size-btn:hover {
    background-color: #fff;
    color: #000;
}

.speed-display-setting, .font-size-display {
    min-width: 40px; /* 进一步减小最小宽度 */
    text-align: center;
    font-size: 0.9em; /* 进一步减小字体大小 */
}

.language-control {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.language-btn {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-btn.active,
.language-btn:hover {
    background-color: #fff;
    color: #000;
}

/* 添加颜色选择器样式 */
.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.color-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.color-option.active {
    background-color: rgba(255, 193, 7, 0.3);
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.color-label {
    font-size: 14px;
}

/* 添加阅读模式下的侧边控制按钮位置 */
.player-view.read-mode .side-controls {
    top: 50%; /* 将按钮向上移动 */
}

/* 添加阅读模式导航按钮样式 */
.read-mode-nav {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-view.read-mode .read-mode-nav {
    opacity: 0; /* 隐藏阅读模式导航按钮 */
}

.read-mode-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.read-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.read-mode-btn i {
    pointer-events: none;
}

/* 添加滑动提示区域 */
.swipe-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 14px;
    text-align: center;
    z-index: 5;
    background: rgba(245, 245, 220, 0.8);
    padding: 5px 15px;
    border-radius: 15px;
    display: none;
}

.player-view.read-mode .swipe-hint {
    display: none; /* 隐藏滑动提示 */
}

.swipe-hint i {
    margin: 0 5px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-5px);
    }
    60% {
        transform: translateX(5px);
    }
}

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99;
}

.modal-content {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #2c2c2c;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 100;
  width: 90%;
  max-width: 450px;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

body.modal-open {
  overflow: hidden;
}

.player-view.mindmap-mode {
    background: #f5f5dc; /* Same as read mode */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    padding-top: 40px; /* Make space for banner */
    box-sizing: border-box;
    width: 100%;
}

.player-view.mindmap-mode .subtitle-area,
.player-view.mindmap-mode .screen-area {
    display: none !important;
}

.player-view.mindmap-mode .mindmap-view {
    display: block !important;
    width: 100%;
    height: 100%;
}

.player-view.mindmap-mode .side-btn {
    color: #333; /* Dark color for visibility on light background */
}

.mindmap-view {
    display: none;
}

.player-view.mindmap-mode .mindmap-view {
    display: block;
}

#markmap {
    width: 100%;
    height: 100%;
}

.mindmap-content {
    padding: 30px;
    text-align: right;
    direction: rtl;
    color: #333;
    overflow-y: auto;
    height: 100%;
    background-color: #fdfdfd;
    font-size: 18px;
    line-height: 1.8;
}

.mindmap-content h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #111;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.mindmap-content .mindmap-main-item {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #222;
    border-right: 3px solid #00bcd4;
    padding-right: 15px;
}

.mindmap-content .mindmap-sub-item {
    font-size: 1.1em;
    margin-bottom: 10px;
    margin-right: 40px;
    color: #444;
    position: relative;
    text-align: justify;
}

.mindmap-content .mindmap-sub-item::before {
    content: '•';
    color: #00bcd4;
    position: absolute;
    right: -20px;
    top: 0;
}

.mindmap-content strong {
    color: #000;
}
