:root {
  color-scheme: dark;
  --bg: #05070a;
  --bg-soft: #0b1014;
  --surface: rgba(14, 19, 24, 0.88);
  --surface-strong: rgba(20, 27, 33, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --ink: #f2fbf8;
  --muted: #a1b4b2;
  --faint: #718584;
  --line: rgba(165, 188, 185, 0.16);
  --line-strong: rgba(165, 188, 185, 0.34);
  --primary: #53ead0;
  --primary-strong: #b2fff0;
  --primary-soft: rgba(83, 234, 208, 0.14);
  --accent: #ff946f;
  --accent-soft: rgba(255, 148, 111, 0.14);
  --violet: #aeb5ff;
  --violet-soft: rgba(174, 181, 255, 0.13);
  --gold: #f7c96d;
  --gold-soft: rgba(247, 201, 109, 0.14);
  --danger: #ff7088;
  --danger-soft: rgba(255, 112, 136, 0.14);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.56);
  --lift: 0 16px 48px rgba(0, 0, 0, 0.32);
  --glow: 0 0 0 1px rgba(83, 234, 208, 0.18), 0 16px 56px rgba(83, 234, 208, 0.12);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

* {
  scrollbar-color: rgba(83, 234, 208, 0.38) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 68px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 68px),
    linear-gradient(126deg, rgba(83, 234, 208, 0.13), transparent 28%),
    linear-gradient(304deg, rgba(255, 148, 111, 0.1), transparent 32%),
    linear-gradient(238deg, rgba(174, 181, 255, 0.08), transparent 36%),
    linear-gradient(180deg, #10161a 0%, #070a0e 54%, #040507 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(90deg, transparent, rgba(83, 234, 208, 0.05), transparent),
    radial-gradient(ellipse at 50% -12%, rgba(255, 255, 255, 0.12), transparent 48%);
  content: "";
}

::selection {
  color: #04100e;
  background: var(--primary-strong);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-header::before,
.site-card::before {
  position: absolute;
  inset: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(178, 255, 240, 0.78), transparent);
  content: "";
}

.brand-row,
.title-group,
.header-actions,
.toolbar,
.password-row,
.dialog-header,
.dialog-actions,
.right-actions,
.section-heading,
.credential-editor-header,
.credential-preview,
.credential-preview-actions {
  display: flex;
  align-items: center;
}

.brand-row,
.title-group {
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.46);
  border-radius: 8px;
  color: #06110f;
  background:
    linear-gradient(135deg, var(--primary-strong), var(--primary) 52%, #74b8ff),
    var(--primary);
  box-shadow: 0 14px 38px rgba(83, 234, 208, 0.24);
  font-weight: 900;
}

.brand-mark.compact {
  width: 40px;
  height: 40px;
}

.brand-mark.warm,
.tool-icon.warm {
  border-color: rgba(255, 148, 111, 0.44);
  background:
    linear-gradient(135deg, #ffe0b8, var(--accent) 58%, #ff6f92),
    var(--accent);
  box-shadow: 0 14px 38px rgba(255, 148, 111, 0.2);
}

.brand-mark.cool,
.tool-icon.cool {
  border-color: rgba(174, 181, 255, 0.45);
  background:
    linear-gradient(135deg, #e6dcff, var(--violet) 44%, var(--primary) 100%),
    var(--violet);
  box-shadow: 0 14px 38px rgba(174, 181, 255, 0.2);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
}

h4 {
  font-size: 14px;
  line-height: 1.35;
}

p,
.metric-label {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: #d6e6e3;
  font-size: 14px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(4, 8, 11, 0.58);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

select {
  color: var(--ink);
}

option {
  color: var(--ink);
  background: #11181c;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(83, 234, 208, 0.72);
  background: rgba(4, 8, 11, 0.82);
  box-shadow: 0 0 0 3px rgba(83, 234, 208, 0.15);
}

.password-row {
  gap: 8px;
}

.password-row input {
  flex: 1;
}

.credential-secret-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.private-note-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.private-note-row textarea {
  flex: 1;
}

.private-note-row .icon-button {
  align-self: flex-start;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button,
.ghost-button,
.icon-button,
.mini-icon-button {
  min-height: 40px;
  border-radius: 7px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #06110f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 34%),
    linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 14px 38px rgba(83, 234, 208, 0.22);
  font-weight: 900;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(83, 234, 208, 0.32);
}

.secondary-button,
.icon-text-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04));
  font-weight: 780;
}

.compact-button {
  min-width: 64px;
  padding: 0 12px;
}

.secondary-button:hover,
.icon-text-button:hover,
.ghost-button:hover,
.icon-button:hover,
.mini-icon-button:hover {
  border-color: rgba(83, 234, 208, 0.44);
  background: rgba(83, 234, 208, 0.1);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.08);
  box-shadow: inset 0 0 0 1px rgba(83, 234, 208, 0.22);
}

.danger-button {
  padding: 0 14px;
  color: #ffdbe1;
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 134, 0.32);
  font-weight: 850;
}

.danger-button:hover {
  background: rgba(255, 111, 134, 0.22);
}

.icon-button,
.mini-icon-button {
  display: inline-grid;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04));
}

.icon-button {
  width: 42px;
  min-width: 42px;
}

.mini-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
}

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

.copy-account-button {
  color: #78e2ff;
  border-color: rgba(120, 226, 255, 0.28);
  background: rgba(120, 226, 255, 0.08);
}

.copy-password-button {
  color: #ffd36a;
  border-color: rgba(255, 211, 106, 0.3);
  background: rgba(255, 211, 106, 0.09);
}

.copy-account-button:hover {
  color: #c6f4ff;
  border-color: rgba(120, 226, 255, 0.52);
  background: rgba(120, 226, 255, 0.14);
}

.copy-password-button:hover {
  color: #ffe6a8;
  border-color: rgba(255, 211, 106, 0.56);
  background: rgba(255, 211, 106, 0.15);
}

.copy-account-button:disabled,
.copy-password-button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.password-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 11, 18, 0.72);
  backdrop-filter: blur(14px);
}

.password-unlock-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(151, 173, 171, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(150deg, rgba(83, 234, 208, 0.1), transparent 46%),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.password-unlock-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.password-unlock-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.password-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.download-ready-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.14), transparent 48%),
    rgba(10, 19, 27, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.download-ready-panel > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.download-ready-panel strong {
  color: var(--ink);
  font-size: 14px;
}

.download-ready-panel span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-ready-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  display: grid;
  width: min(100%, 440px);
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.13), transparent 46%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.08), transparent 42%),
    rgba(12, 17, 21, 0.92);
  box-shadow: var(--lift);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand h1 {
  margin: 0;
  color: #f8fffc;
  font-size: 24px;
}

.auth-brand p,
.auth-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.library-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 28px;
}

.library-sidebar {
  position: sticky;
  top: 28px;
  display: grid;
  align-self: start;
  gap: 16px;
  min-height: calc(100vh - 56px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.11), transparent 46%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 46%),
    rgba(8, 12, 15, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.library-brand h1 {
  font-size: 20px;
}

.library-brand p,
.sidebar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-nav,
.sidebar-section {
  display: grid;
  gap: 8px;
}

.library-nav-button,
.future-tool-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 850;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.library-nav-button strong,
.future-tool-button strong {
  color: var(--muted);
  font-size: 12px;
}

.library-nav-button:hover,
.library-nav-button.active {
  border-color: rgba(83, 234, 208, 0.38);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.11);
  transform: translateY(-1px);
}

.future-tool-button {
  color: var(--muted);
  cursor: default;
  opacity: 0.78;
}

#logoutButton {
  color: #ffdbe1;
  cursor: pointer;
  opacity: 1;
}

#logoutButton:hover {
  border-color: rgba(255, 111, 134, 0.32);
  background: rgba(255, 111, 134, 0.1);
  transform: translateY(-1px);
}

.library-main {
  min-width: 0;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.home-command-panel,
.home-metrics-grid,
.home-workbench-grid {
  max-width: 1280px;
  margin: 0 auto 18px;
}

.home-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 44%),
    rgba(8, 12, 15, 0.74);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.home-search-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(2, 6, 8, 0.58);
}

.home-search-box input {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-search-box input:focus {
  box-shadow: none;
}

.home-search-box .primary-button {
  min-height: 36px;
}

.home-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.home-metric-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.07), transparent 50%),
    rgba(255, 255, 255, 0.04);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.home-metric-card:hover {
  border-color: rgba(83, 234, 208, 0.36);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.1), transparent 50%),
    rgba(255, 255, 255, 0.055);
  box-shadow: var(--lift);
  transform: translateY(-1px);
}

.home-metric-card span {
  font-size: 13px;
  font-weight: 850;
}

.home-metric-card strong {
  color: var(--primary-strong);
  font-size: 32px;
  line-height: 1;
}

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

.home-panel {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.045), transparent 45%),
    rgba(12, 17, 21, 0.82);
  box-shadow: var(--lift);
}

.home-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-panel-header h2 {
  font-size: 17px;
}

.home-site-list,
.home-security-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.home-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(165, 188, 185, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.home-site-main-button,
.home-security-row {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.home-site-main-button strong,
.home-site-main-button span,
.home-security-row strong,
.home-security-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-site-main-button strong,
.home-security-row strong {
  color: #f8fffc;
  font-size: 14px;
}

.home-site-main-button span,
.home-security-row span {
  color: var(--muted);
  font-size: 12px;
}

.home-site-row:hover,
.home-security-row:hover {
  border-color: rgba(83, 234, 208, 0.3);
  background: rgba(83, 234, 208, 0.08);
}

.home-security-row {
  padding: 10px;
  border: 1px solid rgba(247, 201, 109, 0.2);
  border-radius: 8px;
  background: rgba(247, 201, 109, 0.06);
}

.home-security-row span {
  color: #ffe7a6;
}

.home-empty-line {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 1px dashed rgba(165, 188, 185, 0.22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  font-weight: 800;
}

.home-empty-line.success {
  border-color: rgba(83, 234, 208, 0.22);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.06);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.hub-card {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.84);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.primary-tool-card {
  cursor: pointer;
}

.hub-card:hover {
  border-color: rgba(83, 234, 208, 0.34);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tool-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.32);
  border-radius: 8px;
  color: #06110f;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  font-weight: 950;
}

.tool-icon.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.tool-status {
  padding: 5px 9px;
  border: 1px solid rgba(83, 234, 208, 0.3);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
}

.tool-status.muted {
  border-color: rgba(165, 188, 185, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.hub-card h2 {
  margin-bottom: 9px;
}

.hub-card p {
  line-height: 1.6;
}

.tool-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tool-metrics span {
  padding: 7px 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.tool-metrics strong {
  color: var(--primary-strong);
}

.framework-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--lift);
}

.framework-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.framework-steps span {
  padding: 8px 10px;
  border: 1px solid rgba(83, 234, 208, 0.2);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 850;
}

.app-header {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(11, 16, 20, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.app-header p {
  margin-top: 4px;
  color: #bfd0cd;
}

.header-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  white-space: nowrap;
}

.toolbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto 18px;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 15, 0.72);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.clue-capture-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 14px;
  border: 1px solid rgba(255, 148, 111, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.12), transparent 46%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.065), transparent 46%),
    rgba(8, 12, 15, 0.74);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.quick-fields,
.quick-side {
  display: grid;
  gap: 10px;
}

.quick-side {
  align-content: start;
}

.pp-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.pp-dashboard article,
.pp-account-stats article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(174, 181, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.13), transparent 50%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 52%),
    rgba(10, 15, 20, 0.78);
  box-shadow: var(--lift);
}

.pp-dashboard span,
.pp-account-stats span,
.pp-detail-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pp-dashboard strong,
.pp-account-stats strong {
  overflow: hidden;
  color: #e7eaff;
  font-size: 24px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.pp-account-panel,
.pp-record-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.1), transparent 46%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.07), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.pp-account-panel {
  position: sticky;
  top: 84px;
  display: grid;
  align-self: start;
  gap: 12px;
  padding: 14px;
}

.pp-record-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pp-create-box,
.pp-account-detail,
.pp-record-main {
  display: grid;
  min-width: 0;
}

.pp-create-box {
  gap: 10px;
}

.pp-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.pp-account-list,
.pp-record-list {
  display: grid;
  gap: 10px;
}

.pp-account-card {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.pp-account-card:hover,
.pp-account-card.active {
  border-color: rgba(174, 181, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.14), transparent 50%),
    rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.pp-account-card strong,
.pp-account-card span,
.pp-account-card small,
.pp-record-main strong,
.pp-record-main span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-account-card strong {
  color: #f7f8ff;
  font-size: 15px;
  white-space: nowrap;
}

.pp-account-card span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pp-account-card small {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
}

.pp-account-detail {
  gap: 14px;
}

.pp-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pp-detail-heading h2 {
  margin-top: 4px;
  color: #f7f8ff;
  font-size: 24px;
}

.pp-detail-heading p {
  margin-top: 5px;
  color: #c8d5d3;
}

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

.pp-account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pp-account-stats small {
  color: var(--muted);
  font-size: 12px;
}

.pp-record-form {
  display: grid;
  grid-template-columns: auto minmax(110px, 150px) minmax(190px, 210px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(174, 181, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pp-record-type {
  display: inline-flex;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 8, 0.52);
}

.pp-record-toolbar {
  display: flex;
  justify-content: flex-end;
}

.pp-record-toolbar select {
  width: min(220px, 100%);
}

.pp-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.pp-record-row.expense {
  border-color: rgba(255, 148, 111, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.08), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.pp-record-main {
  gap: 4px;
}

.pp-record-main strong {
  color: #f7f8ff;
  white-space: nowrap;
}

.pp-record-main span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pp-record-row b {
  color: var(--primary-strong);
  font-size: 16px;
  white-space: nowrap;
}

.pp-record-row.expense b {
  color: #ffd7c5;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.admin-metrics-grid article {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.13), transparent 48%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 52%),
    rgba(10, 15, 20, 0.78);
  box-shadow: var(--lift);
}

.admin-metrics-grid span,
.admin-tool-card span,
.admin-backup-main span,
.integration-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-metrics-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-metrics-grid strong {
  overflow: hidden;
  color: #e5fff9;
  font-size: 23px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.admin-tool-panel,
.admin-backup-panel {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 12px;
}

.admin-tool-card,
.admin-backup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.05), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.admin-tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.admin-tool-card h2 {
  margin: 5px 0;
  color: #f7f8ff;
  font-size: 18px;
}

.admin-tool-card p {
  color: #c8d5d3;
  font-size: 13px;
  line-height: 1.55;
}

.admin-migration-card {
  border-color: rgba(255, 148, 111, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.12), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 48%),
    rgba(9, 14, 18, 0.8);
}

.admin-database-card {
  border-color: rgba(174, 181, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.13), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 48%),
    rgba(9, 14, 18, 0.8);
}

.admin-backup-panel {
  gap: 14px;
  padding: 16px;
}

.admin-backup-create {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(83, 234, 208, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

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

.admin-import-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.admin-backup-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-backup-main strong,
.admin-backup-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-backup-main strong {
  color: #f7f8ff;
  font-size: 15px;
}

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

.admin-backup-actions .icon-text-button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.admin-integration-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1280px;
  margin: 18px auto 0;
}

.integration-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.06), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.integration-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-card h2 {
  margin: 5px 0;
  color: #f7f8ff;
  font-size: 18px;
}

.integration-card p {
  color: #c8d5d3;
  font-size: 13px;
}

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

.compact-toggle {
  display: inline-flex;
  min-width: 86px;
}

.admin-settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.search-box {
  display: flex;
  min-width: 240px;
  flex: 1 1 360px;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(2, 6, 8, 0.58);
}

.search-box:focus-within {
  border-color: rgba(83, 234, 208, 0.65);
  box-shadow: 0 0 0 3px rgba(83, 234, 208, 0.12);
}

.search-box input {
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

.toolbar select {
  width: auto;
  min-width: 136px;
}

.view-toggle {
  display: inline-flex;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 8, 0.58);
}

.segmented-button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.segmented-button:hover,
.segmented-button.active {
  color: #06110f;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 10px 26px rgba(83, 234, 208, 0.18);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.stats-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 10px;
  align-self: start;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.11), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(11, 16, 20, 0.72);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.stats-panel > div:not(.tag-list) {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.stats-panel > div:first-child {
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.16), transparent),
    rgba(255, 255, 255, 0.045);
}

.stats-panel strong {
  color: var(--primary-strong);
  font-size: 28px;
  line-height: 1;
}

.metric-label {
  font-size: 12px;
  font-weight: 850;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.collection-list {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.collection-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 820;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.collection-button strong {
  color: inherit;
  font-size: 13px;
}

.collection-button:hover,
.collection-button.active {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
  transform: translateY(-1px);
}

.tag-pill {
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-pill.warm {
  border-color: rgba(255, 148, 111, 0.24);
  color: #ffd7c5;
  background: var(--accent-soft);
}

.site-list-wrap {
  container: site-list-area / inline-size;
  min-width: 0;
}

.site-list {
  display: grid;
  gap: 14px;
}

.site-list.card-view {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
}

.site-list.list-view {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 17, 21, 0.78);
}

.site-card {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.055), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.88);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.site-list.list-view .site-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(165, 188, 185, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.site-list.list-view .site-avatar {
  display: none;
}

.site-list.list-view .site-card:last-child {
  border-bottom: 0;
}

.site-list.list-view .site-card:hover {
  background: rgba(83, 234, 208, 0.055);
  box-shadow: none;
  transform: none;
}

.site-list.list-view .site-main {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
  gap: 12px;
  align-items: center;
}

.site-list.list-view .site-topline {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.site-list.list-view .site-title {
  font-size: 14px;
}

.site-list.list-view .status {
  max-width: 96px;
  padding: 3px 7px;
  font-size: 11px;
}

.site-list.list-view .site-url {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #9edbd3;
  background: transparent;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-list.list-view .site-url::after {
  display: none;
}

.site-list.list-view .site-url:hover {
  color: var(--primary-strong);
  background: transparent;
  transform: none;
}

.site-list.list-view .site-meta {
  flex-wrap: nowrap;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
}

.site-list.list-view .meta-chip {
  max-width: 118px;
  padding: 3px 6px;
  font-size: 11px;
}

.site-list.list-view .site-summary,
.site-list.list-view .site-facts,
.site-list.list-view .credential-preview-list,
.site-list.list-view .site-notes {
  display: none;
}

.site-list.list-view .site-actions {
  flex-wrap: nowrap;
  max-width: none;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background: rgba(8, 13, 17, 0.96);
  box-shadow: -18px 0 24px rgba(8, 13, 17, 0.72);
}

.site-list.list-view .icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  background: rgba(24, 32, 36, 0.98);
}

@container site-list-area (max-width: 760px) {
  .site-list.list-view {
    border: 0;
    background: transparent;
  }

  .site-list.list-view .site-card {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 21, 0.88);
  }

  .site-list.list-view .site-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-list.list-view .site-topline,
  .site-list.list-view .site-meta,
  .site-list.list-view .site-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .site-list.list-view .site-url {
    padding: 6px 8px;
    border: 1px solid rgba(83, 234, 208, 0.18);
    border-radius: 7px;
    background: rgba(83, 234, 208, 0.06);
  }

  .site-list.list-view .site-actions {
    width: fit-content;
    max-width: 100%;
    box-shadow: none;
  }
}

.site-card.is-archived {
  opacity: 0.74;
}

.site-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 8px;
  color: var(--primary-strong);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.2), transparent),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 24px rgba(83, 234, 208, 0.08);
  font-size: 20px;
  font-weight: 950;
}

.site-card:hover {
  border-color: rgba(83, 234, 208, 0.38);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.site-main {
  min-width: 0;
}

.site-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.site-title {
  min-width: 0;
  overflow: hidden;
  color: #f8fffc;
  font-size: 18px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  max-width: 220px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid rgba(244, 199, 107, 0.3);
  border-radius: 999px;
  color: #ffe7a6;
  background: var(--gold-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-favorite {
  border-color: rgba(83, 234, 208, 0.32);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.status-read-later {
  border-color: rgba(174, 181, 255, 0.32);
  color: #dce0ff;
  background: var(--violet-soft);
}

.status-archived {
  border-color: rgba(165, 188, 185, 0.24);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.site-url {
  display: inline-flex;
  max-width: min(100%, 720px);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(83, 234, 208, 0.08);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.site-url::after {
  flex: 0 0 auto;
  color: var(--primary-strong);
  content: "打开";
  font-size: 12px;
  font-weight: 850;
}

.site-url:hover {
  border-color: rgba(83, 234, 208, 0.52);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.14);
  transform: translateY(-1px);
}

.site-url-empty {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.035);
}

.site-url-empty::after {
  display: none;
}

.site-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.site-summary {
  max-width: 780px;
  margin-top: 10px;
  color: #d8e6e3;
  font-size: 14px;
  line-height: 1.58;
}

.site-facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.site-fact {
  display: inline-flex;
  max-width: min(100%, 520px);
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: #d8e6e3;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.site-fact strong {
  flex: 0 0 auto;
  color: var(--primary-strong);
}

.site-fact span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-fact.warning {
  border-color: rgba(247, 201, 109, 0.24);
  color: #ffe7a6;
  background: rgba(247, 201, 109, 0.07);
}

.site-fact.warning strong {
  color: var(--gold);
}

.meta-chip {
  max-width: 100%;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.credential-preview {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid rgba(151, 173, 171, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.07), transparent),
    rgba(255, 255, 255, 0.04);
}

.credential-preview-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.credential-preview-text strong,
.credential-preview-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-preview-text strong {
  color: #f4fffb;
  font-size: 13px;
}

.credential-preview-text span {
  color: var(--muted);
  font-size: 12px;
}

.credential-preview-text .secret-line {
  color: #dce0ff;
}

.credential-preview-actions {
  gap: 6px;
  flex: 0 0 auto;
}

.credential-more {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.site-notes {
  display: -webkit-box;
  max-width: 760px;
  margin-top: 10px;
  overflow: hidden;
  color: #c5d3d0;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.site-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 144px;
}

.active-action {
  border-color: rgba(83, 234, 208, 0.44);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.12);
}

.empty-state {
  display: none;
  padding: 68px 20px;
  border: 1px dashed rgba(165, 188, 185, 0.32);
  border-radius: 8px;
  place-items: center;
  gap: 14px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent),
    rgba(255, 255, 255, 0.035);
  box-shadow: var(--lift);
}

.empty-state.visible {
  display: grid;
}

.clue-list {
  display: grid;
  gap: 14px;
}

.clue-card {
  position: relative;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.11), transparent 40%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.07), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.88);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.clue-card:hover {
  border-color: rgba(255, 148, 111, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 148, 111, 0.16), 0 16px 48px rgba(255, 148, 111, 0.08);
  transform: translateY(-1px);
}

.clue-card.is-archived {
  opacity: 0.68;
}

.clue-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.clue-title-button {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.clue-title-button h3,
.clue-title-button p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.clue-title-button h3 {
  color: #fff9f5;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.clue-title-button p {
  display: -webkit-box;
  color: #d9e5e2;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.clue-status {
  border-color: rgba(255, 148, 111, 0.3);
  color: #ffd7c5;
  background: var(--accent-soft);
}

.clue-source-url {
  max-width: 100%;
}

.clue-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clue-image-strip,
.clue-attachment-list {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.clue-image-thumb,
.clue-attachment-item {
  overflow: hidden;
  border: 1px solid rgba(165, 188, 185, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.clue-image-thumb {
  width: 78px;
  height: 58px;
  padding: 0;
}

.clue-image-thumb img,
.clue-attachment-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clue-image-more {
  display: grid;
  width: 48px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 148, 111, 0.24);
  border-radius: 8px;
  color: #ffd7c5;
  background: rgba(255, 148, 111, 0.08);
  font-weight: 900;
}

.clue-attachment-list {
  margin-top: 8px;
}

.clue-attachment-list.compact {
  margin-top: 0;
}

.clue-attachment-item {
  position: relative;
  display: grid;
  width: min(180px, 100%);
  grid-template-rows: 104px auto;
  margin: 0;
}

.clue-attachment-item figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 38px 7px 8px;
}

.clue-attachment-item figcaption span,
.clue-attachment-item figcaption small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue-attachment-item figcaption span {
  color: #f4fffb;
  font-size: 12px;
  font-weight: 850;
}

.clue-attachment-item figcaption small {
  color: var(--muted);
  font-size: 11px;
}

.clue-attachment-item .mini-icon-button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  background: rgba(8, 13, 17, 0.92);
}

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

.site-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 44%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    #10171b;
  box-shadow: var(--shadow);
}

.site-dialog::backdrop {
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.08), transparent),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
}

.site-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialog-header,
.dialog-actions {
  justify-content: space-between;
  gap: 16px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.toggle-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 820;
}

.toggle-field input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.toggle-field:has(input:checked) {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
}

.url-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.url-edit-row input {
  flex: 1 1 260px;
}

.credentials-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.055), transparent),
    rgba(255, 255, 255, 0.035);
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
}

.section-heading p {
  margin-top: 3px;
  font-size: 13px;
}

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

.credential-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(151, 173, 171, 0.18);
  border-radius: 8px;
  background: rgba(3, 7, 10, 0.48);
}

.credential-editor-header {
  justify-content: space-between;
  gap: 12px;
}

.credential-index {
  color: var(--primary-strong);
}

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

.credential-field-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.mini-toggle-field {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(151, 173, 171, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 850;
}

.mini-toggle-field input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.mini-toggle-field:has(input:checked) {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
}

.right-actions {
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(82, 221, 199, 0.28);
  border-radius: 8px;
  color: #06110f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1100px) {
  .library-shell {
    grid-template-columns: 1fr;
  }

  .library-sidebar {
    position: static;
    min-height: auto;
  }

  .library-nav,
  .sidebar-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .home-command-panel,
  .home-workbench-grid,
  .pp-shell,
  .admin-shell,
  .admin-integration-panel,
  .clue-capture-panel {
    grid-template-columns: 1fr;
  }

  .pp-account-panel {
    position: static;
  }

  .pp-record-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-quick-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .library-shell {
    padding: 16px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

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

  .pp-dashboard,
  .pp-account-stats,
  .admin-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pp-detail-heading {
    flex-direction: column;
  }

  .pp-detail-actions {
    justify-content: flex-start;
  }

  .stats-panel > div:not(.tag-list) {
    display: grid;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .tag-list {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .collection-list {
    grid-column: 1 / -1;
  }

  .site-card {
    grid-template-columns: 1fr;
  }

  .site-list.card-view {
    grid-template-columns: 1fr;
  }

  .site-list.list-view {
    border: 0;
    background: transparent;
  }

  .site-list.list-view .site-card,
  .site-list.list-view .site-main {
    grid-template-columns: 1fr;
  }

  .site-list.list-view .site-card {
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 21, 0.78);
  }

  .site-list.list-view .site-topline,
  .site-list.list-view .site-meta,
  .site-list.list-view .site-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .site-avatar {
    display: none;
  }

  .site-actions {
    flex-wrap: wrap;
    max-width: none;
    justify-content: flex-start;
  }

  .field-grid,
  .credential-field-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .credential-field-grid label:has(textarea),
  .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .library-nav,
  .sidebar-section {
    grid-template-columns: 1fr;
  }

  .toolbar > *,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle .segmented-button {
    flex: 1;
    width: auto;
  }

  .search-box {
    min-width: 0;
  }

  .home-search-box {
    align-items: stretch;
    flex-direction: column;
  }

  .home-search-box .primary-button,
  .home-quick-actions button,
  .home-metrics-grid {
    width: 100%;
  }

  .home-metrics-grid {
    grid-template-columns: 1fr;
  }

  .pp-dashboard,
  .pp-account-stats,
  .pp-record-form,
  .admin-metrics-grid,
  .admin-backup-create,
  .integration-grid {
    grid-template-columns: 1fr;
  }

  .admin-tool-card,
  .admin-backup-row {
    grid-template-columns: 1fr;
  }

  .admin-tool-card button,
  .admin-backup-actions {
    width: 100%;
  }

  .admin-backup-actions .icon-text-button {
    flex: 1 1 120px;
  }

  .admin-import-row,
  .integration-card header,
  .admin-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pp-record-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pp-record-row .mini-icon-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .right-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button,
  .right-actions button,
  .section-heading button {
    width: 100%;
  }
}
