:root {
  --blue: #1f6feb;
  --blue-dark: #1557c0;
  --blue-light: #edf5ff;
  --blue-soft: #f6faff;
  --green: #16824a;
  --green-bg: #eaf8f0;
  --orange: #b65f00;
  --orange-bg: #fff3df;
  --red: #c93636;
  --red-bg: #fff0f0;
  --ink: #101828;
  --muted: #667085;
  --muted-soft: #98a2b3;
  --light: #f5f7fb;
  --line: #e4e9f2;
  --card: #fff;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
  --shadow-soft: 0 6px 18px rgba(16, 24, 40, 0.05);
  --sidebar-width: 232px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--light);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: start center;
  overflow: hidden;
  background: #e8f6ff;
}

.login-page .login-card {
  position: relative;
  width: min(100%, 600px);
  aspect-ratio: 892 / 1763;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: url("../assets/agent-login-robot-v1.png") center top / 100% 100% no-repeat;
  box-shadow: none;
}

.login-page .login-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8%;
  background: linear-gradient(transparent, #e8f6ff);
  pointer-events: none;
}

.login-page .login-brand {
  position: absolute;
  top: 21.7%;
  left: 9.3%;
  display: block;
  margin: 0;
}

.login-page .login-brand h1 {
  margin: 0;
  color: #07182f;
  font-size: clamp(30px, 9vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.025em;
}

.login-page .login-brand::after {
  content: "";
  display: block;
  width: clamp(44px, 13.8vw, 83px);
  height: 3px;
  margin-top: clamp(12px, 3.5vw, 21px);
  border-radius: 3px;
  background: linear-gradient(90deg, #0082ff 0 63%, #deefff 63% 100%);
}

.login-page .login-form {
  position: absolute;
  top: 50.76%;
  left: 9.3%;
  width: 81.5%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.login-page .login-field {
  display: block;
  min-width: 0;
  margin: 0;
}

.login-page .login-account-field {
  margin-bottom: 12.5%;
}

.login-page .login-password-field {
  margin-bottom: 4.8%;
}

.login-page .login-form .login-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  aspect-ratio: 727 / 101;
  border: 1px solid #a4abb0;
  border-radius: clamp(12px, 3.4vw, 20px);
  padding: 0 9.5%;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.94), rgba(234, 241, 245, 0.9));
  box-shadow: 0 5px 12px rgba(80, 137, 176, 0.12), inset 0 1px 1px #fff;
  color: #111820;
  font-size: clamp(16px, 4.5vw, 27px);
  font-weight: 400;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-page .login-input::placeholder {
  color: #171c22;
  opacity: 1;
}

.login-page .login-form .login-input:focus {
  border-color: #168aff;
  box-shadow: 0 0 0 3px rgba(22, 138, 255, 0.14), 0 5px 12px rgba(80, 137, 176, 0.12);
}

.login-page .login-submit.button {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 44px;
  aspect-ratio: 727 / 94;
  border: 0;
  border-radius: clamp(12px, 3.4vw, 20px);
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 26%, rgba(0, 125, 225, 0) 84%, rgba(0, 125, 225, 0.025)), linear-gradient(155deg, #9bd1ff 0%, #49a8ff 40%, #0090ff 100%);
  box-shadow: 0 4px 9px rgba(19, 150, 250, 0.11);
  color: #fff;
  font-size: clamp(18px, 4.5vw, 27px);
  font-weight: 700;
  line-height: 1.3;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.login-page .login-submit:hover:not(:disabled) {
  filter: brightness(1.04);
}

.login-page .login-submit:focus-visible {
  outline: 3px solid #086dcc;
  outline-offset: 4px;
}

.login-page .login-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.login-page .login-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #b42318;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.login-page .login-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 760px) {
  .login-page {
    align-items: center;
    padding: 32px;
  }

  .login-page .login-card {
    width: min(100%, 1120px);
    min-height: 620px;
    height: min(800px, calc(100svh - 64px));
    aspect-ratio: auto;
    border-radius: 28px;
    background-color: #eaf7ff;
    background-image: linear-gradient(90deg, #eaf7ff 0 43%, rgba(234, 247, 255, 0) 70%), url("../assets/agent-login-robot-v1.png");
    background-size: 100% 100%, 660px auto;
    background-position: center, right -130px;
    box-shadow: 0 20px 70px rgba(71, 130, 183, 0.12);
  }

  .login-page .login-card::after {
    display: none;
  }

  .login-page .login-brand {
    top: 124px;
    left: 6%;
  }

  .login-page .login-brand h1 {
    font-size: clamp(36px, 4.4vw, 50px);
  }

  .login-page .login-brand::after {
    width: 72px;
    margin-top: 22px;
  }

  .login-page .login-form {
    top: 280px;
    left: 6%;
    width: 40%;
    max-width: 420px;
  }

  .login-page .login-account-field {
    margin-bottom: 24px;
  }

  .login-page .login-password-field {
    margin-bottom: 24px;
  }

  .login-page .login-form .login-input {
    height: 62px;
    aspect-ratio: auto;
    padding: 0 26px;
    font-size: 21px;
  }

  .login-page .login-submit.button {
    height: 60px;
    aspect-ratio: auto;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page .login-input,
  .login-page .login-submit {
    transition: none;
  }
}

html {
  min-width: 320px;
  background: var(--light);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -120px, #eaf3ff 0, rgba(234, 243, 255, 0) 330px),
    var(--light);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-size: 16px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

button,
select {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: min(82vw, var(--sidebar-width));
  transform: translateX(-105%);
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-mask {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.sidebar-mask.show {
  display: block;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #2b7cf6, #1557c0);
  border-radius: 15px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.25);
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.sidebar-note {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 16px 14px;
  overflow: auto;
}

.nav-button,
.sub-nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-button {
  min-height: 48px;
  padding: 0 14px;
  font-weight: 700;
}

.nav-button.active,
.sub-nav-button.active {
  color: var(--blue);
  background: var(--blue-light);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.08);
}

.nav-group-label {
  margin: 10px 12px 4px;
  color: var(--muted);
  font-size: 12px;
}

.sub-nav-button {
  min-height: 40px;
  padding: 0 12px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px 16px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.main-shell {
  min-height: 100vh;
  padding-bottom: 84px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  min-height: 62px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.top-title {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.topbar-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.page-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 16px 26px;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.section-card {
  padding: 18px;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title h2,
.card-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.card-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.summary-item {
  position: relative;
  overflow: hidden;
  min-height: 58px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.summary-item::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.08);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.summary-item strong {
  display: block;
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.entry-grid,
.config-grid {
  display: grid;
  gap: 12px;
}

.entry-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 18px 46px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fcfdff);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.entry-card::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-soft);
  font-size: 28px;
  line-height: 1;
}

.entry-card:active {
  transform: scale(0.985);
}

.entry-card:hover {
  border-color: rgba(31, 111, 235, 0.35);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.08);
}

.entry-card strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.entry-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.scope {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-light);
  font-size: 12px;
  font-weight: 700;
}

.scope.warning {
  color: var(--orange);
  background: var(--orange-bg);
}

.form-grid,
.field-list,
.row-list {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field small {
  color: var(--muted);
}

.info-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.info-row {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: var(--muted);
}

.info-row strong,
.info-row b {
  min-width: 0;
  word-break: break-all;
}

.button-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.vip-toolbar {
  margin-bottom: 14px;
}

.vip-config-list {
  display: grid;
  gap: 12px;
}

.vip-config-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.vip-config-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.vip-card-badges {
  display: grid;
  gap: 6px;
  justify-items: end;
  flex: 0 0 auto;
}

.vip-config-head strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.vip-config-head div > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.vip-config-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--soft);
}

.vip-config-meta span {
  color: var(--muted);
  font-size: 13px;
}

.vip-config-meta b {
  color: var(--ink);
}

.vip-editor-grid .vip-wide {
  grid-column: 1 / -1;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: linear-gradient(180deg, #2b7cf6, var(--blue));
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.22);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-outline {
  color: var(--blue);
  border-color: rgba(31, 111, 235, 0.32);
  background: #fff;
}

.button-danger {
  color: var(--red);
  background: var(--red-bg);
}

.button-block {
  width: 100%;
}

.danger-text {
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.hint {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid #e6eefb;
}

.switch-list {
  display: grid;
  gap: 10px;
}

.switch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fcfdff);
  box-shadow: var(--shadow-soft);
}

.switch-item strong {
  display: block;
}

.switch-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}

.switch input:checked + .slider {
  background: var(--blue);
}

.switch input:checked + .slider::after {
  transform: translateX(20px);
}

.repeat-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fcfdff);
  box-shadow: var(--shadow-soft);
}

.repeat-row.two,
.repeat-row.three,
.repeat-row.keyword {
  grid-template-columns: 1fr;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-running {
  color: var(--green);
  background: var(--green-bg);
}

.status-expiring {
  color: var(--orange);
  background: var(--orange-bg);
}

.status-expired {
  color: var(--red);
  background: var(--red-bg);
}

.date-running {
  color: var(--green);
  font-weight: 800;
}

.date-expiring {
  color: var(--orange);
  font-weight: 800;
}

.date-expired {
  color: var(--red);
  font-weight: 800;
}

.filters {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
}

.group-card {
  padding: 18px;
  margin-bottom: 14px;
}

.group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.group-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.group-card .button-row {
  margin-top: 12px;
}

.desktop-table-wrap {
  display: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.data-table td {
  word-break: break-word;
}

.tab-bar {
  display: flex;
  gap: 9px;
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-bar button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.tab-bar button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.sticky-save {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 0;
  background: none;
}

.page-end-save {
  margin-top: 18px;
}

.page-end-save .button {
  min-height: 50px;
}

.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-height: 70px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 15px;
}

.bottom-nav button.active {
  color: var(--blue);
  background: var(--blue-light);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 42, 0.42);
}

.modal-sheet {
  width: min(100%, 560px);
  max-height: 88vh;
  overflow: auto;
  margin: 0 auto;
  padding: 18px;
  background: #fff;
  border-radius: 22px 22px 0 0;
}

.modal-sheet h2 {
  margin: 0 0 8px;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 14px 44px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fcfdff);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.option-item::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-soft);
  font-size: 26px;
}

.option-item strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.option-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.option-item:active {
  transform: scale(0.985);
}

.toast-root {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 86px;
  z-index: 100;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: var(--shadow);
}

.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #fff;
}

.ipad-form-grid {
  display: grid;
  gap: 12px;
}

.ipad-account-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.ipad-account-list {
  display: grid;
  gap: 12px;
}

.ipad-account-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.ipad-account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef4ff;
}

.ipad-account-avatar-fallback {
  display: grid;
  place-items: center;
  color: #31578d;
  font-weight: 800;
}

.ipad-account-main {
  min-width: 0;
}

.ipad-account-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ipad-account-status {
  font-size: 13px;
}

.ipad-account-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.ipad-account-protocol {
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #2867c7;
  font-size: 12px;
  font-weight: 700;
}

.ipad-account-status.online {
  color: #18864b;
}

.ipad-account-status.offline {
  color: var(--muted);
}

.ipad-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ipad-qr-hint {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
}

.ipad-dual-progress {
  display: grid;
  grid-template-columns: max-content minmax(48px, 1fr) max-content;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
}

.modal-sheet.ipad-dual-sheet {
  width: min(100%, 440px);
  padding: 20px;
}

.ipad-dual-dialog h2 {
  margin-bottom: 4px;
}

.ipad-dual-step {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.ipad-dual-step span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
}

.ipad-dual-step.active,
.ipad-dual-step.done {
  color: var(--blue);
}

.ipad-dual-step.active span {
  border-color: var(--blue);
  background: var(--blue-light);
}

.ipad-dual-step.done span {
  border-color: #22a06b;
  color: #fff;
  background: #22a06b;
}

.ipad-dual-line {
  height: 1px;
  background: #dbe3ef;
}

.ipad-dual-line.done {
  background: #22a06b;
}

.ipad-dual-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #eef5ff;
}

.ipad-dual-status strong {
  display: block;
  color: var(--ink);
}

.ipad-dual-status p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ipad-dual-confirming {
  align-content: center;
  gap: 8px;
  min-height: 156px;
  border-style: solid;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.ipad-dual-confirming strong {
  color: var(--ink);
  font-size: 16px;
}

.ipad-dual-qr-box {
  gap: 10px;
  min-height: 194px;
  border-style: solid;
  background: #fff;
}

.ipad-dual-qr-box img {
  width: min(160px, 62vw);
  height: min(160px, 62vw);
}

.ipad-dual-qr-caption {
  color: var(--muted);
  font-size: 13px;
}

.ipad-dual-actions {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px;
}

.ipad-dual-actions .button-primary {
  width: 100%;
}

.ipad-session-layout {
  display: grid;
  gap: 16px;
}

.ipad-qr-box {
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ipad-qr-box img {
  width: min(240px, 80vw);
  height: min(240px, 80vw);
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
}

.ipad-verification-box {
  position: relative;
  overflow: hidden;
  height: min(430px, 62vh);
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overscroll-behavior: none;
}

.ipad-verification-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
  overflow: hidden;
}

.ipad-verification-fallback {
  margin-top: 16px;
  color: var(--muted);
  text-align: center;
}

.ipad-verification-fallback img {
  display: block;
  width: min(220px, 75vw);
  height: min(220px, 75vw);
  margin: 12px auto 0;
  object-fit: contain;
  background: #fff;
}

.ipad-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.ipad-table th,
.ipad-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ipad-table th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
}

.ipad-log-list {
  display: grid;
  gap: 10px;
}

.ipad-log-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.ipad-log-main {
  color: var(--ink);
  word-break: break-all;
}

.ipad-log-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.loading-state,
.empty-state,
.error-state {
  padding: 18px;
  border-radius: 14px;
  color: var(--muted);
  background: #f8fafc;
}

.error-state {
  color: var(--red);
  background: var(--red-bg);
}

.button-secondary {
  color: var(--blue);
  background: #eef4ff;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

@media (min-width: 760px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-grid,
  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vip-config-list,
  .vip-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: 1.3fr 0.8fr 0.8fr;
  }

  .repeat-row.two {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  .repeat-row.three {
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
  }

  .repeat-row.keyword {
    grid-template-columns: 1fr 0.8fr 1fr 1fr auto;
    align-items: end;
  }

  .ipad-form-grid,
  .ipad-session-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .ipad-account-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
}

@media (max-width: 560px) {
  .ipad-account-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .ipad-account-avatar {
    width: 48px;
    height: 48px;
  }

  .ipad-account-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .ipad-account-actions .button {
    flex: 1 1 0;
  }
}

@media (min-width: 980px) {
  .sidebar {
    transform: none;
    width: var(--sidebar-width);
    box-shadow: none;
    background: #fff;
  }

  .sidebar-mask,
  .sidebar-mask.show {
    display: none;
  }

  .main-shell {
    margin-left: var(--sidebar-width);
    padding-bottom: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 66px;
    padding: 0 32px;
  }

  #menuButton {
    display: none;
  }

  .top-title {
    text-align: left;
  }

  .page-content {
    width: min(100%, 1120px);
    padding: 32px 32px 52px;
  }

  .bottom-nav {
    display: none;
  }

  .summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .layout-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 16px;
    align-items: start;
  }

  .mobile-card-list {
    display: none;
  }

  .desktop-table-wrap {
    display: block;
  }

  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal-sheet {
    border-radius: 20px;
  }
}
