@charset "utf-8";
/**
 * 子工具公共基础样式。
 * 引用：<link href="../common/css/ztools-base.css" />（按页面深度调整 ../ 层数）。
 *
 * 主题变量：:root 下 --zt-*（背景/表面/边框/文字/强调色/圆角/阴影等）。
 * 兼容别名：--bg-page、--accent 等（映射到 --zt-*）。
 *
 * 布局类：.ztools-format-outer（整页 flex 壳）、.ztools-page-header、
 * .ztools-page-header__title、.ztools-page-header__actions、.ztools-page-main、.ztools-input。
 * 合并原 tool_iframe_theme：滚动条、Vue v-cloak。
 */

[v-cloak] {
  display: none !important;
}

:root {
  --zt-bg: #eef1f6;
  --zt-surface: #ffffff;
  --zt-surface-muted: #f7f8fa;
  --zt-border: #e1e5eb;
  --zt-border-strong: #cfd6e0;
  --zt-text: #1c2433;
  --zt-text-muted: #5c6578;
  --zt-accent: #22c55e;
  --zt-accent-hover: #16a34a;
  --zt-accent-active: #15803d;
  --zt-focus-ring: rgba(34, 197, 94, 0.28);
  --zt-radius: 8px;
  --zt-radius-sm: 6px;
  --zt-shadow: 0 1px 3px rgba(28, 36, 51, 0.06);

  /* 原 tool_iframe_theme / 子工具 index.css 中 var(--bg-page) 等 */
  --bg-page: var(--zt-bg);
  --bg-main: var(--zt-surface);
  --bg-canvas: #f8fafc;
  --border: #e2e6ef;
  --text: var(--zt-text);
  --text-muted: var(--zt-text-muted);
  --accent: var(--zt-accent);
  --accent-dark: var(--zt-accent-hover);
  --accent-soft: rgba(34, 197, 94, 0.1);
  --accent-tint: rgba(34, 197, 94, 0.14);
  --accent-glow: rgba(34, 197, 94, 0.18);
  --header-bg: linear-gradient(180deg, #ffffff 0%, #f0f2f7 100%);
  --header-border: 1px solid #e2e6ef;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Segoe UI", "Microsoft YaHei", "微软雅黑", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "Microsoft YaHei", monospace;
}

* {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Monaco", "Consolas", monospace, sans-serif;
  box-sizing: border-box;
}

html {
  height: 100%;
  margin: 0;
}

/* 嵌入 iframe 时须用 100% 形成高度链；勿用 100vh（会按整窗视口） */
body,
body.ztools-format-page {
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--zt-bg);
  color: var(--zt-text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* 表单项、可复制区域仍需可选中文本 */
input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #b8c0cc;
}

::-webkit-scrollbar-thumb:hover {
  background: #9aa3b0;
}

::-webkit-scrollbar-track {
  background: #e8ebf0;
}

.ztools-format-outer {
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.ztools-page-header {
  background: linear-gradient(180deg, #ffffff 0%, #f0f2f7 100%);
  color: var(--zt-text);
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e6ef;
  flex-shrink: 0;
}

.ztools-page-header__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0 20px;
  color: var(--zt-text);
}

.ztools-page-header__actions {
  margin-right: 20px;
}

.zbtn,
button.zbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #4ade80 0%, var(--zt-accent) 100%);
  padding: 8px 18px;
  color: #fff;
  border-radius: var(--zt-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  box-shadow: var(--zt-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, filter 0.15s ease;
}

.zbtn:hover {
  background: linear-gradient(180deg, #86efac 0%, var(--zt-accent-hover) 100%);
  filter: brightness(1.02);
}

.zbtn:active {
  background: var(--zt-accent-active);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(1px);
}

/**
 * 顶栏与工具主体之间的可滚动主区域（替代 json_format 等专用布局）；
 */
.ztools-page-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  width: 100%;
  position: relative;
  padding: 16px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.ztools-input {
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--zt-text);
  background: var(--zt-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ztools-input:focus {
  border-color: var(--zt-accent);
  box-shadow: 0 0 0 3px var(--zt-focus-ring);
}
