/* ============================================================
 * HT Editor · 账户系统样式（ht-auth.css）
 * ------------------------------------------------------------
 * 全部类名以 hta- 前缀，复用 styles.css 的主题变量与
 * .menu-user / .avatar 的观感，适配 6 套主题（深色/浅色）。
 * ============================================================ */

/* ---------------- 顶栏账号入口 ---------------- */
.menu-user.hta-user {
  position: relative;
  cursor: pointer;
}
.hta-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: var(--radius);
  transition: background .15s;
}
.hta-user-btn:hover { background: var(--bg-elevated); }
.hta-user-name {
  font-size: 12.5px;
  color: var(--text);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hta-user-guest { color: var(--text-dim); }
.hta-user .avatar { font-weight: 600; flex-shrink: 0; }
.hta-user .hta-avatar-guest {
  background: var(--bg-elevated);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.hta-user .hta-avatar-guest svg { width: 13px; height: 13px; display: block; }
.hta-user-caret-wrap { display: grid; place-items: center; }
.hta-user-caret {
  width: 11px; height: 11px;
  color: var(--text-dim);
  transition: transform .18s;
}
.hta-user.open .hta-user-caret { transform: rotate(180deg); }

/* 下拉菜单（观感对齐 .theme-menu） */
.menu-user.hta-user .hta-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 184px;
  z-index: 400;
  display: none;
}
.hta-user.open .hta-menu { display: block; animation: hta-pop .16s ease-out; }
@keyframes hta-pop { from { opacity: 0; transform: translateY(-6px); } }

.hta-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.hta-menu-item:hover { background: var(--bg-elevated); }
.hta-menu-item.danger { color: var(--danger); }
.hta-menu-item.danger:hover { background: rgba(255, 92, 92, .12); }
.hta-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ---------------- 全屏遮罩与卡片 ---------------- */
.hta-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1200;
}
:root[data-theme="white"] .hta-mask,
:root[data-theme="bilibili"] .hta-mask,
:root[data-theme="sakura"] .hta-mask,
:root[data-theme="ink"] .hta-mask {
  background: rgba(20, 20, 26, .38);
}

.hta-card {
  position: relative;
  width: 360px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hta-card-wide { width: 800px; }

.hta-card h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.hta-card-head { display: flex; flex-direction: column; gap: 5px; }
.hta-sub { font-size: 12px; color: var(--text-dim); line-height: 1.55; }

.hta-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.hta-close:hover { background: var(--bg-elevated); color: var(--text); }

/* ---------------- 标签页 ---------------- */
.hta-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.hta-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  user-select: none;
  transition: background .15s, color .15s;
}
.hta-tab:hover { color: var(--text); }
.hta-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------------- 表单 ---------------- */
.hta-form { display: flex; flex-direction: column; gap: 12px; }
.hta-field { display: flex; flex-direction: column; gap: 6px; }
.hta-field label { font-size: 12px; color: var(--text-dim); }
.hta-field input {
  width: 100%;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.hta-field input::placeholder { color: var(--text-mute); }
.hta-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------------- 按钮 ---------------- */
.hta-btn {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.hta-btn:hover { border-color: var(--border-strong); }
.hta-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.hta-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.hta-btn-danger { color: var(--danger); }
.hta-btn-danger:hover { background: rgba(255, 92, 92, .12); border-color: var(--danger); }
.hta-btn:disabled { opacity: .6; cursor: not-allowed; }
.hta-btn-block { width: 100%; }
.hta-btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ---------------- 提示信息 ---------------- */
.hta-msg {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: none;
}
.hta-msg.show { display: block; }
.hta-msg-error {
  background: rgba(255, 92, 92, .12);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, .35);
}
.hta-msg-success {
  background: rgba(46, 204, 113, .14);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, .35);
}

.hta-foot {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.65;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* ---------------- 账号信息 ---------------- */
.hta-info {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hta-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.hta-info-row:last-child { border-bottom: none; }
.hta-info-row .k { color: var(--text-dim); flex-shrink: 0; }
.hta-info-row .v { color: var(--text); text-align: right; word-break: break-all; }

.hta-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* ---------------- 管理员面板 ---------------- */
.hta-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 26px;
}
.hta-admin-head > div { display: flex; flex-direction: column; gap: 4px; }
.hta-admin-head .hta-count {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 4px;
}
.hta-admin-bar { display: flex; justify-content: flex-end; }
.hta-admin-foot { display: flex; justify-content: flex-end; }

.hta-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 52vh;
}
.hta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.hta-table th,
.hta-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.hta-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-panel);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
}
.hta-table tbody tr:hover td { background: var(--bg-elevated); }
.hta-table tbody tr:last-child td { border-bottom: none; }
.hta-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.hta-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.hta-tag-admin { background: var(--primary-soft); color: var(--primary); }
.hta-tag-user { background: var(--bg-elevated); color: var(--text-dim); }
.hta-tag-ok { background: rgba(46, 204, 113, .15); color: var(--success); }
.hta-tag-off { background: rgba(255, 92, 92, .15); color: var(--danger); }

/* ---------------- 管理员：新增账号表单 ---------------- */
.hta-create {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin: 4px 0 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
}
.hta-create input,
.hta-create select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  padding: 5px 8px;
  min-width: 150px;
  outline: none;
}
.hta-create input:focus,
.hta-create select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

/* ---------------- 轻提示 ---------------- */
.hta-toasts {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 1400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.hta-toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: hta-toast-in .18s ease-out;
}
.hta-toast-success { border-color: rgba(46, 204, 113, .5); color: var(--success); }
.hta-toast-danger { border-color: rgba(255, 92, 92, .5); color: var(--danger); }
@keyframes hta-toast-in { from { opacity: 0; transform: translateY(-8px); } }