/* =========================================================
   码上生成 · 二维码批量生成工具
   ========================================================= */
:root {
  --ink: #161a2e;
  --ink-2: #4b5169;
  --muted: #8a90a6;
  --line: #e8eaf3;
  --bg: #f4f5fb;
  --primary: #6366f1;
  --primary-deep: #4f46e5;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --shadow-sm: 0 8px 22px rgba(28, 33, 80, 0.06);
  --shadow-md: 0 14px 40px rgba(28, 33, 80, 0.09);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
}

button,
select,
input,
textarea {
  font-size: 16px;
}

svg {
  display: block;
}

/* =========================================================
   登录页
   ========================================================= */
.login-view {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px
    calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 620px at 12% 6%, rgba(99, 102, 241, 0.32), transparent 62%),
    radial-gradient(820px 600px at 92% 92%, rgba(168, 85, 247, 0.26), transparent 60%),
    linear-gradient(160deg, #080b1c 0%, #121735 52%, #1b1440 100%);
}

.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 78%);
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.glow-a {
  width: 420px;
  height: 420px;
  left: -140px;
  top: -120px;
  background: rgba(79, 70, 229, 0.55);
}

.glow-b {
  width: 380px;
  height: 380px;
  right: -120px;
  bottom: -130px;
  background: rgba(168, 85, 247, 0.4);
}

.finder-deco {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 15px solid rgba(255, 255, 255, 0.05);
  border-radius: 26px;
  pointer-events: none;
}

.finder-deco::before {
  content: "";
  position: absolute;
  inset: 32px;
  border: 13px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.finder-deco::after {
  content: "";
  position: absolute;
  inset: 66px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.finder-a {
  top: -70px;
  right: -60px;
  transform: rotate(14deg);
}

.finder-b {
  bottom: -80px;
  left: -70px;
  transform: rotate(-12deg);
}

.login-shell {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-card {
  width: 100%;
  padding: 34px 30px 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  animation: rise 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.35);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.brand-text small {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 1.7px;
  color: var(--muted);
}

.brand-light .brand-text strong {
  color: #fff;
}

.brand-light .brand-text small {
  color: rgba(255, 255, 255, 0.42);
}

.login-card > .brand {
  margin-bottom: 28px;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: #fff;
}

.login-sub {
  margin: 9px 0 26px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* 表单 */
.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.62);
}

.field-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field-box:focus-within {
  border-color: rgba(139, 140, 255, 0.9);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.field-icon {
  width: 18px;
  height: 18px;
  margin-left: 14px;
  flex: none;
  color: rgba(255, 255, 255, 0.42);
}

.field-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: none;
  outline: none;
  background: none;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.field-box input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field-box input:-webkit-autofill,
.field-box input:-webkit-autofill:hover,
.field-box input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #232a52 inset;
  transition: background-color 9999s ease-out;
}

.eye-btn {
  flex: none;
  width: 46px;
  height: 46px;
  margin-right: 2px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  border-radius: 12px;
}

.eye-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.eye-btn svg {
  width: 19px;
  height: 19px;
}

.eye-btn .eye-off {
  display: none;
}

.eye-btn.is-visible .eye-open {
  display: none;
}

.eye-btn.is-visible .eye-off {
  display: block;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  user-select: none;
}

.remember input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.remember-box {
  width: 17px;
  height: 17px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  transition: 0.18s ease;
}

.remember-box svg {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: 0.18s ease;
}

.remember input:checked + .remember-box {
  background: var(--grad);
  border-color: transparent;
}

.remember input:checked + .remember-box svg {
  opacity: 1;
  transform: none;
}

.login-tip {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.3);
}

.login-error {
  min-height: 19px;
  margin: 9px 0 2px;
  font-size: 12.5px;
  color: #fda4af;
  line-height: 1.5;
}

.btn-login {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  background: var(--grad);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(99, 102, 241, 0.46);
}

.btn-login:hover svg {
  transform: translateX(3px);
}

.btn-login:active {
  transform: translateY(0) scale(0.995);
}

.login-card.shake {
  animation: shake 0.42s ease;
}

.login-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 24px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.36);
}

.login-features i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.login-foot {
  margin: 18px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
}

/* =========================================================
   主应用
   ========================================================= */
.app-view {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(1000px 460px at 50% -200px, #e3e7ff 0%, rgba(244, 245, 251, 0) 72%),
    var(--bg);
  animation: fadeIn 0.35s ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(22, 26, 46, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.topbar-inner {
  max-width: 1080px;
  height: 62px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.topbar .brand-mark svg {
  width: 20px;
  height: 20px;
}

.topbar .brand-text strong {
  font-size: 15px;
}

.topbar .brand-text small {
  font-size: 8px;
  letter-spacing: 1.4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  background: #f3f4fb;
  border: 1px solid #ebedf7;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  text-transform: uppercase;
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s;
}

.icon-btn:hover {
  color: #e11d48;
  background: #fff1f4;
  border-color: #ffe0e7;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 30px;
  margin-bottom: 18px;
  border-radius: 24px;
  border: 1px solid #e3e6f7;
  background:
    linear-gradient(120deg, #eef0ff 0%, #f7f4ff 52%, #eef8ff 100%);
}

.hero-text {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.hero h1 {
  margin: 11px 0 7px;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.7px;
}

.hero p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.hero-deco {
  position: relative;
  z-index: 0;
  flex: none;
  width: 168px;
  height: 168px;
  margin: -26px -18px -30px 0;
  color: #6366f1;
  opacity: 0.28;
}

/* 输入面板 */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.input-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 600;
}

.panel-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary-deep);
  background: #eef0ff;
}

.panel-icon svg {
  width: 16px;
  height: 16px;
}

.count-pill {
  padding: 4px 10px;
  border-radius: 99px;
  background: #f4f5fb;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.url-input {
  display: block;
  width: 100%;
  min-height: 172px;
  padding: 14px 16px;
  border: 1.5px solid #e4e7f2;
  border-radius: 16px;
  outline: none;
  resize: vertical;
  background: #fafbff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, var(--font);
  font-size: 14px;
  line-height: 1.75;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.url-input::placeholder {
  color: #aeb3c6;
  font-family: var(--font);
}

.url-input:focus {
  border-color: #9c9ef5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  padding: 0 12px;
  border: 1px solid #eceef8;
  border-radius: 10px;
  background: #f7f8fd;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.16s;
}

.chip-btn svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.chip-btn:hover {
  background: #eef0ff;
  border-color: #dfe2fb;
  color: var(--primary-deep);
}

.chip-btn:hover svg {
  color: var(--primary-deep);
}

.chip-btn:active {
  transform: scale(0.97);
}

.tool-spacer {
  flex: 1;
}

.url-count {
  font-size: 12px;
  color: var(--muted);
  padding-left: 2px;
}

.url-count b {
  color: var(--primary-deep);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #eceef6;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch .track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  border-radius: 99px;
  background: #dfe2ee;
  transition: background 0.2s;
}

.switch .track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s cubic-bezier(0.3, 0.9, 0.4, 1.2);
}

.switch input:checked + .track {
  background: var(--grad);
}

.switch input:checked + .track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .track {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.size-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.size-select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid #e4e7f2;
  border-radius: 10px;
  outline: none;
  background-color: #fafbff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 13px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}

.size-select:focus {
  border-color: #9c9ef5;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-generate {
  width: 100%;
  height: 52px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
  cursor: pointer;
  background: var(--grad);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.32);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.btn-generate svg {
  width: 20px;
  height: 20px;
}

.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.4);
}

.btn-generate:active {
  transform: translateY(0) scale(0.995);
}

.btn-generate .badge {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 空状态 */
.empty-state {
  margin-top: 18px;
  padding: 34px 22px 30px;
  text-align: center;
  border: 1px dashed #dde1f1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.empty-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  color: #6d6df0;
  background: linear-gradient(135deg, #eef0ff, #f6f0ff);
  box-shadow: inset 0 1px 0 #fff;
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 7px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid #eceef7;
  font-size: 11.5px;
  color: var(--ink-2);
}

.step b {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef0ff;
  color: var(--primary-deep);
  font-size: 10.5px;
  font-weight: 700;
}

.step-line {
  width: 14px;
  height: 1px;
  background: #dfe3f2;
}

/* 结果 */
.results {
  margin-top: 26px;
  animation: fadeUp 0.4s ease both;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.results-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.results-head p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.btn-zip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid #e0e3fb;
  border-radius: 12px;
  background: #eef0ff;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.btn-zip svg {
  width: 16px;
  height: 16px;
}

.btn-zip:hover {
  background: #e4e7ff;
  border-color: #cfd3fa;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.14);
}

.btn-zip:active {
  transform: scale(0.98);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(28, 33, 80, 0.05);
  animation: cardIn 0.42s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  transition: box-shadow 0.2s, transform 0.2s;
}

.qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(28, 33, 80, 0.1);
}

.qr-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 2px;
}

.qr-badge {
  flex: none;
  padding: 3px 6px;
  border-radius: 7px;
  background: #eef0ff;
  color: var(--primary-deep);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qr-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.qr-thumb {
  display: block;
  width: 100%;
  padding: 7px;
  border: 1px solid #f0f1f7;
  border-radius: 13px;
  background: #fff;
  cursor: zoom-in;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.qr-thumb:hover {
  border-color: #d9dcf0;
  box-shadow: 0 5px 16px rgba(99, 102, 241, 0.12);
}

.qr-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.qr-url {
  margin: 0;
  padding: 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a3a8bb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.5;
}

.qr-card-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  flex: 1;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #eef0f8;
  border-radius: 9px;
  background: #f8f9fd;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.16s;
}

.mini-btn svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.mini-btn:hover {
  background: #eef0ff;
  border-color: #dcdefc;
  color: var(--primary-deep);
}

.mini-btn:hover svg {
  color: var(--primary-deep);
}

.mini-btn:active {
  transform: scale(0.97);
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 34px;
  color: #a6abbd;
  font-size: 11px;
  text-align: center;
}

.app-foot svg {
  width: 13px;
  height: 13px;
}

/* =========================================================
   弹窗 / 提示
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 30, 0.62);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.22s ease both;
}

.modal-card {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 24px 22px 20px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
  animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #f3f4fa;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s;
}

.modal-close:hover {
  background: #e8eaf5;
  color: var(--ink);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-qr {
  width: 100%;
  max-width: 286px;
  margin: 6px auto 14px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid #eef0f7;
  background: #fff;
  box-shadow: 0 10px 26px rgba(28, 33, 80, 0.07);
}

.modal-qr canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.modal-index {
  display: block;
  width: fit-content;
  margin: 0 auto 7px;
  padding: 3px 9px;
  border-radius: 99px;
  background: #eef0ff;
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
}

.modal-url {
  margin: 0;
  padding: 0 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
  text-align: center;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.btn-modal {
  flex: 1;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.btn-modal svg {
  width: 16px;
  height: 16px;
}

.btn-modal.primary {
  border: none;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.3);
}

.btn-modal.primary:hover {
  box-shadow: 0 13px 28px rgba(99, 102, 241, 0.38);
}

.btn-modal.ghost {
  border: 1px solid #e6e8f4;
  background: #f8f9fd;
  color: var(--ink-2);
}

.btn-modal.ghost:hover {
  background: #eef0ff;
  border-color: #dcdefc;
  color: var(--primary-deep);
}

.btn-modal:active {
  transform: scale(0.98);
}

.modal-hint {
  margin: 12px 0 0;
  color: #b0b5c7;
  font-size: 11px;
  text-align: center;
}

.progress-mask {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 30, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.progress-box {
  width: min(310px, 100%);
  padding: 27px 24px 24px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
  animation: pop 0.24s ease both;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #e7e9f5;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.progress-box p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.progress-bar {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef0f8;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--grad);
  transition: width 0.2s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 200;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(20, 24, 45, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.24s, transform 0.24s;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   动画
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* =========================================================
   响应式
   ========================================================= */
@media (min-width: 640px) {
  .qr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 920px) {
  .qr-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .container {
    padding: 26px 24px 48px;
  }

  .input-panel {
    padding: 22px;
  }

  .url-input {
    min-height: 188px;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    height: 58px;
    padding: 0 14px;
  }

  .user-name {
    display: none;
  }

  .user-chip {
    padding: 3px;
    border: none;
    background: none;
  }

  .container {
    padding: 14px 14px 34px;
  }

  .hero {
    padding: 22px 20px;
    border-radius: 20px;
    margin-bottom: 14px;
  }

  .hero h1 {
    font-size: 22px;
    letter-spacing: -0.4px;
  }

  .hero p {
    font-size: 12.5px;
    line-height: 1.6;
  }

  .hero-deco {
    width: 128px;
    height: 128px;
    margin: -20px -26px -22px 0;
    opacity: 0.22;
  }

  .input-panel {
    padding: 15px;
    border-radius: 20px;
  }

  .url-input {
    min-height: 158px;
    font-size: 13.5px;
    padding: 12px 13px;
  }

  .tool-spacer {
    display: none;
  }

  .url-count {
    margin-left: auto;
  }

  .options-row {
    gap: 10px;
  }

  .btn-generate {
    height: 50px;
    font-size: 15px;
  }

  .empty-state {
    padding: 30px 18px 26px;
  }

  .results-head {
    align-items: center;
  }

  .results-head h2 {
    font-size: 17.5px;
  }

  .btn-zip {
    height: 37px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .qr-grid {
    gap: 10px;
  }

  .qr-card {
    padding: 9px;
    gap: 8px;
    border-radius: 16px;
  }

  .qr-name {
    font-size: 11px;
  }

  .qr-badge {
    font-size: 10px;
    padding: 2px 5px;
  }

  .mini-btn {
    height: 30px;
    font-size: 11px;
  }

  .login-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .login-card {
    padding: 28px 21px 24px;
    border-radius: 24px;
  }

  .login-card h1 {
    font-size: 25px;
  }

  .modal-card {
    padding: 22px 18px 18px;
    border-radius: 22px;
  }
}

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

/* =========================================================
   账号菜单 / 修改密码 / 账号管理
   ========================================================= */
.login-note {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.34);
  text-align: center;
}

.topbar-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #e3e6fb;
  border-radius: 10px;
  background: #f2f3ff;
  color: var(--primary-deep);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.topbar-btn:hover {
  background: #e9ebff;
  border-color: #d5d9fa;
}

.topbar-btn:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.topbar-btn svg {
  width: 15px;
  height: 15px;
}

.user-menu-wrap {
  position: relative;
}

.user-chip {
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.user-chip:hover {
  background: #eef0fa;
  border-color: #e0e3f4;
}

.user-chip:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.user-chip .chev {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--muted);
  transition: transform 0.2s;
}

.user-chip[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 172px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(28, 33, 80, 0.16);
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.menu-item {
  width: 100%;
  height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: none;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.menu-item:hover {
  background: #f5f6fc;
  color: var(--ink);
}

.menu-item.danger {
  color: #e11d48;
}

.menu-item.danger svg {
  color: #e11d48;
}

.menu-item.danger:hover {
  background: #fff1f4;
}

/* 通用对话框 */
.dialog-card {
  padding: 26px 24px 22px;
}

.dialog-title {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.dialog-sub {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.form-field {
  display: block;
  margin-bottom: 12px;
}

.form-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.form-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1.5px solid #e2e5f1;
  border-radius: 11px;
  outline: none;
  background: #fafbff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.form-input::placeholder {
  color: #b3b8c9;
}

.form-input:focus {
  border-color: #9c9ef5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-error {
  min-height: 18px;
  margin: 2px 0 8px;
  color: #e11d48;
  font-size: 12px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  gap: 9px;
}

.btn-dialog {
  flex: 1;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.btn-dialog:active {
  transform: scale(0.98);
}

.btn-dialog.primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}

.btn-dialog.primary:hover {
  box-shadow: 0 13px 28px rgba(99, 102, 241, 0.36);
}

.btn-dialog.ghost {
  border: 1px solid #e8eaf4;
  background: #f6f7fc;
  color: var(--ink-2);
}

.btn-dialog.ghost:hover {
  background: #eef0f9;
}

.btn-dialog.danger {
  color: #fff;
  background: #e11d48;
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.24);
}

.btn-dialog[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.dialog-card.compact {
  text-align: center;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff1f4;
  color: #e11d48;
  font-size: 20px;
  font-weight: 700;
}

.dialog-card.compact .dialog-sub {
  margin: 8px 0 20px;
}

/* 账号管理面板 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
  animation: rise 0.3s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.sheet-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.modal-close.static {
  position: static;
  flex: none;
}

.create-user {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 13px;
  border: 1px solid #eceef7;
  border-radius: 16px;
  background: #fafbff;
}

.create-user-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.create-user .form-input {
  height: 43px;
  background: #fff;
}

.create-submit {
  flex: none;
  width: auto;
  height: 43px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13px;
}

#createUserError {
  margin: 8px 2px 0;
}

.user-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 2px 3px;
  color: var(--muted);
  font-size: 12px;
}

.user-list {
  flex: 1;
  min-height: 90px;
  overflow-y: auto;
  margin-top: 3px;
  padding-right: 2px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid #f0f2f9;
  flex-wrap: wrap;
}

.user-row:last-child {
  border-bottom: none;
}

.user-row-avatar {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b8cf7, #b28bfa);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-row-main {
  flex: 1;
  min-width: 130px;
}

.user-row-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.role-tag {
  padding: 2px 7px;
  border-radius: 99px;
  background: #eef0ff;
  color: var(--primary-deep);
  font-size: 9.5px;
  font-weight: 600;
}

.role-tag.member {
  background: #f3f4fa;
  color: #7f859b;
}

.status-tag {
  padding: 2px 7px;
  border-radius: 99px;
  background: #ecfdf3;
  color: #059669;
  font-size: 9.5px;
  font-weight: 600;
}

.status-tag.off {
  background: #fff1f4;
  color: #e11d48;
}

.user-row-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.user-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #eceef7;
  border-radius: 8px;
  background: #f8f9fd;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.16s;
}

.row-btn:hover {
  border-color: #dcdefc;
  background: #eef0ff;
  color: var(--primary-deep);
}

.row-btn.danger {
  border-color: #ffe4ea;
  background: #fff7f9;
  color: #e11d48;
}

.row-btn.danger:hover {
  border-color: #ffd2dc;
  background: #fff1f4;
}

.sheet-hint {
  margin: 12px 0 0;
  color: #b0b5c7;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.modal-high {
  z-index: 130;
}

.modal-top {
  z-index: 140;
}

@media (max-width: 560px) {
  .dialog-card {
    padding: 22px 18px 18px;
  }

  .sheet {
    align-items: stretch;
    padding: 0;
  }

  .sheet-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .sheet-head {
    margin-bottom: 14px;
  }

  .sheet-head h2 {
    font-size: 19px;
  }

  .create-user {
    flex-direction: column;
  }

  .create-user-fields {
    grid-template-columns: 1fr;
  }

  .create-submit {
    width: 100%;
  }

  .user-row-actions {
    width: 100%;
    padding-left: 47px;
  }

  .user-list {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .topbar-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .topbar-btn span {
    display: none;
  }

  .user-name {
    display: none;
  }
}

.btn-login[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}

.user-empty,
.user-loading {
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.row-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

