.modal-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.modal-container.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-container.active .modal-overlay {
  opacity: 1;
}
.modal-content {
  position: relative;
  background: var(--color-bg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--space-2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: min(var(--width-container), 800px);
  width: 90%;
  max-height: 90vh;
  margin: 0 auto;
  overflow: hidden;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  flex-direction: column;
}
.modal-container.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}
.modal-content.modal-small {
  max-width: min(380px, var(--width-container));
  max-height: none;
  overflow: visible;
}
.modal-content.modal-large {
  max-width: min(1200px, var(--width-container));
  max-height: 80vh;
}
.modal-content.modal-fullscreen {
  max-width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
}
.modal-close {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  border-radius: 0;
  color: var(--color-fg-muted);
  cursor: pointer;
  transition: all var(--ease-fast);
  opacity: 0.8;
  padding: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-top: auto;
}
.modal-close svg {
  display: block;
  width: var(--size-xs);
  height: var(--size-xs);
  fill: currentColor;
  margin-right: var(--space-1);
}
.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-fg);
  opacity: 1;
}
.modal-close:focus {
  outline: none;
  box-shadow: inset 0 0 0 var(--focus-outline) var(--color-accent);
}
.modal-body {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + var(--size-2xl));
  margin: 0;
  scroll-behavior: smooth;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-modal-accent-bg);
  position: relative;
}
.modal-header::before {
  content: "";
  position: absolute;
  top: var(--space-1);
  left: 50%;
  transform: translateX(-50%);
  width: var(--space-10);
  height: var(--space-1);
  background: var(--color-modal-handle);
  border-radius: var(--space-1);
  opacity: 0.6;
}
.modal-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-fg);
  margin: 0;
  text-align: center;
  flex: 1;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-modal-accent-bg);
}
.modal-footer-actions {
  display: flex;
  gap: var(--space-3);
}
.modal-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}
.modal-button-container {
  display: flex;
  height: 40px;
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-bg-secondary);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  margin-top: auto;
  flex-shrink: 0;
}
.modal-button-container .modal-close-btn,
.modal-button-container .modal-visit-btn,
.modal-button-container .modal-share-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
  color: var(--color-fg);
}
.modal-button-container .modal-close-btn {
  background: var(--color-bg-alt);
  border-bottom-left-radius: var(--radius-md);
  border-right: 1px solid var(--color-border);
}
.modal-button-container .modal-visit-btn {
  border-bottom-right-radius: var(--radius-md);
  background: var(--color-accent);
  color: white;
}
.modal-button-container .modal-share-btn {
  background: var(--color-bg-alt);
  border-left: 1px solid var(--color-border);
}
.modal-button-container .modal-close-btn:hover,
.modal-button-container .modal-visit-btn:hover,
.modal-button-container .modal-share-btn:hover {
  opacity: 0.8;
}
.modal-button-container .modal-close-btn:hover {
  background: var(--color-bg);
}
.modal-button-container .modal-visit-btn:hover {
  background: var(--color-accent-hover);
}
.modal-button-container .modal-share-btn:hover {
  background: var(--color-bg);
}
@media (max-width: 768px) {
  .modal-container {
    align-items: flex-start;
  }
  .modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 80vh;
    margin: 0;
    transform: translateY(-100%);
  }
  .modal-content.modal-small {
    max-width: 100%;
    margin: 0;
    max-height: 70vh;
  }
  .modal-content.modal-large {
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
    transform: translateY(-100%);
  }
  .modal-content.modal-fullscreen {
    max-width: 100%;
    max-height: 100vh;
    margin: 0;
    transform: translateY(-100%);
  }
  .modal-header,
  .modal-footer {
    padding: var(--space-4) var(--space-5);
  }
  .modal-body {
    padding: var(--space-1) var(--space-1) var(--space-1);
  }
  .modal-title {
    font-size: var(--font-size-xl);
  }
  .note-post-header {
    padding: var(--space-2);
  }
  .note-post-header-layout {
    flex-direction: column;
    gap: var(--space-2);
    align-items: center;
  }
  .note-post-header-image {
    width: 100px;
    height: 100px;
  }
  .note-post-header-content {
    text-align: center;
    width: 100%;
  }
  .note-post-header-no-image .note-post-header-content {
    max-width: 100%;
  }
  .note-post-meta {
    justify-content: center;
  }
  .note-post-description {
    font-size: var(--font-size-xs);
  }
  .note-post-header .note-post-title {
    font-size: 1.25rem;
  }
  .note-card-tags {
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .modal-container {
    align-items: flex-start;
  }
  .modal-content {
    max-width: 100%;
    max-height: 85vh;
    margin: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transform: translateY(-100%);
  }
  .modal-content.modal-fullscreen {
    max-width: 100%;
    max-height: 100vh;
    margin: 0;
    transform: translateY(-100%);
  }
  .modal-header,
  .modal-footer {
    padding: var(--space-3) var(--space-4);
  }
  .modal-body {
    padding: var(--space-1) var(--space-1) var(--space-1);
  }
  .modal-close {
    padding: var(--space-1) var(--space-4);
    font-size: var(--font-size-xs);
  }
  .modal-title {
    font-size: var(--font-size-lg);
  }
  .note-post-header-layout {
    flex-direction: column;
    gap: var(--space-3);
    align-items: center;
  }
  .note-post-header-image {
    width: 120px;
    height: 120px;
  }
  .note-post-header-content {
    text-align: center;
    width: 100%;
  }
  .note-post-header-no-image .note-post-header-content {
    max-width: 100%;
  }
  .note-post-meta {
    justify-content: center;
  }
  .note-post-description {
    font-size: var(--font-size-sm);
  }
}
.note-post-full {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  line-height: 1.7;
}
.note-post-header {
  margin: 0 auto var(--space-4);
  padding: var(--space-2);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  max-width: 800px;
}
.note-post-header-layout {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.note-post-header-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.note-post-header-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}
.note-post-header-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.note-post-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  justify-content: center;
}
.note-post-header-no-image {
  justify-content: center;
}
.note-post-header-no-image .note-post-header-content {
  text-align: center;
  max-width: 100%;
}
.note-post-header-no-image .note-post-meta {
  justify-content: center;
}
.note-post-header-no-image .note-card-tags {
  justify-content: center;
}
.note-post-description {
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--color-fg-muted);
  margin: 0;
  font-weight: 400;
  opacity: 0.8;
}
.note-post-header .note-post-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: 0.15em;
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.note-post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0.15em;
  font-size: 0.8rem;
  color: var(--color-fg-muted);
  font-weight: 500;
}
.note-post-meta span {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.note-post-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-fg);
  text-align: left;
  font-family: var(--font-body);
}
.note-post-content h1,
.note-post-content h2,
.note-post-content h3,
.note-post-content h4,
.note-post-content h5,
.note-post-content h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: 1em;
  color: var(--color-fg);
  position: relative;
}
.note-post-content h1 {
  font-size: 2.2rem;
  text-align: center;
  margin-top: 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5em;
}
.note-post-content h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
  margin-top: 2em;
}
.note-post-content h3 {
  font-size: 1.4rem;
  color: var(--color-fg);
  margin-top: 1.8em;
}
.note-post-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.6em;
}
.note-post-content h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.4em;
}
.note-post-content h6 {
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  margin-top: 1.2em;
}
.note-post-content p {
  margin-bottom: 1.2em;
  line-height: 1.7;
  color: var(--color-fg);
  text-align: left;
}
.note-post-content ul,
.note-post-content ol {
  border-radius: var(--radius-md);
}
.note-post-content ul {
  list-style: none;
}
.note-post-content ul li {
  position: relative;
  padding-left: 1em;
  margin-bottom: 0.8em;
  line-height: 1.6;
  font-size: 0.95em;
}
.note-post-content ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 1.1em;
  line-height: 1.6;
}
.note-post-content ol {
  list-style: none;
  counter-reset: list-counter;
}
.note-post-content ol li {
  position: relative;
  padding-left: 2em;
  margin-bottom: 0.8em;
  line-height: 1.6;
  font-size: 0.95em;
  counter-increment: list-counter;
}
.note-post-content ol li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0;
  min-width: 1.5em;
  height: 1.5em;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75em;
  line-height: 1.5em;
  text-align: center;
}
.note-post-content blockquote {
  margin: 2em 0;
  padding: 1.5em 2em;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg-secondary);
  color: var(--color-fg-muted);
  font-size: 0.95em;
  line-height: 1.7;
  position: relative;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note-post-content blockquote p {
  margin: 0;
  font-style: italic;
  text-align: left;
  font-weight: 400;
}
.note-post-content code.inline-code {
  background: var(--color-bg-secondary);
  color: var(--color-fg-muted);
  padding: 4px var(--space-1);
  border-radius: 3px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid var(--color-border);
}
code.inline-code:hover {
  color: var(--color-fg);
}
.note-post-content a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: #2563eb;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
  font-weight: 500;
}
.note-post-content a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}
.note-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-3) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.simple-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2) 60px var(--space-2);
}
.content-image {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-width) solid var(--color-border);
}
.content-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 140px;
}
.content-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.content-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.content-category {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.content-date {
  font-size: var(--font-size-sm);
  color: var(--color-fg-muted);
}
.content-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.content-description {
  font-size: var(--font-size-base);
  line-height: 1.4;
  color: var(--color-fg);
  margin: 0;
}
.content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.content-tag {
  font-size: var(--font-size-xs);
  padding: 2px 5px;
  background: var(--color-bg-secondary);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-fg-muted);
  font-weight: 500;
}
[data-theme="dark"] .content-date {
  color: var(--color-fg-muted);
}
[data-theme="dark"] .content-tag {
  background: var(--color-bg-alt);
  border-color: var(--color-border-hover);
  color: var(--color-fg-muted);
}
.code-block {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5em 1em 1em 1em;
  background: var(--color-bg-secondary);
  color: var(--color-fg-muted);
  font-family: ui-monospace, "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono",
    "Consolas", "Courier New", monospace;
  font-size: 0.9em;
  line-height: 1.6;
  overflow-x: auto;
}
.code-lang-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  height: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.code-block:hover {
  color: var(--color-fg);
}
.code-block:hover .code-lang-badge {
  opacity: 0.8;
}
.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-fg);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}
.code-copy-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-border-hover);
  color: var(--color-fg);
}
.code-copy-btn.copied {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  transform: scale(1.05);
}
.code-copy-btn svg {
  width: 14px;
  height: 14px;
}
.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: 0;
}
.note-tag {
  background: var(--color-bg-secondary);
  color: var(--color-fg);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  border: 1px solid var(--color-border);
  letter-spacing: 0;
  font-weight: 500;
}
.note-card-date {
  font-size: var(--font-size-sm);
  color: var(--color-fg-muted);
}
@media (max-width: 768px) {
  .note-post-header .note-post-title {
    font-size: var(--font-size-3xl);
  }
  .note-post-content {
    font-size: var(--font-size-lg);
  }
  .note-post-content h1 {
    font-size: var(--font-size-2xl);
  }
  .note-post-content h2 {
    font-size: var(--font-size-xl);
  }
  .simple-content {
    padding: var(--space-2) var(--space-2) 50px var(--space-2);
    gap: var(--space-1);
  }
  .content-meta {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
  }
  .content-description {
    font-size: var(--font-size-sm);
    line-height: 1.4;
  }
  .content-tag {
    font-size: var(--font-size-xs);
    padding: 3px 6px;
  }
}
@media (max-width: 480px) {
  .note-post-header .note-post-title {
    font-size: var(--font-size-2xl);
  }
  .note-post-content {
    font-size: 0.95rem;
  }
  .note-post-content h1 {
    font-size: 1.5rem;
  }
  .note-post-content h2 {
    font-size: 1.3rem;
  }
}