: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: 12px; padding: 2px 6px 18px; }
.logo {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
}
.head-text { min-width: 0; }
h1 { margin: 0; font-size: 17px; letter-spacing: .2px; white-space: nowrap; }
.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: 6px; }
.admin-chip {
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  background: #eef0ff;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.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; }

/* 网站按钮列表 */
.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;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.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);
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(20, 25, 50, .25);
}
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 span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #4a5063; }
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dfe3ee;
  border-radius: 11px;
  background: #fbfcff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.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.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); }

/* 轻提示 */
.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; }
}
