:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  --bg: #f5f6fa; --panel: #fff; --line: #e7e9f0; --ink: #202538;
  --muted: #7b8194; --accent: #5b57db; --accent-soft: #eeedff; --danger: #c94d62;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a, summary, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.app-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 20px 32px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 17px; font-weight: 700; text-decoration: none; letter-spacing: -.03em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; }
.brand-mark svg { width: 24px; height: 24px; }
#account, .nav-links, .account-meta { display: flex; align-items: center; gap: 20px; }
.nav-links a { font-size: 13px; text-decoration: none; }
.account-meta { color: var(--muted); font-size: 12px; }
body[data-view="workspace"], body[data-view="admin"] { padding-left: 216px; }
body[data-view="workspace"] .app-header, body[data-view="admin"] .app-header {
  position: fixed; inset: 0 auto 0 0; z-index: 10; width: 216px; min-height: 100dvh;
  padding: 32px 22px 24px; align-items: stretch; justify-content: flex-start; flex-direction: column;
  border: 0; background: #161e32; color: #f2f4ff;
}
body[data-view="workspace"] #account, body[data-view="admin"] #account { flex: 1; align-items: stretch; gap: 0; flex-direction: column; margin-top: 50px; }
body[data-view="workspace"] .nav-links, body[data-view="admin"] .nav-links { align-items: stretch; flex-direction: column; gap: 9px; }
body[data-view="workspace"] .nav-links a, body[data-view="admin"] .nav-links a { padding: 13px 16px; color: #a4aec8; border-radius: 9px; }
.nav-links a.active { background: #30364f; color: #fff !important; }
body[data-view="workspace"] .account-meta, body[data-view="admin"] .account-meta { margin-top: auto; border-top: 1px solid #30384b; padding-top: 20px; justify-content: space-between; gap: 12px; color: #a4aec8; }
#expiry { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1320px; margin: auto; padding: 44px 44px 60px; }
h1, h2 { margin: 0; font-weight: 650; line-height: 1.4; letter-spacing: -.035em; }
h1 { font-size: 28px; } h2 { font-size: 20px; }
p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.library-heading, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.library-heading h1 { display: flex; align-items: center; gap: 12px; }
.count-label { font-size: 13px; font-weight: 550; line-height: 1; background: #e9ebf3; color: #737a91; padding: 7px 9px; border-radius: 7px; letter-spacing: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; margin-bottom: 24px; }
.collection { padding: 0 24px 8px; box-shadow: 0 4px 20px #25315103; }
.collection-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; }
.search-field { position: relative; width: min(360px, 100%); }
.search-field > svg { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; fill: none; stroke: #8c91a2; stroke-width: 1.7; stroke-linecap: round; pointer-events: none; }
.search-field input { padding-left: 40px; min-height: 42px; background: #f7f8fb; border-color: transparent; }
.collection-actions { display: flex; align-items: center; gap: 12px; }
.collection-actions select { width: 166px; min-height: 40px; background: #fff; font-size: 12px; }
.list-head, .entry { display: grid; grid-template-columns: 16px minmax(0, 1fr) 100px 80px 172px; gap: 20px; align-items: center; }
.list-head { padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #9297a6; font-size: 11px; }
.entry { padding: 22px 0; border-bottom: 1px solid #eff0f5; }
.entry:last-child { border-bottom: 0; }
.entry-info { min-width: 0; }
.entry-name { display: inline-block; font-size: 14px; font-weight: 550; text-decoration: none; overflow-wrap: anywhere; }
.entry-name:hover { color: var(--accent); }
.entry-meta { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 6px; }
.entry-queue { display: flex; align-items: flex-start; flex-direction: column; }
.queue-count { font-size: 12px; color: #626a80; }
.app-badge { justify-self: start; padding: 6px 9px; border-radius: 6px; background: #f0f1f5; color: #4e576d; font-size: 11px; white-space: nowrap; }
.app-badge.lite { background: #fff2e7; color: #a87336; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.entry .inline-actions { justify-content: flex-end; flex-wrap: nowrap; margin: 0; }
.primary, .button, .small-button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 11px 17px; border-radius: 8px; border: 1px solid #e1e4ed;
  background: #fff; color: #535b72; font-size: 12px; font-weight: 550; line-height: 1.4; text-decoration: none;
}
.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.primary:hover { background: #4945c8; border-color: #4945c8; }
.primary > span { font-size: 20px; line-height: 0; font-weight: 400; }
.small-button { min-height: 34px; padding: 8px 10px; border-color: #e7e9f0; font-size: 11px; }
.small-button:hover, .button:hover { background: #f6f5ff; color: var(--accent); }
.text-button { border: 0; padding: 4px 0; background: transparent; color: inherit; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.icon-button { min-height: 36px; width: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.icon-button:hover { background: #f1f2f7; }
button:disabled { opacity: .5; cursor: wait; }
input, textarea, select {
  width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid #dfe3ed;
  border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px;
}
input::placeholder, textarea::placeholder { color: #a1a6b5; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #8c87f4; outline-offset: 3px; }
input[type=checkbox] { width: 15px; min-height: 15px; height: 15px; flex-shrink: 0; margin: 0; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.75; }
label { display: block; color: #656d80; font-size: 12px; margin: 22px 0 9px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.check-line { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 12px; line-height: 1.6; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.status { color: var(--accent); font-size: 12px; line-height: 1.75; margin: 14px 0 0; overflow-wrap: anywhere; }
.status:empty, #entry-hint:empty, #queue-summary:empty { display: none; }
.error, .danger { color: var(--danger); }
.bulk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--accent); font-size: 12px; }
.bulk-toolbar .small-button { border: 0; background: #efeeff; color: var(--accent); }
.bulk-toolbar .danger { color: var(--danger); background: #fff0f2; }
.bulk-toolbar .text-button { margin-left: auto; color: var(--muted); }
.empty { padding: 70px 20px; text-align: center; font-size: 13px; color: var(--muted); }
.entry-menu { position: relative; }
.entry-menu > summary { display: grid; place-items: center; min-height: 34px; width: 30px; border-radius: 6px; color: #8e94a5; font-size: 20px; cursor: pointer; list-style: none; }
.entry-menu > summary::-webkit-details-marker { display: none; }
.entry-menu > summary:hover, .entry-menu[open] > summary { background: #f0f0f8; color: var(--accent); }
.menu-items { position: absolute; z-index: 5; right: 0; top: calc(100% + 7px); min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 5px; box-shadow: 0 12px 28px #202b4020; }
.menu-items button { display: block; width: 100%; padding: 11px 12px; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 12px; }
.menu-items button.danger { color: var(--danger); }
.menu-items button:hover { background: #f4f4fb; }
dialog { width: min(92vw, 400px); border: 1px solid var(--line); border-radius: 16px; padding: 26px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px #111d3430; }
dialog::backdrop { background: #111b364d; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { font-size: 18px; }
dialog .inline-actions { justify-content: center; }
.builder-dialog {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(540px, 100%); max-width: 100%;
  height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0;
}
.builder-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; }
.builder-header h2 { font-size: 21px; }
.builder-tabs { display: flex; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.builder-tabs button { padding: 14px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #969cae; font-size: 13px; }
.builder-tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.builder-content { padding: 6px 28px 32px; }
.builder-tabs[hidden] + .builder-content { border-top: 1px solid var(--line); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; }
.form-footer .primary { margin-left: auto; }
.full { width: 100%; margin-top: 24px; }
.followers-panel { margin-top: 23px; }
summary { cursor: pointer; color: #737b91; font-size: 12px; }
.followers-panel textarea { margin-top: 13px; }
.result-box { padding: 20px; margin-top: 26px; background: #f5f5ff; border: 1px solid #e7e4ff; border-radius: 10px; }
#result-url { font-size: 12px; }
.builder-dialog .inline-actions { justify-content: flex-start; }
.qr { background: white; padding: 10px; width: max-content; }
.qr img, .qr canvas { display: block; max-width: 100%; }
.large-qr { margin: 26px auto; }
.wrap { overflow-wrap: anywhere; }
#qr-url { background: #f7f8fb; padding: 12px; border-radius: 7px; font-size: 11px; }
.auth-panel, .launch-panel { max-width: 420px; padding: 34px; margin: 65px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px #212d4a05; }
.auth-panel h1 { font-size: 24px; margin-bottom: 26px; }
.auth-panel .primary { width: 100%; margin-top: 28px; }
#setup-help { margin: 7px 0 0; }
.launch-panel { text-align: center; padding: 40px 30px; }
.launch-panel h1 { font-size: 24px; overflow-wrap: anywhere; }
.launch-panel .button { width: 100%; margin-top: 16px; }
.launch-panel #launch { margin-top: 26px; }
.launch-panel details { margin-top: 23px; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.user-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.user-fields input { max-width: 200px; }
.user-fields label { margin: 0; }
.user-fields .check-line { margin-bottom: 12px; }
#user-form > .primary { margin-top: 24px; }
@media (max-width: 1160px) {
  body[data-view="workspace"], body[data-view="admin"] { padding-left: 184px; }
  body[data-view="workspace"] .app-header, body[data-view="admin"] .app-header { width: 184px; padding: 28px 18px 22px; }
  .brand { font-size: 15px; gap: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  main { padding: 34px 28px 50px; }
  .list-head, .entry { grid-template-columns: 15px minmax(0, 1fr) 85px 65px 164px; gap: 14px; }
  .user-row { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  body[data-view="workspace"], body[data-view="admin"] { padding-left: 0; }
  .app-header, body[data-view="workspace"] .app-header, body[data-view="admin"] .app-header { position: static; display: grid; grid-template-columns: 1fr auto; width: 100%; min-height: auto; padding: 20px; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); }
  #account, body[data-view="workspace"] #account, body[data-view="admin"] #account { display: contents; margin: 0; }
  .nav-links, body[data-view="workspace"] .nav-links, body[data-view="admin"] .nav-links { flex-direction: row; gap: 18px; grid-column: 1 / -1; grid-row: 2; padding-top: 20px; }
  body[data-view="workspace"] .nav-links a, body[data-view="admin"] .nav-links a { padding: 9px 12px; color: #868c9c; font-size: 12px; }
  .nav-links a.active { background: var(--accent-soft); color: var(--accent) !important; }
  .account-meta, body[data-view="workspace"] .account-meta, body[data-view="admin"] .account-meta { padding: 0; margin: 0; border: 0; gap: 12px; grid-column: 2; grid-row: 1; color: #8b91a1; }
  #expiry { max-width: 102px; font-size: 11px; }
  main { padding: 28px 20px 40px; }
  h1 { font-size: 25px; }
}
@media (max-width: 620px) {
  main { padding: 26px 16px 40px; }
  .app-header, body[data-view="workspace"] .app-header, body[data-view="admin"] .app-header { padding: 18px 20px 12px; }
  .brand { font-size: 15px; }
  .library-heading { margin-bottom: 22px; }
  .library-heading .primary { padding: 10px 13px; }
  .library-heading .primary > span { display: none; }
  .collection { padding: 0 16px 2px; border-radius: 12px; }
  .collection-toolbar { flex-wrap: wrap; gap: 12px; padding: 18px 0; }
  .search-field { width: 100%; }
  .collection-actions { width: 100%; justify-content: space-between; }
  .collection-actions select { width: 166px; }
  .list-head { grid-template-columns: 15px 1fr; }
  .list-head > span:not(:first-of-type) { display: none; }
  .entry { grid-template-columns: 15px minmax(0, 1fr) auto; gap: 12px; padding: 19px 0; }
  .entry-info { grid-column: 2; grid-row: 1; }
  .entry > input { grid-column: 1; grid-row: 1; }
  .entry > .inline-actions { grid-column: 2 / 4; grid-row: 3; justify-content: flex-start; }
  .entry-queue { grid-column: 2; grid-row: 2; flex-direction: row; gap: 8px; align-items: center; }
  .entry-queue .entry-meta { margin: 0; }
  .app-badge { grid-column: 3; grid-row: 1; }
  .entry-name { font-size: 14px; }
  .entry-meta { margin-top: 4px; }
  .entry .small-button { min-height: 36px; }
  .entry-menu > summary { min-height: 36px; }
  .panel { padding: 20px; }
  .collection { padding: 0 16px 2px; }
  .two { gap: 12px; }
  .three { grid-template-columns: 1fr; gap: 0; }
  .builder-header { padding: 22px 22px 18px; }
  .builder-tabs { padding: 0 22px; }
  .builder-content { padding: 4px 22px 28px; }
  .auth-panel, .launch-panel { padding: 28px 24px; margin: 28px auto; }
  .user-fields { display: grid; grid-template-columns: 1fr; }
  .user-fields input { max-width: none; }
}
