/* layout.css — editor + bottom bar + pairing screen */

/* Brand sizing tokens (LOCKED — locked by design decision 2026-07-25) */
:root {
  --logo-h-desktop: 75px;
  --logo-w-desktop: 195px;
  --logo-h-mobile: 42px;
  --logo-w-mobile: 110px;

  --name-h-desktop: 53px;  /* +10% over base 48 */
  --name-h-mobile: 30px;   /* +10% over base 27 */

  --brand-gap: 12px;
}

/* Mobile override for base vars (only those that change) */
@media (max-width: 767px) {
  :root {
    --logo-h-desktop: var(--logo-h-mobile);  /* desktop var reused for plain `.pairing-logo` */
    --logo-w-desktop: var(--logo-w-mobile);
    --name-h-desktop: var(--name-h-mobile);
  }
}

/* Editor */
#editor {
  flex: 1;
  width: 100%;
  resize: none;
  background: transparent;
  color: var(--fg);
  border: none;
  outline: none;
  padding: 24px 20px;
  font-size: 16px;
  line-height: 1.75;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  caret-color: var(--accent);
}

#editor::placeholder {
  color: #555;
}

[data-theme="light"] #editor::placeholder {
  color: #aaa;
}

/* Status indicator */
#status.status-warn {
  color: var(--status-warn) !important;
}

#status {
  position: fixed;
  top: 14px;
  right: 18px;
  font-size: 11px;
  color: #444;
  font-family: monospace;
  pointer-events: none;
  user-select: none;
  transition: color 0.3s ease;
  opacity: 0.5;
}

/* Bottom bar */
#bottom-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--bar-bg);
  color: var(--bar-fg);
  border-top: 1px solid var(--bar-border);
  font-size: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  user-select: none;
  min-height: 48px;
  position: relative;
  z-index: 60;
}

@media (max-width: 767px) {
  #bottom-bar {
    padding: 4px 12px;
    min-height: 0;
    gap: 2px;
  }
  .bar-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  #cut-btn, #copy-btn {
    padding: 0 8px;
    font-size: 11px;
  }
  .bar-link {
    padding: 4px 8px;
    font-size: 11px;
    display: none !important;  /* 移动端 GitHub/关于 不显示 */
  }
}

#bottom-bar .spacer {
  flex: 1;
  min-width: 4px;
}

/* ===== Pairing screen ===== */
#pairing-screen {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--pairing-bg);
  color: var(--pairing-fg);
  transition: none;
  z-index: 50;
  padding: 24px 24px 70px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#pairing-screen.show {
  display: flex;
}

#pairing-screen h2 {
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.5px;
}

/* Brand row — logo + product name, center-aligned */
.pairing-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--brand-gap);
  margin-bottom: 24px;
}

.pairing-logo {
  width: auto;
  height: var(--logo-h-desktop);
  max-width: var(--logo-w-desktop);
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.pairing-name {
  display: block;
  height: var(--name-h-desktop);
  width: auto;
}

#pairing-screen .hint {
  opacity: 0.5;
  font-size: 13px;
  margin-bottom: 24px;
}

#pairing-screen .room-id {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 12px 0;
}

#pairing-screen .status-text {
  font-size: 13px;
  margin-top: 20px;
  opacity: 0.6;
}

#qrcode {
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  display: inline-block;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#qrcode img,
#qrcode canvas {
  display: block;
  border-radius: 4px;
}

/* Editor mode */
.editor-mode #editor {
  display: block;
}

/* Mobile: 备案号永远不显示（手机端无意义） */
@media (max-width: 767px) {
  .bar-meta {
    display: none !important;
  }
}

/* 键盘升起: 备案号隐藏, 底部栏浮动 */
.keyboard-open .bar-meta {
  display: none !important;
}

.keyboard-open #bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  border-top: 1px solid var(--bar-border);
}
