/* ============================================================
 *  左下角账号 / 登录框（account-box）
 *  样式命名统一 fkacc- 前缀，避免和站点既有类名冲突。
 *  配色跟随站点主题：默认深色，html[data-theme="light"] 时切浅色
 *  （与 static/index.html 的白天/黑夜切换同一套机制）
 * ============================================================ */

.fkacc,
.fkacc * { box-sizing: border-box; }

.fkacc {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9000;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  color-scheme: dark;          /* 让原生 select 的下拉在深色下也正常 */

  /* 深色（默认） */
  --fkacc-card: #17212b;
  --fkacc-card2: #1d2937;
  --fkacc-line: #24333f;
  --fkacc-tx: #ffffff;
  --fkacc-sub: #7d8b99;
  --fkacc-acc: #e67e22;
  --fkacc-acc2: #f39c12;
  --fkacc-err: #e74c3c;
  --fkacc-ok: #4caf50;
  --fkacc-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}

html[data-theme="light"] .fkacc {
  color-scheme: light;
  --fkacc-card: #ffffff;
  --fkacc-card2: #f4f6fa;
  --fkacc-line: #e2e6ee;
  --fkacc-tx: #1c1f26;
  --fkacc-sub: #6a7381;
  --fkacc-acc: #e67e22;
  --fkacc-acc2: #d97b1e;
  --fkacc-err: #d93025;
  --fkacc-ok: #0f9d58;
  --fkacc-shadow: 0 10px 30px rgba(20, 30, 50, .16);
}

/* ---------- 头部（常驻可见） ---------- */
.fkacc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 168px;
  max-width: 260px;
  padding: 6px 11px 6px 6px;
  background: var(--fkacc-card);
  border: 1px solid var(--fkacc-line);
  border-radius: 999px;
  box-shadow: var(--fkacc-shadow);
  cursor: pointer;
  color: var(--fkacc-tx);
  font: inherit;
  text-align: left;
  transition: border-color .16s, transform .16s, background .16s;
}
.fkacc-head:hover { border-color: var(--fkacc-acc); }
.fkacc-head:active { transform: scale(.98); }

.fkacc-ava {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #888;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}
.fkacc-head .fkacc-me { min-width: 0; flex: 1 1 auto; }
.fkacc-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fkacc-sub {
  display: block;
  font-size: 11px;
  color: var(--fkacc-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fkacc-live {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fkacc-ok);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, .18);
}
.fkacc-caret {
  flex: 0 0 auto;
  color: var(--fkacc-sub);
  font-size: 10px;
  transition: transform .18s;
}
.fkacc.open .fkacc-caret { transform: rotate(180deg); }

/* ---------- 面板（向上展开） ---------- */
.fkacc-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 252px;
  max-width: calc(100vw - 32px);
  background: var(--fkacc-card);
  border: 1px solid var(--fkacc-line);
  border-radius: 14px;
  box-shadow: var(--fkacc-shadow);
  padding: 12px;
  display: none;
  color: var(--fkacc-tx);
}
.fkacc.open .fkacc-panel { display: block; }

.fkacc-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fkacc-title small {
  font-weight: 400;
  font-size: 11px;
  color: var(--fkacc-sub);
}

.fkacc input {
  width: 100%;
  height: 36px;
  margin-bottom: 8px;
  padding: 0 12px;
  background: var(--fkacc-card2);
  border: 1px solid var(--fkacc-line);
  border-radius: 9px;
  color: var(--fkacc-tx);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.fkacc input::placeholder { color: var(--fkacc-sub); }
.fkacc input:focus { border-color: var(--fkacc-acc); }

.fkacc-btn {
  width: 100%;
  height: 36px;
  background: var(--fkacc-acc);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.fkacc-btn:hover { background: var(--fkacc-acc2); }
.fkacc-btn:active { transform: scale(.98); }
.fkacc-btn:disabled { opacity: .55; cursor: default; }

.fkacc-msg {
  min-height: 16px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--fkacc-err);
  text-align: center;
  word-break: break-all;
}
.fkacc-msg.ok { color: var(--fkacc-ok); }
.fkacc-tip {
  margin-top: 4px;
  font-size: 11px;
  color: var(--fkacc-sub);
  text-align: center;
}

/* ---------- 「登录有效期」选择 ---------- */
.fkacc-rem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 10px;
  font-size: 12.5px;
  color: var(--fkacc-sub);
  cursor: pointer;
  user-select: none;
}
.fkacc-rem > span {
  flex: 0 0 auto;
  white-space: nowrap;         /* 标签别被挤成两行 */
}
.fkacc-rem select {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 0 6px 0 8px;
  background: var(--fkacc-card2);
  border: 1px solid var(--fkacc-line);
  border-radius: 8px;
  color: var(--fkacc-tx);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  outline: none;
}
.fkacc-rem select:focus { border-color: var(--fkacc-acc); }

/* ---------- 已登录菜单 ---------- */
.fkacc-who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--fkacc-line);
}
.fkacc-who .fkacc-ava { width: 36px; height: 36px; font-size: 16px; }
.fkacc-who .fkacc-name { font-size: 14px; }
.fkacc-kv {
  display: block;              /* 每行一条：FKID 一行、有效期一行，别挤在一起换行 */
  font-size: 11.5px;
  color: var(--fkacc-sub);
  font-variant-numeric: tabular-nums;
}
.fkacc-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 3px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fkacc-tx);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.fkacc-item:hover { background: var(--fkacc-card2); }
.fkacc-item.danger { color: var(--fkacc-err); }

/* ---------- 紧凑模式（页面本身左下角有内容时用） ---------- */
.fkacc[data-compact="1"] .fkacc-head { min-width: 0; padding: 5px; }
.fkacc[data-compact="1"] .fkacc-me,
.fkacc[data-compact="1"] .fkacc-caret,
.fkacc[data-compact="1"] .fkacc-live { display: none; }

/* ---------- 小屏 ---------- */
@media (max-width: 600px) {
  .fkacc { left: 10px; bottom: 10px; }
  .fkacc-head { min-width: 0; max-width: calc(100vw - 20px); }
  .fkacc-panel { width: 236px; }
  .fkacc input { font-size: 16px; } /* 防 iOS 聚焦缩放 */
}

/* 背单词入口右侧的小字（今日 X · 连续 Y 天） */
.fkacc-tip2 {
  margin-left: auto;
  font-size: 11px;
  color: var(--fkacc-sub);
  white-space: nowrap;
}
.fkacc-tip2-hot { color: var(--fkacc-acc); font-weight: 600; }
