/* Logo 制作器（/tools/logo-maker）样式
   复用站点主题变量（--bg-primary / --accent / --text-* / --border-color），适配深 / 浅色。 */
:root {
  color-scheme: dark;
  --lm-card: var(--bg-primary, #fff);
  --lm-card-2: var(--bg-secondary, #16181c);
  --lm-line: var(--border-color, #2f3336);
  --lm-line-2: color-mix(in srgb, var(--text-primary, #e7e9ea) 16%, transparent);
  --lm-fg: var(--text-primary, #e7e9ea);
  --lm-fg-2: color-mix(in srgb, var(--text-secondary, #71767b) 92%, var(--text-primary, #e7e9ea));
  --lm-accent: var(--accent, #136ce9);
  --lm-ac-08: color-mix(in srgb, var(--lm-accent) 8%, transparent);
  --lm-ac-14: color-mix(in srgb, var(--lm-accent) 14%, transparent);
  --lm-ac-40: color-mix(in srgb, var(--lm-accent) 40%, transparent);
  --lm-ac-22: color-mix(in srgb, var(--lm-accent) 22%, transparent);
  --lm-ac-deep: color-mix(in srgb, var(--lm-accent) 88%, #000);
  --lm-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  --lm-radius: 16px;
}
[data-theme="light"] {
  color-scheme: light;
  --lm-line-2: rgba(15, 20, 25, .14);
  --lm-shadow: 0 6px 20px rgba(15, 23, 42, .08);
}
body.page-logo-maker-full .app { max-width: 100%; }
body.page-logo-maker-full .main-content { max-width: 100%; width: 100%; border-right: 0; }

.lm-page { max-width: 100%; margin: 0 auto; padding: 24px 20px 64px; box-sizing: border-box; -webkit-text-size-adjust: 100%; }
.lm-page *, .lm-page *::before, .lm-page *::after { box-sizing: border-box; }

/* ================= 头部 ================= */
.lm-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.lm-hero-ico {
  width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 24px; border-radius: 14px;
  background: linear-gradient(135deg, var(--lm-accent), var(--lm-ac-deep));
}
.lm-hero-t { flex: 1 1 300px; min-width: 0; }
.lm-hero-title { margin: 0 0 4px; font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--lm-fg); }
.lm-hero-sub { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--lm-fg-2); max-width: 60em; }
.lm-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.lm-tag {
  font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--lm-card-2); color: var(--lm-fg-2); border: 1px solid var(--lm-line-2);
}

/* ================= 模式切换 ================= */
.lm-modes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lm-mode-btn {
  appearance: none; cursor: pointer; font-family: inherit;
  height: 42px; padding: 0 18px; border-radius: 12px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  background: var(--lm-card); color: var(--lm-fg-2);
  border: 1px solid var(--lm-line-2);
  transition: color .15s, border-color .15s, background .15s;
}
.lm-mode-btn:hover { border-color: var(--lm-ac-40); color: var(--lm-accent); }
.lm-mode-btn.is-on { background: var(--lm-ac-14); border-color: var(--lm-ac-40); color: var(--lm-accent); }
.lm-mode-btn:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }

/* ================= 卡片 ================= */
.lm-card {
  background: var(--lm-card); border: 1px solid var(--lm-line-2);
  border-radius: var(--lm-radius); padding: 18px 20px 20px; margin-bottom: 16px;
}
.lm-card-title { margin: 0 0 14px; font-size: 14.5px; font-weight: 800; color: var(--lm-fg); }

/* ================= 模板 ================= */
.lm-tpls { display: flex; gap: 8px; flex-wrap: wrap; }
.lm-tpl {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  background: var(--lm-card-2); color: var(--lm-fg-2); border: 1px solid var(--lm-line-2);
  transition: color .15s, border-color .15s, background .15s;
}
.lm-tpl:hover { color: var(--lm-accent); border-color: var(--lm-ac-40); background: var(--lm-ac-08); }
.lm-tpl.is-on { background: var(--lm-ac-14); border-color: var(--lm-ac-40); color: var(--lm-accent); }
.lm-tpl:focus-visible { outline: 2px solid var(--lm-ac-40); outline-offset: 2px; }

/* ================= 预览 ================= */
.lm-preview-card { padding-bottom: 18px; }
.lm-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lm-size { font-size: 12px; color: var(--lm-fg-2); font-variant-numeric: tabular-nums; }
/* 棋盘格：便于判断哪些区域是透明的 */
.lm-stage {
  display: grid; place-items: center; min-height: 220px; padding: 22px;
  border-radius: 14px; border: 1px dashed var(--lm-line-2);
  background-color: var(--lm-card-2);
  background-image:
    linear-gradient(45deg, color-mix(in srgb, var(--lm-fg-2) 12%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--lm-fg-2) 12%, transparent) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--lm-fg-2) 12%, transparent) 75%),
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--lm-fg-2) 12%, transparent) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  overflow: auto;
}
.lm-preview { display: grid; place-items: center; max-width: 100%; }
.lm-preview svg { max-width: 100%; height: auto; display: block; }

/* ================= 导出按钮 ================= */
.lm-export { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.lm-export-spacer { flex: 1 1 auto; }
.lm-export-sep { font-size: 12.5px; color: var(--lm-fg-2); }
.lm-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; box-sizing: border-box; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  color: var(--lm-fg); background: var(--lm-card-2);
  border: 1px solid var(--lm-line-2); border-radius: 10px;
  transition: color .15s, border-color .15s, background .15s, transform .06s;
}
.lm-btn:hover { border-color: var(--lm-ac-40); color: var(--lm-accent); }
.lm-btn:active { transform: translateY(1px); }
.lm-btn:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }
.lm-btn--primary { background: var(--lm-accent); border-color: var(--lm-accent); color: #fff; }
.lm-btn--primary:hover { background: var(--lm-ac-deep); border-color: var(--lm-ac-deep); color: #fff; }

/* ================= 双列设置区 ================= */
.lm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lm-cols .lm-card { margin-bottom: 0; }

.lm-row { margin-bottom: 14px; }
.lm-row:last-child { margin-bottom: 0; }
.lm-row--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lm-row--checks { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.lm-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--lm-fg-2); margin-bottom: 6px; }
.lm-num { font-variant-numeric: tabular-nums; color: var(--lm-accent); font-weight: 700; }

.lm-input, .lm-select {
  width: 100%; height: 40px; padding: 0 12px; box-sizing: border-box;
  font-size: 14px; font-family: inherit; color: var(--lm-fg);
  background: var(--lm-card-2);
  border: 1px solid var(--lm-line-2); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.lm-input::placeholder { color: var(--lm-fg-2); opacity: .75; }
.lm-input:focus, .lm-select:focus {
  outline: none; border-color: var(--lm-accent); box-shadow: 0 0 0 3px var(--lm-ac-22);
}
.lm-select { cursor: pointer; }

.lm-color {
  width: 100%; height: 40px; padding: 3px; box-sizing: border-box; cursor: pointer;
  background: var(--lm-card-2);
  border: 1px solid var(--lm-line-2); border-radius: 10px;
}
.lm-color::-webkit-color-swatch-wrapper { padding: 0; }
.lm-color::-webkit-color-swatch { border: none; border-radius: 7px; }
.lm-color:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }

.lm-range {
  width: 100%; height: 22px; margin: 0; cursor: pointer; accent-color: var(--lm-accent);
  background: transparent;
}
.lm-range:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 4px; border-radius: 4px; }

.lm-check {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
  font-size: 13px; color: var(--lm-fg);
}
.lm-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--lm-accent); }

/* ================= 图标选择网格 ================= */
.lm-icongrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
.lm-icobtn {
  appearance: none; cursor: pointer; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--lm-line-2);
  background: var(--lm-card-2); color: var(--lm-fg-2);
  transition: color .15s, border-color .15s, background .15s, transform .08s;
}
.lm-icobtn:hover { color: var(--lm-accent); border-color: var(--lm-ac-40); background: var(--lm-ac-08); }
.lm-icobtn.is-on { color: #fff; background: var(--lm-accent); border-color: var(--lm-accent); }
.lm-icobtn:active { transform: scale(.94); }
.lm-icobtn:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }
.lm-icobtn svg { display: block; }

/* ================= 说明区 ================= */
.lm-about {
  margin-top: 20px; padding: 0; overflow: hidden;
  background: var(--lm-card); border: 1px solid var(--lm-line-2); border-radius: var(--lm-radius);
}
.lm-about > summary {
  cursor: pointer; list-style: none; padding: 13px 18px;
  font-size: 14px; font-weight: 700; color: var(--lm-fg);
  -webkit-tap-highlight-color: transparent;
}
.lm-about > summary::-webkit-details-marker { display: none; }
.lm-about > summary:hover { background: var(--lm-ac-08); }
.lm-about > summary:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: -3px; }
.lm-about[open] > summary { border-bottom: 1px solid var(--lm-line-2); }
.lm-about-body { padding: 16px 18px 18px; font-size: 12.5px; line-height: 1.75; color: var(--lm-fg-2); }
.lm-about-body p { margin: 0 0 10px; }
.lm-about-body h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--lm-fg); }
.lm-about-body ul { margin: 0 0 8px; padding-left: 18px; }
.lm-about-body li { margin: 3px 0; }
.lm-about-body strong { color: var(--lm-fg); }

/* ================= Toast ================= */
.lm-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  max-width: min(90vw, 460px); padding: 11px 18px; border-radius: 12px;
  background: #1f2430; color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  opacity: 0; pointer-events: none; z-index: 100000;
  transition: opacity .2s, transform .2s;
}
.lm-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); will-change: opacity, transform; }
.lm-toast.is-ok { background: #167a4a; }
.lm-toast.is-err { background: #c0392b; }
.lm-toast[hidden] { display: none !important; }

/* ================= 响应式 ================= */
/* 平板：设置区仍两列，预览与控件间距收紧 */
@media (max-width: 1000px) {
  .lm-page { padding: 20px 16px 56px; }
  .lm-cols { gap: 12px; }
  .lm-card { padding: 16px 16px 18px; }
}

/* 手机：设置区单列，触控目标抬高，输入框 16px 防 iOS 缩放 */
@media (max-width: 700px) {
  .lm-page { padding: 14px 12px calc(56px + env(safe-area-inset-bottom)); }
  .lm-hero { gap: 12px; }
  .lm-hero-ico { width: 42px; height: 42px; font-size: 20px; }
  .lm-hero-title { font-size: 20px; }
  .lm-hero-sub { font-size: 12.5px; }
  .lm-hero-tags { display: none; }

  .lm-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lm-mode-btn { height: 46px; padding: 0 8px; font-size: 13px; }
  .lm-tpl { min-height: 38px; padding: 10px 14px; }

  .lm-stage { min-height: 170px; padding: 16px; }
  .lm-export { gap: 8px; }
  .lm-btn { height: 44px; flex: 1 1 auto; }
  .lm-btn--primary { flex: 1 1 100%; }
  .lm-export-sep { flex: 1 1 100%; }
  .lm-export-spacer { display: none; }

  .lm-cols { grid-template-columns: 1fr; }
  .lm-input, .lm-select, .lm-color { font-size: 16px; }   /* 16px 防 iOS 聚焦缩放 */
  .lm-select { height: 44px; }
  .lm-color { height: 44px; }
  .lm-range { height: 30px; }
  .lm-icobtn { border-radius: 12px; }
}

/* 横屏手机：压缩纵向占用 */
@media (max-height: 560px) and (orientation: landscape) {
  .lm-stage { min-height: 140px; }
  .lm-hero { margin-bottom: 12px; }
}

/* 触屏 */
@media (hover: none) {
  .lm-btn:active, .lm-tpl:active, .lm-mode-btn:active { transform: scale(.98); }
  .lm-btn, .lm-tpl, .lm-mode-btn, .lm-icobtn { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
  .lm-page *, .lm-toast { transition: none !important; animation: none !important; }
}

@media print {
  .lm-modes, .lm-export, .lm-cols, .lm-about, .lm-toast, .lm-tpls { display: none !important; }
  .lm-page { max-width: none; padding: 0; }
  .lm-stage { border: none; background: none; }
  .lm-preview svg { max-width: 60mm; }
}
