:root {
  --ink: #1b1f2a;
  --muted: #8a90a0;
  --line: #e9ecf3;
  --accent: #4f46e5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 82% -10%, #e6e9ff 0%, transparent 60%),
    radial-gradient(900px 520px at 8% 110%, #e6f6f0 0%, transparent 55%),
    #f5f6fa;
  -webkit-font-smoothing: antialiased;
}
.shell { display: flex; min-height: 100vh; }

/* 左侧栏 */
.sidebar {
  width: 368px;
  flex: 0 0 368px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(20, 25, 40, .06);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 18px; }
.logo {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-text { flex: 1; min-width: 0; }
h1 {
  margin: 0; font-size: 17px; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.me-btn {
  display: flex; align-items: center; gap: 6px;
  max-width: 112px;
  padding: 3px 5px 3px 3px;
  border: 0; border-radius: 999px;
  background: transparent;
  font: inherit; color: #4a5063;
  cursor: pointer;
}
.me-btn:hover { background: #f1f3f9; }
.head-avatar {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.me-name {
  font-size: 12.5px;
  max-width: 62px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-btn {
  border: 0; background: none;
  padding: 4px 2px;
  font: inherit; font-size: 12px;
  color: #6b7183;
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.link-btn.danger:hover { color: #d9364b; }

/* 网站按钮列表 */
.site-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -4px;
  padding: 4px 4px 12px;
}
.site-list::-webkit-scrollbar { width: 8px; }
.site-list::-webkit-scrollbar-thumb { background: #dde1ec; border-radius: 8px; }
.site-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.site-item:hover {
  transform: translateY(-1px);
  border-color: #dfe3ef;
  box-shadow: 0 10px 22px rgba(23, 29, 52, .08);
}
.site-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.avatar img, .avatar-lg img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.site-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.site-name {
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-domain {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-actions { display: flex; gap: 1px; flex: 0 0 auto; opacity: 0; transition: opacity .15s; }
.site-item:hover .site-actions,
.site-item:focus-within .site-actions { opacity: 1; }
.act {
  width: 26px; height: 26px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: #9aa0b0;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.act:hover { background: #f1f3f9; color: #3b4256; }
.act.danger:hover { background: #ffeef0; color: #d9364b; }
.act:disabled { opacity: .28; cursor: default; background: transparent; color: #c3c7d2; }

/* 空状态 */
.empty {
  margin: 6px 4px;
  padding: 30px 18px;
  border: 1.5px dashed #dfe3ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, .5);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.empty .empty-title { display: block; font-size: 14px; font-weight: 600; color: #5b6175; margin-bottom: 2px; }

/* 添加按钮 */
.add-btn {
  margin-top: 8px;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px;
  border: 1.5px dashed #cfd5e6;
  border-radius: 14px;
  background: rgba(255, 255, 255, .6);
  color: var(--accent);
  font: inherit;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.add-btn:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .10);
}

/* 右侧装饰区 */
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.stage-inner { text-align: center; user-select: none; }
.stage-date { margin: 0; font-size: 13px; color: #9aa0b6; letter-spacing: .18em; }
.stage-title {
  margin: 16px 0 0;
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 800;
  letter-spacing: .08em;
  color: #e0e3f0;
  background: linear-gradient(180deg, #dfe2f0, #eef0f8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stage-tip { margin: 16px 0 0; font-size: 13px; color: #b3b8c9; }

/* 弹窗 */
dialog {
  width: min(430px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(20, 25, 50, .25);
}
#myDialog { width: min(460px, 94vw); }
#usersDialog { width: min(600px, 94vw); }
dialog::backdrop { background: rgba(20, 24, 40, .38); backdrop-filter: blur(3px); }
.dlg { padding: 24px 24px 20px; margin: 0; }
.dlg h2 { margin: 0 0 4px; font-size: 17px; }
.dlg .hint { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field.tight { margin-bottom: 10px; }
.field span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #4a5063; }
.dlg input[type="text"],
.dlg input[type="password"],
.dlg input[type="date"],
.dlg select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dfe3ee;
  border-radius: 11px;
  background: #fbfcff;
  font: inherit;
  font-size: 14px;
  color: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dlg input[type="text"]:focus,
.dlg input[type="password"]:focus,
.dlg input[type="date"]:focus,
.dlg select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.inline-row { display: flex; align-items: center; gap: 8px; }
.inline-row input { flex: 1; min-width: 0; }
.inline-row .btn { flex: 0 0 auto; }
.check {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 8px;
  font-size: 13px; color: #4a5063;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.error { min-height: 18px; margin: -4px 0 10px; font-size: 12.5px; color: #d9364b; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.btn {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.small { padding: 8px 13px; font-size: 13px; }
.btn.ghost { background: #f3f5fa; color: #4a5063; }
.btn.ghost:hover { background: #eceff7; }
.btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 8px 16px rgba(79, 70, 229, .24);
}
.btn.primary:hover { filter: brightness(1.05); }

/* 我的 */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 12px 0 6px; }
.avatar-lg {
  width: 68px; height: 68px; flex: 0 0 68px;
  border: 0; padding: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
  cursor: pointer;
}
.avatar-lg:hover { filter: brightness(.96); }
.profile-meta { min-width: 0; }
.profile-name { margin: 0; font-size: 16px; font-weight: 700; }
.profile-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.section-title { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: #4a5063; }
.logo-row { margin-top: 6px; }
.logo-preview {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  display: grid; place-items: center;
  color: #fff;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 账号管理 */
.users-list { max-height: 50vh; overflow-y: auto; margin: 2px 0 8px; padding-right: 2px; }
.users-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0; margin: 0; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: 0; }
.user-info { flex: 1; min-width: 0; }
.user-top { display: flex; align-items: center; gap: 6px; }
.user-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.user-badge {
  font-size: 11px; line-height: 1.6;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f3f9; color: #6b7183;
  white-space: nowrap;
}
.user-badge.super { background: #eef0ff; color: var(--accent); }
.user-badge.bad { background: #ffeef0; color: #d9364b; }
.user-badge.self { background: #e9f7ef; color: #1f8f5f; }
.user-actions { display: flex; gap: 2px; flex: 0 0 auto; }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(27, 31, 42, .92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 99;
  box-shadow: 0 12px 30px rgba(20, 25, 50, .25);
}

@media (hover: none) {
  .site-actions { opacity: 1; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { width: 100%; height: auto; min-height: 100vh; position: static; border-right: 0; }
  .stage { display: none; }
}
