@import url("tokens.css");

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e8eaee;
  font-family: var(--font-ui);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
}

/* ============ 窗口外壳（无原生标题栏） ============ */
.win {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid rgba(24, 24, 27, 0.14);
  border-radius: 10px;
  box-shadow: 0 20px 48px rgba(24, 24, 27, 0.18), 0 2px 6px rgba(24, 24, 27, 0.06);
  overflow: hidden;
}

.titlebar {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.titlebar .app-mark { display: flex; align-items: center; gap: 7px; color: var(--text-muted); }
.titlebar .app-mark .name { font-size: var(--fs-12); font-weight: 600; color: var(--text); }
.titlebar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.win-controls { margin-left: auto; display: flex; height: 40px; }

.wc {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.wc:hover { background: rgba(24, 24, 27, 0.07); color: var(--text); }
.wc:active { background: rgba(24, 24, 27, 0.12); }
.wc.close:hover { background: var(--danger); color: #fff; }
.wc svg { width: 14px; height: 14px; display: block; }

/* ============ 通用 ============ */
.ic { width: 16px; height: 16px; display: block; }
.ic-14 { width: 14px; height: 14px; display: block; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: rgba(24, 24, 27, 0.06); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

.btn {
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-active); }

.btn.subtle { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-muted); }
.btn.subtle:hover { background: rgba(24, 24, 27, 0.06); color: var(--text); }

.btn.danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.4); }
.btn.danger:hover { background: var(--danger-subtle); }

.field {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-subtle);
  font-size: var(--fs-13);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.18);
  color: var(--text);
}
.field .ic { color: var(--text-subtle); flex: none; }
.field.focus .ic { color: var(--accent); }

.label {
  display: block;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* 头像 */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: var(--fs-14);
  font-weight: 600;
  flex: none;
  position: relative;
}
.avatar.sm { width: 28px; height: 28px; font-size: var(--fs-12); }
.avatar.lg { width: 56px; height: 56px; font-size: var(--fs-20); }
.avatar .online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--bg);
}

/* 徽标 */
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-11);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.badge.muted { background: var(--text-subtle); }

/* 滚动条：细，桌面感 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(24, 24, 27, 0.18);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(24, 24, 27, 0.3); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 焦点可见 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
