/* ==========================================================================
   PassGen base.css — 共享基础层
   各套皮肤只需覆写下面这组 CSS 变量，即可获得一致的通用组件外观。
   ========================================================================== */

:root {
  --pg-text: #0f172a;
  --pg-muted: #64748b;
  --pg-surface: #ffffff;
  --pg-surface-2: #f1f5f9;
  --pg-border: #e2e8f0;
  --pg-accent: #4f46e5;
  --pg-accent-contrast: #ffffff;
  --pg-radius: 12px;
  --pg-mono: 'SFMono-Regular', 'JetBrains Mono', 'Cascadia Mono', Consolas,
             'Liberation Mono', Menlo, monospace;
  --pg-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
             'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--pg-sans);
  color: var(--pg-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--pg-mono); }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

.pg-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.is-hidden, [hidden] { display: none !important; }

.pg-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   滑块：用 --pg-fill（由 controller.js 写入）绘制已填充部分
   -------------------------------------------------------------------------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--pg-accent) 0%,
    var(--pg-accent) var(--pg-fill, 50%),
    var(--pg-border) var(--pg-fill, 50%),
    var(--pg-border) 100%
  );
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--pg-accent);
  border: 3px solid var(--pg-surface);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  transition: transform .12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--pg-accent);
  border: 3px solid var(--pg-surface);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 4px;
}
input[type="range"]::-moz-range-track { background: transparent; }

/* --------------------------------------------------------------------------
   通用组件（由 controller.js 动态生成的 DOM）
   -------------------------------------------------------------------------- */
.pg-mini-btn {
  flex: none;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--pg-border);
  background: var(--pg-surface-2);
  color: var(--pg-muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pg-mini-btn:hover {
  background: var(--pg-accent);
  border-color: var(--pg-accent);
  color: var(--pg-accent-contrast);
}

.pg-history-item,
.pg-bulk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.pg-history-item:hover,
.pg-bulk-item:hover {
  background: var(--pg-surface-2);
  border-color: var(--pg-border);
}

.pg-history-time,
.pg-bulk-index {
  flex: none;
  font-family: var(--pg-mono);
  font-size: 11px;
  color: var(--pg-muted);
  opacity: .8;
}

.pg-history-value,
.pg-bulk-value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--pg-mono);
  font-size: 13px;
  word-break: break-all;
}

.pg-tpl-chip {
  display: inline-flex;
  align-items: stretch;
  margin: 0 6px 6px 0;
  border: 1px solid var(--pg-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--pg-surface-2);
}
.pg-tpl-use {
  padding: 4px 12px;
  font-size: 12px;
  border: 0;
  background: transparent;
}
.pg-tpl-use:hover { background: var(--pg-accent); color: var(--pg-accent-contrast); }
.pg-tpl-del {
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1;
  border: 0;
  border-left: 1px solid var(--pg-border);
  background: transparent;
  color: var(--pg-muted);
}
.pg-tpl-del:hover { background: #ef4444; color: #fff; }

.pg-empty {
  margin: 0;
  font-size: 12px;
  color: var(--pg-muted);
}

/* 生成时的闪烁反馈 */
@keyframes pg-flash {
  0%   { opacity: .25; transform: translateY(-2px); }
  100% { opacity: 1;   transform: translateY(0); }
}
.is-flash { animation: pg-flash .28s ease-out; }

/* 重新生成时的滚动动画：controller.js 在翻滚期间给输出加上此 class */
.is-scrambling { opacity: .9; }

/* 语言切换按钮（i18n.js 接管，各皮肤可覆写） */
[data-i18n-toggle] {
  font: inherit; background: transparent; border: 0; cursor: pointer;
  color: var(--pg-muted); font-size: 12.5px; padding: 6px 10px; border-radius: 8px;
}
[data-i18n-toggle]:hover { color: var(--pg-text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
