.zi-attributes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 0.5rem;
}

.zi-attr {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 0.75rem;
  line-height: 1.5;
  break-inside: avoid; /* 防止内容断开 */
}

.zi-attr.full-width {
  grid-column: 1 / -1; /* 跨所有列 */
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attr-label {
  color: #dc3545;
  min-width: 60px;
  margin-right: 0.5rem;
}

.attr-label a {
  color: inherit;
  text-decoration: none;
}

.attr-label a:hover {
  text-decoration: underline;
}

.attr-value {
  color: #333;
  word-break: break-all;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .zi-attributes {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .zi-attr:not(.full-width) {
    grid-column: span 2; /* 手机端每行2列 */
  }
}

@media (max-width: 480px) {
  .zi-attributes {
    grid-template-columns: 1fr;
  }
  
  .zi-attr:not(.full-width) {
    grid-column: 1;
  }
}
/* 响应式适配 */
@media screen and (min-width: 769px) {
  .zi-writer-container {
    position: sticky;
    top: 1rem;
    padding-right: 2rem;
    border-right: 1px solid #eee;
  }
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
  .zi-writer-container {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
  }
}

/* 保持原有标签样式 */
.zi-attr-item {
  background: #f8f9fa;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

/* 响应式适配 */
@media screen and (max-width: 768px) {
  .zi-title-main {
    text-align: center;
  }
  .pinyin {
    justify-content: center;
  }
}

/* 语音标签样式 */
.pinyin .tag {
  align-items: center;
  padding: 0.5em 0.8em;
}
.pinyin img {
  vertical-align: middle;
}

/* Unicode显示优化 */
.unicode {
  font-family: monospace;
  background: #f5f5f5;
  padding: 2px 5px;
  border-radius: 3px;
}

/* 标签悬停效果 */
.zi-tags a:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}





/* niuniuniu */
/* ===== 核心布局样式 ===== */
.content-card-body {
  background: var(--theme-bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 12px var(--shadow-color);
  margin: 20px 0;
  padding: 24px;
}
.content-nav-list {
    --gap-x: 20px;
    padding-bottom: 10px;
    padding-top: 5px;
}
.content-nav-list .list {
    display: flex;
    margin: 0 calc(var(20px)* -1);
}
.zi-pinyin-nav {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}
.scroll-x {
    --gap-x: 20px;
    margin: 0 calc(#fff -1);
    position: relative;
}
.scroll-x:after, .scroll-x:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 1;
}
.scroll-x:before {
    right: 0;
    background: linear-gradient(90deg, transparent, var(--theme-bg-color));
}
.scroll-x .wrap {
    padding: 10px 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    scrollbar-width: none;
}
.content-nav-list .list a.active {
    position: relative;
    background-color: red;
    font-weight: 700;
    color: #fff;
}
.content-nav-list .list a:first-child {
    margin-left: 0;
}
.content-nav-list .list a {
    flex-grow: 1;
    white-space: nowrap;
    text-align: center;
    border: 1px solid rgba(200, 200, 200, 0.4);
    background-color: #f9f9f9;
    border-radius: 5px;
    font-size: 14px;
    padding: 5px 15px;
    margin: 0 5px;
}
.content-nav-list .list a.active::before {
    bottom: -7px;
}
.content-nav-list .list a.active::after {
    bottom: -6px;
    border-top-color: red;
}

.content-nav-list .list a.active::after, .content-nav-list .list a.active::before {
    position: absolute;
    content: " ";
    width: 0;
    height: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid transparent;
}
sup {
    position: relative;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
}
.zi-contents .zi-content {
    margin-bottom: 20px;
}
.zi-content {
    --explain-en-color: #004200;
    --explain-en-outer-color: #aaa;
    --extra-en-color: #004200;
    --extra-quote-color: #885e1b;
    --extra-eg-color: #777;
}
.zi-heading.main {
    justify-content: flex-start;
    border-bottom: none;
    margin-bottom: 25px;
}
.zi-heading {
    margin-bottom: 25px;
    display: flex
;
    align-items: center;
}
.zi-heading .zi-title, .zi-heading h5 {
    font-size: 1.75rem;
    margin-bottom: 0;
}
.zi-heading .zi-title::before {
    content: "▶ ";
    padding-right: .5em;
    font-size: .875rem;
}
.zi-heading .zi-title-alias::after, .zi-heading .zi-title-alias::before {
    color: #999;
}
.zi-heading .zi-title-alias {
    font-size: 1rem;
}
.zi-heading .zi-title-alias::before {
    content: " ( ";
}
.zi-heading .zi-title-alias::after {
    content: " ) ";
}
.zi-heading h3, .zi-heading h5 {
    display: inline-flex;
    align-items: center;
}
.zi-heading h5+span, .zi-heading.main .voice {
    margin-left: 10px;
}
.kxzd-cover figure, .zi-contents h3, .zi-contents h4, .zi-contents h5 {
    margin-bottom: 0;
}
.zi-title, .zi-title>* {
    position: relative;
}
.zi-heading.main sup {
    background-color: #f60c0c;
    color: #fff;
    width: 14px;
    line-height: 14px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    height: 14px;
    border-radius: 10px;
    margin-left: 8px;
}
sup {
    top: -.5em;
}
.zi-heading.secondary {
    justify-content: space-between;
    border-bottom: 2px solid rgba(200, 200, 200, 0.4);
}
.zi-heading h4 {
    background-color: #f0f0f0;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
    padding: 5px 10px;
    font-size: .875rem;
}
.zi-basic-explain .explain {
    margin-left: 30px;
    position: relative;
}
.zi-content .explain {
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin: 0 0 0 30px;
    padding: 8px 0;
    position: relative;
    line-height: 180%;
    border-left: none!important;
}
.zi-content .explain .no {
    position: absolute;
    left: -26px;
    top: 14px;
    color: red;
    line-height: 1rem;
    font-size: 16px;
}
.zi-content .explain .eg {
    color: var(--extra-eg-color);
    font-size: 14px;
}
.zi-detail-explain .cixing {
    font-size: 1rem;
    color: red;
    border-bottom: 0;
    margin: 1.25rem 0;
    font-weight: 700;
    counter-reset: content-counter 0;
}
.zi-detail-explain .cixing::before {
    content: "〈 ";
    font-size: .875rem;
}
.zi-detail-explain .cixing::after {
    content: " 〉";
    font-size: .875rem;
}
.list.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

/* ===== 汉字标题与拼音 ===== */
.zi-title {
  font-size: 2rem;
  color: var(--text-color);
  margin: 0 0.5em 0 0;
  display: inline-block;
}

.zi-title-alias {
  font-size: 0.9em;
  color: #666;
  vertical-align: super;
}

.voice:hover {
    border-color: rgba(255, 0, 0, .6);
    box-shadow: 0 .5rem 1rem var(--shadow-color);
}
.voice {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 0, 0, .3);
    border-radius: 50px;
    padding: 0 2px;
    height: 24px;
    cursor: pointer;
    transition: all .2slinear;
}
.voice em {
    padding: 0 6px 0 2px;
    font-style: normal;
    font-size: 14px;
    font-family: Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
}
.voice em.zy {
    font-size: 12px;
}
.voice em:last-child {
    padding-right: 10px;
}
a.primary {
    padding-bottom: 1px;
    text-align: center;
    color: red;
    border-bottom: 1px solid #dc3545;
}
.py, .zy {
  font-style: normal;
  margin: 0 4px;
}

/* ===== 解释内容区块 ===== */
.zi-basic-explain .explain {
  line-height: 1.8;
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
  position: relative;
}

.zi-basic-explain .no {
  position: absolute;
  left: 0;
  color: var(--red);
  font-weight: 500;
}
.extra.quotes {
  background: #f9f9f9;
  border-radius: 4px;
  padding: 12px;
  margin: 8px 0;
}
.zi-detail-explain .extra.quotes {
    color: #885e1b;
}
.zi-detail-explain .extra.quotes>label {
    background-color: #8a0303;
}
.zi-detail-explain .extra>label:before {
    content: "";
    background-color: #fff;
    top: -9px;
    left: 0;
    width: 36px;
    height: 8px;
    position: absolute;
}
.zi-detail-explain .extra.quotes .author {
    color: #666;
}

.zi-detail-explain .extra {
    font-size: 14px;
    position: relative;
    padding-left: 0;
    margin-bottom: 0;
    margin-left: 20px;
    border-left: 1px solid rgba(200, 200, 200, 0.4);
    padding-top: 32px;
    line-height: 1.5;
}
.zi-detail-explain .extra.eg {
    color: #777;
}
.zi-detail-explain .extra.eg>label {
    background-color: #666;
}
.zi-detail-explain .extra>label {
    position: absolute;
    left: -20px;
    top: 8px;
    border-radius: 12px;
    width: 36px;
    height: 20px;
    line-height: 20px;
    box-sizing: content-box;
    color: #fff;
    z-index: 1;
    white-space: nowrap;
    text-align: center;
    font-size: 11px;
    margin-bottom: 0;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.zi-detail-explain .extra>span {
    display: block;
    padding: 6px 0 6px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.zi-detail-explain .extra.en>label {
    background-color: #67a535;
}

.hanzi-container {
  display: inline-block;
  text-align: center;
  margin: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 20px;
  transition: transform 0.2s ease;
}

.hanzi-container:hover {
  transform: translateY(-2px);
}

.hanzi-animation {
  width: 150px !important;
  height: 150px !important;
  margin: 0 auto 15px;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  background: #fff;
}

.hanzi-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hanzi-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(135deg,#cc0f35,#a50c2b);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(60,153,255,0.2);
}

.hanzi-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(60,153,255,0.3);
  opacity: 0.95;
}

.hanzi-button:active {
  transform: translateY(0);
}

.replay-icon {
  fill: currentColor;
  transition: transform 0.3s ease;
}

.hanzi-button:hover .replay-icon {
  transform: rotate(-180deg);
}

/* 新增适配代码 */
#hanzi-canvas svg {
  max-width: 100%; /* 防止SVG溢出 */
}


/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .content-card-body {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 16px;
  }

  .zi-title {
    font-size: 1.6rem;
  }

  .list.scroll-x {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  .list.scroll-x::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .zi-basic-explain .explain {
    font-size: 0.95rem;
    padding-left: 1rem;
  }

  .extra.quotes {
    padding: 8px;
  }
}

/* ===== 暗黑模式 ===== */
html[data-theme="dark"] {
  --body-bg-color: #1a1a1a;
  --theme-bg-color: #2d2d2d;
  --text-color: #e0e0e0;
  --border-color: #404040;

  .zi-title-alias {
    color: #999;
  }

  .extra.quotes {
    background: #363636;
  }

  .zi-basic-explain .no {
    color: #ff6b6b;
  }
}

/* ===== 工具类 ===== */
.mb-0 { margin-bottom: 0 !important; }
.mr-2 { margin-right: 8px !important; }
.d-flex { display: flex !important; }
.wrap { flex-wrap: wrap; }
.has-text-danger { color: var(--red) !important; }

/* ===== 动画效果 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zi-content {
  animation: fadeInUp 0.3s ease-out;
}