/* 主题色、字号、间距令牌见 assets/css/design-tokens.css */

/* 公共样式类 */

/* 动画效果 */
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-out {
  animation: fadeOut 0.2s ease-in;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-logo-scale {
  animation: logoScale 0.4s ease-out;
}

.animate-title-fade {
  animation: titleFade 0.5s ease-out 0.1s both;
}

.animate-lead-fade {
  animation: leadFade 0.5s ease-out 0.2s both;
}

.animate-form-fade {
  animation: formFade 0.5s ease-out 0.3s both;
}

.animate-error-fade {
  animation: errorFade 0.3s ease-out;
}

/* 按钮基础样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-ui);
  text-decoration: none;
}

/* 按钮尺寸 */
.btn-sm {
  min-height: var(--btn-height-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-sm);
}

.btn-md {
  min-height: var(--btn-height-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-md);
}

.btn-lg {
  min-height: var(--btn-height-lg);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-lg);
}

/* 按钮变体 */
.btn-primary {
  background: var(--btn-primary-bg);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--btn-primary-bg-hover);
  transform: translateY(var(--translate-y-sm));
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

/* 输入框基础样式 */
.input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: var(--font-size-md);
  line-height: var(--leading-snug);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--c-text-primary);
  transition: border-color var(--t-fast) var(--ease-ui), box-shadow var(--t-fast) var(--ease-ui), transform var(--t-fast) var(--ease-ui);
}

/* 输入框尺寸 */
.input-sm {
  min-height: var(--btn-height-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
}

.input-md {
  min-height: var(--btn-height-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-md);
}

.input-lg {
  min-height: var(--btn-height-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-lg);
}

/* 输入框状态 */
.input:hover {
  border-color: var(--c-text-secondary);
  transform: translateY(var(--translate-y-sm));
}

.input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 var(--shadow-spread-sm) var(--c-accent-muted);
  outline: none;
  transform: translateY(var(--translate-y-sm));
}

/* 卡片基础样式 */
.card {
  border-radius: var(--radius-lg);
  border: var(--border-width-sm) solid var(--c-border-primary);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-normal) var(--ease-ui), transform var(--t-normal) var(--ease-ui);
}

/* 卡片变体 */
.card-elevated {
  background: color-mix(in srgb, var(--surface-elevated) 94%, transparent);
  border: var(--border-width-sm) solid color-mix(in srgb, var(--c-border-primary) 88%, var(--c-accent) 12%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 20px 50px rgba(0, 0, 0, 0.35),
    var(--shadow-modal);
  backdrop-filter: blur(var(--blur-md)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(1.12);
}

.card-elevated:hover {
  transform: translateY(var(--translate-y-md));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 24px 60px rgba(0, 0, 0, 0.4),
    var(--shadow-modal);
}

/* 卡片尺寸 */
.card-sm {
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.card-md {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-lg {
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

/* 间距工具类 */
.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.m-0 { margin: var(--space-0); }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

/* 排版工具类 */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-body { font-size: var(--font-size-body); }
.text-ui { font-size: var(--font-size-ui); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 布局工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* 响应式工具类 */
@media (max-width: 768px) {
  .mobile-pad {
    padding: max(var(--space-3), env(safe-area-inset-top, 0px))
      max(var(--space-3), env(safe-area-inset-right, 0px))
      max(var(--space-3), env(safe-area-inset-bottom, 0px))
      max(var(--space-3), env(safe-area-inset-left, 0px));
  }
  
  .mobile-btn-height {
    min-height: var(--btn-height-lg);
  }
  
  .mobile-flex-col {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .small-mobile-btn-height {
    min-height: var(--btn-height-md);
  }
}

@media (hover: none) and (pointer: coarse) {
  .touch-btn-height {
    min-height: var(--btn-height-xl);
  }
}

body {
  padding-top: var(--navbar-height);
  background-color: var(--c-bg-body);
  color: var(--c-text-primary);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* 首页访问门（个人密码，仅前端会话）— 桌面与移动端统一布局 */
.home-auth {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  padding: max(var(--space-3), env(safe-area-inset-top, 0px))
    max(var(--space-4), env(safe-area-inset-right, 0px))
    max(var(--space-3), env(safe-area-inset-bottom, 0px))
    max(var(--space-4), env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.home-auth.is-unlocked {
  display: none !important;
  animation: fadeOut 0.2s ease-in;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.home-auth__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(61, 106, 158, 0.28) 0%, transparent 52%),
    radial-gradient(ellipse 80% 50% at 100% 80%, rgba(61, 106, 158, 0.08) 0%, transparent 45%),
    linear-gradient(168deg, var(--obsidian-black) 0%, #121820 38%, #0a0d12 100%);
  animation: backgroundFade 0.5s ease-out;
}

@keyframes backgroundFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.home-auth__frame {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  max-height: min(90vh, 32rem);
  max-height: min(90dvh, 32rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(var(--translate-y-2xl));
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.home-auth__card {
  width: 100%;
  padding: clamp(var(--space-5), 4vw, var(--space-8))
    clamp(var(--space-4), 4vw, var(--space-6))
    clamp(var(--space-5), 3.5vw, var(--space-7));
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface-elevated) 94%, transparent);
  border: var(--border-width-sm) solid color-mix(in srgb, var(--c-border-primary) 88%, var(--c-accent) 12%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 20px 50px rgba(0, 0, 0, 0.35),
    var(--shadow-modal);
  backdrop-filter: blur(var(--blur-md)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(1.12);
  transition: box-shadow var(--t-normal) var(--ease-ui), transform var(--t-normal) var(--ease-ui);
  box-sizing: border-box;
}

.home-auth__card:hover {
  transform: translateY(var(--translate-y-md));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 24px 60px rgba(0, 0, 0, 0.4),
    var(--shadow-modal);
}

@supports not (backdrop-filter: blur(1px)) {
  .home-auth__card {
    background: var(--surface-elevated);
  }
}

.home-auth__header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.home-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-3);
  animation: logoScale 0.4s ease-out;
}

@keyframes logoScale {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 笔记本意象：圆角本 + 横线 */
.home-auth__logo-icon {
  display: block;
  width: 44px;
  height: 52px;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--c-accent-muted) 0%, var(--surface-subtle) 100%);
  border: 1px solid var(--c-accent-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  box-sizing: border-box;
  transition: transform var(--t-normal) var(--ease-ui);
}

.home-auth__logo-icon:hover {
  transform: rotate(3deg);
}

.home-auth__logo-icon::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 14px;
  height: 2px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--c-accent) 72%, var(--c-text-secondary) 28%);
  box-shadow:
    0 9px 0 color-mix(in srgb, var(--c-accent) 55%, var(--c-text-secondary) 45%),
    0 18px 0 color-mix(in srgb, var(--c-accent) 38%, var(--c-text-secondary) 62%);
  opacity: 0.92;
}

.home-auth__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(var(--font-size-lg), 2.8vw, var(--font-size-xl));
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: var(--leading-tight);
  color: color-mix(in srgb, var(--c-text-primary) 82%, var(--c-text-secondary) 18%);
  animation: titleFade 0.5s ease-out 0.1s both;
}

@keyframes titleFade {
  from {
    opacity: 0;
    transform: translateY(var(--translate-y-xl));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-auth__lead {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--leading-snug);
  color: var(--c-text-secondary);
  animation: leadFade 0.5s ease-out 0.2s both;
}

@keyframes leadFade {
  from {
    opacity: 0;
    transform: translateY(var(--translate-y-xl));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: formFade 0.5s ease-out 0.3s both;
}

@keyframes formFade {
  from {
    opacity: 0;
    transform: translateY(var(--translate-y-xl));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-auth__field {
  margin: 0;
}

.home-auth__input {
  width: 100%;
  box-sizing: border-box;
  font-size: var(--font-size-md);
  line-height: var(--leading-snug);
  min-height: var(--btn-height-md);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border-color: var(--c-border-strong);
  background: var(--surface-elevated);
  color: var(--c-text-primary);
  transition: border-color var(--t-fast) var(--ease-ui), box-shadow var(--t-fast) var(--ease-ui), transform var(--t-fast) var(--ease-ui);
}

.home-auth__input:hover {
  border-color: var(--c-text-secondary);
  transform: translateY(var(--translate-y-sm));
}

.home-auth__input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 var(--shadow-spread-sm) var(--c-accent-muted);
  outline: none;
  transform: translateY(var(--translate-y-sm));
}

.home-auth__error {
  margin: calc(var(--space-1) * -1) 0 0;
  min-height: 1.25em;
  font-size: var(--font-size-xs);
  color: var(--c-danger);
  text-align: center;
  animation: errorFade 0.3s ease-out;
}

@keyframes errorFade {
  from {
    opacity: 0;
    transform: translateY(var(--translate-y-lg));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-auth__submit {
  width: 100%;
  margin-top: var(--space-1);
  min-height: var(--btn-height-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast) var(--ease-ui);
}

.home-auth__submit:hover {
  transform: translateY(var(--translate-y-sm));
  box-shadow: var(--shadow-md);
}

.home-auth__submit:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.home-auth__submit:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

.dark .home-auth__card {
  background: color-mix(in srgb, var(--c-bg-primary) 96%, transparent);
  border-color: color-mix(in srgb, var(--c-border-primary) 90%, var(--c-accent) 10%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 20px 50px rgba(0, 0, 0, 0.45),
    var(--shadow-modal);
}

.dark .home-auth__card:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.5),
    var(--shadow-modal);
}

@supports not (backdrop-filter: blur(1px)) {
  .dark .home-auth__card {
    background: var(--c-bg-primary);
  }
}

.dark .home-auth__logo-icon {
  background: linear-gradient(165deg, var(--c-bg-secondary) 0%, var(--c-bg-primary) 100%);
  border-color: var(--c-border-strong);
}

.dark .home-auth__title {
  color: color-mix(in srgb, var(--c-text-primary) 90%, var(--c-text-secondary) 10%);
}

.dark .home-auth__lead {
  color: var(--c-text-secondary);
}

.dark .home-auth__input {
  background: var(--c-bg-button);
  border-color: var(--c-border-strong);
  color: var(--c-text-primary);
}

.dark .home-auth__logo-icon::before {
  background: color-mix(in srgb, var(--c-accent) 65%, var(--c-text-secondary) 35%);
  box-shadow:
    0 9px 0 color-mix(in srgb, var(--c-accent) 45%, var(--c-text-secondary) 55%),
    0 18px 0 color-mix(in srgb, var(--c-accent) 30%, var(--c-text-secondary) 70%);
}

/* 平板与手机：略放宽卡片、保证触控高度 */
@media (max-width: 768px) {
  .home-auth {
    padding: max(var(--space-3), env(safe-area-inset-top, 0px))
      max(var(--space-3), env(safe-area-inset-right, 0px))
      max(var(--space-3), env(safe-area-inset-bottom, 0px))
      max(var(--space-3), env(safe-area-inset-left, 0px));
    align-content: center;
  }

  .home-auth__frame {
    width: min(100%, 24rem);
    padding: 0;
    box-sizing: border-box;
  }

  .home-auth__card {
    padding: var(--space-6) var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    max-width: 100%;
    box-sizing: border-box;
  }

  .home-auth__header {
    margin-bottom: var(--space-4);
  }

  .home-auth__input,
  .home-auth__submit {
    min-height: 48px;
  }
}

@media (max-width: 420px) {
  .home-auth__frame {
    width: 100%;
    padding: 0;
  }

  .home-auth__card {
    padding: var(--space-5) var(--space-3-5) var(--space-4);
    max-width: 100%;
  }

  .home-auth__logo-icon {
    width: 40px;
    height: 48px;
    border-radius: 10px;
  }

  .home-auth__logo-icon::before {
    left: 9px;
    right: 9px;
    top: 13px;
  }
}

/* 小屏幕设备的额外优化 */
@media (max-width: 360px) {
  .home-auth {
    padding: max(var(--space-2), env(safe-area-inset-top, 0px))
      max(var(--space-2), env(safe-area-inset-right, 0px))
      max(var(--space-2), env(safe-area-inset-bottom, 0px))
      max(var(--space-2), env(safe-area-inset-left, 0px));
  }

  .home-auth__frame {
    width: 100%;
    padding: 0;
  }

  .home-auth__card {
    padding: var(--space-4) var(--space-3) var(--space-4);
    max-width: 100%;
  }

  .home-auth__header {
    margin-bottom: var(--space-3);
  }

  .home-auth__logo {
    margin-bottom: var(--space-2);
  }

  .home-auth__logo-icon {
    width: 36px;
    height: 44px;
    border-radius: 9px;
  }

  .home-auth__logo-icon::before {
    left: 8px;
    right: 8px;
    top: 12px;
  }

  .home-auth__title {
    font-size: var(--font-size-lg);
  }

  .home-auth__lead {
    font-size: var(--font-size-xs);
  }

  .home-auth__input,
  .home-auth__submit {
    min-height: 44px;
  }
}

/* iPhone SE 等极小屏幕设备的优化 */
@media (max-width: 320px) {
  .home-auth {
    padding: max(var(--space-1), env(safe-area-inset-top, 0px))
      max(var(--space-1), env(safe-area-inset-right, 0px))
      max(var(--space-1), env(safe-area-inset-bottom, 0px))
      max(var(--space-1), env(safe-area-inset-left, 0px));
  }

  .home-auth__frame {
    width: 100%;
    padding: 0;
  }

  .home-auth__card {
    padding: var(--space-3) var(--space-2) var(--space-3);
    max-width: 100%;
  }

  .home-auth__header {
    margin-bottom: var(--space-2);
  }

  .home-auth__logo {
    margin-bottom: var(--space-1);
  }

  .home-auth__logo-icon {
    width: 32px;
    height: 40px;
    border-radius: 8px;
  }

  .home-auth__logo-icon::before {
    left: 7px;
    right: 7px;
    top: 11px;
  }

  .home-auth__title {
    font-size: var(--font-size-md);
  }

  .home-auth__lead {
    font-size: var(--font-size-xs);
  }

  .home-auth__input,
  .home-auth__submit {
    min-height: 40px;
    padding: var(--space-1) var(--space-2);
  }
}

/* 超大屏幕设备的优化 */
@media (min-width: 1200px) {
  .home-auth__frame {
    width: min(100%, 24rem);
  }

  .home-auth__card {
    padding: var(--space-8) var(--space-6) var(--space-7);
  }

  .home-auth__logo-icon {
    width: 48px;
    height: 56px;
    border-radius: 12px;
  }

  .home-auth__logo-icon::before {
    left: 11px;
    right: 11px;
    top: 15px;
  }
}

/* 触控设备的优化 */
@media (hover: none) and (pointer: coarse) {
  .home-auth__card {
    padding: var(--space-6) var(--space-4) var(--space-5);
  }

  .home-auth__input,
  .home-auth__submit {
    min-height: 52px;
  }

  .home-auth__logo-icon {
    width: 48px;
    height: 56px;
  }
}

/* 减少动画效果以提高性能的设备 */
@media (prefers-reduced-motion: reduce) {
  .home-auth,
  .home-auth__scrim,
  .home-auth__frame,
  .home-auth__logo,
  .home-auth__title,
  .home-auth__lead,
  .home-auth__form,
  .home-auth__error {
    animation: none;
  }

  .home-auth__card,
  .home-auth__logo-icon,
  .home-auth__input,
  .home-auth__submit {
    transition: none;
  }
  
  .home-auth__card:hover {
    transform: none;
  }
  
  .home-auth__logo-icon:hover {
    transform: none;
  }
  
  .home-auth__input:hover,
  .home-auth__input:focus {
    transform: none;
  }
  
  .home-auth__submit:hover {
    transform: none;
  }
  
  .home-auth__submit:active {
    transform: none;
  }
}

@media (min-width: 992px) {
  .col-md-5 {
    width: 50%;
  }
}

#mainContainer {
  position: relative;
}

#mainContainer.notepad-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: calc(100vh - var(--navbar-height));
}

.notepad-sidebar {
  flex: 0 0 200px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--c-border-primary);
  background: var(--dough-white);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3) var(--space-2-5) var(--space-4);
  box-sizing: border-box;
}

/* 侧栏搜索：iA Writer 风格（克制、紧凑） */
.note-sidebar-search {
  flex: 0 0 auto;
  margin: 0 0 var(--space-2);
}

.note-sidebar-search__input {
  width: 100%;
  height: 34px;
  padding: 0 var(--space-2-5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: var(--c-text-primary);
  font: inherit;
  font-size: var(--font-size-sm);
  outline: none;
  transition: background var(--t-fast) var(--ease-ui), border-color var(--t-fast) var(--ease-ui), box-shadow var(--t-fast) var(--ease-ui);
}

.note-sidebar-search__input::placeholder {
  color: var(--c-text-secondary);
}

.note-sidebar-search__input:focus-visible {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: var(--focus-ring);
  background: rgba(255, 255, 255, 0.6);
}

.dark .note-sidebar-search__input {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e6e6e6;
}

.dark .note-sidebar-search__input:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.notepad-main-pane {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.notepad-main-pane > #textareaContainer.container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
}

.note-list-sidebar {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.note-trash-section {
  flex: 0 0 auto;
  margin-top: var(--space-2);
  padding-top: var(--space-2-5);
  border-top: 1px solid var(--c-border-primary);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.note-trash-section:not(.is-collapsed) {
  max-height: min(40vh, 280px);
}

.note-trash-section.is-collapsed {
  max-height: none;
}

.note-trash-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  margin: 0 0 var(--space-1-5);
  padding: var(--space-1) 0;
  font: inherit;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--c-text-secondary);
  letter-spacing: 0.02em;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-ui), color var(--t-fast) var(--ease-ui);
}

.note-trash-heading:hover {
  color: var(--c-text-primary);
  background: var(--surface-subtle);
}

.note-trash-heading:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.note-trash-heading__text {
  flex: 1;
  min-width: 0;
}

.note-trash-heading__chev {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  opacity: 0.65;
  transition: transform var(--t-normal) var(--ease-ui), opacity var(--t-fast) var(--ease-ui);
}

.note-trash-section:not(.is-collapsed) .note-trash-heading__chev {
  transform: rotate(-135deg);
  margin-top: 3px;
  opacity: 0.85;
}

.note-trash-section.is-collapsed .note-trash-heading {
  margin-bottom: 0;
}

.note-trash-section.is-collapsed .note-trash-list {
  display: none;
}

.note-trash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.note-trash-row {
  margin: 0 0 var(--space-1-5);
  padding: 0;
}

.note-trash-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}

.dark .note-trash-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.note-trash-title {
  font-size: var(--font-size-sm);
  line-height: var(--leading-snug);
  color: var(--c-text-primary);
  word-break: break-word;
}

.dark .note-trash-title {
  color: #e6e6e6;
}

.note-trash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1-5);
}

.note-trash-actions .btn {
  font-size: var(--font-size-xs);
  padding: 2px var(--space-2);
}

.note-trash-empty {
  font-size: var(--font-size-xs);
  color: var(--c-text-secondary);
  margin: var(--space-1) 0 0;
}

.note-sidebar-row {
  margin: 0 0 var(--space-1);
  padding: 0;
}

.note-sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-2-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.35;
  color: var(--c-text-primary);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.note-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.note-sidebar-item.is-active {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
}

.dark .notepad-sidebar {
  background: var(--dough-white);
  border-right-color: var(--c-border-primary);
  box-shadow: var(--shadow-sm);
}

.dark .note-sidebar-item {
  color: #e6e6e6;
}

.dark .note-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dark .note-sidebar-item.is-active {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
}

/* 移动端：笔记目录为左侧抽屉，由顶栏按钮展开（非旧版导航菜单折叠） */
@media (max-width: 768px) {
  #mainContainer.notepad-split {
    flex-direction: row;
    position: relative;
    min-height: calc(100vh - var(--navbar-height));
  }

  .note-sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: rgba(0, 0, 0, 0.38);
    -webkit-tap-highlight-color: transparent;
  }

  #mainContainer.notepad-split.note-sidebar-open .note-sidebar-backdrop {
    display: block;
  }

  .notepad-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: min(240px, 88vw);
    max-width: 240px;
    max-height: none;
    flex: none;
    z-index: 1025;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--c-border-primary);
    border-bottom: none;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.14);
  }

  #mainContainer.notepad-split.note-sidebar-open .notepad-sidebar {
    transform: translateX(0);
  }

  .notepad-main-pane {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
  }

  .dark .notepad-sidebar {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  }
}

@media (min-width: 769px) {
  .note-sidebar-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  /* 桌面端收起目录（与手机 drawer 不同类，避免「默认展开/折叠」冲突） */
  #mainContainer.notepad-split.is-desktop-sidebar-hidden .notepad-sidebar {
    flex: 0 0 0;
    width: 0;
    max-width: 0;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.pip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #7e7d7d;
  font-weight: bold;
  pointer-events: none;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.5);

  &::after {
    content: "Floating Window is Activated";
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* Adjust opacity as needed */
  pointer-events: none;
  /* Makes overlay non-interactive by default */
  z-index: 10;
  display: none;
}

.break-veil {
  position: fixed;
  inset: 0;
  z-index: 1040;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at top, rgba(255, 246, 224, 0.18), rgba(255, 246, 224, 0) 35%),
    rgba(24, 31, 38, 0.14);
  backdrop-filter: blur(0px);
  transition: opacity 900ms ease, backdrop-filter 900ms ease;
}

.break-veil.active {
  opacity: 1;
  backdrop-filter: blur(2px);
}

.dark .break-veil {
  background:
    radial-gradient(circle at top, rgba(147, 197, 253, 0.08), rgba(147, 197, 253, 0) 35%),
    rgba(6, 10, 14, 0.34);
}

.pip-icon {
  cursor: pointer;
}

@media all and (display-mode: picture-in-picture) {
  body {
    padding-top: 0px;
  }
}

.generic-flex {
  display: flex;
  align-items: center;
  gap: var(--space-1-25);
}

textarea {
  width: 100%;
  height: 100%;
  font-size: var(--font-size-editor);
  outline: none;
  box-shadow: none;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  outline: 0px !important;
  -webkit-appearance: none;
  resize: none;
  font-family: var(--font-sans);
  background: transparent;
  scrollbar-gutter: stable;
}

kbd {
  display: inline-block;
  padding: 3px var(--space-2-5);
  font-size: var(--font-size-2xs);
  font-family: var(--font-mono);
  color: #333;
  background: #fff;
  border: 2px solid #c8c8c8;
  border-radius: 4px;
  box-shadow: 0 4px #b0b0b0, inset 0 -2px 4px rgba(0, 0, 0, 0.1), inset 0 3px 6px rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  margin: 0 var(--space-1);
  line-height: 1.4;
  transition: transform 0.1s, box-shadow 0.1s;
  font-weight: bold;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-1-25);
}

kbd>span {
  font-size: var(--font-size-2xs);
}

table {
  padding: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

table tr {
  display: flex;
  background-color: var(--dough-white);
  margin: 0;
  padding: var(--space-2-5);
  align-items: center;
}

table tr:nth-child(n+2) {
  border-top: 1px solid #e0e0e0;
}

table tr td {
  text-align: left;
  margin: 0;
  padding: var(--space-1-5) 13px;
  width: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.about-icon-container {
  display: inline-flex;
  gap: var(--space-2-5);
  float: left;
  align-items: center;
}

.about-icon-container>a {
  transition: transform 200ms ease-out;
}

.about-icon-container>a:hover {
  transform: translateY(-5px) rotate(-15deg);
}

.dark .notepad-navbar__tools-scroll .notepad-navbar__tool > .notepad-navbar__icon-btn,
.dark .notepad-navbar__more-wrap--mobile-only > .notepad-navbar__icon-btn {
  transition: background-color var(--t-fast) var(--ease-ui), opacity var(--t-fast) var(--ease-ui);
}

.dark .notepad-navbar__tools-scroll .notepad-navbar__tool > .notepad-navbar__icon-btn:hover,
.dark .notepad-navbar__more-wrap--mobile-only > .notepad-navbar__icon-btn:hover {
  -webkit-filter: none;
  filter: none;
  background-color: rgba(255, 255, 255, 0.08);
}

.navbar-download-wrap {
  position: relative;
}

.dropdown-menu {
  top: 124%;
  padding: var(--space-2) 0;
  border-radius: var(--radius-md);
}

.dark .glow-text {
  animation: glow 2s forwards;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px #91ceff, 0 0 10px #91ceff, 0 0 20px #91ceff, 0 0 40px #91ceff, 0 0 80px #91ceff;
  }

  100% {
    /* Return to normal text shadow */
    text-shadow: 0 0 5px #2196f3;
  }
}

.dark .dropdown-menu {
  background-color: #26313f;
  border: 1px solid rgb(51 63 78);
}

.dark .dropdown-menu>li>a {
  color: #dcd6d6;
}

.dark .dropdown-menu>li>a:focus,
.dark .dropdown-menu>li>a:hover {
  background-color: #324256;
}

.navbar-default {
  background-color: #4d4d4d;
  border-color: #4d4d4d;
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background-color: #4d4d4d !important;
}

.dark .navbar-inverse .navbar-toggle:focus,
.dark .navbar-inverse .navbar-toggle:hover {
  background-color: #293443 !important;
}

.navbar-default .navbar-toggle {
  border-color: #A1887F;
}

.navbar-default .navbar-brand {
  color: #ecf0f1;
}

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
  color: #ecdbff;
}

.navbar-default .navbar-text {
  color: #ecf0f1;
}

.navbar-default .navbar-nav>li>a {
  color: #ecf0f1;
}

.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
  color: #ecdbff;
}

.navbar-default .navbar-nav>.active>a,
.navbar-default .navbar-nav>.active>a:hover,
.navbar-default .navbar-nav>.active>a:focus {
  color: #ecdbff;
  background-color: #8e44ad;
}

.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus {
  color: #ecdbff;
  background-color: #8e44ad;
}

.navbar-default .navbar-toggle {
  border-color: #A1887F;
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background-color: #4d4d4d;
}

.navbar-default .navbar-toggle .icon-bar {
  background-color: #ecf0f1;
}

.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
  border-color: #ecf0f1;
}

.navbar-default .navbar-link {
  color: #ecf0f1;
}

.navbar-default .navbar-link:hover {
  color: #ecdbff;
}

#flash {
  color: #64ff6a;
  font-weight: bold;
}

.btn-custom {
  margin-top: 9px;
}

#Rectangle {
  fill: lightgreen;
}

#trash {
  fill: lightcoral;
}

.trash-icon {
  cursor: pointer;
}

.download-icon,
.dropdown-icon {
  margin-top: 0px;
  cursor: pointer;
}

.dropdown-item {
  display: flex !important;
  gap: 9px;
  align-items: center;
}

.dropdown-item span {
  background: #ffc413;
  color: black;
  padding: 3px 6px;
  font-size: var(--font-size-caption);
  border-radius: 4px;
  font-weight: bold;
}

/* 顶栏间距：--navbar-toolbar-gap / --notepad-navbar-gap 在 design-tokens.css */

/* 无 Bootstrap 全量 CSS 时须显式固定顶栏；否则顶栏随文档流排在 body 的 padding-top 之下，视觉上「不在页面最顶」 */
.navbar.navbar-inverse.navbar-fixed-top,
.navbar.navbar-default.navbar-fixed-top,
nav.notepad-navbar.notepad-navbar--fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1030;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  box-sizing: border-box;
  min-height: var(--navbar-height) !important;
  display: flex !important;
  align-items: center !important;
}

/* Bootstrap 3 默认 .navbar-brand { height: 50px }，会撑高整条顶栏，需强制覆盖 */
.navbar.navbar-inverse .navbar-brand,
.navbar.navbar-default .navbar-brand {
  float: none !important;
  /* 不要用满行高：否则文字在 40px 盒内几何居中，与 20px 图标视觉中线易错位 */
  height: auto !important;
  min-height: 0 !important;
  max-height: var(--navbar-height) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: var(--leading-tight) !important;
  font-size: var(--font-size-ui) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.navbar.navbar-inverse.navbar-fixed-top .container-fluid,
.navbar.navbar-default.navbar-fixed-top .container-fluid {
  min-height: 0;
}

.app-heading {
  margin-left: 0;
  font-weight: bold;
  font-size: var(--font-size-ui);
  letter-spacing: 1.2px;
  transition: color .2s ease-out, opacity .2s ease-out;
}

/* 顶栏品牌与 .navbar-brand 字号统一 */
.navbar .navbar-brand.app-heading {
  font-size: var(--font-size-ui) !important;
}

/* 覆盖 Bootstrap 与全局小屏 .navbar-brand 左右 padding，否则与侧栏按钮间距会大于与工具图标的间距 */
nav.notepad-navbar .navbar-brand.app-heading,
nav.notepad-navbar .notepad-navbar__brand.app-heading,
nav.notepad-navbar .navbar-brand {
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 顶栏全宽贴左，避免 .container 居中导致「笔记本」远离左缘 */
nav.navbar.navbar-inverse > .container-fluid.navbar-inner-fluid,
nav.notepad-navbar > .notepad-navbar__inner.container-fluid {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  margin-left: 0;
  margin-right: 0;
  padding-left: var(--page-inline-padding);
  padding-right: var(--page-inline-padding-end);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: var(--navbar-height);
}

.navbar.navbar-inverse .navbar-header,
.notepad-navbar.notepad-navbar--fixed .notepad-navbar__header {
  float: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: var(--navbar-height) !important;
  max-height: var(--navbar-height) !important;
  height: var(--navbar-height) !important;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  column-gap: var(--notepad-navbar-gap, var(--navbar-toolbar-gap, var(--space-3)));
  row-gap: 4px;
}

.navbar.navbar-inverse .navbar-header {
  flex-wrap: wrap;
}

/* 笔记本顶栏：手机端也单行，溢出由 .notepad-navbar__tools-scroll 横向滚动承担 */
.notepad-navbar.notepad-navbar--fixed .notepad-navbar__header {
  flex-wrap: nowrap;
}

/* 侧栏按钮 + 品牌标题 */
.notepad-navbar__start {
  display: inline-flex;
  align-items: center;
  align-self: center;
  column-gap: var(--navbar-toolbar-gap, var(--space-3));
}

nav.notepad-navbar .notepad-navbar__start {
  column-gap: var(--notepad-navbar-gap, var(--navbar-toolbar-gap, var(--space-3)));
}

/* 顶栏：展开/收起笔记目录（桌面折叠侧栏、手机抽屉均用） */
.note-sidebar-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  cursor: pointer;
}

.note-sidebar-toggle:hover,
.note-sidebar-toggle:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.note-sidebar-toggle .icon-bar {
  display: block;
  width: 15px;
  height: 2px;
  margin: 1.5px auto;
  background: #ecf0f1;
  border-radius: 1px;
}

@media (max-width: 768px) {
  /* 窄屏下 inverse 顶栏可增高；笔记本顶栏保持单行固定高度 + 工具区横向滚动 */
  .navbar.navbar-inverse .navbar-header {
    height: auto !important;
    max-height: none !important;
    min-height: var(--navbar-height) !important;
  }
}

body.note-sidebar-drawer-active {
  overflow: hidden;
}

@media (min-width: 769px) {
  body.note-sidebar-drawer-active {
    overflow: auto;
  }
}

.navbar-inverse .app-heading {
  color: #7cc5ff;
  text-shadow: 0px 0px 3px #2196F3;
}

.navbar-default .app-heading {
  color: #ecf0f1;
  text-shadow: none;
}

.container {
  position: relative;
  padding-right: 0px;
  padding-left: 0px;
  margin-right: auto;
  margin-left: auto;
}

.make-hidden {
  display: none !important;
}

.about-notice {
  --shadow-color: 0deg 0% 67%;
  --shadow-elevation-low:
    0.3px 0.5px 0.9px hsl(var(--shadow-color) / 0),
    0.9px 1.9px 3.2px hsl(var(--shadow-color) / 0.45);
  background-color: #ecf0ff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-elevation-low);
  line-height: 23px;
}

.about-author-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.about-author-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.about-author-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.about-origin-text {
  font-size: var(--font-size-micro);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #7d7d7d;
}

.modal-content {
  border-radius: 12px;
  border: none;
  background-color: var(--dough-white);
  overflow: hidden;
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:focus,
.nav-tabs>li.active>a:hover {
  background-color: var(--dough-white);
}

.btn {
  border-radius: 8px;
}

.swal2-popup {
  border-radius: 1.3125em !important;
}

.swal2-styled.swal2-confirm,
.swal2-styled.swal2-cancel {
  border-radius: 0.55em !important;
}

.form-control {
  border-radius: 8px;
  background-color: var(--dough-white);
}

.swal2-popup {
  background: var(--dough-white) !important;
}

/* SweetAlert2：删除等确认，统一较小弹窗（由 notepadSwalCompactConfirm 挂载 .swal-compact-confirm） */
.swal2-popup.swal-compact-confirm {
  width: min(20rem, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem) !important;
  padding: 0.85rem 1rem 1rem !important;
  box-sizing: border-box !important;
}

.swal2-popup.swal-compact-confirm .swal2-title {
  font-size: 1.05rem !important;
  padding: 0 0 0.35em !important;
  margin: 0 !important;
}

.swal2-popup.swal-compact-confirm .swal2-html-container {
  font-size: 0.8125rem !important;
  line-height: 1.45 !important;
  margin: 0.3em 0 0 !important;
}

.swal2-popup.swal-compact-confirm .swal2-actions {
  margin: 0.65em auto 0 !important;
  gap: 0.35em !important;
}

.swal2-popup.swal-compact-confirm .swal2-styled {
  padding: 0.35em 0.85em !important;
  font-size: 0.875rem !important;
}

.swal2-popup.swal-compact-confirm .swal2-icon {
  margin: 0.25em auto 0.4em !important;
  transform: scale(0.88);
}

.dark .swal2-popup.swal-compact-confirm {
  background: #1e2428 !important;
  color: #e6e6e6 !important;
}

.dark .swal2-popup.swal-compact-confirm .swal2-title {
  color: #f0f0f0 !important;
}

.dark .swal2-popup.swal-compact-confirm .swal2-html-container {
  color: #c5c5c5 !important;
}

.sticky-notice {
  position: absolute;
  background: #009688;
  bottom: 48px;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 60%;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0px 0px 9px 2px #abababc9;
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-body);
  gap: 14px;
}

.word-count-container {
  display: flex;
  background: #e2dcd8;
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 20px;
  color: #403333;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-caption);
  gap: 10px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--t-fast) var(--ease-ui), box-shadow var(--t-fast) var(--ease-ui), transform var(--t-fast) var(--ease-ui);
}

.word-count-container:hover {
  background: rgba(0, 0, 0, 0.08);
}

.word-count-container:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.note-save-status {
  font-size: var(--font-size-caption);
  font-weight: 600;
  color: #5c534d;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.note-save-status[data-state="saving"] {
  color: #0b5ed7;
}

.note-save-status[data-state="saved"] {
  color: #146c43;
}

.note-save-status[data-state="offline"],
.note-save-status[data-state="error"],
.note-save-status[data-state="conflict"],
.note-save-status[data-state="load_error"] {
  color: #b45309;
}

.dark .note-save-status {
  color: #c8c2bc;
}

.dark .note-save-status[data-state="saving"] {
  color: #6ea8fe;
}

.dark .note-save-status[data-state="saved"] {
  color: #75b798;
}

.dark .note-save-status[data-state="offline"],
.dark .note-save-status[data-state="error"],
.dark .note-save-status[data-state="conflict"],
.dark .note-save-status[data-state="load_error"] {
  color: #ffc107;
}

/* “统计图标链接”入口已移除：字数条本身可点击打开统计弹窗 */

.transparency.word-count-container {
  background: #fff2 !important;
  box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.2), 0 0 18px #fff inset;
  backdrop-filter: blur(5px);
}

.dark .transparency.word-count-container {
  color: #fff;
  box-shadow: none;
}

.about-tabs li a {
  display: flex;
  align-items: center;
  gap: 5px;
}

.about-tabs-wrap {
  position: relative;
}

.about-tabs .nav-item {
  flex: 0 0 auto;
}

.about-tabs .nav-link {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .about-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    scrollbar-width: none;
  }

  .about-tabs::-webkit-scrollbar {
    height: 0;
  }

  .about-tabs-wrap::before,
  .about-tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    z-index: 2;
  }

  .about-tabs-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--dough-white) 0%, rgba(255, 255, 255, 0) 100%);
  }

  .about-tabs-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--dough-white) 0%, rgba(255, 255, 255, 0) 100%);
  }
}

.dark .word-count-container {
  background: #9ed4ff;
}

.tab-content .container {
  width: 100%;
  padding: 20px 0px 12px;
}

.word-count-container p {
  margin: 0;
}

.sticky-notice p {
  margin: 0;
  line-height: 26px;
}

.sticky-notice a {
  color: #ffeb3b;
}

.dark .sticky-notice {
  background: #a2ffa2;
  box-shadow: 0px 0px 17px 0px #abababc9;
  color: #272727;
  font-weight: bold;
}

.dark .sticky-notice a {
  color: #93103d;
}

textarea {
  padding: 15px 24px 40px;
  border: 1px solid #e6e4e4;
}

#textareaContainer.container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--navbar-height));
}

.starter-template.note-editor-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e6e4e4;
  background: transparent;
  font-size: var(--font-size-editor);
}

.starter-template.note-editor-stack textarea {
  font-size: 1em;
}

.starter-template.note-editor-stack .note-title-input {
  font-size: calc(1em + 1px);
}

.note-editor-stack textarea,
.note-editor-stack .note-title-input {
  border: none !important;
  box-shadow: none !important;
}

.note-title-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px 0 16px;
  box-sizing: border-box;
  min-width: 0;
}

.note-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  flex-shrink: 0;
  margin-left: auto;
}

.note-title-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.note-title-icon-btn img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* 标题栏图标为白色描边 svg（stroke="#fff"），浅色主题下需要反色以保证可见性 */
body:not(.dark) .note-title-icon-btn img {
  filter: invert(1);
}

.dark .note-title-icon-btn img {
  filter: none;
}

/* 阅读态只高亮「编辑」；编辑态只高亮「保存」——非当前态弱化 */
.note-title-icon-btn:not(.is-active) {
  opacity: 0.88;
}

.note-title-icon-btn:not(.is-active) img {
  opacity: 0.55;
}

.note-title-icon-btn.is-active {
  opacity: 1;
  border-color: var(--c-text-secondary);
  background: var(--surface-subtle);
  box-shadow: 0 0 0 1px rgba(33, 150, 243, 0.35);
}

.note-title-icon-btn.is-active img {
  opacity: 1;
}

.note-title-icon-btn:not(.is-active):hover {
  opacity: 1;
  border-color: var(--c-border-primary);
  background: color-mix(in srgb, var(--surface-elevated) 88%, transparent);
}

.note-title-icon-btn:not(.is-active):hover img {
  opacity: 0.85;
}

.note-title-icon-btn.is-active:hover {
  border-color: var(--c-text-secondary);
  background: color-mix(in srgb, var(--surface-subtle) 85%, var(--surface-elevated) 15%);
}

.note-title-icon-btn:focus-visible {
  outline: 2px solid rgba(145, 206, 255, 0.85);
  outline-offset: 2px;
}

.dark .note-title-icon-btn:not(.is-active):hover {
  border-color: var(--c-border-strong);
  background: color-mix(in srgb, var(--c-bg-secondary) 90%, transparent);
}

.dark .note-title-icon-btn.is-active {
  border-color: var(--c-border-strong);
  background: color-mix(in srgb, var(--c-bg-secondary) 90%, transparent);
  box-shadow: 0 0 0 1px rgba(100, 181, 246, 0.35);
}

.note-title-row .note-title-input {
  width: auto;
}

.note-title-input {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 8px 10px 8px;
  font-weight: 600;
  line-height: 1.35;
  outline: none;
  background: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: inherit;
  box-sizing: border-box;
}

.note-title-separator {
  flex: 0 0 auto;
  height: 1px;
  margin: 0 24px 10px;
  background: rgba(0, 0, 0, 0.12);
}

.dark .note-title-input {
  color: #dedede;
}

.dark .note-title-separator {
  background: rgba(255, 255, 255, 0.14);
}

.note-editor-stack #note {
  flex: 1 1 auto;
  min-height: 200px;
  height: auto !important;
  padding-top: 4px;
}

/* Markdown：默认阅读态（渲染预览）；通过“进入编辑”切换到输入 */
.note-md-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.note-editor-stack.is-md-preview .note-md-body {
  align-items: stretch;
  min-height: 200px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dark .note-editor-stack.is-md-preview .note-md-body {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.note-editor-stack.is-md-preview .note-md-body #note {
  display: none;
}

.note-markdown-preview {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 240px;
  overflow: auto;
  padding: 12px 20px 32px;
  box-sizing: border-box;
  font-size: 1em;
  line-height: 1.55;
  text-align: left;
  word-break: break-word;
}

.note-markdown-preview:not([hidden]) {
  display: block;
}

.note-markdown-preview .notepad-md-preview-error {
  color: #c62828;
}

.dark .note-markdown-preview .notepad-md-preview-error {
  color: #ff8a80;
}

.note-markdown-preview h1,
.note-markdown-preview h2,
.note-markdown-preview h3 {
  margin: 0.85em 0 0.4em;
  font-weight: 600;
  line-height: 1.25;
}

.note-markdown-preview h1 {
  font-size: 1.45em;
}

.note-markdown-preview h2 {
  font-size: 1.2em;
}

.note-markdown-preview h3 {
  font-size: 1.05em;
}

.note-markdown-preview p {
  margin: 0.5em 0;
}

.note-markdown-preview ul,
.note-markdown-preview ol {
  margin: 0.5em 0;
  padding-left: 1.35em;
}

.note-markdown-preview pre {
  margin: 0.65em 0;
  padding: 10px 12px;
  overflow: auto;
  font-size: 0.92em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
}

.dark .note-markdown-preview pre {
  background: rgba(255, 255, 255, 0.08);
}

.note-markdown-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.note-markdown-preview p code,
.note-markdown-preview li code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
}

.dark .note-markdown-preview p code,
.dark .note-markdown-preview li code {
  background: rgba(255, 255, 255, 0.1);
}

.note-markdown-preview blockquote {
  margin: 0.6em 0;
  padding-left: 0.85em;
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  color: var(--c-text-secondary, #555);
}

.dark .note-markdown-preview blockquote {
  border-left-color: rgba(255, 255, 255, 0.2);
  color: #b0b0b0;
}

/* 覆盖全局 table/tr/td 的 flex+50% 布局（About 页等），恢复 GFM 表格语义 */
.note-markdown-preview table {
  display: table;
  border-collapse: collapse;
  margin: 0.65em 0;
  font-size: 0.95em;
  width: 100%;
  max-width: 100%;
  table-layout: auto;
}

.note-markdown-preview thead {
  display: table-header-group;
}

.note-markdown-preview tbody {
  display: table-row-group;
}

.note-markdown-preview tr {
  display: table-row;
  background-color: transparent;
  margin: 0;
  padding: 0;
  align-items: initial;
}

.note-markdown-preview tr:nth-child(n + 2) {
  border-top: none;
}

.note-markdown-preview th,
.note-markdown-preview td {
  display: table-cell;
  vertical-align: top;
  box-sizing: border-box;
  width: auto;
  min-width: 2.5em;
  text-align: left;
  margin: 0;
  padding: 8px 12px;
  gap: initial;
  align-items: initial;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.note-markdown-preview thead th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
}

.dark .note-markdown-preview thead th {
  background: rgba(255, 255, 255, 0.06);
}

.note-markdown-preview tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.dark .note-markdown-preview tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.dark .note-markdown-preview th,
.dark .note-markdown-preview td {
  border-color: rgba(255, 255, 255, 0.15);
}

.note-markdown-preview .notepad-katex-math[data-display='1'],
.note-markdown-preview .katex-display {
  display: block;
  margin: 0.65em 0;
  overflow-x: auto;
  text-align: center;
}

.notepad-code-block-wrap {
  margin: 0.65em 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .notepad-code-block-wrap {
  border-color: rgba(255, 255, 255, 0.12);
}

.notepad-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  font-size: var(--font-size-xs);
  background: rgba(0, 0, 0, 0.06);
}

.dark .notepad-code-toolbar {
  background: rgba(255, 255, 255, 0.08);
}

.notepad-code-copy {
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--dough-white, #fff);
  cursor: pointer;
}

.dark .notepad-code-copy {
  border-color: rgba(255, 255, 255, 0.2);
  background: #2a2a2a;
  color: #e6e6e6;
}

.notepad-code-block-wrap pre {
  margin: 0;
  border-radius: 0;
}

/* 保留语法着色，去掉 highlight.js 自带底色 */
.note-markdown-preview pre code.hljs,
.notepad-code-block-wrap pre code.hljs,
.note-markdown-preview .hljs {
  background: transparent !important;
}

@media (max-width: 768px) {
  .note-markdown-preview:not([hidden]) {
    flex: 1 1 auto;
    min-height: 200px;
    padding: 12px 14px 26px;
  }
}

.notepad-navbar__icon-btn.is-active {
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.65);
  border-radius: 4px;
}

.dark .note-editor-stack {
  border-color: #000000;
  color: #dedede;
  border-right: 1px solid #3e3e3e;
  border-left: 1px solid #3e3e3e;
}

.grain-paper .note-editor-stack,
.linen-paper .note-editor-stack,
.recycled-paper .note-editor-stack,
.newspaper-paper .note-editor-stack,
.marble-paper .note-editor-stack,
.graph-paper .note-editor-stack,
.dotted-paper .note-editor-stack {
  border-color: transparent;
}

a {
  font-weight: bold;
}

.dark textarea {
  border: #000000;
  color: #dedede;

  border-right: 1px solid #3e3e3e;
  border-left: 1px solid #3e3e3e;
}

.dark {
  background-color: var(--obsidian-black);
  color-scheme: dark;
}

.adFooter {
  position: fixed;
  bottom: 0px;
  font-size: 0.8em;
  z-index: 1000;
  background: #ffffff;
  padding: 5px;
  text-align: center;
  width: 100%;
  float: left;
  border-top: 1px solid #f0f0f0;
}

.theme-switcher {
  background-color: var(--c-bg-secondary);
  border-radius: 8px;
  display: flex;
  padding: 0 3px;
  align-items: center;
  position: relative;
  overflow: hidden;
  font-size: var(--font-size-xs);
  width: 100%;
}

.theme-switcher .slider {
  display: block;
  position: absolute;
  z-index: 1;
  width: calc((100% - 6px) / 3);
  top: 3px;
  transform: translatex(-110%);
  bottom: 3px;
  border-radius: 6px;
  transition: 0.15s ease, transform 0.25s ease-out;
  background-color: var(--c-bg-button);
  box-shadow: var(--slider-shadow);
}

.theme-switcher input {
  display: none;
}

.theme-switcher input:nth-of-type(1):checked~.slider {
  transform: translateX(0);
}

.theme-switcher input:nth-of-type(2):checked~.slider {
  transform: translateX(100%);
}

.theme-switcher input:nth-of-type(3):checked~.slider {
  transform: translateX(200%);
}

.theme-switcher label {
  margin-bottom: 0;
  position: relative;
  z-index: 2;
  width: calc(100% / 3);
  color: var(--c-text-secondary);
}

.theme-switcher label span {
  padding: var(--space-2) 0;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  color: #727272;
  cursor: pointer;
}

.theme-switcher label svg {
  display: inline-block;
  margin-right: 0.5rem;
  width: 20px;
}

#mode {
  cursor: pointer;
  display: flex;
  font-size: var(--font-size-md);
}

/* 高于 shim 中单类 .modal-body，避免与 header/footer 形成过大「框中框」留白 */
.modal-body.modal-container {
  padding: 10px 12px;
}

#toast {
  visibility: hidden;
  min-width: 250px;
  margin-left: -125px;
  background-color: #cecece;
  color: #494949;
  text-align: center;
  border-radius: 10px;
  padding: 14px;
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: 30px;
  font-weight: bold;
}

.dark #toast {
  background-color: #202630;
  color: #fff;
}


#toast.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 1.5s;
  animation: fadein 0.5s, fadeout 0.5s 1.5s;
}

.custom-modal-title {
  display: inline-block;
}

.preferences-layout {
  padding-top: 4px;
}

.preferences-section + .preferences-section {
  margin-top: 10px;
}

.preferences-section-title {
  margin: 0 0 6px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: #595959;
}

.preferences-panel {
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  background: #f0f0f0;
  overflow: hidden;
}

.preferences-panel .form-group {
  margin: 0;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d6d6d6;
}

.preferences-panel .form-group:last-child {
  border-bottom: 0;
}

.preferences-panel .control-label {
  margin-bottom: 0;
  padding-top: 0;
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: #24364f;
}

.preferences-panel .col-sm-6,
.preferences-panel .col-md-5,
.preferences-panel .col-md-6 {
  float: none;
}

.preferences-panel .col-sm-6.col-md-5 {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.preferences-panel .checkbox.checbox-switch {
  margin: 0;
}

.preferences-reset-row {
  margin-top: 12px;
}

#preferencesModal .modal-dialog {
  width: min(560px, calc(100vw - 24px));
}

#preferencesModal .modal-content {
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

#preferencesModal .modal-body.modal-container {
  overflow-y: auto;
  padding-top: 4px;
  padding-bottom: 4px;
}

#preferencesModal .preferences-panel .form-control {
  height: 28px;
  padding: 3px 7px;
  font-size: var(--font-size-xs);
  line-height: 1.2;
}

#preferencesModal .preferences-panel .btn,
#preferencesModal .preferences-panel .btn-group > .btn {
  padding: 3px 7px;
  font-size: var(--font-size-2xs);
  line-height: 1.2;
}

#preferencesModal .theme-switcher {
  font-size: var(--font-size-2xs);
}

#resetPreferences {
  float: right;
  margin-right: 2px;
}

.install-app-btn-container {
  display: none;
}

.install-app-btn {
  padding: 5px 10px;
  background-color: #3F51B5;
  color: white;
  font-weight: bold;
  font-size: var(--font-size-sm);
  border-radius: 6px;
}

.install-app-btn:hover,
.install-app-btn:focus {
  text-decoration: none;
  color: white;
  transform: scale(1.05);
}

#changelog {
  padding: 16px 8px 8px;
}

#changelog .changelog-card {
  --changelog-card-bg: #f7f8fb;
  --changelog-border: #e2e6ec;
  --changelog-line: #d5dae2;
  --changelog-dot: #b3b3b3;
  --changelog-text: #131517;
  --changelog-muted: #7b8794;

  max-width: 520px;
  padding: 18px 8px 18px;
  position: relative;
  overflow: hidden;
}

#changelog .changelog-title {
  margin: 0 0 20px;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--changelog-text);
}

#changelog .changelog-timeline {
  position: relative;
  --timeline-padding: 31px;
  --timeline-axis: 11px;
  --timeline-dot-size: 10px;
  --timeline-dot-radius: 5px;
  padding-left: var(--timeline-padding);
}

#changelog .changelog-timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 8px;
  width: 2px;
  background: var(--changelog-line);
  border-radius: 999px;
}

#changelog .changelog-timeline h4 {
  position: relative;
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--changelog-muted);
  letter-spacing: 0.02em;
}

#changelog .changelog-timeline h4::before {
  content: "";
  position: absolute;
  left: calc(var(--timeline-axis) - var(--timeline-padding) - var(--timeline-dot-radius));
  top: 0.15em;
  width: var(--timeline-dot-size);
  height: var(--timeline-dot-size);
  border-radius: 999px;
  background: var(--changelog-dot);
  box-shadow: 0 0 0 6px var(--changelog-card-bg);
}

#changelog .changelog-timeline ul:last-child {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

#changelog .changelog-timeline ul:not(:last-child) {
  list-style: none;
  padding: 0;
  margin: 8px 0 46px;
}

#changelog .changelog-timeline li {
  font-size: var(--font-size-ui);
  color: var(--changelog-text);
  line-height: 1.4;
  margin: 0 0 10px;
}

#changelog .changelog-timeline li:last-child {
  margin-bottom: 0;
}

#changelog .changelog-timeline a {
  color: #337ab7;
}

#changelog .changelog-footer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-weight: 600;
  text-decoration: none;
  padding-top: 6px;
  transition: transform 0.2s ease, color 0.2s ease;
}

#changelog .changelog-footer:hover,
#changelog .changelog-footer:focus {
  color: #1f2937;
  text-decoration: none;
  transform: translateX(2px);
}

@media (max-width: 600px) {
  #changelog .changelog-card {
    padding: 22px 0 14px;
  }

  #changelog .changelog-title {
    font-size: var(--font-size-xl);
  }

  #changelog .changelog-timeline li {
    font-size: var(--font-size-body);
  }
}

.mic-icon {
  cursor: pointer;
}

.mic-active span {
  position: relative;
  display: inline-block;
}

/* Pulse effect around mic when active */
.mic-active span::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 25px;
  background-color: rgba(255, 0, 0, 0.503);
  border-radius: 50%;
  z-index: 1;
  animation: heartbeat 1.2s infinite ease-in-out !important;
}

.timer-options {
  justify-content: center;
  margin: 26px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.5em;
}

.timer-options .btn {
  font-weight: bold;
  padding: 10px 18px;
}

.dark .timer-pill {
  background: #bff0ff;
}

.bottom-line {
  position: absolute;
  bottom: 1.2em;
  right: 1.4em;
  display: flex;
  gap: 6px;
}


@keyframes rise-s-curve {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.2;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    transform: translateX(-50%) translateY(-30px);
    opacity: 0;
  }
}

.timer-pill {
  display: inline-block;
  background: #c9c7c7;
  margin-left: auto;
  padding: var(--space-1-25) var(--space-3-5);
  border-radius: 20px;
  color: #403333;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-caption);
  gap: var(--space-1-5);
  align-items: center;
}

.pip .timer-pill {
  display: none;
}

.generic-gap {
  gap: var(--space-2-5);
}

nav.notepad-navbar .notepad-navbar__toolbar.icon-container {
  gap: var(--notepad-navbar-gap, var(--navbar-toolbar-gap, var(--space-3)));
}

.icon-container {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--navbar-toolbar-gap, var(--space-3));
  align-self: center;
  height: auto;
  max-height: var(--navbar-height);
  line-height: 0;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.icon-container > .notepad-navbar__tool {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.icon-container > .notepad-navbar__tool > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
  box-sizing: border-box;
}

.icon-container > .notepad-navbar__tool > .notepad-navbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
  box-sizing: border-box;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
}

.icon-container > .notepad-navbar__tool > .notepad-navbar__icon-btn:focus-visible {
  outline: 2px solid rgba(33, 150, 243, 0.9);
  outline-offset: 2px;
}

/* 消除 img/svg 行内基线空隙，与「笔记本」文字同一条视觉中线 */
nav.notepad-navbar .notepad-navbar__tools-scroll img,
nav.notepad-navbar .notepad-navbar__more-wrap--mobile-only img,
nav.navbar .icon-container img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

nav.notepad-navbar .notepad-navbar__tools-scroll svg,
nav.navbar .icon-container svg {
  display: block;
  flex-shrink: 0;
}

@media (max-width: 400px) {
  /* 与桌面同一套间距，避免窄屏工具栏更挤、左侧更疏 */
  nav.notepad-navbar .notepad-navbar__toolbar.icon-container,
  nav.notepad-navbar .notepad-navbar__tools-scroll {
    gap: var(--notepad-navbar-gap, var(--navbar-toolbar-gap, var(--space-3)));
  }
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-modal {
  position: relative;
}

.about-modal-logo {
  position: absolute;
  right: 0px;
  top: 60px;
  transform: rotate(6deg);
  opacity: 0.09;
}

.love-wall {
  position: relative;
  padding: 4px 6px 12px;
}

.love-wall-header {
  text-align: center;
  margin-bottom: 22px;
}

.love-kicker {
  margin: 0 0 6px;
  font-size: var(--font-size-2xs);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: #8d8d8d;
  font-weight: 700;
}

.love-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: #1f1f1f;
}

.love-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: start;
}

.love-card {
  background: linear-gradient(160deg, #ffffff 0%, #fbfbfb 100%);
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 12px 26px rgba(18, 18, 18, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.love-card::after {
  content: "”";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: var(--font-size-display-sm);
  color: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.love-quote {
  margin: 0 0 16px;
  color: #2c2c2c;
  font-size: var(--font-size-body);
  line-height: 1.6;
}

.love-highlight {
  background: #fff4b8;
  border-radius: 6px;
  padding: 0 4px;
  box-shadow: inset 0 -6px 0 rgba(255, 218, 92, 0.45);
}

.love-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eeeeee;
  padding-top: 12px;
}

.love-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: #2a2a2a;
  background: #ffe4d6;
}

.love-card:nth-child(4n + 2) .love-avatar {
  background: #d9edff;
}

.love-card:nth-child(4n + 3) .love-avatar {
  background: #ddf7e5;
}

.love-card:nth-child(4n) .love-avatar {
  background: #f1e6ff;
}

.love-meta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.love-name {
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: #1f1f1f;
}

.love-source {
  font-size: var(--font-size-xs);
  color: #7c7c7c;
  font-weight: 600;
}

.love-source:hover {
  text-decoration: none;
  color: #2f2f2f;
}

@media (max-width: 520px) {
  .love-title {
    font-size: var(--font-size-lg);
  }

  .love-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 591px) {
  .about-modal-logo {
    display: none;
  }
}

.checkbox.checbox-switch {
  padding-left: 0;
}

.checkbox.checbox-switch label,
.checkbox-inline.checbox-switch {
  display: inline-block;
  position: relative;
  padding-left: 0;
}

.checkbox.checbox-switch label input,
.checkbox-inline.checbox-switch input {
  display: none;
}

.checkbox.checbox-switch label span,
.checkbox-inline.checbox-switch span {
  width: 35px;
  border-radius: 20px;
  height: 18px;
  border: 1px solid #dbdbdb;
  background-color: rgb(255, 255, 255);
  border-color: rgb(211 211 211);
  box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

.checkbox.checbox-switch label span:before,
.checkbox-inline.checbox-switch span:before {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgb(255, 255, 255);
  content: " ";
  top: 0;
  position: relative;
  left: 0;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.checkbox.checbox-switch label>input:checked+span:before,
.checkbox-inline.checbox-switch>input:checked+span:before {
  left: 17px;
}

.checkbox.checbox-switch label>input:checked+span,
.checkbox-inline.checbox-switch>input:checked+span {
  background-color: rgb(180, 182, 183);
  border-color: rgb(180, 182, 183);
  box-shadow: rgb(180, 182, 183) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch label>input:checked:disabled+span,
.checkbox-inline.checbox-switch>input:checked:disabled+span {
  background-color: rgb(220, 220, 220);
  border-color: rgb(220, 220, 220);
  box-shadow: rgb(220, 220, 220) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch label>input:disabled+span,
.checkbox-inline.checbox-switch>input:disabled+span {
  background-color: rgb(232, 235, 238);
  border-color: rgb(255, 255, 255);
}

.checkbox.checbox-switch label>input:disabled+span:before,
.checkbox-inline.checbox-switch>input:disabled+span:before {
  background-color: rgb(248, 249, 250);
  border-color: rgb(243, 243, 243);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Switch Light */
.checkbox.checbox-switch.switch-light label>input:checked+span,
.checkbox-inline.checbox-switch.switch-light>input:checked+span {
  background-color: rgb(248, 249, 250);
  border-color: rgb(248, 249, 250);
  box-shadow: rgb(248, 249, 250) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

/* Switch Dark */
.checkbox.checbox-switch.switch-dark label>input:checked+span,
.checkbox-inline.checbox-switch.switch-dark>input:checked+span {
  background-color: rgb(52, 58, 64);
  border-color: rgb(52, 58, 64);
  box-shadow: rgb(52, 58, 64) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-dark label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-dark>input:checked:disabled+span {
  background-color: rgb(100, 102, 104);
  border-color: rgb(100, 102, 104);
  box-shadow: rgb(100, 102, 104) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

/* Switch Success */
.checkbox.checbox-switch.switch-success label>input:checked+span,
.checkbox-inline.checbox-switch.switch-success>input:checked+span {
  background-color: rgb(40, 167, 69);
  border-color: rgb(40, 167, 69);
  box-shadow: rgb(40, 167, 69) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-success label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-success>input:checked:disabled+span {
  background-color: rgb(153, 217, 168);
  border-color: rgb(153, 217, 168);
  box-shadow: rgb(153, 217, 168) 0px 0px 0px 8px inset;
}

/* Switch Danger */
.checkbox.checbox-switch.switch-danger label>input:checked+span,
.checkbox-inline.checbox-switch.switch-danger>input:checked+span {
  background-color: rgb(200, 35, 51);
  border-color: rgb(200, 35, 51);
  box-shadow: rgb(200, 35, 51) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-danger label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-danger>input:checked:disabled+span {
  background-color: rgb(216, 119, 129);
  border-color: rgb(216, 119, 129);
  box-shadow: rgb(216, 119, 129) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

/* Switch Primary */
.checkbox.checbox-switch.switch-primary label>input:checked+span,
.checkbox-inline.checbox-switch.switch-primary>input:checked+span {
  background-color: rgb(0, 105, 217);
  border-color: rgb(0, 105, 217);
  box-shadow: rgb(0, 105, 217) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-primary label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-primary>input:checked:disabled+span {
  background-color: rgb(109, 163, 221);
  border-color: rgb(109, 163, 221);
  box-shadow: rgb(109, 163, 221) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

/* Switch Info */
.checkbox.checbox-switch.switch-info label>input:checked+span,
.checkbox-inline.checbox-switch.switch-info>input:checked+span {
  background-color: rgb(23, 162, 184);
  border-color: rgb(23, 162, 184);
  box-shadow: rgb(23, 162, 184) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-info label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-info>input:checked:disabled+span {
  background-color: rgb(102, 192, 206);
  border-color: rgb(102, 192, 206);
  box-shadow: rgb(102, 192, 206) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

/* Switch Warning */
.checkbox.checbox-switch.switch-warning label>input:checked+span,
.checkbox-inline.checbox-switch.switch-warning>input:checked+span {
  background-color: rgb(255, 193, 7);
  border-color: rgb(255, 193, 7);
  box-shadow: rgb(255, 193, 7) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.checkbox.checbox-switch.switch-warning label>input:checked:disabled+span,
.checkbox-inline.checbox-switch.switch-warning>input:checked:disabled+span {
  background-color: rgb(226, 195, 102);
  border-color: rgb(226, 195, 102);
  box-shadow: rgb(226, 195, 102) 0px 0px 0px 8px inset;
  transition: border 0.4s ease 0s, box-shadow 0.4s ease 0s, background-color 1.2s ease 0s;
}

.monospaced {
  font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
}

.serif {
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
}

.handwritten {
  font-family: 'Segoe Print', 'Bradley Hand', Chilanka, TSCu_Comic, casual, cursive;
}

.humanist {
  font-family: Optima, Candara, 'Noto Sans', source-sans-pro, sans-serif;
}

.grain-paper {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='160'%20height='160'%20filter='url(%23n)'%20opacity='0.14'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.grain-paper textarea {
  border-color: transparent;
}

.dark.grain-paper {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='160'%20height='160'%20filter='url(%23n)'%20opacity='0.2'/%3E%3C/svg%3E");
}

.linen-paper {
  background-image: repeating-linear-gradient(0deg, rgba(210, 210, 210, 0.12) 0, rgba(210, 210, 210, 0.12) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(210, 210, 210, 0.12) 0, rgba(210, 210, 210, 0.12) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(0deg, rgba(210, 210, 210, 0.05) 0, rgba(210, 210, 210, 0.05) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(90deg, rgba(210, 210, 210, 0.05) 0, rgba(210, 210, 210, 0.05) 1px, transparent 1px, transparent 12px);
  background-position: 0 0, 0 0, 3px 3px, 3px 3px;
}

.linen-paper textarea {
  border-color: transparent;
}

.dark.linen-paper {
  background-image: repeating-linear-gradient(0deg, rgba(80, 80, 80, 0.2) 0, rgba(80, 80, 80, 0.2) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(80, 80, 80, 0.2) 0, rgba(80, 80, 80, 0.2) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(0deg, rgba(80, 80, 80, 0.08) 0, rgba(80, 80, 80, 0.08) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(90deg, rgba(80, 80, 80, 0.08) 0, rgba(80, 80, 80, 0.08) 1px, transparent 1px, transparent 12px);
}

.recycled-paper {
  background-color: #f0e6d7;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'160'%20height%3D'160'%20viewBox%3D'0%200%20160%20160'%3E%0A%3Cfilter%20id%3D't'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'1.2'%20numOctaves%3D'1'%20seed%3D'9'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'dots'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0%200%200%200.05%200.25%200.6%201'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0%200%200%200.04%200.2%200.5%200.9'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0%200%200%200.03%200.18%200.45%200.8'/%3E%0A%3C/feComponentTransfer%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'160'%20height%3D'160'%20filter%3D'url(%23t)'%20opacity%3D'0.12'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'260'%20height%3D'260'%20viewBox%3D'0%200%20260%20260'%3E%0A%3Cfilter%20id%3D's'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.85'%20numOctaves%3D'1'%20seed%3D'3'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'specks'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0%200%200%200.2%200.55%200.75%200.9'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0%200%200%200.18%200.48%200.68%200.82'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0%200%200%200.15%200.4%200.58%200.7'/%3E%0A%3C/feComponentTransfer%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.2'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'260'%20height%3D'260'%20filter%3D'url(%23s)'%20opacity%3D'0.1'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'620'%20height%3D'620'%20viewBox%3D'0%200%20620%20620'%3E%0A%3Cfilter%20id%3D'f'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.03'%20numOctaves%3D'2'%20seed%3D'5'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'tone'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0.45%200.6%200.74%200.84%200.92'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0.42%200.57%200.7%200.8%200.88'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0.38%200.52%200.64%200.74%200.82'/%3E%0A%3C/feComponentTransfer%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.6'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'620'%20height%3D'620'%20filter%3D'url(%23f)'%20opacity%3D'0.18'/%3E%0A%3C/svg%3E");
  background-size: 160px 160px, 260px 260px, 620px 620px;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: repeat;
  background-blend-mode: multiply;
}

.recycled-paper textarea {
  border-color: transparent;
}

.dark.recycled-paper {
  background-color: #101113;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'160'%20height%3D'160'%20viewBox%3D'0%200%20160%20160'%3E%0A%3Cfilter%20id%3D't'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'1.2'%20numOctaves%3D'1'%20seed%3D'9'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'dots'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0%200%200%200.04%200.12%200.3%200.55'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0%200%200%200.04%200.12%200.3%200.55'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0%200%200%200.04%200.12%200.3%200.55'/%3E%0A%3C/feComponentTransfer%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'160'%20height%3D'160'%20filter%3D'url(%23t)'%20opacity%3D'0.1'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'260'%20height%3D'260'%20viewBox%3D'0%200%20260%20260'%3E%0A%3Cfilter%20id%3D's'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.85'%20numOctaves%3D'1'%20seed%3D'3'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'specks'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0%200%200%200.08%200.2%200.35%200.5'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0%200%200%200.08%200.2%200.35%200.5'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0%200%200%200.08%200.2%200.35%200.5'/%3E%0A%3C/feComponentTransfer%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.2'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'260'%20height%3D'260'%20filter%3D'url(%23s)'%20opacity%3D'0.08'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'620'%20height%3D'620'%20viewBox%3D'0%200%20620%20620'%3E%0A%3Cfilter%20id%3D'f'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.03'%20numOctaves%3D'2'%20seed%3D'5'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeComponentTransfer%20in%3D'gray'%20result%3D'tone'%3E%0A%20%20%3CfeFuncR%20type%3D'table'%20tableValues%3D'0.08%200.12%200.16%200.2%200.24'/%3E%0A%20%20%3CfeFuncG%20type%3D'table'%20tableValues%3D'0.08%200.12%200.16%200.2%200.24'/%3E%0A%20%20%3CfeFuncB%20type%3D'table'%20tableValues%3D'0.08%200.12%200.16%200.2%200.24'/%3E%0A%3C/feComponentTransfer%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.6'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'620'%20height%3D'620'%20filter%3D'url(%23f)'%20opacity%3D'0.12'/%3E%0A%3C/svg%3E");
  background-size: 160px 160px, 260px 260px, 620px 620px;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: repeat;
  background-blend-mode: multiply;
}

.newspaper-paper {
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.05) 0.7px, transparent 1.5px),
    radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.03) 0.5px, transparent 1.2px),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'320'%20height%3D'320'%20viewBox%3D'0%200%20320%20320'%3E%0A%3Cfilter%20id%3D'n'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.6'%20numOctaves%3D'2'%20seed%3D'7'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'/%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.35'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'320'%20height%3D'320'%20filter%3D'url(%23n)'%20opacity%3D'0.07'/%3E%0A%3C/svg%3E");
  background-size: 6px 6px, 10px 10px, 320px 320px;
  background-position: 0 0, 3px 1px, 0 0;
  background-repeat: repeat;
}

.newspaper-paper textarea {
  border-color: transparent;
}

.dark.newspaper-paper {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.02) 0.7px, transparent 1.5px),
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.015) 0.5px, transparent 1.2px),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'320'%20height%3D'320'%20viewBox%3D'0%200%20320%20320'%3E%0A%3Cfilter%20id%3D'n'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.6'%20numOctaves%3D'2'%20seed%3D'7'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeColorMatrix%20in%3D'gray'%20type%3D'matrix'%20values%3D'0.2%200%200%200%200%200%200.2%200%200%200%200%200%200.2%200%200%200%200%200%201%200'/%3E%0A%3CfeGaussianBlur%20stdDeviation%3D'0.35'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'320'%20height%3D'320'%20filter%3D'url(%23n)'%20opacity%3D'0.08'/%3E%0A%3C/svg%3E");
  background-size: 6px 6px, 10px 10px, 320px 320px;
  background-position: 0 0, 3px 1px, 0 0;
  background-repeat: repeat;
}

.marble-paper {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'1200'%20height%3D'1200'%20viewBox%3D'0%200%201200%201200'%3E%0A%3Cfilter%20id%3D'm'%3E%0A%3CfeTurbulence%20type%3D'turbulence'%20baseFrequency%3D'0.006%200.018'%20numOctaves%3D'2'%20seed%3D'11'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'matrix'%20values%3D'1.6%200%200%200%20-0.3%200%201.6%200%200%20-0.3%200%200%201.6%200%20-0.3%200%200%200%201%200'%20result%3D'veins'/%3E%0A%3CfeColorMatrix%20in%3D'veins'%20type%3D'matrix'%20values%3D'1.01%200%200%200%200.008%200%201.01%200%200%200.006%200%200%200.98%200%200.015%200%200%200%201%200'%20result%3D'tint'/%3E%0A%3CfeGaussianBlur%20in%3D'tint'%20stdDeviation%3D'0.3'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'1200'%20height%3D'1200'%20filter%3D'url(%23m)'%20opacity%3D'0.12'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'700'%20height%3D'700'%20viewBox%3D'0%200%20700%20700'%3E%0A%3Cfilter%20id%3D'g'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.7'%20numOctaves%3D'1'%20seed%3D'4'/%3E%0A%3CfeColorMatrix%20type%3D'saturate'%20values%3D'0'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'700'%20height%3D'700'%20filter%3D'url(%23g)'%20opacity%3D'0.015'/%3E%0A%3C/svg%3E");
  background-repeat: repeat;
  background-size: 1200px 1200px, 700px 700px;
  background-blend-mode: multiply, normal;
}

.marble-paper textarea {
  border-color: transparent;
}

.dark.marble-paper {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'1200'%20height%3D'1200'%20viewBox%3D'0%200%201200%201200'%3E%0A%3Cfilter%20id%3D'm'%3E%0A%3CfeTurbulence%20type%3D'turbulence'%20baseFrequency%3D'0.006%200.018'%20numOctaves%3D'2'%20seed%3D'11'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'matrix'%20values%3D'-1%200%200%200%201%200%20-1%200%200%201%200%200%20-1%200%201%200%200%200%201%200'%20result%3D'inv'/%3E%0A%3CfeColorMatrix%20in%3D'inv'%20type%3D'matrix'%20values%3D'1.02%200%200%200%20-0.03%200%201.02%200%200%20-0.03%200%200%201.02%200%20-0.03%200%200%200%201%200'%20result%3D'veins'/%3E%0A%3CfeGaussianBlur%20in%3D'veins'%20stdDeviation%3D'0.3'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'1200'%20height%3D'1200'%20filter%3D'url(%23m)'%20opacity%3D'0.07'/%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'700'%20height%3D'700'%20viewBox%3D'0%200%20700%20700'%3E%0A%3Cfilter%20id%3D'g'%3E%0A%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.7'%20numOctaves%3D'1'%20seed%3D'4'%20result%3D'noise'/%3E%0A%3CfeColorMatrix%20in%3D'noise'%20type%3D'saturate'%20values%3D'0'%20result%3D'gray'/%3E%0A%3CfeColorMatrix%20in%3D'gray'%20type%3D'matrix'%20values%3D'-1%200%200%200%201%200%20-1%200%200%201%200%200%20-1%200%201%200%200%200%201%200'/%3E%0A%3C/filter%3E%0A%3Crect%20width%3D'700'%20height%3D'700'%20filter%3D'url(%23g)'%20opacity%3D'0.012'/%3E%0A%3C/svg%3E");
  background-repeat: repeat;
  background-size: 1200px 1200px, 700px 700px;
  background-blend-mode: screen, normal;
}

.graph-paper {
  background-image: linear-gradient(#d2d2d24d 1px, #0000 1px), linear-gradient(90deg, #d2d2d24d 1px, #0000 1px);
  background-position: -14px 14px;
  background-size: 12px 12px;
}

.graph-paper textarea {
  border-color: transparent;
}

.dark.graph-paper {
  background-image: linear-gradient(#5050504d 1px, #0000 1px), linear-gradient(90deg, #5050504d 1px, #0000 1px);
}

.dotted-paper {
  background-image: radial-gradient(#d2d2d280 1px, #0000 1px);
  background-size: 24px 24px;
}

.dotted-paper textarea {
  border-color: transparent;
}

.dark.dotted-paper {
  background-image: radial-gradient(#50505080 1px, #0000 1px);
}

/* Heartbeat animation */
@keyframes heartbeat {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  30% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
}

@-webkit-keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 30px;
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

@media (max-width: 767px) {
  .navbar-default .navbar-nav .open .dropdown-menu>li>a {
    color: #ecf0f1;
  }

  .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus {
    color: #ecdbff;
  }

  .navbar-default .navbar-nav .open .dropdown-menu>.active>a,
  .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus {
    color: #ecdbff;
    background-color: #8e44ad;
  }
}

.form-horizontal .control-label {
  text-align: left !important;
}

.navbar-toggle {
  margin-right: 24px;
}

.modal-title {
  font-weight: 600;
  color: #333;
}

.modal-header .close {
    margin-top: 0px;
}

.nav-tabs>li>a {
  border-radius: 8px 8px 0 0;
}

#whiteNoiseModal .custom-modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#whiteNoiseModal .modal-body {
  max-height: min(68vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 12px;
  padding-right: 12px;
}

.ambient-noise-title-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ambient-noise-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.ambient-noise-presets-dropdown {
  position: relative;
  margin-right: 10px;
}

.ambient-noise-preset-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #ffffff;
  color: #333;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ambient-noise-preset-trigger:hover,
.ambient-noise-preset-trigger:focus,
.ambient-noise-preset-trigger.open {
  border-color: #3498db;
  outline: none;
}

.ambient-noise-preset-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1055;
  width: 280px;
  padding: 10px 0 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(28, 31, 36, 0.18);
  overflow: hidden;
}

.ambient-noise-preset-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 22px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  transform: rotate(45deg);
}

.ambient-noise-preset-list {
  max-height: 240px;
  overflow-y: auto;
}

.ambient-noise-preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  color: #2f2f35;
  cursor: pointer;
}

.ambient-noise-preset-row:hover,
.ambient-noise-preset-row:focus {
  background: #f5f8ff;
  outline: none;
}

.ambient-noise-preset-row.active {
  background: #f2f7ff;
}

.ambient-noise-preset-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-ui);
  font-weight: 600;
}

.ambient-noise-preset-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ambient-noise-preset-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #1677ff;
  opacity: 0;
}

.ambient-noise-preset-check.visible {
  opacity: 1;
}

.ambient-noise-preset-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
}

.ambient-noise-preset-icon-button:hover,
.ambient-noise-preset-icon-button:focus {
  background: rgba(22, 119, 255, 0.08);
  color: #1f2937;
  outline: none;
}

.ambient-noise-preset-icon-button.delete:hover,
.ambient-noise-preset-icon-button.delete:focus {
  background: rgba(220, 38, 38, 0.08);
  color: #c53030;
}

.ambient-noise-preset-empty {
  padding: 16px;
  color: #7a7a85;
  font-size: var(--font-size-body);
  text-align: center;
}

.ambient-noise-preset-create {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid #ececec;
  background: #ffffff;
  color: #2f2f35;
  font-size: var(--font-size-ui);
  font-weight: 600;
}

.ambient-noise-preset-create:hover,
.ambient-noise-preset-create:focus {
  background: #f8fafc;
  outline: none;
}

.snapshot-text {
  display: none;
}

/* Custom style for Swal toast */
.swal-toast-bottom-offset {
  margin-bottom: 42px !important;
  background: #f0f0f0 !important;
  box-shadow: 0 5px 10px rgba(109, 109, 109, 0.4) !important;
}

.dark .swal-toast-bottom-offset {
  background: #353535 !important;
  color: #eaeaea !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.dark .swal-toast-bottom-offset .swal2-title {
  color: #eaeaea !important;
}

.dark .swal-toast-bottom-offset .swal2-timer-progress-bar {
  background: rgba(255, 255, 255, 0.3) !important;
}

/* Custom style for Swal toast */

@media (max-width: 412px) {
  .nav>li>a {
    padding: 10px 10px;
  }

  .nav-tabs {
    border-bottom: 1px solid #ddd;
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 766px) {
  .dark textarea {
    border-right: 1px solid #0d1117;
    border-left: 1px solid #0d1117;
  }
}

@media (max-width: 450px) {
  .sticky-notice {
    width: 75%;
  }

  /* 勿作用于笔记本顶栏品牌：由 flex gap 控制间距，避免小屏「按钮—标题」过宽 */
  .navbar-brand:not(.app-heading) {
    padding: 0 12px !important;
  }

  .ambient-noise-header-actions,
  .ambient-noise-presets-dropdown {
    width: 100%;
  }

  .ambient-noise-title-group {
    width: 100%;
  }

  .ambient-noise-preset-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .ambient-noise-preset-menu {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .search-container {
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .navbar.navbar-inverse .navbar-header {
    flex-wrap: nowrap;
  }

  .navbar.navbar-inverse .navbar-brand {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0;
    padding-right: 0;
    margin-right: 0;
    flex: 0 0 auto;
  }

  .navbar.navbar-inverse .icon-container,
  .notepad-navbar__tools-scroll {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
}

.ambient-noise-icon {
  position: relative;
}

.floating-notes {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.about-link {
  padding-right: 0 !important;
}

@keyframes floatNote {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-80px) scale(0.8);
    opacity: 0;
  }
}

.toast-popup {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: white;
  padding: 15px 15px 15px 18px;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1060;
  display: none;
  max-width: 305px;
  border: 1px solid #e0e0e0;
  background-color: #dddddd;
  background-image: radial-gradient(#646464 0.5px, transparent 0.5px), radial-gradient(#646464 0.5px, #dddddd 0.5px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.toast-popup.show {
  display: block;
  animation: slideIn 0.5s ease-out forwards;
}

.toast-popup.hide {
  animation: slideOut 0.3s ease-in forwards;
}

.dark .toast-popup {
  background-image: radial-gradient(45.07% 92.4% at 51% 7.61%, #464646 0, #181e27 100%);
  border-color: #30363d;
  background-size: initial;
}

.dark .toast-content a {
  color: #c9d1d9;
  transition: color .2s ease-out, opacity .2s ease-out;
}

.dark .toast-content a:hover {
  color: #58a6ff;
}

.dark .close-popup {
  color: #8b949e;
}

.dark .close-popup:hover {
  color: #c9d1d9;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-content a {
  color: #2c3e50;
  text-decoration: none;
  flex-grow: 1;
}

.toast-content a:hover {
  color: #3498db;
}

.close-popup {
  background: none;
  border: none;
  color: #666;
  font-size: var(--font-size-xl);
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.close-popup:hover {
  color: #333;
}

.break-reminder-popup {
  max-width: 360px;
}

.break-reminder-content {
  align-items: flex-start;
}

.break-reminder-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.break-reminder-copy strong {
  color: #213547;
  font-size: var(--font-size-ui);
  line-height: 1.3;
}

.break-reminder-copy p {
  margin: 0;
  color: #48576a;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.break-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.break-reminder-button {
  border: 1px solid #bcc7d3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #22303f;
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 7px 12px;
  transition: transform .18s ease-out, background-color .18s ease-out, border-color .18s ease-out;
}

.break-reminder-button:hover,
.break-reminder-button:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #7ca4c8;
  outline: none;
  transform: translateY(-1px);
}

.break-reminder-button-primary {
  background: #213547;
  border-color: #213547;
  color: #fff;
}

.break-reminder-button-primary:hover,
.break-reminder-button-primary:focus {
  background: #182736;
  border-color: #182736;
}

.break-reminder-popup.break-active .break-reminder-actions {
  margin-top: 12px;
}

.break-reminder-popup.break-active .break-reminder-copy strong {
  font-size: var(--font-size-stat);
  letter-spacing: 1px;
}

.break-reminder-popup.break-active .break-reminder-copy p {
  font-size: var(--font-size-sm);
}

.dark .break-reminder-copy strong {
  color: #eef6ff;
}

.dark .break-reminder-copy p {
  color: #b5c2cf;
}

.dark .break-reminder-button {
  background: rgba(24, 30, 39, 0.78);
  border-color: #384352;
  color: #dce6f0;
}

.dark .break-reminder-button:hover,
.dark .break-reminder-button:focus {
  background: rgba(32, 40, 52, 0.96);
  border-color: #5b7592;
}

.dark .break-reminder-button-primary {
  background: #93c5fd;
  border-color: #93c5fd;
  color: #0f172a;
}

.dark .break-reminder-button-primary:hover,
.dark .break-reminder-button-primary:focus {
  background: #bfdbfe;
  border-color: #bfdbfe;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  0% {
    transform: translateX(0);
    opacity: 1;
  }

  20% {
    transform: translateX(30px);
    opacity: 1;
  }

  100% {
    transform: translateX(-400px);
    opacity: 0;
  }
}

/* White Noise Player Styles */
.sound-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.6em;
}

.sound-button>div:first-child {
  display: flex;
  flex-direction: row;
  gap: 0.6em
}

.sound-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 10px;
  background: #f1efef;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  gap: 22px;
}

.sound-button:hover {
  background: #e3e2e2;
}

.sound-button .new-badge {
  position: absolute;
  top: -5px;
  left: 11px;
  background-color: #28a745 !important;
  color: white;
  font-size: var(--font-size-micro);
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 3px;
  line-height: 1;
  background: #e3e2e2;
}

.sound-button.playing {
  background: #dcefff;
}

.sound-button span {
  flex: 1;
  font-size: var(--font-size-sm);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-button.playing::after {
  content: '';
  width: 8px;
  height: 8px;
  background-color: #2196f3;
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
  position: absolute;
  top: 10px;
  right: 10px;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
  }
}

.dark .sound-button.playing span::after {
  background-color: var(--c-accent);
}

.volume-control {
  width: 100px;
}

.volume-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: #cccccc;
  outline: none;
  border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #2196f3;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #2196f3;
  cursor: pointer;
  border: none;
}

/* 环境音卡片：与 body.dark 同步（原 .dark-mode 未在脚本中使用） */
.dark .sound-button {
  background: var(--surface-subtle);
  color: var(--c-text-primary);
  border: 1px solid transparent;
}

.dark .sound-button:hover {
  background: var(--c-bg-secondary);
  border-color: var(--c-border-primary);
}

.dark .sound-button.playing {
  background: var(--c-accent-muted);
  border: 1px solid var(--c-accent-border);
}

.dark .volume-slider {
  background: var(--c-border-strong);
}

.sound-button.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.sound-button.loading::before {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid #2196f3;
  border-top-color: transparent;
  border-radius: 50%;
  animation: loading-spinner 0.8s linear infinite;
  top: 10px;
  right: 10px;
}

@keyframes loading-spinner {
  to {
    transform: rotate(360deg);
  }
}

.dark .sound-button.loading::before {
  border-color: var(--c-accent);
  border-top-color: transparent;
}

/* Global mute button styles */
.global-mute-button {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.global-mute-button.muted svg {
  color: #ff3333;
}

.custom-modal-title {
  display: flex;
  align-items: center;
}

/* Global mute button styles */
.global-mute-button.muted svg {
  color: #ff3333;
}

/* Import OpenDyslexic font */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/OpenDyslexic-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Cookie';
  src: url('../fonts/Cookie-Regular.ttf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'DepartureMono';
  src: url('../fonts/DepartureMono-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* Dyslexic font class */
.dyslexic {
  font-family: 'OpenDyslexic', sans-serif !important;
  line-height: 1.6;
}

.pixel {
  font-family: 'DepartureMono', sans-serif !important;
  line-height: 1.6;
}

.new-tag {
  background: #71fa82 !important;
}

.new-badge {
  padding: 2px 9px;
  background: #0bb120;
  font-size: var(--font-size-caption);
  border-radius: 4px;
  color: white;
}

.typewriter-switch {
  gap: 12px;
}

.typewriter-switch-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}

#typewriterVolumeValue {
  font-size: var(--font-size-sm);
  color: #2c2c2c;
  font-variant-numeric: tabular-nums;
  width: 30px;
}

@media (max-width: 767px) {
  .preferences-panel .form-group {
    display: block;
    padding: 7px 6px;
  }

  .preferences-panel .control-label {
    margin-bottom: 6px;
  }

  .preferences-panel .col-sm-6.col-md-5 {
    justify-content: flex-start;
  }

  .typewriter-switch {
    flex-wrap: wrap;
  }

  .preferences-panel .checkbox.checbox-switch {
    flex-direction: row-reverse;
  }
}

#keyburstLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 999;
}

.keyburst-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--burst-color, #ff6b6b);
  box-shadow: 0 0 6px var(--burst-color, #ff6b6b);
  opacity: 1;
  transform: translate(0, 0) scale(1);
  animation: keyburst 650ms ease-out forwards;
  will-change: transform, opacity;
}

@keyframes keyburst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--burst-x, 0), var(--burst-y, -20px)) scale(0);
  }
}

.chime-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.chime-container input {
  margin: 0;
  color-scheme: none;
}

.chime-container label {
  margin: 0;
  font-size: 1em;
}

.tilt-css:hover span {
  display: inline-block;
  transform-origin: 50% 65%;
}

.tilt-css:hover span:first-child {
  transform: rotate(6deg) !important;
}

.tilt-css:hover span:nth-child(6n+1) {
  transform: rotate(-7deg);
}

.tilt-css:hover span:nth-child(6n+2) {
  transform: rotate(4deg);
}

.tilt-css:hover span:nth-child(6n+3) {
  transform: rotate(-2deg);
}

.tilt-css:hover span:nth-child(6n+4) {
  transform: rotate(6deg);
}

.tilt-css:hover span:nth-child(6n+5) {
  transform: rotate(-5deg);
}

.tilt-css:hover span:nth-child(6n+6) {
  transform: rotate(3deg);
}

/* Focus Mode Close Button */
.focus-mode-close-btn {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: dropDown 0.4s ease-out;
}

@keyframes dropDown {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.focus-mode-close-btn button {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 0 0 8px 8px;
  color: white;
  padding: 4px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.focus-mode-close-btn button:hover {
  background: rgba(0, 0, 0, 0.9);
}

body.dark .focus-mode-close-btn button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark .focus-mode-close-btn button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Statistics Modal Styles */
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border-radius: 10px;
  background: #e5e6e7;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 1px 1px 4px 0px #0000001f;
}

body.dark .stat-item {
  background: rgb(224 242 255);
}

body.dark .stat-item:hover {
  box-shadow: 2px 2px 3px 1px #0000001f;
}

.stat-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: #5d5b5b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-align: center;
}

.stat-label a {
  vertical-align: 2px;
}

.stat-label .tooltip {
  text-transform: none;
}

.stat-value {
  font-size: var(--font-size-display-sm);
  font-weight: 700;
  color: var(--c-text-primary);
}

body.dark .stat-value {
  color: #585656;
}

@media (max-width: 480px) {
  .statistics-grid {
    gap: 15px;
  }

  .stat-value {
    font-size: var(--font-size-xl-alt);
  }

  .stat-label {
    font-size: var(--font-size-caption);
  }
}

@media (max-width: 360px) {
  .statistics-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media print {

  .dark .toast-popup,
  .toast-popup,
  .word-count-container {
    display: none !important;
  }

  .note-editor-stack {
    border: none !important;
  }

  .dark textarea {
    border-left: none;
    border-right: none;
  }

  textarea {
    border: none;
    border-left: none;
    border-right: none;
  }
}

/* ---- public/html 子页（无顶栏）---- */
body.about-subpage {
  padding-top: 0;
  min-height: 100vh;
  box-sizing: border-box;
}

.about-subpage__main {
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.about-subpage__title {
  font-size: var(--font-size-display-sm);
  font-weight: 700;
  margin: 0 0 var(--space-4);
  color: var(--c-text-primary);
}

.about-subpage__lead {
  line-height: 1.65;
  color: var(--c-text-secondary);
  margin: 0 0 var(--space-5);
}

.about-subpage__lead code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm, 4px);
  background: rgba(0, 0, 0, 0.06);
}

.about-subpage__meta {
  font-size: var(--font-size-sm);
  color: var(--c-text-secondary);
}

.about-subpage__meta a {
  color: var(--c-text-primary);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

body.dark.about-subpage {
  background-color: #121518;
}

body.dark.about-subpage .about-subpage__title {
  color: #f0f0f0;
}

body.dark.about-subpage .about-subpage__lead,
body.dark.about-subpage .about-subpage__meta {
  color: #9ca3af;
}

body.dark.about-subpage .about-subpage__meta a {
  color: #93c5fd;
}

body.dark.about-subpage .about-subpage__lead code {
  background: rgba(255, 255, 255, 0.08);
}