/* 轻松学汉字（全新设计）—— 暖色书卷渐变 + 玻璃卡片 + 明确按钮与悬停，CSS/SVG 轻量可动画 */
.hanzi-learning {
  position: relative; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--ink); font-family: var(--font-sans);
  background:
    radial-gradient(1100px 560px at 88% -10%, #fde68a 0%, transparent 55%),
    radial-gradient(900px 520px at -12% 108%, #fecaca 0%, transparent 55%),
    #fbf8f3;
}
.hanzi-learning[hidden] { display: none; }
.hanzi-learning * { box-sizing: border-box; }
.hanzi-learning button { cursor: pointer; font: inherit; border: 0; }
.hanzi-learning button:focus-visible { outline: 3px solid #d97706; outline-offset: 3px; border-radius: 10px; }
.hanzi-learning button:disabled { opacity: .45; cursor: default; }

.hz-ambient { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hz-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; }
.b1 { width: 300px; height: 300px; left: -70px; top: -50px; background: #fca5a5; animation: hz-float 15s ease-in-out infinite; }
.b2 { width: 340px; height: 340px; right: -90px; top: 130px; background: #fcd34d; animation: hz-float 19s ease-in-out infinite reverse; }
.b3 { width: 250px; height: 250px; right: 16%; bottom: -70px; background: #fdba74; opacity: .35; animation: hz-float 17s ease-in-out infinite; }
@keyframes hz-float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(22px) translateX(10px); } }

.hz-topbar {
  position: relative; z-index: 2; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px;
}
.hz-topbar h1 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.hz-step-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,.85); color: #b45309;
  border: 1px solid rgba(180,83,9,.18); font-weight: 700; font-size: 13px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06); transition: transform .15s;
}
.hz-step-btn:hover { transform: translateX(-2px); }

.hz-body {
  position: relative; z-index: 1; width: 100%; max-width: 1120px;
  margin: 0 auto; flex: 1; min-height: 0; overflow: auto;
  padding: 8px 26px 60px;
}
.hz-empty { text-align: center; color: #94a3b8; padding: 50px 0; }
.hz-status { color: #dc2626; text-align: center; font-size: 13px; }

.hz-hero { margin: 4px 0 20px; }
.hz-hero h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.hz-hero p { margin: 0; color: #a16207; font-size: 14px; }

/* 快捷入口 */
.hz-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 26px; }
.hz-quick-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px; border-radius: 18px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(15,23,42,.07);
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
  transition: transform .18s, box-shadow .18s;
}
.hz-quick-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,23,42,.12); }
.hz-q-ic {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 17px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--hz-soft); color: var(--hz-solid);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 8px 16px -10px var(--hz-solid);
  transition: background .25s, color .25s, box-shadow .25s;
}
.hz-q-ic::before { content:""; position:absolute; inset:0; border-radius:inherit;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.8), transparent 62%); pointer-events:none; }
.hz-q-ic svg { position: relative; width: 30px; height: 30px; overflow: visible; }
.hz-quick-card[data-color="amber"] { --hz-solid:#f59e0b; --hz-soft:#fef3dc; }
.hz-quick-card[data-color="rose"] { --hz-solid:#fb5b6c; --hz-soft:#ffe4e8; }
.hz-quick-card:hover .hz-q-ic { background: var(--hz-solid); color:#fff; box-shadow: 0 14px 24px -10px var(--hz-solid); }
.hz-quick-card strong { display: block; font-size: 15px; font-weight: 800; }
.hz-quick-card small { color: #94a3b8; font-size: 12.5px; }

.hz-section-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; color: #475569; }
.hz-grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hz-grade-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15,23,42,.07);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.hz-grade-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15,23,42,.1); border-color: #f59e0b; }
.hz-grade-ic {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 17px;
  display: grid; place-items: center; overflow: hidden;
  background: #fef3dc; color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 8px 16px -10px #f59e0b;
  transition: background .25s, color .25s, box-shadow .25s;
}
.hz-grade-ic::before { content:""; position:absolute; inset:0; border-radius:inherit;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.8), transparent 62%); pointer-events:none; }
.hz-grade-ic svg { position: relative; width: 30px; height: 30px; overflow: visible; }
.hz-grade-badge {
  position: absolute; right: -4px; top: -4px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: #f59e0b; color: #fff; font-style: normal; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(245,158,11,.5);
}
.hz-grade-card:hover .hz-grade-ic { background: #f59e0b; color: #fff; box-shadow: 0 14px 24px -10px #f59e0b; }
.hz-grade-card:hover .hz-grade-badge { background: #fff; color: #f59e0b; }
.hz-grade-name { flex: 1; font-weight: 800; font-size: 15px; }
.hz-grade-card > svg { color: #cbd5e1; }

/* 字表 */
.hz-word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.hz-word {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.08);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.hz-word:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.1); border-color: #f59e0b; }
.hz-word span { font-size: 34px; font-weight: 800; line-height: 1; }
.hz-word small { color: #a16207; font-size: 12.5px; }
.hz-more {
  margin: 18px auto 0; display: block;
  padding: 10px 26px; border-radius: 999px;
  background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700;
}
.hz-more:hover { background: #ffedd5; }

/* 搜索 */
.hz-search-form { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.hz-search-form input {
  flex: 1; padding: 13px 16px; border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12); background: rgba(255,255,255,.9); font: inherit;
}
.hz-search-form input:focus { outline: none; border-color: #f59e0b; }
.hz-search-form button {
  width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hz-search-form button[type="reset"] { background: #f1f5f9; color: #64748b; }
.hz-search-form button[type="submit"] { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; }
.hz-search-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hz-search-heading h2 { font-size: 15px; margin: 0; }
.hz-mini { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 700; font-size: 12.5px; }
.hz-mini.danger { background: #fee2e2; color: #dc2626; }
.hz-history { display: flex; flex-wrap: wrap; gap: 10px; }
.hz-history button { padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.9); border: 1px solid rgba(15,23,42,.1); font-weight: 700; }
.hz-history button:hover { background: #fef3c7; border-color: #f59e0b; }

/* 生字本工具 */
.hz-notebook-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.hz-notebook-tools label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #475569; }
.hz-notebook-tools select { padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(15,23,42,.12); background: #fff; font: inherit; }
.hz-notebook-tools > button { padding: 8px 18px; border-radius: 999px; background: #f59e0b; color: #fff; font-weight: 700; }
.hz-select-all { color: #475569; }

/* 详情 */
.hz-detail { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 22px; }
.hz-character-side {
  background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px; padding: 22px; box-shadow: 0 14px 34px rgba(15,23,42,.07);
}
.hz-readings { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hz-readings button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 13px;
}
.hz-readings button[aria-pressed="true"] { background: #d97706; color: #fff; }
.hz-main-character {
  display: flex; align-items: center; justify-content: center;
  min-height: 280px; border-radius: 16px; background:
    linear-gradient(#f1f5f9 1px, transparent 1px) 0 0/100% 50%,
    linear-gradient(90deg,#f1f5f9 1px, transparent 1px) 0 0/50% 100%,
    #fffdf8;
  border: 1px solid rgba(15,23,42,.06);
}
.hz-character-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.hz-character-tools button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  background: #fef3c7; color: #92400e;
}
.hz-character-tools button:hover { background: #fde68a; }
.hz-properties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.hz-properties div { display: flex; justify-content: space-between; background: #f8fafc; border-radius: 10px; padding: 9px 12px; }
.hz-properties dt { color: #94a3b8; font-size: 12.5px; }
.hz-properties dd { margin: 0; font-weight: 800; font-size: 13px; }
.hz-word-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.hz-nav-btn {
  display: inline-flex; align-items: center; gap: 5px; flex: 1; justify-content: center;
  padding: 10px; border-radius: 12px; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700; font-size: 13px;
}
.hz-nav-btn:hover { background: #ffedd5; }

.hz-detail-info section { margin-bottom: 22px; }
.hz-detail-info h2 { font-size: 16px; margin: 0 0 10px; border-left: 4px solid #f59e0b; padding-left: 9px; }
.hz-detail-info p { color: #64748b; font-size: 13px; margin: 0 0 12px; }
.hz-strokes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.hz-strokes button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px; border-radius: 12px; background: rgba(255,255,255,.9); border: 1px solid rgba(15,23,42,.08);
  font-size: 12.5px; font-weight: 700;
}
.hz-strokes button:hover { border-color: #f59e0b; background: #fffbeb; }
.hz-stroke-preview { width: 48px; height: 48px; }
.hz-stroke-preview canvas { width: 100%; height: 100%; }
.hz-meanings { margin: 0; padding-left: 20px; color: #475569; font-size: 13.5px; line-height: 1.9; }
.hz-phrases { display: flex; flex-wrap: wrap; gap: 8px; }
.hz-phrases span { padding: 7px 14px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 13px; }

/* 写一写弹窗 */
.hz-writing-dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(440px, 92vw);
  box-shadow: 0 30px 70px rgba(15,23,42,.3);
}
.hz-writing-dialog::backdrop { background: rgba(15,23,42,.45); }
.hz-writing-dialog header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(15,23,42,.08);
}
.hz-writing-dialog h2 { margin: 0; font-size: 17px; font-weight: 900; }
.hz-dlg-close { width: 36px; height: 36px; border-radius: 10px; background: #f1f5f9; color: #64748b; display: inline-flex; align-items: center; justify-content: center; }
.hz-writing-grid { display: flex; justify-content: center; padding: 24px 20px 8px; }
.hz-progress { text-align: center; font-weight: 800; color: #b45309; margin: 8px 0; }
.hz-writing-dialog footer { display: flex; gap: 12px; padding: 14px 20px 22px; }
.hz-writing-dialog footer button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
}
.hz-writing-dialog footer button:nth-child(1) { background: #fef3c7; color: #92400e; }
.hz-writing-dialog footer button:nth-child(2) { background: #f59e0b; color: #fff; }

/* 确认弹窗 */
.hz-confirm { border: 0; border-radius: 18px; padding: 24px; width: min(340px, 90vw); box-shadow: 0 24px 60px rgba(15,23,42,.28); }
.hz-confirm h2 { margin: 0 0 10px; font-size: 17px; }
.hz-confirm p { color: #64748b; font-size: 14px; margin: 0 0 18px; }
.hz-confirm-actions { display: flex; gap: 12px; }
.hz-confirm-actions button { flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; }
.hz-confirm-actions [data-cancel] { background: #f1f5f9; color: #475569; }
.hz-confirm-actions [data-confirm] { background: #dc2626; color: #fff; }

.hz-retry { display: inline-flex; align-items: center; gap: 8px; background: #f59e0b; color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 700; }

@media (max-width: 860px) { .hz-detail { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .hz-body { padding: 6px 16px 48px; }
  .hz-word-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .hz-grade-grid { grid-template-columns: 1fr; }
}

/* ===== 动态 logo 动画（柔和缓慢循环，hover 加速） ===== */
.hz-q-ic [class^="ic-"], .hz-grade-ic [class^="ic-"] { transform-box: fill-box; transform-origin: center; }
@keyframes hz-grid-move { to { stroke-dashoffset: 8.8; } }
.ic-grid { animation: hz-grid-move 1.6s linear infinite; }
@keyframes hz-lines-show { 0%,100% { opacity:.5; } 50% { opacity:1; } }
.ic-lines path { animation: hz-lines-show 2.4s ease-in-out infinite; }
.ic-lines path:nth-child(2) { animation-delay:.3s; }
.ic-lines path:nth-child(3) { animation-delay:.6s; }
@keyframes hz-search-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.ic-search { animation: hz-search-pulse 2.4s ease-in-out infinite; }
.hz-quick-card:hover .hz-q-ic [class^="ic-"],
.hz-grade-card:hover .hz-grade-ic [class^="ic-"] { animation-duration: 1.1s; }
