:root { color-scheme: light dark; }

/* 基础与居中布局修复 */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  margin: 0;                 /* 确保真正居中，不被 margin 影响 */
  padding: 16px;             /* 适度留白，避免贴边 */
  line-height: 1.5;
  font-size: 14px;
  background: #ffffff;
  color: #0f172a;
}

.card {
  width: 100%;
  max-width: 680px;          /* 控制卡片最大宽度 */
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  body { background: #0b0f14; color: #e5eef7; }
  .card { background: #0f1621; border-color: #213042; }
  .item { background: #0c121b; }
}

/* 标题 */
h1 { font-size: 22px; margin: 0 0 6px; }
.sub { color: #64748b; margin-bottom: 10px; font-size: 12px; }
.center { text-align: center; }

/* 输入框 + 按钮（更稳的宽度写法，避免某些浏览器不支持 min()） */
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 10px 0 14px;
  flex-wrap: wrap;                 /* 小屏换行更友好 */
  width: 100%;
}

.controls input {
  flex: 1 1 260px;                 /* 先给一个基础宽度 */
  max-width: 420px;                /* 最大不超过 420px */
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: inherit;
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.controls input::placeholder {
  color: #94a3b8;
}

.controls input:focus,
.controls input:focus-visible {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,.15);
  background: #fff;
}

.btn-primary {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  color: #fff;
  transition: transform .05s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 16px rgba(14,165,233,.25);
  appearance: none;
  -webkit-appearance: none;
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 20px rgba(14,165,233,.3);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: .7;
  cursor: not-allowed;
  filter: saturate(.7);
}

@media (prefers-color-scheme: dark) {
  .controls input { background: #0f1621; border-color: #213042; color: #e5eef7; }
  .controls input::placeholder { color: #7a8aa0; }
}

/* 两列紧凑布局 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 0;
}

.item {
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

.key { color: #475569; font-size: 11px; margin-bottom: 4px; }
.val { font-weight: 600; word-break: break-all; font-size: 13px; }
