
/*
102解构器Style

*/


/*
 * 916 Sonnet加了4个不同风格的按钮
817解构器Style CC试图调整次数按钮位置

*/


/*
817解构器Style CC优化无法隐藏的问题成功

*/


/*
87解构器Style

*/

/* 新增：句子解构器美化样式 */

/* === 解构器标题行 === */
.hnc-deconstructor-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 1em;
}

.hnc-deconstructor-header-row .hnc-module-title {
  margin: 0;
  text-align: left;
}

/* === 复制链接图标按钮 === */
#hnc-deconstructor-section #hnc-deconstructor-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-deconstructor-section #hnc-deconstructor-copy-link-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

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

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

/* 难度分析卡片 */
.hnc-difficulty-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 1.5em;
  margin: 1em 0;
  border: 1px solid #e2e8f0;
}

.hnc-difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1em;
}

.hnc-cefr-a1, .hnc-cefr-a2 { background: #dcfce7; color: #166534; }
.hnc-cefr-b1 { background: #dbeafe; color: #1e40af; }
.hnc-cefr-b2 { background: #fef3c7; color: #92400e; }
.hnc-cefr-c1, .hnc-cefr-c2 { background: #fecaca; color: #991b1b; }

.hnc-cefr-level {
  font-size: 18px;
  font-weight: bold;
}

.hnc-cefr-desc {
  font-size: 14px;
  opacity: 0.9;
}

.hnc-complexity-meter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hnc-complexity-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.hnc-complexity-bars {
  display: flex;
  gap: 4px;
}

.hnc-complexity-bar {
  width: 20px;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  transition: all 0.3s ease;
}

.hnc-complexity-bar.active {
  background: #3b82f6;
}

/* 句子类型卡片 */
.hnc-sentence-type-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5em;
  margin: 1em 0;
  border-left: 4px solid #3b82f6;
}

.hnc-type-badge {
  display: inline-block;
  background: #3b82f6;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.5em;
}

.hnc-type-description {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

/* 语法点样式 */
.hnc-grammar-points {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.hnc-grammar-point {
  background: #fefefe;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1em;
  transition: all 0.2s ease;
}

.hnc-grammar-point:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.hnc-grammar-term {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5em;
  font-size: 16px;
}

.hnc-grammar-explanation {
  color: #64748b;
  line-height: 1.5;
}

/* 成分分析样式 */
.hnc-component-analysis {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.hnc-clause-analysis {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5em;
  border: 1px solid #e2e8f0;
}

.hnc-clause-title {
  margin: 0 0 1em 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hnc-clause-title::before {
  content: "📝";
  font-size: 18px;
}

.hnc-clause-quote {
  background: #f1f5f9;
  border-left: 3px solid #3b82f6;
  padding: 0.75em 1em;
  margin: 1em 0;
  font-style: italic;
  color: #475569;
  border-radius: 0 6px 6px 0;
}

.hnc-clause-components {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.hnc-component {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5em 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.hnc-component-label {
  font-weight: 600;
  color: #64748b;
  min-width: 80px;
  font-size: 14px;
}

.hnc-component-value {
  color: #1e293b;
  font-weight: 500;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.hnc-clause-note {
  margin-top: 0.75em;
  padding: 0.75em;
  background: #fef3c7;
  border-radius: 6px;
  color: #92400e;
  font-size: 14px;
  border-left: 3px solid #f59e0b;
}

/* 词汇卡片样式 */
.hnc-vocabulary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1em;
}

.hnc-vocab-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5em;
  transition: all 0.2s ease;
}

.hnc-vocab-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

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

.hnc-vocab-word {
  margin: 0 0 0.25em 0;
  color: #1e293b;
  font-size: 18px;
  font-weight: 600;
}

.hnc-vocab-ipa {
  display: block;
  font-family: "Lucida Sans Unicode", "Arial Unicode MS", sans-serif;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 0.5em;
  font-style: italic;
}

.hnc-vocab-definition {
  color: #64748b;
  font-size: 14px;
}

.hnc-vocab-synonyms {
  margin-bottom: 1em;
  padding: 0.75em;
  background: #f8fafc;
  border-radius: 6px;
}

.hnc-synonyms-label {
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hnc-synonyms-list {
  color: #3b82f6;
  font-weight: 500;
  margin-left: 8px;
}

.hnc-vocab-example {
  border-top: 1px solid #f1f5f9;
  padding-top: 1em;
}

.hnc-example-english {
  font-style: italic;
  color: #475569;
  margin-bottom: 0.25em;
}

.hnc-example-chinese {
  color: #64748b;
  font-size: 14px;
}

/* 使用场景样式 */
.hnc-usage-scenario {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5em;
  border: 1px solid #e2e8f0;
}

.hnc-usage-context {
  display: inline-block;
  background: #3b82f6;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1em;
}

.hnc-usage-description {
  margin: 0 0 1em 0;
  color: #475569;
  line-height: 1.6;
}

.hnc-usage-examples {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hnc-examples-label {
  font-weight: 600;
  color: #64748b;
  font-size: 14px;
}

.hnc-usage-tag {
  background: #e2e8f0;
  color: #475569;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* 例句样式 */
.hnc-example-sentences {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.hnc-example-sentence {
  display: flex;
  gap: 1em;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1em;
  transition: all 0.2s ease;
}

.hnc-example-sentence:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.hnc-example-number {
  background: #3b82f6;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.hnc-example-content {
  flex: 1;
}

.hnc-example-english {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0.25em;
}

.hnc-example-chinese {
  color: #64748b;
  font-size: 14px;
}

/* 全句翻译样式 */
.hnc-full-translation {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  padding: 1.5em;
  border: 1px solid #bae6fd;
}

.hnc-translation-text {
  color: #0c4a6e;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
}

/* 解构器专用手风琴样式 - 用于所有8个部分 */
.hnc-deconstructor-accordion-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1em;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hnc-deconstructor-accordion-item:last-child {
  margin-bottom: 0;
}

/* 解构器手风琴标题 */
.hnc-deconstructor-accordion-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2em 1.5em;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1em;
  color: #334155;
  list-style: none;
  transition: all 0.2s ease;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
  margin: 0;
}

.hnc-deconstructor-accordion-title:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.hnc-deconstructor-accordion-title::-webkit-details-marker {
  display: none;
}

/* 解构器手风琴文本 */
.hnc-deconstructor-accordion-text {
  flex: 1;
}

/* 解构器手风琴图标 */
.hnc-deconstructor-accordion-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-size: 14px;
}

.hnc-deconstructor-accordion-icon::after {
  content: "▼";
}

/* 展开时旋转图标 */
.hnc-deconstructor-accordion-item[open] > .hnc-deconstructor-accordion-title .hnc-deconstructor-accordion-icon {
  transform: rotate(180deg);
}

/* 展开时标题样式 */
.hnc-deconstructor-accordion-item[open] > .hnc-deconstructor-accordion-title {
  color: #1e293b;
  background: #eff6ff;
  border-bottom: 1px solid #e2e8f0;
}

/* 解构器手风琴内容 */
.hnc-deconstructor-accordion-content {
  padding: 1.5em;
  background: #ffffff;
  border-radius: 0 0 12px 12px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 风格选择器样式 */
#hnc-deconstructor-section .hnc-style-selector {
  margin: 1em 0 !important;
  padding: 1.5em !important;
  background: #f8fafc !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}

#hnc-deconstructor-section .hnc-style-label {
  margin: 0 0 1em 0 !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  font-size: 16px !important;
}

#hnc-deconstructor-section .hnc-style-buttons {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#hnc-deconstructor-section .hnc-style-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 1em !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: white !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-weight: 600 !important;
  color: #64748b !important;
  font-size: 14px !important;
}

#hnc-deconstructor-section .hnc-style-btn:hover {
  border-color: #3b82f6 !important;
  background: #f0f9ff !important;
}

#hnc-deconstructor-section .hnc-style-btn.active {
  border-color: #3b82f6 !important;
  background: #3b82f6 !important;
  color: white !important;
}

#hnc-deconstructor-section .hnc-style-desc {
  font-size: 12px !important;
  font-weight: normal !important;
  margin-top: 4px !important;
  opacity: 0.8 !important;
}

/* 移动端优化 */
@media (max-width: 600px) {
  .hnc-vocabulary-grid {
    grid-template-columns: 1fr;
  }
  
  .hnc-difficulty-card,
  .hnc-sentence-type-card,
  .hnc-clause-analysis,
  .hnc-usage-scenario,
  .hnc-full-translation {
    padding: 1em;
  }
  
  .hnc-component {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .hnc-component-label {
    min-width: auto;
  }
}

/* 粘性头部样式 */
.hnc-sticky-header {
  position: fixed;
  top: 60px; /* 调整顶部位置，避免被WordPress头部遮挡 */
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 2px solid #3b82f6;
  padding: 15px 20px;
  z-index: 999; /* 降低z-index，确保在WordPress头部下方 */
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  will-change: transform;
}

.hnc-sticky-header.visible {
  transform: translateY(0);
}

.hnc-sticky-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.hnc-sticky-icon {
  font-size: 20px;
  color: #3b82f6;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hnc-sticky-text {
  color: #1e293b;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  flex: 1;
  background: rgba(59, 130, 246, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .hnc-grammar-point:hover,
  .hnc-vocab-card:hover,
  .hnc-example-sentence:hover {
    border-color: #e2e8f0;
    box-shadow: none;
  }
  
  .hnc-grammar-point:active,
  .hnc-vocab-card:active,
  .hnc-example-sentence:active {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  }
}

/* 移动端粘性头部优化 */
@media (max-width: 600px) {
  .hnc-sticky-header {
    padding: 10px 15px;
    position: fixed !important;
    top: 50px !important; /* 移动端调整位置 */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999 !important;
  }
  
  .hnc-sticky-text {
    font-size: 13px;
    word-break: break-word;
    hyphens: auto;
  }
  
  .hnc-sticky-header {
    -webkit-transform: translateY(-100%);
    transform: translateY(-100%);
  }
  
  .hnc-sticky-header.visible {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

/* === 新增：解构器专用手风琴样式（完全独立作用域）=== */

/* 限定作用域：只影响解构器内的元素 */
#hnc-deconstructor-result .hnc-decon-section {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 1em !important;
    overflow: hidden !important;
    animation: hnc-expandIn 0.5s ease-out !important;
}

@keyframes hnc-expandIn {
    from {
        opacity: 0;
        transform: scaleY(0.8);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

#hnc-deconstructor-result .hnc-decon-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    padding: 1em 1.5em !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #e2e8f0 !important;
    transition: background 0.2s !important;
}

#hnc-deconstructor-result .hnc-decon-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

#hnc-deconstructor-result .hnc-decon-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.75em !important;
    font-weight: 600 !important;
    color: #374151 !important;
}

#hnc-deconstructor-result .hnc-decon-icon {
    font-size: 1.2em !important;
}

#hnc-deconstructor-result .hnc-decon-toggle {
    font-size: 1.2em !important;
    color: #64748b !important;
    transition: transform 0.3s !important;
}

#hnc-deconstructor-result .hnc-decon-section.expanded .hnc-decon-toggle {
    transform: rotate(180deg) !important;
}

#hnc-deconstructor-result .hnc-decon-content {
    max-height: 0 !important; /* 默认折叠 */
    overflow: hidden !important; /* 折叠时隐藏内容 */
    transition: max-height 0.4s ease-out !important; /* 保留平滑的动画效果 */
}

#hnc-deconstructor-result .hnc-decon-section.expanded .hnc-decon-content {
    max-height: 2000px !important; /* 展开时给一个足够大的高度 */
}

#hnc-deconstructor-result .hnc-decon-body {
    padding: 1.5em !important;
}

/* === 隐藏/显示分析功能样式 === */
#hnc-deconstructor-section.hnc-analysis-hidden #hnc-deconstructor-result {
    display: none !important;
}

#hnc-deconstructor-section.hnc-analysis-visible #hnc-deconstructor-result {
    display: block !important;
}

/* 按钮状态样式 */
#hnc-toggle-analysis-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    margin-left: 10px;
}

#hnc-toggle-analysis-btn:hover {
    background: #2563eb;
}

#hnc-toggle-analysis-btn:active {
    background: #1d4ed8;
}

/* === 使用次数信息和按钮布局 === */
#hnc-deconstructor-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#hnc-usage-info {
    font-size: 14px;
    color: #666;
    margin-left: 15px;
}

@media (max-width: 768px) {
    #hnc-deconstructor-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #hnc-usage-info {
        margin-left: 0;
        margin-top: 10px;
    }
}






