/* ===== Card Component ===== */
.card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: none; /* Remove translateY for cleaner hover */
}

/* ===== Button Component ===== */
.btn {
  display: inline-block;
  background-color: #2563EB; /* Primary Blue - solid color */
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), box-shadow var(--transition);
  text-align: center;
  text-decoration: none;
  font-family: var(--font-family);
}

.btn:hover {
  background-color: #1E40AF; /* Secondary Deep Blue on hover */
  box-shadow: var(--shadow-md);
  transform: none; /* Remove translateY */
}

.btn:active {
  transform: none;
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-hover-bg);
  border-color: var(--color-hover-border);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ===== Input Component ===== */
.input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.input:hover {
  border-color: var(--color-hover-border);
  background-color: var(--color-hover-bg);
}

.input:focus {
  outline: none;
  border-color: var(--color-hover-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--color-white);
}

.input:disabled {
  background-color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.input::placeholder {
  color: var(--color-gray-medium);
}

/* Textarea */
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  resize: vertical;
}

textarea:hover {
  border-color: var(--color-hover-border);
  background-color: var(--color-hover-bg);
}

textarea:focus {
  outline: none;
  border-color: var(--color-hover-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--color-white);
}

textarea:disabled {
  background-color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.6;
}

textarea::placeholder {
  color: var(--color-gray-medium);
}

/* Select */
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  cursor: pointer;
}

select:hover {
  border-color: var(--color-hover-border);
  background-color: var(--color-hover-bg);
}

select:focus {
  outline: none;
  border-color: var(--color-hover-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--color-white);
}

select:disabled {
  background-color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== Grid Layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
}

@media (max-width: 768px) {
  .grid-2,
  .tools-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* ===== Tool Card (for homepage) ===== */
.tool-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.tool-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.tool-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.tool-card p {
  flex-grow: 1;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-body);
  font-size: 14px;
  line-height: 1.6;
}

.tool-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ===== Blog Card ===== */
.blog-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: none; /* Remove translateY */
}

.blog-card h3 {
  font-size: var(--font-size-h3);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.blog-card p {
  flex-grow: 1;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.blog-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ===== Calculator Section ===== */
.calculator-section {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-xl);
  transition: box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
}

.calculator-section:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--color-hover-border);
  background-color: var(--color-hover-bg);
}

.calculator-section h2 {
  margin-bottom: var(--spacing-lg);
}

.input-group {
  margin-bottom: var(--spacing-lg);
}

.input-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--color-text);
}

.input-group .input {
  margin-bottom: 0;
}

.input-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.help-tooltip {
  display: inline-block;
  margin-left: 0.25rem;
  cursor: help;
  color: #6b7280;
  font-size: 0.875rem;
  vertical-align: middle;
  position: relative;
}

.help-tooltip:hover {
  color: #2563eb;
}

.help-tooltip[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: #1f2937;
  color: #fff;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.help-tooltip[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  margin-bottom: -5px;
  z-index: 1000;
}

.quick-examples {
  margin-bottom: 1.5rem;
}

.professional-disclaimer {
  margin-bottom: 1.5rem;
}

.result-section {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-xl);
  transition: box-shadow var(--transition);
}

.result-section h2 {
  margin-bottom: var(--spacing-lg);
}

#result {
  font-size: var(--font-size-base);
  line-height: 1.8;
}

.button-group {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
}

.button-group .btn {
  flex: 1;
  min-width: 120px;
}

/* ===== Info Sections ===== */
.info-section {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-xl);
}

.info-section h2 {
  margin-bottom: var(--spacing-lg);
}

/* ===== Related Sections ===== */
.related-section {
  margin-bottom: var(--spacing-xl);
}

.related-section h2 {
  margin-bottom: var(--spacing-lg);
}

.related-tools {
  margin-bottom: var(--spacing-xl);
}

.related-tools h2 {
  margin-bottom: var(--spacing-lg);
}

/* ===== Article Styles ===== */
.article-content {
  max-width: 100%;
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--spacing-xl);
  padding-top: calc(var(--spacing-xl) + 120px); /* Top padding to prevent header overlap (header ~114px + 6px buffer) */
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 120px; /* Prevent overlap with sticky header on anchor links */
}

/* Disable card hover effects for article content to prevent overlap with header */
.article-content.card {
  transition: none !important; /* Disable all transitions to prevent transform */
}

.article-content.card:hover {
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
  border-color: var(--color-border) !important;
  background-color: var(--color-white) !important;
}

/* Ensure article header and content stay below header */
.article-content,
.article-header,
.article-header h1 {
  position: relative;
  z-index: 1; /* Lower than header's z-index: 100 */
}

.breadcrumb {
  margin-bottom: var(--spacing-lg);
  font-size: 14px;
  color: var(--color-gray-medium);
}

.breadcrumb a {
  color: var(--color-link);
}

.article-header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: 0; /* Remove padding-bottom to merge with content */
  border-bottom: none; /* Remove border to merge with content */
  scroll-margin-top: 120px; /* Prevent overlap with sticky header on anchor links */
  margin-top: 0; /* Reset any default margin */
}

.article-header h1 {
  margin-top: 0; /* Ensure h1 starts at the top of article-header */
  padding-top: 0; /* No extra padding on h1 */
}

.article-meta {
  color: var(--color-gray-medium);
  font-size: 14px;
  margin-top: var(--spacing-sm);
}

.article-body {
  line-height: 1.8;
}

.article-intro {
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: var(--spacing-xl);
  font-weight: 500;
}

.article-body h2 {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.article-body h3 {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.article-body li {
  margin-bottom: var(--spacing-sm);
}

.formula {
  background-color: var(--color-gray-light);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  margin: var(--spacing-md) 0;
  font-family: 'Courier New', monospace;
}

/* ===== Toast Notification ===== */
#toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-text);
  color: var(--color-white);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  display: none;
  max-width: 300px;
  min-width: 200px;
  word-wrap: break-word;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 768px) {
  #toast {
    bottom: 30px;
    left: 50%;
    right: auto;
    max-width: calc(100% - 40px);
    min-width: auto;
  }
}

#toast.show {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ===== Back to Top Button ===== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: var(--color-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition);
  z-index: 99;
  display: none;
}

#back-to-top:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
  transform: translateY(-2px);
}

#back-to-top.show {
  display: block;
}

/* ===== AI Drawer ===== */
#ai-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

#ai-drawer-overlay.show {
  display: block;
}

#ai-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: var(--color-white);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right var(--transition);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

#ai-drawer.open {
  right: 0;
}

#ai-drawer-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#ai-drawer-header h2 {
  margin: 0;
  font-size: var(--font-size-h3);
}

#ai-drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

#ai-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.ai-message {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  line-height: 1.6;
  word-wrap: break-word;
  max-width: 85%;
  position: relative;
}

/* 用户消息样式 - 右侧，蓝色背景 */
.ai-message.ai-user {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: var(--color-white);
  margin-left: auto;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border-top-right-radius: var(--radius-sm);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

/* AI回复消息样式 - 左侧，灰色背景 */
.ai-message:not(.ai-user) {
  background-color: var(--color-gray-light);
  color: var(--color-text);
  margin-right: auto;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-top-right-radius: var(--radius-sm);
  border-top-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

/* 思考中状态 */
.ai-message.ai-thinking {
  color: var(--color-gray-medium);
  font-style: italic;
  opacity: 0.7;
}

#ai-chat-input-container {
  display: flex;
  gap: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--spacing-lg);
}

#ai-query {
  flex: 1;
  min-height: 80px;
  resize: vertical;
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

#ai-query:hover {
  border-color: var(--color-hover-border);
  background-color: var(--color-hover-bg);
}

#ai-query:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--color-white);
}

#ai-query:disabled {
  background-color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.6;
}

#ai-query::placeholder {
  color: var(--color-gray-medium);
}

#ai-query-btn {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-family);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

#ai-query-btn:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#ai-query-btn:active {
  transform: translateY(0);
}

/* ===== Tool Description & FAQ Components ===== */
.tool-description,
.tool-faq {
  margin-top: 40px;
  padding: 24px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #eee;
}

.tool-description h2,
.tool-faq h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--color-text-primary);
  font-size: 24px;
  font-weight: 600;
}

.tool-description h2:not(:first-child) {
  margin-top: 32px;
}

.tool-description p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.tool-description ol,
.tool-description ul {
  margin: 16px 0;
  padding-left: 24px;
}

.tool-description li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.tool-description ol li {
  margin-bottom: 16px;
}

.tool-faq details {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-faq details:hover {
  border-color: #2563EB;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.tool-faq details[open] {
  border-color: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.tool-faq summary {
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  position: relative;
  padding-right: 24px;
}

.tool-faq summary::-webkit-details-marker {
  display: none;
}

.tool-faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 300;
  color: #2563EB;
  transition: transform 0.2s ease;
}

.tool-faq details[open] summary::after {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}

.tool-faq details p {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ===== AI Inline Component Styles ===== */
.ai-inline-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ai-inline-header {
  margin-bottom: 1rem;
}

.ai-inline-header h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ai-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ai-quick-btn {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-quick-btn:hover {
  background: #e5e7eb;
  border-color: #2563eb;
  color: #2563eb;
}

.ai-input-section {
  margin-bottom: 1rem;
}

.ai-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.ai-input-wrapper textarea {
  flex: 1;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.ai-input-wrapper textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ai-submit-btn {
  padding: 0.75rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.ai-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-cancel-btn {
  padding: 0.75rem 1.5rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-cancel-btn:hover {
  background: #dc2626;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.ai-answer-container {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: none;
}

.ai-answer-container.has-answer {
  display: block;
}

.ai-answer-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
}

.ai-answer-content {
  color: #374151;
  line-height: 1.6;
  font-size: 0.875rem;
}

.ai-answer-content p {
  margin: 0.5rem 0;
}

.ai-answer-content p:first-child {
  margin-top: 0;
}

.ai-answer-content p:last-child {
  margin-bottom: 0;
}

.ai-loading {
  color: #6b7280;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .card,
  .calculator-section,
  .result-section,
  .info-section {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
  }
  
  .tool-card,
  .blog-card {
    padding: var(--spacing-md);
  }
  
  .button-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .button-group .btn {
    width: 100%;
  }
  
  .input-group {
    margin-bottom: var(--spacing-md);
  }
  
  .ai-drawer {
    width: 100%;
    right: -100%;
  }
  
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .hero-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  /* Adjust article padding for mobile (header is taller on mobile) */
  .article-content {
    padding-top: calc(var(--spacing-md) + 170px); /* Mobile header ~164px + small buffer */
    scroll-margin-top: 170px;
  }
  
  .article-header {
    scroll-margin-top: 170px;
  }
  
  .tool-description,
  .tool-faq {
    margin-top: 24px;
    padding: 16px;
    border-radius: 8px;
  }
  
  .tool-description h2,
  .tool-faq h2 {
    font-size: 20px;
  }
  
  .tool-description h2:not(:first-child) {
    margin-top: 24px;
  }
  
  .tool-faq details {
    padding: 12px;
  }
}
