/* ============================================================
   在线工具 · 公共样式
   配色：Splatoon 3 限定机（实拍取色）
   白色主机背板 + 荧光黄墨迹 + 左柄蓝紫渐变 + 右柄黄绿渐变
   ============================================================ */
:root {
  /* 白色主机背板基调 */
  --bg: #f4f6fb;
  --bg-2: #e8ecf6;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --line: #d9dfee;
  --ink: #1b2440;          /* 深墨蓝文字（白底上清晰） */
  --muted: #5b6585;

  /* 手柄渐变（实拍取色） */
  --blue: #4050e0;         /* 左柄 蓝 */
  --violet: #a060d0;       /* 左柄 紫 */
  --grad-left: linear-gradient(135deg, #4050e0, #a060d0);
  --yellow: #d0f030;       /* 荧光黄 / 墨迹 */
  --green: #209030;        /* 右柄 绿 */

  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* 顶部手柄色带：左蓝紫 → 右黄绿（对应两只手柄） */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 10px;
  z-index: 10;
  background: linear-gradient(90deg, var(--blue) 0%, var(--violet) 28%, var(--violet) 42%, var(--yellow) 42%, var(--green) 100%);
  box-shadow: 0 2px 12px rgba(64, 80, 224, .25);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  /* 柔焦气泡壁纸（纯 CSS）：蓝黄双色气泡 + 浅色主机背板 */
  background-color: #f4f6fb;
  background-image:
    linear-gradient(160deg, #f4f6fb, #e8ecf6);
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  isolation: isolate;
  line-height: 1.6;
  padding: 0 20px 56px;
}

/* ---------- 顶部区域 ---------- */
.page-head { max-width: none; margin: 0 auto; padding: 44px 4px 26px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }

.brand-mark {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--grad-left);
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900;
  box-shadow: 0 6px 16px rgba(64, 80, 224, .3);
  transform: rotate(-4deg);
}

.brand h1 { font-size: 23px; font-weight: 800; margin: 0; letter-spacing: -.4px; color: var(--ink); }
.brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 工具导航 ---------- */
.tool-nav { max-width: none; margin: 0 auto 24px; display: flex; flex-wrap: wrap; gap: 9px; }

.tool-nav a {
  display: inline-block;
  padding: 8px 17px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: all .18s ease;
}
.tool-nav a:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 5px 14px rgba(64, 80, 224, .16); }
.tool-nav a.active {
  color: #fff;
  background: var(--grad-left);
  border-color: transparent;
  box-shadow: 0 5px 16px rgba(64, 80, 224, .3);
}

/* ---------- 主卡片（白色面板，像主机背板） ---------- */
.card {
  position: relative;
  max-width: none;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(28, 38, 78, .1), 0 0 0 1px rgba(64, 80, 224, .04);
  padding: 30px;
  overflow: hidden;
}
/* 顶部手柄双色条 */
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--yellow) 50% 100%);
}

.card-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; color: var(--ink); }
.card-desc { font-size: 13px; color: var(--muted); margin: 0 0 24px; }

code {
  font-family: var(--mono); font-size: .92em;
  background: rgba(64, 80, 224, .09);
  color: var(--blue);
  padding: 2px 6px; border-radius: 6px;
}

/* ---------- 双栏输入输出 ---------- */
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.field label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.field label .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(64, 80, 224, .14);
  flex: none;
}
.field:has(.dot.out) label { color: #5f7a12; }
.field label .dot.out { background: var(--yellow); box-shadow: 0 0 0 3px rgba(208, 240, 48, .28); }

textarea {
  width: 100%; min-height: 240px; resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea::placeholder { color: #9aa4c0; }
textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(64, 80, 224, .16); }

/* 输出框：荧光黄绿阵营 */
textarea[readonly] { background: #fbfde9; border-color: #cfe46a; }
textarea[readonly]::placeholder { color: #9bab4a; }
textarea[readonly]:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(32, 144, 48, .14); }

/* ---------- 操作按钮 ---------- */
.actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 22px; padding-top: 22px;
  border-top: 1px dashed var(--line);
}

button, .baseButton, input[type="button"], input[type="submit"] {
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 800;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

/* 主操作：左柄蓝紫渐变 */
.primary, input[type="button"].primary, input[type="submit"].primary, button.primary, input.blueButton {
  color: #fff;
  background: var(--grad-left);
  box-shadow: 0 4px 14px rgba(64, 80, 224, .3);
}
/* 次操作：清爽描边风（白底 + 荧光黄绿描边 + 深墨字） */
.ghost, input[type="button"].ghost, input[type="submit"].ghost, button.ghost, input.whiteBtn {
  color: #3f5210;
  background: #fbfde9;
  border-color: #a9cf2f;
  box-shadow: 0 2px 8px rgba(32, 144, 48, .10);
}
button:hover, .baseButton:hover, input[type="button"]:hover, input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(28, 38, 78, .18);
}
button:active, .baseButton:active, input[type="button"]:active, input[type="submit"]:active { transform: translateY(0); }

.ghost:hover, input[type="button"].ghost:hover, input[type="submit"].ghost:hover, button.ghost:hover, input.whiteBtn:hover {
  color: #2f3f0a;
  background: #f2f9d4;
  border-color: #7fa81a;
  box-shadow: 0 5px 14px rgba(32, 144, 48, .18);
}

.narrow { max-width: none; }

/* ---------- 提示条 ---------- */
.tip {
  max-width: none; margin: 18px auto 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: #f0f3fd;
  border: 1px solid #d6def6;
  border-left: 4px solid var(--blue);
  color: var(--muted); font-size: 13px;
}
.tip b { color: #5f7a12; font-weight: 700; }
.tip-narrow { max-width: none; }

.key-meta { font-size: 12px; color: var(--muted); font-weight: 400; }
.key-meta b { color: var(--green); }

/* ---------- 下拉框 ---------- */
select {
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--ink);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(64, 80, 224, .16); }

.field .hint { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: auto; }
.form-note { font-size: 12px; color: var(--muted); margin: 0 0 20px; }

@media (max-width: 720px) {
  body { padding: 0 14px 40px; }
  .page-head { padding: 28px 2px 20px; }
  .card { padding: 20px; }
  .io-grid { grid-template-columns: 1fr; gap: 16px; }
  textarea { min-height: 180px; }
  .actions { gap: 8px; }
  button, .baseButton, input[type="button"], input[type="submit"] { padding: 10px 16px; }
}
