.hnc-unit-reader-root {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2937;
}

.hnc-unit-reader-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.hnc-unit-reader-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.hnc-unit-reader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 主要控制按钮；重复声明背景和文字颜色以抵抗主题覆盖 */
.hnc-unit-reader-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #4f6bff;
    background-color: #5b7cfa !important;
    background-image: linear-gradient(135deg, #5b7cfa 0%, #7f8dff 100%) !important;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 6px 14px rgba(91, 124, 250, 0.2);
}
.hnc-unit-reader-btn:focus,
.hnc-unit-reader-btn:focus-visible {
    outline: 2px solid rgba(91, 124, 250, 0.45);
    outline-offset: 2px;
}

.hnc-unit-reader-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(91, 124, 250, 0.28);
}

.hnc-unit-reader-progress {
    position: relative;
    flex: 1 1 180px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.hnc-unit-reader-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.hnc-unit-reader-progress span::after {
    content: attr(data-label);
    position: absolute;
    right: 12px;
    top: -26px;
    font-size: 12px;
    color: #64748b;
}

.hnc-unit-reader-list {
    display: grid;
    gap: 16px;
}

.hnc-unit-reader-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hnc-unit-reader-card.is-completed {
    border-color: #34d399;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.25);
}

.hnc-unit-reader-card.collapsed .hnc-unit-reader-body {
    display: none;
}

.hnc-unit-reader-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hnc-unit-reader-card-header h4 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.hnc-unit-reader-card-tools {
    display: flex;
    gap: 8px;
}

.hnc-unit-reader-mini-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #eef2ff !important;
    color: #1e293b !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hnc-unit-reader-mini-btn:hover,
.hnc-unit-reader-mini-btn:focus-visible {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8;
    outline: none;
}

.hnc-unit-reader-mini-btn--mark {
    border-color: #34d399;
    background-color: #ecfdf5 !important;
    color: #047857 !important;
}

.hnc-unit-reader-card.is-completed .hnc-unit-reader-mini-btn--mark {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border-color: #0f9f7b;
}

.hnc-unit-reader-card.is-completed .hnc-unit-reader-mini-btn--mark:hover,
.hnc-unit-reader-card.is-completed .hnc-unit-reader-mini-btn--mark:focus-visible {
    filter: brightness(0.95);
}

.hnc-unit-reader-audio {
    width: 100%;
    margin-bottom: 14px;
    border-radius: 10px;
    background: #ffffff;
}

.hnc-unit-reader-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hnc-unit-reader-text {
    margin: 0;
    line-height: 1.7;
    font-size: 16px;
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.hnc-unit-reader-text.zh {
    display: none;
    color: #334155;
    background: #f1f5f9;
}

.hnc-unit-reader-text.zh.visible,
.hnc-unit-reader-root.hnc-unit-reader-show-zh .hnc-unit-reader-text.zh {
    display: block;
}

.hnc-unit-reader-keywords {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.hnc-unit-reader-keywords-label {
    display: inline-block;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.hnc-unit-reader-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hnc-unit-reader-keyword-btn {
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background-color: #f8fafc !important;
    color: #1e293b !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hnc-unit-reader-keyword-btn:hover,
.hnc-unit-reader-keyword-btn:focus-visible {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8;
    outline: none;
}

.hnc-unit-reader-keyword-detail {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    background: #eff6ff;
    color: #1e293b;
    display: none;
    line-height: 1.6;
}

.hnc-unit-reader-keyword-detail.active {
    display: block;
}

.hnc-unit-reader-keyword-detail strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.hnc-unit-reader-keyword-audio {
    margin-top: 8px;
    width: 100%;
}

.hnc-unit-reader-empty {
    text-align: center;
    font-size: 16px;
    color: #64748b;
    padding: 40px 0;
}

@media (max-width: 768px) {
    .hnc-unit-reader-root {
        padding: 16px;
        border-radius: 12px;
    }

    .hnc-unit-reader-title {
        font-size: 18px;
    }

    .hnc-unit-reader-card {
        padding: 14px;
    }

    .hnc-unit-reader-text {
        font-size: 15px;
    }

    .hnc-unit-reader-controls {
        gap: 8px;
    }

    .hnc-unit-reader-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}
