* { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --primary: #4a90e2;
    --primary-soft: #e8f1fc;
    --text: #2c3e50;
    --text-sub: #7b8a99;
    --text-muted: #aab6c2;
    --border: #eef1f5;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 16px;
    --red: #e74c3c;
    --green: #27ae60;
  }
  html, body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
  }
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .app {
    width: 100%;
    max-width: 1440px;
  }
  .card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .header {
    padding: 22px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .header h1 {
    font-size: 22px;
    font-weight: 600;
  }
  .header a {
    font-size: 13px;
    color: var(--text-sub);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg);
    transition: all .2s;
  }
  .header a:hover { background: var(--primary-soft); color: var(--primary); }

  /* Tabs */
  .tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px 0;
    border-bottom: 1px solid var(--border);
  }
  .tab {
    padding: 10px 18px;
    font-size: 14px;
    color: var(--text-sub);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .2s;
    white-space: nowrap;
  }
  .tab:hover { color: var(--primary); }
  .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
  }

  /* Panel */
  .panel { padding: 22px 24px 26px; display: none; }
  .panel.active { display: block; }

  .field-label {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .field-label .hint { font-size: 12px; color: var(--text-muted); }

  textarea, input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    outline: none;
    transition: border-color .2s, background .2s;
    resize: vertical;
  }
  textarea:focus, input[type="text"]:focus {
    border-color: var(--primary);
    background: #fff;
  }
  textarea { min-height: 80px; }

  .btn-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
  }
  .btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
  }
  .btn-primary {
    background: var(--primary);
    color: #fff;
  }
  .btn-primary:hover { opacity: .88; }
  .btn-ghost {
    background: var(--bg);
    color: var(--text-sub);
  }
  .btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }

  /* Output */
  .output-wrap {
    margin-top: 20px;
    position: relative;
  }
  .output {
    background: linear-gradient(135deg, var(--primary) 0%, #6aa9e9 100%);
    border-radius: 12px;
    padding: 18px 20px;
    color: #fff;
    min-height: 64px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-all;
    letter-spacing: 1px;
  }
  .output.empty {
    font-size: 14px;
    font-weight: 400;
    opacity: .7;
  }
  .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    background: rgba(255,255,255,.22);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .2s;
  }
  .copy-btn:hover { background: rgba(255,255,255,.36); }
  .copy-btn.copied { background: var(--green); }

  .toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
    z-index: 100;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .quick-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .quick {
    padding: 5px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all .2s;
    border: 1px solid transparent;
  }
  .quick:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft);
  }

  .swap-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.6;
  }