:root {
    --bg: #0d1117;
    --panel: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
  }
  .wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
  }
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px 16px;
  }
  header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
  }
  .status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    flex-shrink: 0;
  }
  .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--red);
  }
  .dot.on { background: var(--green); }
  main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
  }
  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
  .qr-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  .qr-box {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .qr-box img { width: 100%; height: 100%; display: block; }
  .qr-side { flex: 1; min-width: 240px; }
  .qr-side .link {
    word-break: break-all;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
  }
  .hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
  textarea {
    width: 100%;
    flex: 1;
    min-height: 200px;
    resize: none;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
  }
  textarea:focus { border-color: var(--accent); }
  .count {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    padding-top: 8px;
  }
  .mobile {
    height: auto;
    min-height: 0;
    padding: 16px;
  }
  @media (min-width: 640px) {
    .mobile textarea { min-height: 60vh; }
  }