/* Manzil —— RTL + UKIJ 字体全局样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'UKIJ', 'UKIJ Tuz Tom', 'UKIJ TuT', Tahoma, sans-serif;
    background: #f2f4f8; color: #2c3e50; direction: rtl; text-align: right;
    line-height: 1.9;
}
a { color: #1f6fb2; text-decoration: none; }
a:hover { color: #0d5a99; }

/* 顶部导航 */
.topbar { background: #1f2d3d; color: #fff; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; flex-wrap: wrap; }
.logo { color: #fff; font-size: 22px; font-weight: bold; padding: 12px 0; }
.topbar nav { margin-right: auto; display: flex; flex-wrap: wrap; }
.topbar nav a { color: #cfd8e3; padding: 12px 14px; display: inline-block; }
.topbar nav a:hover { color: #fff; background: #324157; }
.nav-btn { border: 1px solid #556; border-radius: 20px; margin: 6px 4px; padding: 4px 14px !important; }
.nav-btn-solid { background: #1f6fb2; border-color: #1f6fb2; color: #fff !important; }

/* 头部轮换图片 */
.carousel { position: relative; max-width: 1100px; margin: 14px auto 0; padding: 0 16px; height: 300px; overflow: hidden; }
.carousel .slide { position: absolute; right: 16px; left: 16px; top: 0; height: 300px; opacity: 0; transition: opacity .8s; display: block; }
.carousel .slide.active { opacity: 1; }
.carousel .slide img, .slide-placeholder { width: 100%; height: 300px; object-fit: cover; border-radius: 12px; display: block; }
.slide-placeholder { background: linear-gradient(135deg, #1f6fb2, #1f2d3d); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.dots { position: absolute; bottom: 12px; right: 50%; transform: translateX(50%); display: flex; gap: 8px; z-index: 5; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; }
.dot.active { background: #fff; }

/* 布局：侧栏固定在页面右侧（RTL 下用 row-reverse 让第二个元素 aside 显示在右边） */
.layout { max-width: 1100px; margin: 18px auto; padding: 0 16px; display: flex; flex-direction: row-reverse; gap: 20px; align-items: flex-start; }
.layout.full { display: block; } /* 无侧栏页面（文章页等）主内容通栏 */
.main { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* 文章卡片：图标在右、标题在左（RTL 下 row 的首个元素在右侧） */
.post-item {
    display: flex; flex-direction: row; align-items: center;
    background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.post-icon { width: 84px; height: 84px; border-radius: 16px; background: #eef4fa; object-fit: cover; margin-left: 16px; flex-shrink: 0; }
.post-icon-empty { display: flex; align-items: center; justify-content: center; color: #1f6fb2; font-size: 34px; }
.post-info { flex: 1; overflow: hidden; }
.post-title { font-size: 20px; font-weight: bold; }
.post-title a { color: #2c3e50; }
.post-summary { color: #888; font-size: 14px; margin-top: 4px; }
.post-meta { color: #aaa; font-size: 12px; margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.lock-badge { color: #e6a23c; }
.page-nav { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.page-nav a { background: #fff; padding: 6px 14px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* 文章详情 */
.post-card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.post-head { display: flex; flex-direction: row; align-items: center; margin-bottom: 16px; }
.post-head .post-icon { width: 96px; height: 96px; }
.post-content { font-size: 16px; word-break: break-word; }
.post-content img { max-width: 100%; }
.locked-box {
    background: #fff8e6; border: 1px dashed #e6a23c; border-radius: 10px;
    padding: 28px; text-align: center; margin-top: 16px; color: #8a6d3b;
}
.locked-box a { font-weight: bold; }

/* 下载盒子 */
.download-box {
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    background: #eef7ee; border: 1px solid #b3d9b3; border-radius: 10px; padding: 16px; margin: 18px 0;
}
.btn {
    display: inline-block; padding: 9px 24px; border: none; border-radius: 24px;
    background: #1f6fb2; color: #fff; cursor: pointer; font-family: inherit; font-size: 15px;
}
.btn:hover { background: #0d5a99; color: #fff; }
.btn-gold { background: #e6a23c; }
.btn-gold:hover { background: #cf8f29; }

/* 视频嵌入 */
.video-embed { margin: 16px 0; }
.video-embed iframe, .video-grid iframe { width: 100%; height: 420px; border-radius: 10px; border: none; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.video-card { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }

/* 文章内分集视频播放器（第一集/第二集…） */
.episode-box { background: #fff; border-radius: 12px; padding: 18px; margin: 18px 0; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.ep-frame iframe { width: 100%; height: 440px; border-radius: 10px; border: none; }
.ep-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ep-btn {
    padding: 8px 20px; border: 1px solid #c9d6e4; background: #f7f9fb; color: #1f6fb2;
    border-radius: 22px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.ep-btn:hover { background: #eef4fa; }
.ep-btn.active { background: #1f6fb2; color: #fff; border-color: #1f6fb2; }

/* 侧栏组件 */
.widget { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.widget-title { font-size: 17px; color: #1f2d3d; border-bottom: 2px solid #eef4fa; padding-bottom: 8px; margin-bottom: 12px; }
.widget-subtitle { font-size: 15px; color: #1f6fb2; border-top: 1px dashed #e4e9ef; padding-top: 12px; margin: 16px 0 8px; }
.now-playing { font-size: 14px; color: #1f6fb2; margin-bottom: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#audioPlayer { width: 100%; }
.player-ctrl { display: flex; gap: 8px; margin-top: 8px; }
.player-ctrl button { flex: 1; padding: 6px; border: 1px solid #dcdfe6; background: #f7f9fb; border-radius: 6px; cursor: pointer; font-family: inherit; }
.song-list, .recent-songs, .cat-list { list-style: none; }
.song-list li, .recent-songs li { padding: 7px 0; border-bottom: 1px dashed #eee; font-size: 14px; }
.song-list li.playing a { color: #e6a23c; font-weight: bold; }
.song-list small, .recent-songs small { color: #aaa; margin-right: 6px; }
.recent-songs .ext { font-size: 12px; margin-right: 6px; }
.cat-list li { padding: 5px 0; }
.muted { color: #999; font-size: 14px; }

/* 评论 */
.comment { background: #f7f9fb; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.comment-head { font-size: 13px; color: #888; }
.comment-form label { display: block; margin: 10px 0 4px; color: #666; font-size: 14px; }
.comment-form input, .comment-form textarea, .auth-box input {
    width: 100%; padding: 9px 12px; border: 1px solid #dcdfe6; border-radius: 8px; font-family: inherit; font-size: 15px;
}
.comment-form textarea { min-height: 90px; resize: vertical; }

/* 登录/注册框 */
.auth-box { max-width: 380px; margin: 40px auto; background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.auth-box h2 { text-align: center; margin-bottom: 18px; }
.auth-box label { display: block; margin: 10px 0 4px; color: #666; }
.auth-box .btn { width: 100%; margin-top: 18px; }
.msg-ok { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.msg-err { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }

/* 页脚 */
.footer { background: #1f2d3d; color: #9aa7b5; text-align: center; padding: 18px; margin-top: 30px; font-size: 14px; }

@media (max-width: 800px) {
    .layout, .layout.full { flex-direction: column; }
    .sidebar { width: 100%; }
    .carousel { height: 200px; }
    .carousel .slide, .carousel .slide img, .slide-placeholder { height: 200px; }
    .video-embed iframe, .video-grid iframe, .ep-frame iframe { height: 240px; }
}
