/* ========= AUDIO-PLAYER.CSS - 音频播放器通用样式 ========= */
/* 兼容性：Android 9.0+ / iOS 12+ / Chrome 70+ / Safari 12+ / 微信浏览器 */
/* 老年人专用，极致简洁，大字体，操作简单 */

:root {
    --primary-color: #5a9c20;
    --primary-dark: #4a7c1a;
    --primary-light: #f0f7e6;
    --playing-color: #ff9900;
    --bg-color: #ffffff;
    --border-color: #e6f0d5;
    --text-color: #333333;
    --text-light: #666666;
    --item-height: 60px;
}

/* 离线提示样式 */
.offline-indicator {
    position: fixed;
    top: 55px; /* 在导航条下方 */
    left: 0;
    right: 0;
    background: #ff9900;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.offline-indicator.show {
    display: block;
}

.offline-indicator.online {
    background: #5a9c20;
}

/* 主容器 - 不再固定高度，由内容撑开 */
.audio-player-container {
    max-width: 800px;
    margin: 5px auto 0 auto;
    padding: 0;
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(90, 156, 32, 0.1);
    /* 高度自适应，不再限制 */
    height: auto;
    min-height: 0;
    max-height: none;
    display: block;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
}

/* 当前播放信息 */
.playing-header {
    padding: 15px 15px 0px 15px; /* 减少内边距 */
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #f0f7e6 0%, #ffffff 100%);
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    min-height: 90px; /* 确保最小高度 */
}

.playing-info {
    text-align: center;
    width: 100%;
}

.playing-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-dark);
    line-height: 1.3;
    margin-bottom: 8px; /* 减少间距 */
    padding: 0 5px;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 32px; /* 确保标题高度 */
}

/* 状态和定时器同一行 */
.status-timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px; /* 进一步减少间距 */
    height: 35px; /* 降低高度 */
    margin-bottom: 0px; /* 减少底部间距 */
    min-height: 35px; /* 确保最小高度 */
}

.status-text {
    font-size: 22px; /* 增大字体 */
    color: var(--text-light);
    line-height: 1;
    flex-grow: 1;
    flex-basis: 0;
    text-align: left;
    min-height: 25px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold; /* 加粗 */
}

/* 新增：播放状态指示器 */
.play-status {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: bold;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 10px;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
}

/* 播放状态颜色 */
.play-status[data-status="buffering"] {
    color: #ff9900;
    animation: pulse 1.5s infinite;
}

.play-status[data-status="playing"] {
    color: #5a9c20;
}

.play-status[data-status="paused"] {
    color: #666666;
}

.play-status[data-status="error"] {
    color: #e74c3c;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 睡眠定时器 - 修改为紧凑样式 */
.sleep-timer {
    flex-shrink: 0;
    width: 100px; /* 进一步减小宽度 */
    position: relative;
    margin: 0;
    padding: 0;
}

.timer-select {
    width: 100%;
    padding: 0px 2px; /* 大幅减少内边距 */
    font-size: 20px; /* 减小字体 */
    border: 1px solid var(--primary-color); /* 减小边框 */
    border-radius: 4px; /* 减小圆角 */
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-weight: bold; /* 普通字体 */
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a9c20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center; /* 调整图标位置 */
    background-size: 12px; /* 减小图标 */
    background-color: var(--primary-light);
    height: 30px; /* 固定高度 */
    line-height: 1; /* 行高 */
    box-sizing: border-box; /* 包含内边距 */
    
}

.timer-select:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 1px rgba(90, 156, 32, 0.1); /* 减小阴影 */
}

.timer-select option {
    font-size: 20px; /* 减小选项字体 */
    padding: 3px; /* 减小内边距 */
    background: white;
    color: var(--text-color);
}

/* 倒计时显示区域 */
.sleep-timer-countdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    font-size: 20px;
    color: #ff9900;
    font-weight: bold;
    text-align: center;
    margin-top: 0px;
    padding: 3px 0;
    background: rgba(255, 153, 0, 0.1);
    border-radius: 4px;
    z-index: 10;
    display: none;
    padding-top:10px;
}

/* 播放按钮居中 */
.play-btn-center {
    padding: 12px 15px; /* 减少内边距 */
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    min-height: 80px; /* 最小高度 */
    max-height: 120px; /* 最大高度 */
}

.play-btn {
    width: 90px; /* 减小尺寸 */
    height: 90px; /* 减小尺寸 */
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #5a9c20 0%, #4a7c1a 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(90, 156, 32, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(90, 156, 32, 0.4);
}

.play-btn:active {
    transform: scale(0.98);
}

.play-btn.playing {
    background: linear-gradient(135deg, #4a7c1a 0%, #2a4a0f 100%);
}

.play-icon {
    font-size: 40px;
    line-height: 1;
    display: block;
}

/* 音频列表 - 不再固定高度，由内容撑开，页面整体滚动 */
.audio-list {
    padding: 5px 0; /* 减少内边距 */
    min-height: 150px; /* 最小高度 */
    display: block;
    overflow-y: visible; /* 不产生内部滚动 */
}

.audio-item {
    height: var(--item-height);
    min-height: 60px;
    max-height: 70px; /* 限制最大高度 */
    margin: 0 8px 4px 8px; /* 减小边距 */
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0; /* 防止项目收缩 */
}

.audio-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.audio-item.playing {
    border-color: var(--playing-color);
    background: linear-gradient(135deg, #fff9e6 0%, #fff0cc 100%);
    box-shadow: 0 2px 6px rgba(255, 153, 0, 0.2);
}

.audio-item.last-played {
    border-left: 4px solid var(--primary-color);
}

.audio-item-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 1px; /* 减小内边距 */
    position: relative;
}

/* 左侧播放图标 */
.play-icon-left {
    font-size: 20px;
    margin-right: 1px; /* 减小间距 */
    flex-shrink: 0;
    color: var(--text-light);
}

.audio-item.playing .play-icon-left {
    color: var(--playing-color);
}

/* 编号样式 */
.audio-number {
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
    color: #5a9c20;
    background: #f0f7e6;
    width: 11px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 音频名称 */
.audio-name {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-color);
    flex-grow: 1;
    flex-basis: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 3px; /* 减小内边距 */
}

/* 正在播放指示器 */
.playing-indicator {
    display: none;
    flex-shrink: 0;
    margin-right: 8px; /* 减小间距 */
}

.audio-item.playing .playing-indicator {
    display: block;
}

.playing-text {
    font-size: 16px;
    color: var(--playing-color);
    font-weight: bold;
    background: rgba(255, 153, 0, 0.1);
    padding: 3px 8px; /* 减小内边距 */
    border-radius: 4px;
}

/* 缓存状态指示器 */
.audio-status-indicator {
    flex-shrink: 0;
    width: 28px; /* 减小尺寸 */
    height: 28px; /* 减小尺寸 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.cache-indicator {
    font-size: 18px; /* 减小字体 */
    color: var(--text-light);
    transition: all 0.3s ease;
}

.cache-indicator.cached {
    color: var(--primary-color);
}

.cache-indicator.caching {
    color: var(--playing-color);
    animation: spin 1s linear infinite;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========= 新增的公共样式类（用于页面标题、描述、推荐模块） ========= */
.page-title {
    font-size: 28px;
    color: #5a9c20;
    margin-bottom: 8px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
    line-height: 1.3;
    text-align:center;
}

.page-description {
    font-size: 18px;
    color: #333;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto 10px;
    padding: 0 15px;
}

.hot-recommend {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
}

.hot-recommend h2 {
    font-size: 24px;
    color: #5a9c20;
    border-bottom: 2px solid #5a9c20;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.hot-recommend ul {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-recommend li {
    background: #f0f7e6;
    padding: 8px 18px;
    border-radius: 30px;
}

.hot-recommend li a {
    font-size: 18px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    .page-description {
        font-size: 16px;
    }
    .hot-recommend h2 {
        font-size: 22px;
    }
    .hot-recommend li a {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 22px;
    }
    .page-description {
        font-size: 15px;
    }
    .hot-recommend h2 {
        font-size: 20px;
    }
    .hot-recommend li a {
        font-size: 15px;
    }
}

/* ========= 响应式设计（原播放器响应式） ========= */

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
    .offline-indicator {
        top: 50px; /* 调整位置适应移动端导航条 */
    }
    
    .audio-player-container {
        margin: 10px auto 0 auto;
        /* 高度自适应，不再限制 */
    }
    
    .playing-header {
        padding: 15px 10px 0px  10px; /* 减小内边距 */
        min-height: 80px; /* 调整最小高度 */
    }
    
    .playing-title {
        font-size: 22px;
        margin-bottom: 6px;
        min-height: 28px;
    }
    
    .status-timer-row {
        height: 32px;
        gap: 5px;
        margin-bottom: 0px;
        min-height: 32px;
    }
    
    .status-text {
        font-size: 20px; /* 增大字体 */
    }
    
    .play-status {
        font-size: 20px;
        min-width: 110px;
        padding: 0 8px;
    }
    
    .sleep-timer {
        width: 90px;
    }
    
    .timer-select {
        font-size: 18px;
        padding: 0px 2px;
        background-position: right 5px center;
        background-size: 10px;
        height: 25px;
    }
    
    .timer-select option {
        font-size: 16px;
    }
    
    .sleep-timer-countdown {
        font-size: 20px;
        padding:10px 2px 1px 2px;
    }
    
    .play-btn-center {
        padding: 10px 10px;
        min-height: 70px;
        max-height: 100px;
    }
    
    .play-btn {
        width: 80px;
        height: 80px;
    }
    
    .play-icon {
        font-size: 36px;
    }
    
    .audio-list {
        padding: 4px 0;
        min-height: 120px;
        overflow-y: visible; /* 页面整体滚动 */
    }
    
    .audio-item {
        height: 56px;
        min-height: 56px;
        max-height: 65px;
        margin: 0 6px 3px 6px;
    }
    
    .audio-item-inner {
        padding: 0 1px;
    }
    
    .play-icon-left {
        font-size: 18px;
        margin-right: 5px;
    }
    
    .audio-number {
        width: 22px;
        height: 32px;
        line-height: 32px;
        font-size: 18px;
        margin-right: 1px;
    }
    
    .audio-name {
        font-size: 20px;
    }
    
    .playing-text {
        font-size: 14px;
        padding: 2px 6px;
    }
    
    .audio-status-indicator {
        width: 26px;
        height: 26px;
    }
    
    .cache-indicator {
        font-size: 16px;
    }
}

/* 小屏手机 (480px以下) */
@media (max-width: 480px) {
    .offline-indicator {
        top: 44px; /* 小屏手机导航条高度 */
        font-size: 16px;
        padding: 8px;
    }
    
    .audio-player-container {
        margin: 8px auto 0 auto;
        /* 高度自适应 */
    }
    
    .playing-title {
        font-size: 20px;
        margin-bottom: 4px;
        min-height: 26px;
    }
    
    .status-timer-row {
        flex-direction: row; /* 保持在一行 */
        align-items: center;
        gap: 4px;
        height: 30px;
        margin-bottom: 0;
        min-height: 30px;
    }
    
    .status-text {
        font-size: 18px; /* 增大字体 */
        text-align: left;
        justify-content: flex-start;
    }
    
    .play-status {
        font-size: 18px;
        min-width: 100px;
        padding: 0 5px;
    }
    
    .sleep-timer {
        width: 80px; /* 固定宽度 */
    }
    
    .timer-select {
        font-size: 16px;
        padding: 0px 1px;
        background-position: right 4px center;
        background-size: 8px;
        height: 25px;
    }
    
    .sleep-timer-countdown {
        font-size: 18px;
        padding:10px 2px 1px 2px;
    }
    
    .play-btn-center {
        padding: 8px 8px;
        min-height: 60px;
        max-height: 90px;
    }
    
    .play-btn {
        width: 70px;
        height: 70px;
    }
    
    .play-icon {
        font-size: 32px;
    }
    
    .audio-list {
        padding: 3px 0;
        min-height: 100px;
        overflow-y: visible;
    }
    
    .audio-item {
        height: 52px;
        min-height: 52px;
        max-height: 60px;
        margin: 0 4px 2px 4px;
    }
    
    .audio-item-inner {
        padding: 0 1px;
    }
    
    .play-icon-left {
        font-size: 14px;
        margin-right: 1px;
    }
    
    .audio-number {
        width: 20px;
        height: 28px;
        line-height: 28px;
        font-size: 16px;
        margin-right: 1px;
    }
    
    .audio-name {
        font-size: 18px;
    }
    
    .playing-text {
        display: none;
    }
    
    .audio-status-indicator {
        width: 24px;
        height: 24px;
    }
    
    .cache-indicator {
        font-size: 14px;
    }
}

/* 超小屏幕 (360px以下) */
@media (max-width: 360px) {
    .offline-indicator {
        top: 42px; /* 极小屏幕导航条高度 */
        font-size: 14px;
        padding: 6px;
    }
    
    .audio-player-container {
        margin: 5px auto 0 auto;
        /* 高度自适应 */
    }
    
    .playing-title {
        font-size: 18px;
        min-height: 24px;
    }
    
    .status-text {
        font-size: 16px; /* 保持较大字体 */
    }
    
    .play-status {
        font-size: 16px;
        min-width: 90px;
        padding: 0 3px;
    }
    
    .sleep-timer {
        width: 75px;
    }
    
    .timer-select {
        font-size: 14px;
        padding: 0px 2px;
        height: 24px;
    }
    
    .sleep-timer-countdown {
        font-size: 18px;
        padding:10px 2px 1px 2px;
    }
    
    .play-btn-center {
        padding: 6px 6px;
        min-height: 55px;
        max-height: 80px;
    }
    
    .play-btn {
        width: 65px;
        height: 65px;
    }
    
    .play-icon {
        font-size: 28px;
    }
    
    .audio-list {
        padding: 2px 0;
        min-height: 80px;
        overflow-y: visible;
    }
    
    .audio-item {
        height: 48px;
        min-height: 48px;
        max-height: 55px;
    }
    
    .play-icon-left {
        font-size: 14px;
        margin-right: 1px;
    }
    
    .audio-number {
        width: 14px;
        height: 24px;
        line-height: 24px;
        font-size: 14px;
        margin-right: 6px;
    }
    
    .audio-name {
        font-size: 16px;
    }
    
    .playing-text {
        display: none;
    }
    
    .cache-indicator {
        font-size: 12px;
    }
}

/* 特大字体模式 */
@media (prefers-font-size: large) {
    .offline-indicator {
        font-size: 20px;
        padding: 12px;
        top: 60px;
    }
    
    .audio-player-container {
        /* 高度自适应 */
    }
    
    .playing-title {
        font-size: 28px;
        min-height: 38px;
    }
    
    .status-text {
        font-size: 24px; /* 增大字体 */
    }
    
    .play-status {
        font-size: 20px;
        min-width: 140px;
    }
    
    .timer-select {
        font-size: 18px; /* 增大字体 */
        padding: 0px 2px; /* 增加内边距 */
        background-size: 14px; /* 增大图标 */
        height: 30px; /* 增加高度 */
    }
    
    .timer-select option {
        font-size: 16px;
    }
    
    .sleep-timer-countdown {
        font-size: 18px;
        padding:10px 2px 1px 2px;
    }
    
    .play-btn-center {
        min-height: 90px;
        max-height: 140px;
    }
    
    .play-btn {
        width: 100px;
        height: 100px;
    }
    
    .play-icon {
        font-size: 44px;
    }
    
    .audio-list {
        min-height: 180px;
        overflow-y: visible;
    }
    
    .audio-item {
        height: 70px;
        min-height: 70px;
        max-height: 80px;
    }
    
    .play-icon-left {
        font-size: 22px;
        margin-right: 12px;
    }
    
    .audio-number {
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 22px;
        margin-right: 14px;
    }
    
    .audio-name {
        font-size: 24px;
    }
    
    .playing-text {
        font-size: 18px;
        padding: 4px 10px;
    }
    
    .cache-indicator {
        font-size: 22px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .offline-indicator {
        border: 2px solid black;
    }
    
    .offline-indicator.online {
        border: 2px solid black;
    }
    
    .audio-item {
        border: 3px solid #000;
    }
    
    .audio-item.playing {
        border: 3px solid #000;
        background: #ffff00;
    }
    
    .timer-select {
        border: 2px solid #000;
    }
    
    .sleep-timer-countdown {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
    
    .playing-text {
        background: #000;
        color: #fff;
    }
    
    .play-status[data-status="buffering"] {
        color: #ff9900;
    }
    
    .play-status[data-status="playing"] {
        color: #008000;
    }
    
    .play-status[data-status="error"] {
        color: #ff0000;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .audio-item {
        min-height: 56px;
        max-height: 65px;
    }
    
    .play-btn {
        min-width: 80px;
        min-height: 80px;
    }
    
    .timer-select {
        min-height: 25px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .play-btn,
    .audio-item,
    .cache-indicator {
        animation: none !important;
        transition: none !important;
    }
    
    .play-btn:hover {
        transform: none;
    }
    
    .play-status[data-status="buffering"] {
        animation: none !important;
    }
    
    .offline-indicator {
        transition: none !important;
    }
}

/* ========= 浮动计数器图标 ========= */
.counter-float-icon {
    position: fixed;
    bottom: 120px;
    right: 10%;
    /* 48px 视觉圆 = 点击区 */
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: none;
    transition: all 0.3s ease;
    border: 2px solid #a8d16a;
    -webkit-tap-highlight-color: transparent;
    color: #4a7c1a;
}

.counter-float-icon.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatBounce 0.5s ease;
}

.counter-float-icon:hover {
    transform: scale(1.1);
}

.counter-float-icon:active {
    transform: scale(0.95);
}

.counter-float-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
}

.counter-float-icon .icon {
    display: none;
}

.counter-float-icon .text {
    /* ===== 改动：20px → 26px，字占内径 59%，空白更少 ===== */
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    letter-spacing: 0;
}

/* 浮动动画 */
@keyframes floatBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 呼吸灯效果（播放时）—— 全局 animation: none 会屏蔽，保留原结构 */
.counter-float-icon.playing {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(90, 156, 32, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(90, 156, 32, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(90, 156, 32, 0);
    }
}

/* ========= 计数器iframe容器 - 紧凑样式 ========= */
.counter-iframe-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px; /* 减小圆角 */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #5a9c20; /* 细边框 */
    animation: counterSlideIn 0.4s ease;
}

.counter-iframe-container.show {
    display: flex;
}

@keyframes counterSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.counter-iframe-header {
    padding: 12px 16px; /* 减小内边距，但保留足够触摸区域 */
    background: linear-gradient(135deg, #5a9c20 0%, #4a7c1a 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 2px solid #4a7c1a; /* 细下边框 */
}

.counter-iframe-title {
    display: flex;
    align-items: center;
    gap: 8px; /* 减小间距 */
    font-size: 22px; /* 减小字体 */
    font-weight: bold;
}

.counter-icon {
    font-size: 24px; /* 减小图标 */
}

.close-counter-iframe {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white; /* 细边框 */
    color: white;
    width: 44px; /* 减小尺寸 */
    height: 44px;
    border-radius: 50%;
    font-size: 28px; /* 减小字体 */
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-counter-iframe:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.close-counter-iframe:active {
    transform: scale(0.95);
}

.counter-iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 0 0 20px 20px; /* 与容器圆角匹配 */
}

/* 遮罩层 */
.counter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    animation: overlayFadeIn 0.3s ease;
}

.counter-overlay.show {
    display: block;
}

@keyframes overlayFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .counter-float-icon {
        bottom: 120px;
        right: 15px;
        width: 48px;
        height: 48px;
    }
    
    .counter-float-icon .text {
        /* ===== 改动：20px → 26px ===== */
        font-size: 26px;
        height: 26px;
    }
    
    .counter-iframe-container {
        width: 98%;
        height: 98%;
        max-height: 800px;
    }
    
    .counter-iframe-header {
        padding: 10px 14px;
    }
    
    .counter-iframe-title {
        font-size: 20px;
    }
    
    .close-counter-iframe {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .counter-float-icon {
        bottom: 110px;
        right: 10px;
        width: 48px;
        height: 48px;
    }
    
    .counter-float-icon .text {
        /* ===== 改动：18px → 24px ===== */
        font-size: 24px;
        height: 24px;
    }
    
    .counter-iframe-container {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }
    
    .counter-iframe-header {
        padding: 8px 12px;
    }
    
    .counter-iframe-title {
        font-size: 18px;
    }
    
    .close-counter-iframe {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .counter-float-icon {
        border: 4px solid black;
        background: #000;
        color: white;
    }
    
    .counter-iframe-container {
        border: 4px solid black;
    }
    
    .counter-iframe-header {
        background: #000;
        border-bottom: 4px solid black;
    }
    
    .close-counter-iframe {
        border: 3px solid black;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .counter-float-icon {
        animation: none !important;
        transition: none !important;
    }
    
    .counter-float-icon.playing {
        animation: none !important;
    }
    
    .counter-iframe-container,
    .counter-overlay {
        animation: none !important;
    }
    
    .counter-float-icon:hover,
    .counter-float-icon:active,
    .close-counter-iframe:hover,
    .close-counter-iframe:active {
        transform: none !important;
    }
}

/* 移除之前限制滚动的全局样式 */
/* 页面高度自适应 - 已移除 overflow: hidden */
body {
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

/* 防止内容溢出 */
.audio-player-container {
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
}

/* 导航条占位符调整 */
.navbar-placeholder {
    height: 55px; /* 固定高度，与导航条一致 */
    width: 100%;
}

/* 确保播放列表紧贴底部 */
.audio-player-container {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 确保音频列表没有底部间距 */
.audio-list {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 强制显示缓存指示器 */
.audio-status-indicator {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    visibility: visible !important;
}

.cache-indicator {
    display: inline-block !important;
    font-size: 18px !important;
    line-height: 1 !important;
    visibility: visible !important;
}

/* 移动端浏览器专用修复 */
@media (max-width: 768px) {
    .audio-player-container {
        overflow: visible !important;
    }
    
    .audio-list {
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* iOS Safari 专用修复 */
@supports (-webkit-touch-callout: none) {
    /* iOS 设备 */
    html, body {
        height: 100%;
        overflow: visible; /* 改为 visible，允许页面滚动 */
        -webkit-overflow-scrolling: touch;
    }
    
    .audio-player-container {
        /* iOS 上不再使用固定高度，由内容撑开 */
        height: auto !important;
        max-height: none !important;
    }
    
    .audio-list {
        padding-bottom: 35px !important; /* 为底部留出更多空间 */
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 底部版权信息不再固定，随页面滚动 */
    #david_footer {
        position: static !important;
        bottom: auto !important;
        z-index: 10 !important;
    }
}

/* ========= 分类标题样式（新增，供 amtf.html 等页面使用） ========= */
.category-title {
    font-size: 24px;
    font-weight: bold;
    color: #5a9c20;
    padding: 15px 0 8px 10px;
    border-bottom: 2px solid #5a9c20;
    margin: 10px 0 15px 0;
    background: linear-gradient(135deg, #f0f7e6 0%, #ffffff 100%);
    border-radius: 0 0 8px 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .category-title {
        font-size: 22px;
        padding: 12px 0 6px 8px;
        margin: 8px 0 12px 0;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 20px;
        padding: 10px 0 5px 8px;
        margin: 6px 0 10px 0;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .category-title {
        border-bottom: 4px solid black;
        background: #f0f0f0;
        color: black;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .category-title {
        transition: none;
    }
}

/* 为底部浮动播放器预留空间（避免遮挡） */
body {
    padding-bottom: 90px !important;
}

/* 不同屏幕尺寸微调（可选） */
@media (max-width: 640px) {
    body {
        padding-bottom: 100px !important;  /* 手机竖屏时播放器更高 */
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 110px !important;
    }
}

/* ========= 阅读入口条样式 ========= */
.yuedu-entry-bar {
    max-width: 800px;
    margin: 10px auto 6px auto;
    text-decoration: underline;
    background: linear-gradient(135deg, #fff8e1 0%, #f0f7e6 100%);
    border: 2px solid #5a9c20;
    border-radius: 12px;
    padding: 10px 16px;
    display: block;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

/* 阅读入口条悬停效果 */
.yuedu-entry-bar:hover {
    background: linear-gradient(135deg, #fef3d6 0%, #e8f5d6 100%);
}

/* 阅读入口条响应式 */
@media (max-width: 768px) {
    .yuedu-entry-bar {
        font-size: 18px;
        padding: 8px 12px;
        margin: 8px auto 4px auto;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .yuedu-entry-bar {
        font-size: 18px;
        padding: 3px 5px;
        margin: 6px auto 3px auto;
        border-radius: 8px;
    }
}

@media (max-width: 360px) {
    .yuedu-entry-bar {
        font-size: 16px;
        padding: 2px 5px;
    }
}

/* ========= 阅读提示文字（描述中） ========= */
.reading-hint {
    color: #5a9c20;
    font-weight: bold;
}