/*
 * Pic64 页面样式
 * 结构顺序：设计变量 → 基础重置 → 页头/首屏 → 工具卡片 → 编辑弹窗
 *          → 图片信息与结果区 → 页脚/提示 → 响应式与无障碍适配。
 */

/* 设计令牌：统一管理颜色、纸张质感、边框和阴影，便于后续整体换肤。 */
:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #68736f;
  --paper: #f3f0e8;
  --card: #fffdf8;
  --line: #d8d5ca;
  --lime: #d7f34a;
  --lime-dark: #bcd923;
  --coral: #ff735d;
  --mint: #d8eee5;
  --shadow: 0 16px 45px rgba(28, 40, 36, 0.09);
}

/* 统一盒模型，元素声明的宽高会包含内边距和边框。 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* 页面使用两组低透明径向渐变，营造轻微的青柠/珊瑚色品牌氛围。 */
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(215, 243, 74, 0.19), transparent 21rem),
    radial-gradient(circle at 90% 20%, rgba(255, 115, 93, 0.12), transparent 22rem),
    var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

/* 主内容最大宽度限制；两侧保留自适应安全边距。 */
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- 页头与品牌 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid rgba(24, 33, 31, 0.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-icon {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 3px 9px rgba(24, 33, 31, 0.15);
}

/* 本地处理徽章使用绿色状态点强化隐私承诺。 */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: #50605a;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(24, 33, 31, 0.11);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  background: #7fb027;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(127, 176, 39, 0.16);
}

/* ---------- 首屏标题 ---------- */
.hero {
  padding: 64px 0 44px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: #77817d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.hero h1 em {
  position: relative;
  z-index: 0;
  font-style: italic;
}

/* 标题下方的青柠色手绘式高亮由伪元素生成，不影响文字选择。 */
.hero h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.08em;
  bottom: 0.05em;
  left: -0.08em;
  height: 0.28em;
  background: var(--lime);
  border-radius: 999px;
  transform: rotate(-2deg);
}

.hero-copy {
  margin: 21px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- 双栏转换工作区 ---------- */
.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

/* 工具卡片使用半透明暖白背景，让页面渐变能够轻微透出。 */
.tool-card {
  padding: 27px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(24, 33, 31, 0.13);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 23px;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: var(--lime);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.step-number.coral {
  color: white;
  background: var(--coral);
  transform: rotate(3deg);
}

.direction-label {
  padding-top: 9px;
  color: #9a9f9c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* ---------- 本地文件拖放区 ---------- */
.drop-zone {
  display: flex;
  width: 100%;
  min-height: 185px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: #f7f5ee;
  border: 1.5px dashed #b7bcb4;
  border-radius: 15px;
  cursor: pointer;
  transition: 180ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  background: #f3f8dd;
  border-color: #90a62d;
  outline: none;
  transform: translateY(-2px);
}

.drop-zone strong {
  font-size: 14px;
}

.drop-zone > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.upload-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin-bottom: 5px;
  place-items: center;
  background: var(--lime);
  border: 1px solid rgba(24, 33, 31, 0.13);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 24px;
  box-shadow: 3px 4px 0 rgba(24, 33, 31, 0.1);
}

/* ---------- 线上图片 URL 输入 ---------- */
.url-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0 12px;
  color: #8d9490;
  font-size: 10px;
  white-space: nowrap;
}

.url-divider::before,
.url-divider::after {
  content: "";
  width: 100%;
  height: 1px;
  background: var(--line);
}

.url-convert-form {
  display: flex;
  gap: 8px;
}

.url-input-wrap {
  position: relative;
  min-width: 0;
  flex: 1;
}

.url-input-wrap > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: #7b8581;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  transform: translateY(-50%);
  pointer-events: none;
}

.url-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 36px;
  color: #394440;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.url-input-wrap input:focus {
  border-color: #8b9b91;
  box-shadow: 0 0 0 3px rgba(91, 110, 101, 0.1);
}

.url-input-wrap input::placeholder {
  color: #a8ada9;
}

.button-dark {
  flex: 0 0 auto;
  color: white;
  background: var(--ink);
  box-shadow: 0 3px 0 #080d0c;
}

.url-hint,
.url-message {
  margin: 8px 2px 0;
  font-size: 10px;
  line-height: 1.5;
}

.url-hint {
  color: #8b928f;
}

.url-message {
  padding: 8px 10px;
  color: #386543;
  background: #edf8e9;
  border: 1px solid #c9e5c1;
  border-radius: 8px;
}

.url-message.is-error {
  color: #a33a2c;
  background: #fff0ed;
  border-color: #f3c6be;
}

.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;
}

/* ---------- 通用输入/输出字段 ---------- */
.field-block {
  margin-top: 19px;
}

.decode-input-block {
  margin-top: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label-row label {
  font-size: 12px;
  font-weight: 750;
}

.field-label-row span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  resize: vertical;
  color: #394440;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  transition: border 160ms ease, box-shadow 160ms ease;
}

textarea:focus {
  border-color: #8b9b91;
  box-shadow: 0 0 0 3px rgba(91, 110, 101, 0.1);
}

textarea::placeholder {
  color: #a8ada9;
}

/* ---------- 通用操作按钮 ---------- */
.action-row {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

.button,
.icon-button {
  min-height: 42px;
  border: 1px solid rgba(24, 33, 31, 0.2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  transition: 150ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
}

.button-primary {
  flex: 1;
  background: var(--lime);
  box-shadow: 0 3px 0 var(--lime-dark);
}

.button-secondary {
  background: transparent;
}

.button-coral {
  color: white;
  background: var(--coral);
  border-color: #e65945;
  box-shadow: 0 3px 0 #d95440;
}

.button-full {
  width: 100%;
  margin-top: 14px;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  box-shadow: none;
  transform: translateY(2px);
}

.button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(82, 105, 94, 0.24);
  outline-offset: 2px;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  background: transparent;
  font-size: 20px;
  font-weight: 400;
}

/* ---------- 图片预览与编辑弹窗 ---------- */
.preview-panel {
  margin-top: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* 弹窗打开时锁定页面滚动，避免背景随滚轮移动。 */
body.modal-open {
  overflow: hidden;
}

.editor-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  overflow: auto;
}

/* 全屏遮罩既弱化背景，也作为点击关闭弹窗的交互区域。 */
.editor-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(15, 23, 20, 0.66);
  border: 0;
  cursor: default;
  backdrop-filter: blur(5px);
}

.editor-panel {
  margin-top: 17px;
  padding: 15px;
  background: #f8f6ef;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.editor-dialog {
  position: relative;
  z-index: 1;
  width: min(700px, 100%);
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 21px;
  overflow: auto;
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 26px 80px rgba(8, 14, 12, 0.38);
  animation: editor-enter 180ms ease-out;
}

@keyframes editor-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.editor-heading,
.editor-heading > div,
.edit-footer,
.quality-control {
  display: flex;
  align-items: center;
}

.editor-heading {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 13px;
}

.editor-heading-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  color: #5c6662;
  background: #efede6;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: 150ms ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--ink);
  background: var(--lime);
  outline: none;
  transform: rotate(5deg);
}

.editor-heading > div {
  min-width: 0;
  gap: 9px;
}

.editor-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #47504d;
  background: var(--mint);
  border-radius: 8px;
  font-size: 14px;
}

.editor-heading h3 {
  margin: 0 0 2px;
  font-size: 13px;
}

.editor-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.text-button {
  padding: 4px 0;
  color: #68736f;
  background: none;
  border: 0;
  border-bottom: 1px solid #a9afab;
  cursor: pointer;
  font-size: 10px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--ink);
  outline: none;
  border-bottom-color: var(--ink);
}

/* 裁剪舞台沿用透明棋盘格；Canvas 自身禁止浏览器默认触摸滚动。 */
.crop-stage {
  display: grid;
  min-height: 190px;
  padding: 12px;
  place-items: center;
  overflow: auto;
  border: 1px solid #d3d0c6;
  border-radius: 10px;
}

#crop-canvas {
  display: block;
  max-width: 100%;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 7px 20px rgba(23, 32, 29, 0.13);
}

#crop-canvas:focus-visible {
  outline: 3px solid rgba(215, 243, 74, 0.72);
  outline-offset: 3px;
}

/* 编辑参数在桌面端三列显示，在窄屏断点下重新排布。 */
.editor-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.control-field {
  min-width: 0;
}

.control-field > span,
.quality-control > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.control-field select {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  color: #394440;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.control-field select:focus {
  border-color: #8b9b91;
  box-shadow: 0 0 0 3px rgba(91, 110, 101, 0.09);
}

.quality-control {
  display: grid;
  grid-template-columns: auto 1fr 37px;
  gap: 10px;
  margin-top: 13px;
}

.quality-control > span {
  margin: 0;
}

.quality-control input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--coral);
  cursor: pointer;
}

.quality-control output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.quality-control.is-disabled {
  opacity: 0.42;
}

.edit-footer {
  justify-content: space-between;
  gap: 13px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.edit-footer > span {
  max-width: 60%;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.edit-footer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.edit-footer .button {
  min-height: 38px;
}

/* ---------- 图片展示舞台与透明背景棋盘格 ---------- */
.image-stage {
  display: grid;
  min-height: 190px;
  max-height: 310px;
  padding: 18px;
  place-items: center;
  overflow: hidden;
}

.checkerboard {
  background-color: #f6f5f0;
  background-image:
    linear-gradient(45deg, #e9e7df 25%, transparent 25%),
    linear-gradient(-45deg, #e9e7df 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e7df 75%),
    linear-gradient(-45deg, transparent 75%, #e9e7df 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-stage img {
  display: block;
  max-width: 100%;
  max-height: 270px;
  object-fit: contain;
  filter: drop-shadow(0 8px 13px rgba(22, 31, 28, 0.12));
}

.encode-image-stage {
  position: relative;
}

/* 图片操作位于预览下方，避免悬浮按钮遮挡图片主体。 */
.preview-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: var(--muted);
  background: #f7f5ee;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.preview-image-actions > div {
  display: flex;
  gap: 7px;
}

.preview-action-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  color: #35413c;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(24, 33, 31, 0.18);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(19, 29, 25, 0.08);
  cursor: pointer;
  backdrop-filter: blur(7px);
  font-size: 10px;
  font-weight: 780;
  transition: 150ms ease;
}

.preview-action-primary {
  background: rgba(215, 243, 74, 0.94);
  border-color: rgba(119, 139, 24, 0.35);
}

.preview-action-button:hover:not(:disabled),
.preview-action-button:focus-visible:not(:disabled) {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(19, 29, 25, 0.14);
}

.preview-action-button:active:not(:disabled) {
  transform: translateY(0);
}

.preview-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ---------- 文件信息网格 ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
}

.info-grid div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-grid div:nth-child(2n) {
  border-right: 0;
}

.info-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.info-grid dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}

.info-grid dd {
  margin: 0;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 左侧状态行区分原图与编辑结果，并承载“恢复原图”操作。 */
.preview-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  color: var(--muted);
  background: #fffdf8;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.preview-state-row > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.preview-state-row i {
  width: 7px;
  height: 7px;
  background: #91a09a;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(117, 133, 126, 0.12);
}

.preview-state-row.is-edited i {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 115, 93, 0.15);
}

.restore-button {
  padding: 3px 0;
  color: #4e5d57;
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.restore-button:hover:not(:disabled),
.restore-button:focus-visible:not(:disabled) {
  color: #b34031;
  outline: none;
}

.restore-button:disabled {
  border-bottom-color: transparent;
  cursor: default;
  opacity: 0.38;
}

/* ---------- Base64 解码结果 ---------- */
.decode-result {
  margin-top: 17px;
}

.decode-info-grid {
  gap: 8px;
  padding: 12px;
  background: #f4f2eb;
}

.decode-result .decode-info-grid > div {
  padding: 12px 13px;
  background: #fffdf8;
  border: 1px solid #dedbd0;
  border-radius: 9px;
}

.decode-info-grid dt {
  margin-bottom: 5px;
}

.decode-info-grid dd {
  font-size: 11px;
}

.result-actions {
  margin: 0;
  padding: 13px;
  background: #fffdf8;
  border-top: 1px solid var(--line);
}

/* 右侧结果提示会在编辑后切换为珊瑚色警示状态。 */
.result-tip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 11px 13px;
  color: #4f5d28;
  background: #f4f8d7;
  border-top: 1px solid #dce5a8;
  font-size: 9px;
  line-height: 1.45;
}

.result-tip.is-edited {
  color: #803b31;
  background: #fff0ed;
  border-top-color: #f2c5bd;
}

.result-tip.is-edited .result-tip-icon {
  color: white;
  background: var(--coral);
}

.result-tip-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  color: #657420;
  background: var(--lime);
  border-radius: 50%;
}

.result-tip-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.result-tip strong {
  color: #36401a;
  font-size: 10px;
}

.result-tip small {
  color: #707a4a;
  font-size: 9px;
}

.result-tip.is-edited strong {
  color: #733329;
}

.result-tip.is-edited small {
  color: #95675f;
}

.result-restore-button {
  padding: 4px 0;
  color: #7c453d;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.result-restore-button:disabled {
  border-bottom-color: transparent;
  cursor: default;
  opacity: 0.35;
}

.result-actions {
  flex-wrap: wrap;
}

.inline-message {
  margin-top: 10px;
  padding: 10px 12px;
  color: #a33a2c;
  background: #fff0ed;
  border: 1px solid #f3c6be;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
}

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

/* ---------- 产品特点与页脚 ---------- */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 54px 0 40px;
  padding: 24px 0;
  border-top: 1px solid rgba(24, 33, 31, 0.15);
  border-bottom: 1px solid rgba(24, 33, 31, 0.15);
}

.feature-strip > div {
  display: grid;
  grid-template-columns: 33px auto;
  align-items: center;
  justify-content: center;
  column-gap: 10px;
}

.feature-strip > div + div {
  border-left: 1px solid rgba(24, 33, 31, 0.13);
}

.feature-strip span {
  grid-row: 1 / 3;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  background: var(--mint);
  border-radius: 50%;
}

.feature-strip div:nth-child(2) span {
  background: #fde1da;
}

.feature-strip div:nth-child(3) span {
  background: #eef5bd;
}

.feature-strip strong {
  font-size: 11px;
}

.feature-strip small {
  color: var(--muted);
  font-size: 9px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 0 0 30px;
  color: #89918e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* 全局 Toast 默认透明并下移；添加 is-visible 后淡入。 */
.toast {
  position: fixed;
  z-index: 10;
  right: 22px;
  bottom: 22px;
  padding: 11px 15px;
  color: white;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 9px 27px rgba(24, 33, 31, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

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

/* 平板及以下：双栏工作区改为单列。 */
@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }
}

/* 手机端：缩小留白，并让表单、编辑参数和操作按钮换行。 */
@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 68px;
  }

  .privacy-badge {
    padding: 7px 9px;
    font-size: 10px;
  }

  .hero {
    padding: 43px 0 34px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero-copy br {
    display: none;
  }

  .tool-card {
    padding: 18px;
    border-radius: 17px;
  }

  .editor-modal {
    padding: 10px;
  }

  .editor-dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .editor-heading p {
    display: none;
  }

  .action-row {
    flex-wrap: wrap;
  }

  .action-row .button {
    flex: 1 1 140px;
  }

  .url-convert-form {
    flex-direction: column;
  }

  .url-convert-form .button {
    width: 100%;
  }

  .editor-controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-field:last-child {
    grid-column: 1 / -1;
  }

  .edit-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .edit-footer > span {
    max-width: none;
  }

  .edit-footer-actions {
    width: 100%;
  }

  .edit-footer-actions .button {
    flex: 1;
    padding-inline: 10px;
  }

  .feature-strip {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .feature-strip > div {
    justify-content: start;
    padding-left: 25%;
  }

  .feature-strip > div + div {
    border-left: 0;
  }

  footer {
    gap: 10px;
    flex-direction: column;
    text-align: center;
  }
}

/* 尊重系统“减少动态效果”偏好，避免不必要的动画造成不适。 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
