
/*
102每日一句Style   Codex优化 v3
更新：2026-01-03
- 翻译字体增大50%
- "显示翻译"按钮移到句子下方
- 手风琴动画优化（更流畅）
- 手风琴视觉优化（更精致）
*/

/* === 模块主容器 === */
#hnc-ds-section {
    margin-top: 2em;
    background: #ffffff;
    border-radius: 12px;
    padding: 2em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* === 信息提示框 === */
#hnc-ds-section .hnc-info-box {
    margin-bottom: 1.5em;
}

/* === 内部容器 === */
#hnc-daily-sentence-interactive {
    margin-top: 1em;
}

/* === 1. 句子显示区域 === */
.hnc-ds-sentence-display {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5em;
    margin-bottom: 0.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.hnc-ds-sentence {
    color: #1e293b !important;
    font-size: 1.5rem;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin: 0;
}

/* === 【新增】翻译切换区域 === */
.hnc-ds-translation-toggle-area {
    text-align: center;
    margin-bottom: 1em;
}

#hnc-ds-toggle-trans-btn.hnc-trans-btn-inline {
    background-color: transparent;
    color: #6366f1;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

#hnc-ds-toggle-trans-btn.hnc-trans-btn-inline:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* === 2. 音频控制区域 === */
.hnc-ds-controls-grid {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
    display: flex;
    gap: 2em;
    align-items: flex-start;
}

.hnc-ds-control-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.hnc-accent-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75em;
    width: 100%;
    justify-content: flex-start;
}

.hnc-ds-control-label,
#hnc-ds-user-audio-playback-container label,
#hnc-ds-user-audio-playback-container p {
    color: #1e293b !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: block !important;
}

#hnc-ds-user-audio-playback-container {
    display: none;
    flex-direction: column;
    gap: 0.75em;
}

#hnc-ds-user-audio-playback-container .hnc-ds-user-placeholder {
    width: 100%;
    min-height: 150px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5em;
    text-align: center;
    padding: 1.25em;
}

#hnc-ds-user-audio-playback-container .hnc-ds-placeholder-icon {
    font-size: 1.6em;
    line-height: 1;
}

.hnc-ds-audio,
#hnc-ds-user-audio-playback-container audio {
    width: 100% !important;
    height: 40px !important;
    border-radius: 4px !important;
    max-width: none !important;
}

/* === 3. 主要操作按钮 === */
.hnc-ds-main-actions {
    text-align: center;
    margin-bottom: 1em;
    display: flex;
    justify-content: center;
    gap: 1em;
}

.hnc-primary-btn,
#hnc-ds-record-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.hnc-primary-btn:hover,
#hnc-ds-record-btn:hover {
    background-color: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}

#hnc-ds-record-btn.recording {
    background-color: #ef4444 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hnc-secondary-btn {
    background-color: #f7f8fa;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.hnc-secondary-btn:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.hnc-btn-icon {
    font-size: 1.1em;
}

/* === 录音状态栏 === */
.hnc-ds-status-bar {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-style: italic;
    min-height: 1.5em;
    margin-bottom: 1em;
}

/* === 4. 翻译面板【字体增大50%】 === */
#hnc-daily-sentence-interactive #hnc-ds-translation-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-left: 3px solid #a78bfa;
    border-radius: 8px;
    padding: 1em 1.5em;
    color: #475569;
    line-height: 1.7;
    font-size: 1.5rem;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.08);
    
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    transition: opacity .3s ease, transform .3s ease, max-height .3s ease, padding .3s ease, margin .3s ease;
}

#hnc-daily-sentence-interactive #hnc-ds-translation-container.hnc-translation-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
    padding-top: 1em;
    padding-bottom: 1em;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

/* === 5. 结果容器 === */
.hnc-ds-results-container {
    margin-top: 2em;
}

/* ============================================================
   【重点优化】手风琴样式 - 更精致的视觉 + 更流畅的动画
   ============================================================ */

/* 手风琴整体容器 */
#hnc-daily-sentence-interactive .hnc-result-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    
    /* 入场动画 */
    opacity: 0;
    transform: translateY(12px);
}

#hnc-daily-sentence-interactive .hnc-result-section:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#hnc-daily-sentence-interactive .hnc-result-section.hnc-revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* 手风琴标题栏 */
#hnc-daily-sentence-interactive .hnc-section-header {
    background: linear-gradient(to right, #f9fafb, #ffffff);
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    transition: background 0.2s ease;
    user-select: none;
}

#hnc-daily-sentence-interactive .hnc-section-header:hover {
    background: linear-gradient(to right, #f3f4f6, #f9fafb);
}

#hnc-daily-sentence-interactive .hnc-section-header:active {
    background: #f3f4f6;
}

/* 标题文字 */
#hnc-daily-sentence-interactive .hnc-section-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #374151;
}

#hnc-daily-sentence-interactive .hnc-accordion-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 展开/收起箭头 */
#hnc-daily-sentence-interactive .hnc-section-toggle {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #f3f4f6;
}

#hnc-daily-sentence-interactive .hnc-result-section.expanded .hnc-section-toggle {
    transform: rotate(180deg);
    background: #e5e7eb;
    color: #6b7280;
}

/* 手风琴内容区【关键：流畅动画】 */
#hnc-daily-sentence-interactive .hnc-section-content {
    background: #ffffff;
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    
    /* 使用 GPU 加速的过渡 */
    transition: 
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    will-change: max-height, opacity;
}

#hnc-daily-sentence-interactive .hnc-result-section.expanded .hnc-section-content {
    opacity: 1;
    padding: 16px 18px;
    /* max-height 由 JS 动态设置 */
}

/* 内容区内部容器 */
#hnc-daily-sentence-interactive .hnc-ds-score-summary,
#hnc-daily-sentence-interactive .hnc-ds-diff-result,
#hnc-daily-sentence-interactive .hnc-ds-vocab {
    padding: 4px 0;
}

/* 展开时的分隔线效果 */
#hnc-daily-sentence-interactive .hnc-result-section.expanded .hnc-section-header {
    border-bottom: 1px solid #f3f4f6;
}

/* ============================================================ */

/* === 评分卡片样式 === */
.hnc-score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5em;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.hnc-score-card.high-score {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.hnc-score-card.medium-score {
    background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
}

.hnc-score-card.low-score {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.hnc-score-display {
    text-align: center;
    margin-bottom: 1em;
}

.hnc-score-number {
    font-size: 3rem;
    font-weight: 700;
    color: #166534;
    line-height: 1;
}

.hnc-score-card.medium-score .hnc-score-number {
    color: #854d0e;
}

.hnc-score-card.low-score .hnc-score-number {
    color: #991b1b;
}

.hnc-score-text {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.25em;
}

.hnc-feedback-details {
    width: 100%;
}

.hnc-feedback-toggle {
    width: 100%;
    padding: 0.75em;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    transition: all 0.2s;
}

.hnc-feedback-toggle:hover {
    background: rgba(255,255,255,0.9);
}

.hnc-feedback-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.hnc-feedback-content.show {
    max-height: 500px;
    margin-top: 1em;
}

.hnc-feedback-item {
    display: flex;
    padding: 0.75em 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.hnc-feedback-item:last-child {
    border-bottom: none;
}

.hnc-feedback-label {
    min-width: 100px;
    font-weight: 600;
    color: #374151;
}

.hnc-feedback-value {
    flex: 1;
    color: #64748b;
}

/* === 词汇网格 === */
.hnc-vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
}

.hnc-vocab-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1em;
}

.hnc-vocab-header {
    margin-bottom: 0.5em;
}

.hnc-vocab-word {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.hnc-vocab-pos {
    font-size: 0.8rem;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.5em;
}

.hnc-vocab-ipa {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
    margin-top: 0.25em;
}

.hnc-vocab-definition {
    font-size: 0.9rem;
    color: #475569;
    margin: 0.25em 0;
}

.hnc-vocab-example {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
    margin-top: 0.5em;
    padding-top: 0.5em;
    border-top: 1px dashed #e2e8f0;
}

/* === 响应式设计 === */
@media (max-width: 1024px) {
    .hnc-vocabulary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #hnc-ds-section {
        padding: 1.5em;
    }
    
    .hnc-ds-sentence {
        font-size: 1.25rem;
    }
    
    #hnc-daily-sentence-interactive #hnc-ds-translation-container {
        font-size: 1.25rem !important;
    }
    
    .hnc-ds-controls-grid {
        flex-direction: column !important;
        gap: 1.5em !important;
    }
    
    .hnc-ds-control-item {
        width: 100% !important;
        background: white;
        padding: 1em;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .hnc-ds-control-label,
    #hnc-ds-user-audio-playback-container label,
    #hnc-ds-user-audio-playback-container p {
        margin-bottom: 0.75em !important;
        font-size: 15px !important;
        text-align: center !important;
    }
    
    .hnc-ds-audio,
    #hnc-ds-user-audio-playback-container audio {
        width: 100% !important;
        height: 45px !important;
    }
    
    #hnc-ds-user-audio-playback-container {
        background: white !important;
        padding: 1em !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
    
    .hnc-ds-main-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75em;
    }
    
    .hnc-primary-btn,
    .hnc-secondary-btn,
    #hnc-ds-record-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .hnc-vocabulary-grid {
        grid-template-columns: 1fr;
    }
    
    .hnc-score-number {
        font-size: 2rem !important;
    }
    
    .hnc-feedback-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5em !important;
    }
    
    .hnc-feedback-label {
        min-width: auto !important;
        text-align: center !important;
    }
    
    /* 移动端手风琴优化 */
    #hnc-daily-sentence-interactive .hnc-section-header {
        padding: 12px 14px;
    }
    
    #hnc-daily-sentence-interactive .hnc-section-header-title {
        font-size: 14px;
    }
    
    #hnc-daily-sentence-interactive .hnc-result-section.expanded .hnc-section-content {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    #hnc-ds-section {
        padding: 1em;
    }
    
    .hnc-ds-sentence {
        font-size: 1.1rem;
    }
    
    #hnc-daily-sentence-interactive #hnc-ds-translation-container {
        font-size: 1.1rem !important;
    }
    
    .hnc-ds-sentence-display {
        padding: 1em;
    }
    
    .hnc-score-number {
        font-size: 1.8rem !important;
    }
    
    .hnc-ds-vocab-item {
        min-height: 150px;
    }
}

/* === 入场动画延迟（阶梯效果） === */
#hnc-daily-sentence-interactive .hnc-result-section:nth-child(1) {
    transition-delay: 0.05s;
}
#hnc-daily-sentence-interactive .hnc-result-section:nth-child(2) {
    transition-delay: 0.1s;
}
#hnc-daily-sentence-interactive .hnc-result-section:nth-child(3) {
    transition-delay: 0.15s;
}

/* === 翻译容器隐藏态 === */
#hnc-daily-sentence-interactive #hnc-ds-translation-container:not(.hnc-translation-visible) {
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
}

/* === 句子与下方元素间距 === */
#hnc-daily-sentence-interactive .hnc-ds-sentence-display {
    margin-bottom: 0.5em;
}

/* === 每日一句标题行 === */
.hnc-ds-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5em;
}

.hnc-ds-header-row .hnc-module-title {
    margin: 0;
}

/* === 复制链接图标按钮 === */
#hnc-ds-copy-link-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

#hnc-ds-copy-link-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

#hnc-ds-copy-link-btn:active {
    background: #f1f5f9;
}

#hnc-ds-copy-link-btn.copied {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}


/* === 修复：翻译/详情文字被裁切 === */
#hnc-daily-sentence-interactive #hnc-ds-translation-container.hnc-translation-visible{
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}
#hnc-daily-sentence-interactive .hnc-section-content,
#hnc-daily-sentence-interactive .hnc-feedback-content,
#hnc-daily-sentence-interactive .hnc-feedback-details,
#hnc-daily-sentence-interactive .hnc-ds-user-placeholder{
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}


/* === 修复：翻译/发音详情文字被裁切 === */
#hnc-daily-sentence-interactive #hnc-ds-translation-container.hnc-translation-visible{
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}
#hnc-daily-sentence-interactive .hnc-section-content,
#hnc-daily-sentence-interactive .hnc-feedback-content,
#hnc-daily-sentence-interactive .hnc-feedback-details,
#hnc-daily-sentence-interactive .hnc-ds-user-placeholder{
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* === 修复：手风琴默认收起（恢复折叠状态） === */
#hnc-daily-sentence-interactive .hnc-result-section:not(.expanded) .hnc-section-content{
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
#hnc-daily-sentence-interactive .hnc-result-section.expanded .hnc-section-content{
  overflow: hidden; /* 交给JS控制高度 */
}
#hnc-daily-sentence-interactive .hnc-feedback-content:not(.show){
  max-height: 0 !important;
  overflow: hidden !important;
}


/* === 强制覆盖内联高度（修复翻译被裁切） === */
#hnc-daily-sentence-interactive #hnc-ds-translation-container{
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
