/* ====================================================================
   全局设计系统 - 1:1 还原 frontend - 副本/app.wxss
   主题：精炼工具台（深炭灰）
   设计理念：简洁大气、专业务实、留白克制
   ==================================================================== */

/* ===== 设计令牌（还原 app.wxss 的 page 变量） ===== */
:root {
  /* 主题色 */
  --color-primary: #1a1b1d;
  --color-primary-deep: #0d0e0f;
  --color-primary-light: #f4f4f5;
  --color-primary-soft: rgba(26, 27, 29, 0.05);

  /* 背景色 */
  --color-bg: #f7f7f8;
  --color-card: #ffffff;
  --color-mask: rgba(0, 0, 0, 0.5);

  /* 文字色 */
  --text-1: #1a1a1a;
  --text-2: #3d3d3d;
  --text-3: #8a8a8e;
  --text-4: #b8b8bc;
  --text-inverse: #ffffff;
  /* 兼容旧样式别名 */
  --color-text: var(--text-1);
  --color-text-secondary: var(--text-2);
  --color-text-muted: var(--text-3);

  /* 边框与分割 */
  --border-color: #e8e8ea;
  --divider: #f0f0f2;
  --color-border: var(--border-color);

  /* 功能色 */
  --color-danger: #d64545;
  --color-warning: #d68a45;
  --color-info: #4560d6;
  --color-success: #2da44e;

  /* 圆角（rpx -> px：1rpx≈0.5px，375px设计稿） */
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 500px;
  --radius: var(--radius-lg);

  /* 阴影 */
  --shadow-card: 0 1px 6px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 3px 12px rgba(0, 0, 0, 0.08);
  --shadow-float: 0 0.5px 3px rgba(0, 0, 0, 0.03);
  --shadow-sm: var(--shadow-card);
  --shadow-md: var(--shadow-hover);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.10);

  /* 间距 */
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 15px;
  --space-lg: 20px;
  --space-xl: 28px;

  /* 字号 */
  --font-display: 22px;
  --font-title: 17px;
  --font-subtitle: 14px;
  --font-body: 14px;
  --font-caption: 12px;
  --font-mini: 11px;

  --transition: 0.15s ease;
}

/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img { display: block; max-width: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--text-1);
  font-size: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ====================================================================
   顶部导航（简化版，保留 logo + 标题）
   ==================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-card);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.3px;
}

/* ====================================================================
   顶部菜单导航（6 个模块，sticky 定位，响应式横向滚动）
   ==================================================================== */
.menu-nav {
  position: sticky;
  top: 52px;
  z-index: 99;
  background: var(--color-card);
  border-bottom: 1px solid var(--border-color);
}

.menu-nav-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge */
}
.menu-nav-inner::-webkit-scrollbar {
  display: none;                    /* Chrome/Safari */
}

.menu-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: var(--font-mini);
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.menu-item svg {
  transition: transform var(--transition);
}

.menu-item:hover {
  color: var(--text-2);
  background: var(--color-primary-soft);
}

.menu-item.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 700;
}

.menu-item.active svg {
  transform: scale(1.05);
}

/* 页面视图通用容器 */
.page-view {
  min-height: 60vh;
}

/* 分类页头部（文档工具/图片工具） */
.page-header {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}
.page-header h1 {
  font-size: var(--font-title);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.page-header p {
  font-size: var(--font-caption);
  color: var(--text-3);
}

/* 空状态提示 */
.empty-tip {
  max-width: 760px;
  margin: 40px auto;
  padding: var(--space-md);
  text-align: center;
  color: var(--text-3);
  font-size: var(--font-caption);
}

/* ====================================================================
   占位页面（更多工具/教程/优惠券）
   ==================================================================== */
.placeholder-block {
  max-width: 760px;
  margin: 60px auto 0;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.placeholder-icon {
  margin: 0 auto var(--space-lg);
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-soft);
  border-radius: 50%;
}

.placeholder-block h2 {
  font-size: var(--font-title);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--space-sm);
}

.placeholder-text {
  font-size: var(--font-body);
  color: var(--text-2);
  margin-bottom: var(--space-sm);
}

.placeholder-hint {
  font-size: var(--font-caption);
  color: var(--text-3);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
}

/* ====================================================================
   首页 - 公告条（跑马灯滚动，红色字体）
   ==================================================================== */
.notice-bar {
  max-width: 760px;
  margin: 10px auto 0;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-bar-inner {
  flex: 1;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  background: var(--color-primary-light);
  border-radius: 6px;
  border: 1px solid var(--divider);
  overflow: hidden;
}

.notice-icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-right: 6px;
  line-height: 1;
}

.notice-content {
  flex: 1;
  overflow: hidden;
  height: 34px;
  line-height: 34px;
}

/* 跑马灯无缝滚动 */
.notice-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 12px;
  color: #E64340;
  font-weight: 500;
  animation: notice-scroll 22s linear infinite;
}

@keyframes notice-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ====================================================================
   首页 - 分区标签
   ==================================================================== */
.section-label {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px var(--space-md) 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 2px;
  margin-right: 6px;
}

/* ====================================================================
   首页 - 工具网格（2列 / 4列）
   ==================================================================== */
.tools-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tools-grid {
  display: grid;
  gap: 10px;
}

/* 2列布局 */
.tools-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  justify-items: stretch;
}

/* 4列布局 */
.tools-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  justify-items: stretch;
}

/* 通用工具卡片 */
.tool-card {
  background-color: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.tool-card:active {
  transform: scale(0.97);
}

/* 小卡片（4列布局） */
.tool-card-sm {
  padding: 12px 6px 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 86px;
}

.tool-card-sm .tool-icon-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 5px;
}

.tool-card-sm .tool-icon {
  width: 40px;
  height: 40px;
}

.tool-card-sm .tool-name {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 0;
  text-align: center;
  width: 100%;
  color: var(--text-2);
  line-height: 1.3;
}

/* 第一行重点工具卡片 */
.tool-card-primary {
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 14px 10px;
  min-height: 100px;
}

.tool-card-primary .tool-icon-wrap {
  width: 50px;
  height: 50px;
  margin-bottom: 7px;
}

.tool-card-primary .tool-icon {
  width: 44px;
  height: 44px;
}

.tool-card-primary .tool-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
  width: 100%;
  color: var(--text-1);
}

.tool-desc-primary {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  width: 100%;
}

/* 第八行横向布局卡片 */
.tool-card-row {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 12px;
  min-height: 50px;
  gap: 7px;
}

.tool-card-row .tool-icon-wrap {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.tool-card-row .tool-icon {
  width: 32px;
  height: 32px;
}

.tool-card-row .tool-name {
  font-size: 14px;
  white-space: nowrap;
  text-align: center;
  color: var(--text-1);
  font-weight: 500;
}

/* 工具图标通用容器 */
.tool-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.tool-icon {
  object-fit: contain;
}

.tool-name {
  font-weight: 600;
  color: var(--text-1);
  position: relative;
  z-index: 1;
}

/* 卡片标签 */
.tool-card-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  z-index: 2;
}

.tag-new {
  background: #fef3c7;
  color: #92400e;
}

.tag-ocr {
  background: #dbeafe;
  color: #1e40af;
}

/* ====================================================================
   关于区域
   ==================================================================== */
.about-section {
  background: var(--color-card);
  border-top: 1px solid var(--border-color);
  padding: 24px var(--space-md);
}

.about-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.about-inner h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-1);
}

.about-inner p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 18px;
}

.about-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.about-feature {
  text-align: center;
}

.feature-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.feature-label {
  font-size: 12px;
  color: var(--text-3);
}

/* ====================================================================
   底部
   ==================================================================== */
.footer {
  background: #1a1b1d;
  color: #b8b8bc;
  padding: 20px var(--space-md);
  text-align: center;
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
}

.footer-inner p {
  font-size: 12px;
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 11px;
  color: #8a8a8e;
}

.footer-copyright {
  font-size: 11px;
  color: #8a8a8e;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-icp {
  color: #8a8a8e;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-icp:hover {
  color: #b8b8bc;
  text-decoration: underline;
}

/* ====================================================================
   工具子页面 - 标题区
   ==================================================================== */
.tool-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px var(--space-md) 14px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
  transition: var(--transition);
  padding: 4px 0;
}

.back-btn:hover {
  color: var(--color-primary);
}

.tool-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-header-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
}

.tool-header-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}

.tool-header-info p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ====================================================================
   工具子页面 - 主体（卡片容器）
   ==================================================================== */
.tool-body {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) 40px;
}

/* 内容卡片（小程序 .tool-content.card） */
.tool-card-block {
  width: 100%;
  background-color: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

/* 信息文本 */
.info-text {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.6;
}

/* 醒目大小限制提示（小程序 .size-limit-tip） */
.size-limit-tip {
  color: #c2680a;
  font-size: 12px;
  text-align: center;
  padding: 5px 0;
  margin: 6px 0 12px;
  background: #fdf6ec;
  border-radius: 6px;
  font-weight: 500;
}

/* ====================================================================
   上传区
   ==================================================================== */
.upload-section {
  margin-bottom: 12px;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-card);
}

.upload-area:hover, .upload-area.drag-active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.upload-area svg {
  margin: 0 auto 8px;
}

.upload-area p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-1);
  font-weight: 500;
}

.upload-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

/* ====================================================================
   已选文件信息
   ==================================================================== */
.file-info {
  background: var(--color-primary-light);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 12px var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 12px;
}

.file-info-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.file-info-label {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}

.file-info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  word-break: break-all;
}

.file-remove-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.file-remove-btn:hover {
  background: var(--color-danger);
  color: #fff;
}

/* ====================================================================
   参数设置区
   ==================================================================== */
.params-section {
  margin-bottom: 12px;
}

.param-item {
  margin-bottom: 12px;
}

.param-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.param-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: var(--text-1);
  transition: border-color 0.2s ease;
}

.param-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 27, 29, 0.04);
}

.param-textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.param-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

/* ====================================================================
   转换按钮（小程序 .btn-primary）
   ==================================================================== */
.convert-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease;
}

.convert-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.convert-btn:active:not(:disabled) {
  opacity: 0.75;
}

.convert-btn:disabled {
  background: #c8c8cc;
  color: var(--text-inverse);
  cursor: not-allowed;
}

/* ====================================================================
   结果区（1:1 还原小程序 .result-container）
   ==================================================================== */
.result-area {
  margin-top: var(--space-md);
}

.result-container {
  padding: var(--space-md);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border-top: 1px solid var(--divider);
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--space-sm);
}

.result-info {
  margin-bottom: var(--space-sm);
}

.result-info-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background-color: #FAFBFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.item-label {
  width: 80px;
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}

.item-value {
  font-size: 14px;
  color: var(--text-1);
  font-weight: 500;
  flex: 1;
  text-align: right;
  word-break: break-all;
}

.result-actions {
  margin-top: var(--space-sm);
  display: flex;
  justify-content: flex-end;
}

/* 下载按钮（小程序 .btn-download 样式） */
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  height: 32px;
  line-height: 32px;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.btn-download:hover {
  opacity: 0.85;
}

.no-download-hint {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* 跳转历史提示（小程序 .goto-history-hint） */
.goto-history-hint {
  text-align: center;
  padding: 12px 0 4px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ====================================================================
   错误提示
   ==================================================================== */
.error-area {
  margin-top: 12px;
}

.error-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8e8;
  border: 1px solid #faecd0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.error-card span {
  font-size: 13px;
  color: var(--color-danger);
  line-height: 1.5;
}

/* ====================================================================
   加载遮罩
   ==================================================================== */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
}

.loading-content p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* ====================================================================
   使用提示（小程序 .tips.card 样式）
   ==================================================================== */
.usage-tips {
  margin-top: var(--space-sm);
}

.tips-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
}

.tips-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

/* 标题前竖条 */
.tips-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--color-primary);
  border-radius: 2px;
  margin-right: 6px;
}

.tips-list {
  padding-left: 4px;
}

.tips-item {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.9;
  padding-left: 4px;
}

/* ====================================================================
   文本比较结果
   ==================================================================== */
.diff-result {
  margin-top: 8px;
}

.diff-line {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-same {
  background: var(--color-primary-light);
  color: var(--text-3);
}

.diff-add {
  background: #ecfdf5;
  color: #065f46;
}

.diff-remove {
  background: #fef2f2;
  color: #991b1b;
}

/* ====================================================================
   响应式
   ==================================================================== */

/* 平板适配 */
@media (max-width: 1024px) {
  .tools-grid-4 {
    gap: 8px;
  }
}

/* 手机适配（贴近小程序原生视觉） */
@media (max-width: 768px) {
  .header-inner { padding: 0 12px; height: 48px; }
  .logo-text { font-size: 15px; }

  /* 菜单导航：sticky 跟随 header */
  .menu-nav { top: 48px; }
  .menu-nav-inner { height: 44px; padding: 0 8px; gap: 2px; }
  .menu-item { padding: 5px 10px; font-size: 10px; }
  .menu-item svg { width: 18px; height: 18px; }

  /* 分类页头部 */
  .page-header { padding: 16px 12px 8px; }
  .page-header h1 { font-size: 16px; }
  .page-header p { font-size: 11px; }

  /* 占位页面 */
  .placeholder-block { margin-top: 40px; padding: 24px 12px; }
  .placeholder-icon { width: 80px; height: 80px; }
  .placeholder-block h2 { font-size: 16px; }
  .placeholder-text { font-size: 13px; }
  .placeholder-hint { font-size: 11px; }

  /* 公告栏 */
  .notice-bar { padding: 0 12px; margin-top: 8px; }
  .notice-bar-inner { height: 32px; }
  .notice-content { height: 32px; line-height: 32px; }
  .notice-text { font-size: 11px; }

  /* 分区标签 */
  .section-label { padding: 12px 12px 4px; font-size: 12px; }

  /* 工具网格 - 4列保留，与小程序一致 */
  .tools-container { padding: 0 12px 24px; gap: 8px; }
  .tools-grid-2 { gap: 8px; }
  .tools-grid-4 { gap: 6px; }

  /* 重点工具卡 */
  .tool-card-primary { padding: 12px 8px; min-height: 88px; }
  .tool-card-primary .tool-icon-wrap { width: 44px; height: 44px; margin-bottom: 6px; }
  .tool-card-primary .tool-icon { width: 40px; height: 40px; }
  .tool-card-primary .tool-name { font-size: 13px; }
  .tool-desc-primary { font-size: 10px; }

  /* 小卡片 */
  .tool-card-sm { padding: 10px 4px 8px; min-height: 76px; }
  .tool-card-sm .tool-icon-wrap { width: 40px; height: 40px; margin-bottom: 4px; }
  .tool-card-sm .tool-icon { width: 36px; height: 36px; }
  .tool-card-sm .tool-name { font-size: 11px; }

  /* 横向卡片 */
  .tool-card-row { padding: 12px 8px; min-height: 44px; gap: 6px; }
  .tool-card-row .tool-icon-wrap { width: 36px; height: 36px; }
  .tool-card-row .tool-icon { width: 28px; height: 28px; }
  .tool-card-row .tool-name { font-size: 13px; }

  /* 子页面 */
  .tool-header { padding: 10px 12px 12px; }
  .tool-header-icon { width: 36px; height: 36px; }
  .tool-header-info h3 { font-size: 16px; }
  .tool-header-info p { font-size: 11px; }
  .tool-body { padding: 12px 12px 32px; }
  .tool-card-block { padding: 12px; }

  /* 上传区 */
  .upload-area { padding: 24px 12px; }
  .upload-area p { font-size: 13px; }
  .upload-hint { font-size: 11px; }

  /* 文件信息 */
  .file-info { padding: 10px 12px; }
  .file-info-value { font-size: 12px; }

  /* 参数 */
  .param-input { height: 38px; font-size: 13px; }

  /* 转换按钮 */
  .convert-btn { padding: 11px; font-size: 14px; }

  /* 结果区 */
  .result-info-row { padding: 8px 10px; }
  .item-label { width: 70px; font-size: 11px; }
  .item-value { font-size: 13px; }
  .btn-download { padding: 0 16px; height: 30px; line-height: 30px; font-size: 12px; }

  /* 错误提示 */
  .error-card { padding: 10px 12px; }
  .error-card span { font-size: 12px; }

  /* 使用提示 */
  .tips-card { padding: 12px; }
  .tips-item { font-size: 11px; line-height: 1.8; }

  /* 关于 */
  .about-section { padding: 20px 12px; }
  .about-inner h2 { font-size: 16px; }
  .about-inner p { font-size: 12px; }
  .about-features { gap: 18px; }
  .feature-num { font-size: 20px; }

  /* 底部 */
  .footer { padding: 16px 12px; }
  .footer-inner p { font-size: 11px; }
}

/* 超窄屏（4列变2列） */
@media (max-width: 380px) {
  .tools-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-card-sm .tool-icon-wrap { width: 44px; height: 44px; }
  .tool-card-sm .tool-icon { width: 40px; height: 40px; }
  .header-inner { padding: 0 8px; }
  .logo-text { font-size: 14px; }
  .menu-item { padding: 4px 8px; font-size: 9px; }
  .menu-item svg { width: 16px; height: 16px; }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .tool-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .tool-icon,
  .tool-header-icon {
    image-rendering: -webkit-optimize-contrast;
  }
}
