@font-face {
  font-family: 'xile';
  src: url('../fonts/xile.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'kangkang';
  src: url('../fonts/kangkang.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Patrick Hand';
  src: url('../fonts/patrick-hand-v25-latin-regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dymon ShouXieTi';
  src: url('../fonts/Dymon-ShouXieTi.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #e07a5f;
  --primary-light: #f0a58e;
  --secondary: #3d85c6;
  --accent: #81b29a;
  --warning: #f2cc8f;
  --danger: #c44536;
  --success: #81b29a;
  --bg: #fdf6e3;
  --bg-card: #fffdf7;
  --text: #3d3229;
  --text-light: #7a6e63;
  --border: #3d3229;
  --font-title: 'xile', 'Dymon ShouXieTi', cursive;
  --font-hand: 'kangkang', 'Patrick Hand', cursive;
  --font-body: 'kangkang', 'Patrick Hand', sans-serif;
  --radius: 3px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-hand);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(224, 122, 95, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(61, 133, 198, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(129, 178, 154, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  filter: url(#hand-drawn);
  padding: 16px 32px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-area a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon svg {
  display: block;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 2px;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s;
  filter: url(#hand-drawn);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
  position: relative;
  z-index: 1;
}

.layout-wrapper {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
  margin-top: 40px;
}

.layout-wrapper.no-sidebar {
  grid-template-columns: 1fr;
}

.layout-wrapper.layout-full {
  grid-template-columns: 1fr;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.content-area-full {
  max-width: 100%;
}

.content-area {
  min-width: 0;
}

.hand-drawn-border {
  filter: url(#hand-drawn);
  border-radius: var(--radius);
}

.hero-section {
  text-align: center;
  padding: 60px 0 40px;
  position: relative;
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -2px;
  height: 12px;
  background: var(--primary);
  opacity: 0.15;
  border-radius: 4px;
  transform: rotate(-1deg);
  filter: url(#hand-drawn);
}

.hero-subtitle {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--text-light);
  margin-top: 8px;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  transition: all 0.3s ease;
}

.post-card:hover {
  transform: translateY(-3px) rotate(0.3deg);
  box-shadow: 4px 4px 0 var(--border);
}

.post-card-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 8px;
}

.post-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-card-title a:hover {
  color: var(--primary);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.post-card-meta a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.post-card-meta a:hover {
  color: var(--primary);
}

.post-card-meta .meta-sep {
  opacity: 0.4;
}

.post-card-excerpt {
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 16px;
}

.post-card-main {
  display: block;
}

.post-card-main.has-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.post-card-main.has-thumb .post-card-excerpt {
  margin-bottom: 0;
}

.post-card-thumb {
  display: block;
  width: 132px;
  height: 96px;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  filter: url(#hand-drawn);
  background: rgba(61, 50, 41, 0.06);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-card-tags a,
.post-tags a {
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: var(--font-hand);
  font-size: 15px;
  padding: 2px 8px;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
  text-decoration-color: rgba(224, 122, 95, 0.4);
  filter: none;
}

.post-card-tags a:hover,
.post-tags a:hover {
  text-decoration-color: var(--primary);
}

.read-more {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  filter: url(#hand-drawn);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.read-more:hover {
  opacity: 0.7;
}

.post-detail {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 40px 36px;
  filter: url(#hand-drawn);
}

.post-detail-title {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 400;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.post-detail-meta a {
  color: var(--text-light);
  text-decoration: none;
}

.post-detail-meta a:hover {
  color: var(--primary);
}

.post-content {
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}

.post-content h1 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 400;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  filter: url(#hand-drawn);
}

.post-content h2 {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px dashed rgba(61, 50, 41, 0.2);
  line-height: 1.3;
}

.post-content h3 {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin: 24px 0 10px;
  line-height: 1.3;
}

.post-content h4 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  margin: 20px 0 8px;
}

.post-content p {
  margin-bottom: 14px;
}

.post-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  filter: url(#hand-drawn);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.post-content a:hover {
  opacity: 0.7;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border);
  border-radius: 6px;
  filter: url(#hand-drawn);
  margin: 16px 0;
}

.post-content blockquote {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-left: 5px solid var(--primary);
  padding: 20px 24px;
  margin: 16px 0;
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  position: relative;
  filter: url(#hand-drawn);
}

.post-content blockquote::before {
  content: '\201C';
  font-size: 60px;
  color: var(--primary);
  opacity: 0.3;
  position: absolute;
  top: -10px;
  left: 12px;
  font-family: var(--font-title);
  line-height: 1;
}

.post-content blockquote p {
  padding-left: 16px;
  margin-bottom: 6px;
}

.post-content ul {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
}

.post-content ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 6px;
  line-height: 1.6;
}

.post-content ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  filter: url(#hand-drawn);
}

.post-content ol {
  list-style: none;
  padding-left: 0;
  counter-reset: sketch-counter;
  margin: 12px 0;
}

.post-content ol li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 6px;
  line-height: 1.6;
  counter-increment: sketch-counter;
}

.post-content ol li::before {
  content: counter(sketch-counter) '.';
  position: absolute;
  left: 2px;
  color: var(--primary);
  font-weight: 600;
  font-size: 18px;
}

.post-content code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: rgba(61, 50, 41, 0.08);
  border: 1px solid rgba(61, 50, 41, 0.15);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--primary);
  filter: url(#hand-drawn);
}

.post-content pre {
  background: #2b2520;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0;
  filter: url(#hand-drawn);
}

.post-content pre code {
  display: block;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #e8e0d8;
  padding: 16px 20px;
  background: transparent;
  border: none;
  filter: none;
  overflow-x: auto;
  tab-size: 2;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 4px;
  filter: url(#hand-drawn);
  overflow: hidden;
}

.post-content table th,
.post-content table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1.5px dashed rgba(61, 50, 41, 0.2);
}

.post-content table th {
  color: var(--text);
  font-weight: 400;
  font-size: 15px;
  background: rgba(61, 50, 41, 0.04);
  border-bottom: 2px solid var(--border);
}

.post-content table td {
  color: var(--text-light);
}

.post-content table tbody tr:hover {
  background: rgba(224, 122, 95, 0.04);
}

.post-content table tbody tr:last-child td {
  border-bottom: none;
}

.post-content hr {
  border: none;
  height: 2px;
  background: var(--border);
  opacity: 0.2;
  margin: 32px 0;
  filter: url(#hand-drawn);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1.5px dashed rgba(61, 50, 41, 0.2);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
}

.post-nav-item {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  transition: all 0.2s;
  filter: url(#hand-drawn);
  display: block;
  color: var(--text);
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1.4;
}

.post-nav-item.is-empty {
  opacity: 0.65;
  pointer-events: none;
}

.post-nav-item.prev::before,
.post-nav-item.next::before {
  display: block;
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.post-nav-item.prev::before {
  content: '上一篇';
}

.post-nav-item.next::before {
  content: '下一篇';
}

.post-nav-item:hover {
  transform: translateY(-2px) rotate(0.3deg);
  box-shadow: 3px 3px 0 var(--border);
}

.post-nav-item.next {
  text-align: right;
}

.post-nav-label {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

.post-nav-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--text);
}

.sketch-tag {
  font-family: var(--font-hand);
  font-size: 14px;
  padding: 3px 12px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
  color: var(--text);
  filter: url(#hand-drawn);
  display: inline-block;
  transition: transform 0.2s;
  text-decoration: none;
}

.sketch-tag:hover {
  transform: rotate(1deg) scale(1.03);
}

.tag-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.tag-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-category {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 15px;
  padding: 2px 8px;
  filter: none;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
  text-decoration-color: rgba(224, 122, 95, 0.4);
}

.tag-category:hover {
  text-decoration-color: var(--primary);
}

.sketch-badge {
  font-family: var(--font-hand);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
  filter: url(#hand-drawn);
  display: inline-block;
  letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge-accent { background: var(--accent); color: #fff; border-color: var(--accent); }

.callout {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  align-items: flex-start;
  margin: 16px 0;
  filter: url(#hand-drawn);
}

.callout-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  font-weight: bold;
}

.callout-body {
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.5;
}

.callout-body strong {
  font-family: var(--font-title);
  font-size: 18px;
  display: block;
  margin-bottom: 4px;
}

.callout-body p {
  color: var(--text-light);
  margin-bottom: 4px;
}

.callout-info { border-left: 4px solid var(--secondary); }
.callout-info .callout-icon { background: rgba(61, 133, 198, 0.15); color: var(--secondary); }
.callout-warning { border-left: 4px solid var(--warning); }
.callout-warning .callout-icon { background: rgba(242, 204, 143, 0.25); color: #b8860b; }
.callout-success { border-left: 4px solid var(--success); }
.callout-success .callout-icon { background: rgba(129, 178, 154, 0.15); color: var(--success); }
.callout-error { border-left: 4px solid var(--danger); }
.callout-error .callout-icon { background: rgba(196, 69, 54, 0.15); color: var(--danger); }
.callout-note { border-left: 4px solid var(--text-light); }
.callout-note .callout-icon { background: rgba(122, 110, 99, 0.1); color: var(--text-light); }

.btn {
  font-family: var(--font-hand);
  font-size: 18px;
  padding: 10px 28px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px) rotate(0.5deg);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--text);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--text);
}

.sketch-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hand);
  font-size: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.breadcrumb-item {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.breadcrumb-item:hover {
  opacity: 0.7;
}

.breadcrumb-sep {
  color: var(--text-light);
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--text-light);
}

.sketch-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 40px;
  justify-content: center;
}

.page-btn {
  font-family: var(--font-hand);
  font-size: 16px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-block;
  filter: url(#hand-drawn);
}

.page-btn:hover {
  background: rgba(224, 122, 95, 0.08);
  transform: translateY(-1px);
}

.page-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-dots {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--text-light);
  padding: 0 4px;
}

.sketch-kbd {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 4px;
  color: var(--text);
  filter: url(#hand-drawn);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  vertical-align: middle;
  line-height: 1.4;
}

.notation-underline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='12' viewBox='0 0 200 12'%3E%3Cpath d='M2 8 Q50 2, 100 7 Q150 12, 198 5' stroke='%23e07a5f' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: bottom left;
  background-repeat: repeat-x;
  background-size: 200px 12px;
  padding-bottom: 6px;
}

.notation-highlight {
  background: linear-gradient(180deg, transparent 10%, rgba(242, 204, 143, 0.5) 10%, rgba(242, 204, 143, 0.5) 90%, transparent 90%);
  padding: 2px 4px;
  filter: url(#hand-drawn);
}

.notation-highlight-half {
  background: linear-gradient(180deg, transparent 55%, rgba(242, 204, 143, 0.45) 55%, rgba(242, 204, 143, 0.45) 90%, transparent 90%);
  padding: 2px 4px;
  filter: url(#hand-drawn);
}

.notation-circle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60' viewBox='0 0 160 60'%3E%3Cellipse cx='80' cy='30' rx='75' ry='25' stroke='%23e07a5f' stroke-width='2' fill='none' transform='rotate(-2 80 30)' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 115% 110%;
  padding: 8px 16px;
}

.notation-box {
  border: 2px solid var(--primary);
  filter: url(#hand-drawn);
  border-radius: 2px;
  padding: 4px 12px;
}

.accordion-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.accordion-item {
  border: 2px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  filter: url(#hand-drawn);
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: none;
  border: none;
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(224, 122, 95, 0.05);
}

.accordion-arrow {
  font-size: 14px;
  color: var(--text-light);
  transition: transform 0.3s ease;
}

.accordion-item.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 18px;
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-light);
}

.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 18px 16px;
}

.progress-bar-wrap {
  margin: 16px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.sketch-progress {
  height: 20px;
  background: rgba(61, 50, 41, 0.06);
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  filter: url(#hand-drawn);
}

.sketch-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  position: relative;
}

.sketch-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(255,255,255,0.15) 4px, rgba(255,255,255,0.15) 8px);
}

.notation-strike {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='8' viewBox='0 0 200 8'%3E%3Cpath d='M0 5 Q50 2, 100 5 Q150 8, 200 3' stroke='%23c44536' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: repeat-x;
  background-size: 200px 8px;
  color: var(--text-light);
}

.notation-bracket {
  position: relative;
  padding: 0 20px;
}

.notation-bracket::before,
.notation-bracket::after {
  font-size: 36px;
  color: var(--primary);
  font-weight: 300;
  line-height: 0.8;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.notation-bracket::before {
  content: '[';
  left: 0;
}

.notation-bracket::after {
  content: ']';
  right: 0;
}

.notation-wavy {
  text-decoration: underline wavy var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.tag-warning { background: var(--warning); color: #3d3229; border-color: var(--warning); }
.tag-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.tag-success { background: var(--success); color: #fff; border-color: var(--success); }

.tag-outline {
  background: transparent;
  border-style: dashed;
}

.tag-outline-primary { border-color: var(--primary); color: var(--primary); }
.tag-outline-accent { border-color: var(--accent); color: var(--accent); }
.tag-outline-warning { border-color: #b8860b; color: #b8860b; }

.badge-warning { background: var(--warning); color: #3d3229; border-color: var(--warning); }
.badge-danger { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border: 2px solid var(--text);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid transparent;
}

.btn-ghost:hover {
  background: rgba(61, 50, 41, 0.06);
}

.btn-sm {
  font-size: 14px;
  padding: 6px 16px;
}

.btn-lg {
  font-size: 22px;
  padding: 14px 36px;
}

.sketch-figure {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  max-width: 100%;
  margin: 16px 0;
  filter: url(#hand-drawn);
}

.sketch-figure-img {
  width: 100%;
  height: auto;
  display: block;
}

.sketch-figure figcaption {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  padding: 10px 16px;
  text-align: center;
  border-top: 1.5px dashed rgba(61, 50, 41, 0.2);
}

.code-block-wrapper {
  background: #2b2520;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-block-lang {
  font-family: var(--font-hand);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-block-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-block-filename {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.sketch-code-block {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #e8e0d8;
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  tab-size: 2;
}

.sketch-code-inline {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: rgba(61, 50, 41, 0.08);
  border: 1px solid rgba(61, 50, 41, 0.15);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--primary);
  filter: url(#hand-drawn);
}

.table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 4px;
  margin: 16px 0;
  filter: url(#hand-drawn);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-hand);
  font-size: 16px;
}

.table-wrapper th,
.table-wrapper td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1.5px dashed rgba(61, 50, 41, 0.2);
}

.table-wrapper th {
  color: var(--text);
  font-weight: 400;
  font-size: 15px;
  background: rgba(61, 50, 41, 0.04);
  border-bottom: 2px solid var(--border);
}

.table-wrapper td {
  color: var(--text-light);
}

.table-wrapper tbody tr:hover {
  background: rgba(224, 122, 95, 0.04);
}

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.sketch-tooltip-wrap {
  position: relative;
  display: inline-block;
}

.sketch-tooltip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fdf6e3;
  font-family: var(--font-hand);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 500;
  filter: url(#hand-drawn);
}

.sketch-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}

.sketch-tooltip-top {
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
}

.sketch-tooltip-top::after {
  top: 100%;
  border-top-color: var(--text);
}

.sketch-tooltip-bottom {
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-4px);
}

.sketch-tooltip-bottom::after {
  bottom: 100%;
  border-bottom-color: var(--text);
}

.sketch-tooltip-wrap:hover .sketch-tooltip-top {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sketch-tooltip-wrap:hover .sketch-tooltip-bottom {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sketch-checklist {
  list-style: none;
  padding-left: 0;
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--text);
  margin: 12px 0;
}

.sketch-checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 6px;
  line-height: 1.6;
}

.sketch-checklist li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 2px;
  filter: url(#hand-drawn);
}

.sketch-checklist li.checked::before {
  background: var(--primary);
  border-color: var(--primary);
}

.sketch-checklist li.checked::after {
  content: '\2713';
  position: absolute;
  left: 5px;
  top: 3px;
  font-size: 14px;
  color: #fff;
  font-weight: bold;
}

.sketch-checklist li.checked {
  color: var(--text-light);
}

.divider-dots {
  max-width: 100%;
  height: 10px;
  background-image: radial-gradient(circle, var(--border) 1.5px, transparent 1.5px);
  background-size: 16px 10px;
  background-position: center;
  background-repeat: repeat-x;
  opacity: 0.4;
  margin: 24px 0;
}

.progress-secondary { background: var(--secondary); }
.progress-accent { background: var(--accent); }

.site-footer {
  margin-top: 80px;
  padding: 0 24px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0 32px;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.footer-brand {
  flex: 1;
}

.footer-logo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--text);
}

.footer-desc {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.footer-link {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-divider {
  height: 1.5px;
  background: var(--border);
  opacity: 0.15;
  margin: 24px 0;
  filter: url(#hand-drawn);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-copyright {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer-copyright a {
  color: var(--text-light);
  text-decoration: none;
}

.footer-copyright a:hover {
  color: var(--primary);
}

.footer-icp {
  font-family: var(--font-hand);
  font-size: 0.8rem;
}

.footer-icp a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-icp a:hover {
  color: var(--primary);
}

.fab-group {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.fab-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: url(#hand-drawn);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.08);
}

.fab-btn:hover {
  transform: translateY(-2px) rotate(3deg);
  background: rgba(224, 122, 95, 0.1);
  box-shadow: 2px 4px 12px rgba(0,0,0,0.12);
}

.fab-back-to-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.fab-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-star {
  position: absolute;
  animation: hand-twinkle 3s ease-in-out infinite;
  opacity: 0.3;
}

@keyframes hand-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(1deg); }
  75% { transform: translateY(4px) rotate(-0.5deg); }
}

@keyframes hand-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.anim-float {
  animation: hand-float 4s ease-in-out infinite;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  filter: url(#hand-drawn);
}

.sidebar-widget-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed rgba(61, 50, 41, 0.2);
}

.sidebar-profile {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar-author {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
}

.sidebar-bio {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.4;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: block;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--text-light);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  color: var(--primary);
  background: rgba(224, 122, 95, 0.06);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-post-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-post-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-post-item:hover {
  background: rgba(224, 122, 95, 0.06);
}

.sidebar-post-title {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-post-date {
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.7;
}

.sketch-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hand);
  font-size: 20px;
  font-weight: 400;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.sketch-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.sketch-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.sketch-avatar-img.sketch-avatar-lg {
  width: 64px;
  height: 64px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.social-icon-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  filter: url(#hand-drawn);
}

.social-icon-sm:hover {
  transform: scale(1.1) rotate(3deg);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.comments-area {
  margin-top: 40px;
}

.comments-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 24px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
  list-style: none;
  padding-left: 0;
}

.comment-item {
  display: block;
}

.comment-main {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  flex-shrink: 0;
  padding-top: 4px;
}

.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  filter: url(#hand-drawn);
}

.comment-body {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  filter: url(#hand-drawn);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.comment-reply-to {
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--primary);
  background: rgba(224, 122, 95, 0.12);
  border: 1px dashed rgba(224, 122, 95, 0.45);
  border-radius: 999px;
  padding: 1px 8px;
}

.comment-author {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--text);
  font-weight: 400;
}

.comment-author a {
  color: var(--text);
  text-decoration: none;
}

.comment-author a:hover {
  color: var(--primary);
}

.comment-date {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--text-light);
  opacity: 0.7;
}

.comment-text {
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 8px;
}

.comment-reply-btn {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  text-decoration: none;
  opacity: 0.7;
  transition: color 0.2s, opacity 0.2s;
}

.comment-body .comment-reply a {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  text-decoration: none;
  opacity: 0.7;
  transition: color 0.2s, opacity 0.2s;
}

.comment-body .comment-reply a:hover {
  color: var(--primary);
  opacity: 1;
}

.comment-reply-btn:hover {
  color: var(--primary);
  opacity: 1;
}

.comment-children {
  margin-top: 12px;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.comment-children > .comment-item {
  margin-top: 12px;
}

.comment-thread {
  margin-top: 14px;
  border: 1.5px dashed rgba(224, 122, 95, 0.45);
  border-radius: 6px;
  background: rgba(253, 246, 227, 0.45);
  padding: 10px 12px 12px;
}

.comment-thread-label {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--primary);
  background: rgba(224, 122, 95, 0.1);
  border: 1px dashed rgba(224, 122, 95, 0.35);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.comment-thread .comment-item:first-child {
  margin-top: 0;
}

/* 回复框被移动到评论下方时，保持可读宽度 */
.comment-body .respond {
  margin-top: 14px;
  width: 100%;
  min-width: 280px;
  max-width: 100%;
  padding: 16px;
}

.comment-body .respond .respond-title {
  font-size: 20px;
}

.comment-body .respond .comment-form-fields {
  grid-template-columns: 1fr;
}

.respond {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  filter: url(#hand-drawn);
}

.respond-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
}

.comment-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.comment-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-form-field.full-width {
  grid-column: 1 / -1;
}

.comment-form-field label {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--text-light);
}

.comment-form-field input,
.comment-form-field textarea {
  width: 100%;
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
  border-color: var(--primary);
  border-style: solid;
}

.comment-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.comment-submit {
  margin-top: 12px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.page-desc {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--text-light);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-year {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 400;
  color: var(--primary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

.archive-item:hover {
  background: rgba(224, 122, 95, 0.06);
}

.archive-date {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--text-light);
  flex-shrink: 0;
  width: 70px;
}

.archive-title a {
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.archive-title a:hover {
  color: var(--primary);
}

.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-number {
  font-family: var(--font-title);
  font-size: 120px;
  color: var(--primary);
  opacity: 0.3;
  line-height: 1;
}

.error-message {
  font-family: var(--font-title);
  font-size: 32px;
  color: var(--text);
  margin: 20px 0 12px;
}

.error-desc {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .main-content {
    padding: 0 16px 60px;
  }

  .site-header {
    padding: 12px 16px;
  }

  .header-nav {
    display: none;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    padding: 16px;
    gap: 12px;
    z-index: 99;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .layout-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-section {
    padding: 40px 0 24px;
  }

  .post-detail {
    padding: 24px 20px;
  }

  .post-nav {
    flex-direction: column;
  }

  .comment-form-fields {
    grid-template-columns: 1fr;
  }

  .comment-children {
    margin-left: 0;
  }

  .post-card-main.has-thumb {
    grid-template-columns: 1fr;
  }

  .post-card-thumb {
    width: 120px;
    height: 88px;
  }

  .fab-group {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 600px) {
  .footer-main {
    flex-direction: column;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
}

body.pencil-mode {
  filter: url(#colored-pencil);
}

.theme-panel {
  position: fixed;
  right: 24px;
  bottom: 90px;
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.panel-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px 24px;
  width: 270px;
  filter: url(#hand-drawn);
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 4px 6px 20px rgba(0,0,0,0.12);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--text);
  margin: 0;
}

.panel-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.panel-close:hover {
  color: var(--danger);
}

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: block;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.color-swatches {
  display: flex;
  gap: 8px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  filter: url(#hand-drawn);
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.font-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.font-btn {
  font-size: 14px;
  padding: 4px 10px;
  border: 2px solid var(--border);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.font-btn:hover {
  background: rgba(224, 122, 95, 0.1);
}

.font-btn.active {
  background: var(--primary);
  color: #fff;
}

.range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  filter: url(#hand-drawn);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--text);
  cursor: pointer;
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--text);
  cursor: pointer;
}

.trail-options {
  display: flex;
  gap: 8px;
}

.trail-btn {
  font-family: var(--font-hand);
  font-size: 14px;
  padding: 4px 12px;
  border: 2px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  filter: url(#hand-drawn);
  transition: all 0.2s;
}

.trail-btn:hover {
  background: rgba(224, 122, 95, 0.1);
}

.trail-btn.active {
  background: var(--primary);
  color: #fff;
}

.panel-reset-group {
  margin-bottom: 0;
  padding-top: 4px;
  border-top: 1.5px dashed rgba(61, 50, 41, 0.15);
}

.btn-reset {
  font-family: var(--font-hand);
  font-size: 14px;
  padding: 6px 16px;
  border: 2px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-light);
  filter: url(#hand-drawn);
  transition: all 0.2s;
  width: 100%;
}

.btn-reset:hover {
  background: rgba(196, 69, 54, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.cursor-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

.cursor-star {
  animation: particle-fade 1s ease-out forwards;
}

@keyframes particle-fade {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0) translateY(-30px); }
}

.cursor-bubble {
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: rgba(224, 122, 95, 0.1);
  animation: bubble-rise 1.5s ease-out forwards;
}

@keyframes bubble-rise {
  0% { opacity: 0.8; transform: scale(0.5) translateY(0); }
  100% { opacity: 0; transform: scale(1.5) translateY(-60px); }
}

@media (max-width: 768px) {
  .theme-panel {
    right: 16px;
    bottom: 80px;
  }

  .panel-content {
    width: 240px;
    padding: 16px;
  }
}
