html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { text-decoration: none !important; }
ul, ol { list-style: none !important; }

html {
  min-height: 100%;
}

:root {
  --bg-dark: #0A0A0D;
  --bg-medium: #121217;
  --bg-light: #1A1A22;
  --accent: #FFFFFF;
  --accent-hover: #E5E5E5;
  --accent-light: rgba(255, 255, 255, 0.15);
  --text-primary: #F5F5F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --border: rgba(255,255,255,0.08);
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s ease;
}

.lx-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20000;
  width: min(360px, calc(100vw - 40px));
  transform: translateX(24px);
  border: 0;
  border-left: 3px solid #00ffff;
  border-radius: 2px;
  background: rgba(24, 24, 27, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  padding: 12px 14px 12px 15px;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.lx-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.lx-toast.is-error {
  border-left-color: #ff4d4d;
}

.lx-toast__title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.lx-toast__body {
  margin-top: 3px;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.mobile-menu-open {
  overflow: hidden;
  touch-action: none;
}

input,
select,
button {
  min-height: 44px;
}

.fixed {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.mobile-menu-drawer {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.mobile-menu-panel {
  padding-top: calc(1.25rem + env(safe-area-inset-top));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

.mobile-menu-link,
.mobile-menu-secondary-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  border-radius: 0.875rem;
  padding: 0.65rem 0.85rem;
  color: #d4d4d8;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-menu-secondary-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* 鼠标跟随光效 */
body::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(255,255,255,0.1), transparent 40%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

/* 导航 */
.navbar {
  position: sticky;
  top: 16px;
  z-index: 999;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(18,18,23,0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0 24px;
  height: 56px;
}
.logo {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}
.nav-menu {
  display: flex;
  gap: 8px;
}
.nav-link {
  display: inline-block;   /* 新增这一行 */
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--accent-light);
  color: var(--text-primary);
}

/* 首屏 */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 40px;
}
.btn-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary-lg {
  padding: 16px 40px;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
}
.btn-primary-lg:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.btn-secondary-lg {
  padding: 16px 40px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.btn-secondary-lg:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* 功能区 */
.features {
  max-width: 1200px;
  margin: 0 auto 100px;
  padding: 0 24px;
}
.features-header {
  text-align: center;
  margin-bottom: 60px;
}
.features-header h2 {
  font-size: 40px;
  margin-bottom: 12px;
}
.features-header p {
  color: var(--text-secondary);
  font-size: 18px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
}
.feature-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-slow);
}
.feature-item.active {
  opacity: 1;
  transform: translateY(0);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 22px;
}
.feature-content h3 {
  font-size: 24px;
  margin-bottom: 10px;
}
.feature-content p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 页脚 */
footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 24px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-slow);
}
footer.active {
  opacity: 1;
  transform: translateY(0);
}
.footer-left .footer-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.footer-left p {
  font-size: 14px;
}
.footer-right {
  text-align: right;
}
.footer-links {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--accent);
}

/* 响应式 */
@media (max-width:968px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  footer { flex-direction: column; gap:20px; text-align: center; }
  .footer-right { text-align: center; }
  .footer-links { justify-content: center; }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-slow);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
/* ===== Material Symbols 图标微调 ===== */
.feature-icon .material-symbols-outlined {
  font-size: 26px;                /* 匹配原有图标的视觉大小 */
  font-variation-settings: 
    'FILL' 0,                      /* 轮廓风格 */
    'wght' 300,                    /* 轻盈字重，更显精致 */
    'GRAD' 0,                      /* 默认渐变 */
    'opsz' 24;                     /* 标准光学尺寸 */
  display: block;
  line-height: 1;
  color: var(--accent);
  transition: var(--transition);
}

/* 悬停时微动效，增加交互感 */
.feature-item:hover .material-symbols-outlined {
  font-variation-settings: 
    'FILL' 1,                      /* 悬停时填充，更醒目 */
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  transform: scale(1.05);
}
/* ===== 个人中心全局增强 ===== */
.avatar-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  transition: border 0.2s;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Material Symbols 统一微调 */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 首页 Hero 隐私背书 */
.hero-privacy-line {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hero-privacy-line__icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

/* 工具页：本地安全状态条 + 呼吸灯 */
.tools-local-security-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.tools-local-security-bar__text {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #9ca3af;
}

.tools-local-status-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 9999px;
  background-color: #06b6d4;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.45);
  animation: tools-local-status-breathe 2.4s ease-in-out infinite;
}

@keyframes tools-local-status-breathe {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(1);
    box-shadow: 0 0 4px rgba(6, 182, 212, 0.32);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.55);
  }
}

.ai-badge__icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
/* 赛博卡片：Bento 风格 */
.bento-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.bento-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.12);
}

/* 霓虹发光按钮 */
.btn-neon {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 14px 28px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.btn-neon::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0; transition: 0.5s;
}

.btn-neon:hover::after { opacity: 1; transform: scale(1.2); }
/* 主密码设置弹窗 */
.master-password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.master-password-card {
  background: rgba(18, 22, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 32px;
  padding: 2.5rem;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}
.master-password-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #F5F5F5;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.master-password-card .lock-icon {
  color: #FFFFFF;
}
.master-password-card .hint {
  color: #7a94c8;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.master-password-card .warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 1rem;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.master-password-card .input-group {
  margin-bottom: 1.2rem;
}
.master-password-card .input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.master-password-card .input-field:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1);
}
.master-password-card .btn-confirm {
  width: 100%;
  background: #FFFFFF;
  border: none;
  border-radius: 40px;
  padding: 1rem;
  color: #000;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}
.master-password-card .btn-confirm:hover {
  background: #E5E5E5;
}

/* 1. 轨道独立暂停：只停下鼠标悬停的那一列 */
.testimonials-marquee-track:hover {
  animation-play-state: paused !important;
}

/* 2. 卡片专属聚光灯错觉：悬停的卡片微微放大、提亮边框，拉开视觉层级 */
.testimonial-card {
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.testimonial-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  z-index: 10;
  position: relative;
}

/* ========== tools.html：分栏控制台 ========== */
.tools-page {
  padding-top: 24px;
  padding-bottom: 80px;
}

.tools-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.tools-header {
  text-align: center;
  margin-bottom: 40px;
}

.tools-header h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.tools-header-desc {
  color: #d4d4d8;
  font-size: 16px;
  line-height: 1.65;
}

.tools-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .tools-workspace {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 3rem;
  }

  .tools-command {
    grid-column: span 4;
  }

  .tools-canvas-wrap {
    grid-column: span 8;
    position: sticky;
    top: 7rem;
    align-self: start;
  }
}

.tools-command .form-card,
.tools-canvas-wrap .result-card {
  margin-bottom: 0;
}

.tools-canvas-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: min(52vh, 28rem);
}

.tools-page .is-hidden {
  display: none !important;
}

.tools-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(52vh, 28rem);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 45%),
    var(--bg-medium);
}

.tools-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-muted);
  font-size: 1.35rem;
}

.tools-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.tools-empty-desc {
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #d4d4d8;
}

#resultArea.tools-result-card {
  display: none;
  flex-direction: column;
  position: relative;
  min-height: 280px;
  padding: 3rem 3rem 6rem;
}

#resultArea.tools-result-card.tools-result-visible {
  display: flex;
}

.tools-result-output {
  flex: 1 1 auto;
  min-height: 200px;
}

.tools-result-header {
  align-items: flex-start;
}

.tools-result-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
}

.tools-result-heading {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.tools-result-heading-brand {
  color: #22d3ee;
}

.tools-result-heading-sep {
  margin: 0 0.15em;
  color: rgba(255, 255, 255, 0.35);
}

.tools-result-heading-role {
  color: #e4e4e7;
}

.tools-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

#promptOutput.tools-result-output {
  color: #f4f4f5;
  font-size: 0.95rem;
  line-height: 2;
  letter-spacing: 0.01em;
  white-space: normal;
}

.tools-report-block {
  margin: 0;
}

.tools-report-block + .tools-report-block {
  margin-top: 2rem;
}

.tools-page #resultArea.tools-result-card .ai-badge {
  color: #a1a1aa;
}

.tools-floating-actions {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background: rgba(10, 10, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.tools-floating-btn {
  white-space: nowrap;
}

.form-card {
  background: var(--bg-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.tools-command .form-card {
  padding: 3rem;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 23, 0.75);
}

.form-group {
  margin-bottom: 24px;
}

.tools-page .form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.tools-field-label {
  display: flex !important;
  align-items: center;
  gap: 0.375rem !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.92) !important;
  margin-bottom: 0.5rem !important;
}

.tools-field-label .material-symbols-outlined {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.form-group textarea,
.form-group select,
.form-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 15px;
  transition: var(--transition);
}

.tools-page .form-group textarea,
.tools-page .form-group select,
.tools-page .form-group input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
}

.tools-page .form-group textarea::placeholder,
.tools-page .form-group input::placeholder {
  color: rgba(228, 228, 231, 0.72);
  opacity: 1;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group select {
  min-height: auto;
  height: 48px;
}

.tools-page .form-group select {
  color: rgba(255, 255, 255, 0.92);
}

.tools-page .form-group select option {
  background: #0a0a0d;
  color: #f4f4f5;
}

.form-group input {
  height: 48px;
}

.form-group textarea:focus,
.form-group select:focus,
.form-group input:focus {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1);
  outline: none;
}

.tools-page .form-group textarea:focus,
.tools-page .form-group select:focus,
.tools-page .form-group input:focus {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1);
  outline: none;
}

.tools-page .btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
  border: none;
}

.tools-page .btn-outline {
  background: transparent;
  color: #d4d4d8;
  border: 1px solid var(--border);
}

.tools-page .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tools-page .btn-primary {
  background: #fff;
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.tools-page .btn-primary:hover {
  background: #e5e5e5;
  transform: none;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.tools-page .btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tools-page .btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.tools-reset-btn {
  width: 100%;
  margin-top: 0.75rem;
}

.tools-action-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 1023px) {
  .tools-command .form-card {
    padding-bottom: 100px;
  }

  .tools-action-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.625rem;
    align-items: center;
    padding: 0.625rem;
    padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    background: rgba(10, 10, 13, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  }

  .tools-command .form-card button#generateBtn {
    position: static;
    width: 100%;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .tools-command .form-card button#resetWorkspaceBtn {
    width: 3rem;
    min-width: 3rem;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0;
    font-size: 0;
  }

  .tools-command .form-card button#resetWorkspaceBtn .material-symbols-outlined {
    font-size: 1.125rem;
  }
}

/* tools.html：保存模板 Modal */
.tools-save-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.tools-save-modal.is-open {
  display: block;
}

.tools-save-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tools-save-modal-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: calc(100% - 2rem);
  max-width: 28rem;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.tools-save-modal-input:focus {
  border-color: rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1) !important;
  outline: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 全局 Confirm / Prompt（utils.js）：修复白底白字 + 危险操作语义 */
.global-modal-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.global-modal-btn-cancel {
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.global-modal-btn-cancel:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.global-modal-btn-confirm-safe {
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.global-modal-btn-confirm-safe:hover {
  background: #e5e7eb;
  color: #111827;
}

.global-modal-btn-confirm-danger {
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.global-modal-btn-confirm-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.result-card {
  background: var(--bg-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.result-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.result-content {
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 15px;
  white-space: pre-wrap;
  min-height: 200px;
}

.ai-badge {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* —— 我的模板 · Gallery（与 Tailwind 类配合的局部增强）—— */
.templates-page-main {
  position: relative;
  z-index: 1;
}

.templates-page-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.templates-empty-icon-ring {
  position: absolute;
  inset: -28%;
  border-radius: 9999px;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(255, 255, 255, 0.12),
    transparent 62%
  );
  filter: blur(18px);
  pointer-events: none;
}

.templates-empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0d;
  background: linear-gradient(180deg, #fff 0%, #e4e4e7 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.templates-empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 16px 48px rgba(6, 182, 212, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

/* 法律页（隐私 / 条款 / 免责）—— 滚动、背景、排版与首页同步 */
html.page-legal-root {
  scroll-behavior: smooth;
}

.page-legal,
.page-legal .legal-shell,
.page-legal .legal-content {
  scroll-snap-type: none !important;
  scroll-behavior: smooth;
}

.page-legal {
  min-height: 100vh;
  position: relative;
  background: #030303;
  color: #fff;
}

.page-legal::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(900px circle at 50% -220px, rgba(255, 255, 255, 0.12), transparent 62%);
}

.page-legal .legal-top-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  height: 360px;
  border-radius: 9999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  filter: blur(48px);
  opacity: 0.78;
  z-index: 1;
}

.page-legal .legal-shell {
  position: relative;
  z-index: 10;
}

.page-legal .legal-content {
  position: relative;
  z-index: 10;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page-legal .legal-article {
  font-size: 0.98rem;
  line-height: 1.95;
}

.page-legal .legal-article h2 {
  letter-spacing: -0.01em;
}

.page-legal .legal-article p,
.page-legal .legal-article li {
  margin-bottom: 2rem;
}

.page-legal .legal-article ul li {
  margin-bottom: 0.7rem;
}

.page-legal .legal-article strong {
  color: #fff;
  font-weight: 600;
}

/* —— 随手记 notes.html · Command Bar + Feed + Batch —— */
.notes-capture-input {
  max-height: 40vh;
}

.notes-kbd {
  display: inline-block;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  color: #a1a1aa;
}

.notes-capture-submit {
  background: linear-gradient(180deg, #fafafa 0%, #e4e4e7 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 0 24px rgba(255, 255, 255, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.45);
}

.notes-capture-submit:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 0 32px rgba(255, 255, 255, 0.18),
    0 10px 32px rgba(0, 0, 0, 0.5);
}

.notes-feed-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
  padding: 1.25rem 1.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.notes-feed-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.notes-feed-card.is-mock {
  opacity: 0.85;
}

.notes-feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.notes-feed-card__time {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
}

.notes-feed-card__mock-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #52525b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}

.notes-feed-card__body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #e4e4e7;
  white-space: pre-wrap;
  word-break: break-word;
}

.notes-card-checkbox-wrap {
  padding-top: 0.15rem;
}

.notes-card-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.notes-card-checkbox:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.notes-card-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.notes-card-checkbox:checked {
  border-color: rgba(6, 182, 212, 0.38);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.1) inset;
}

.notes-feed-card__actions {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.notes-feed-card:hover .notes-feed-card__actions,
.notes-feed-card:focus-within .notes-feed-card__actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notes-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.notes-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fafafa;
}

.notes-icon-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.notes-batch-bar {
  pointer-events: none;
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.notes-batch-bar.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.notes-batch-send {
  background: linear-gradient(180deg, #fafafa 0%, #e4e4e7 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25) inset,
    0 0 28px rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

/* —— 历史记录 history.html · 时间轴 + 抽屉 —— */
.history-timeline-root {
  position: relative;
  z-index: 1;
}

.history-timeline-group-title {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.history-timeline-group-title:first-child {
  margin-top: 0;
}

.history-row-card {
  position: relative;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
  padding: 1.5rem;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.24s ease,
    transform 0.24s ease;
}

.history-row-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.history-row-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.history-row-card__title {
  flex: 1;
  min-width: 0;
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 600;
  color: #fafafa;
}

.history-row-card__meta {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.history-row-card__summary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #9ca3af;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

@media (max-width: 640px) {
  .history-card-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

.history-pagination .history-page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.history-pagination .history-page-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.15);
  color: #fafafa;
}

.history-pagination .history-page-btn.is-active {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.history-pagination .history-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.history-empty-card {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.history-clear-btn {
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(239, 68, 68, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.history-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.history-row-card.is-removing {
  opacity: 0;
  transform: scale(0.95);
}

.history-drawer {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.history-drawer.is-open {
  pointer-events: auto;
  opacity: 1;
}

.history-drawer-panel {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-drawer.is-open .history-drawer-panel {
  transform: translateX(0);
}

.history-drawer-backdrop {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.history-drawer.is-open .history-drawer-backdrop {
  opacity: 1;
}

#historyDrawerBody {
  white-space: pre-wrap;
  word-break: break-word;
}
