/* =========================================================
   词屿 Word Isle — 词库编辑（新增 / 修改 / 移除）
   加载在 styles.css、readability.css 之后，尺寸与全站可读性标准保持一致。
   ========================================================= */

/* 页头按钮组允许换行，三个按钮在窄屏不会挤在一起 */
.page-head-actions { flex-wrap: wrap; }

/* 按钮上的改动数量 */
.btn-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px;
  background: rgba(241, 105, 92, .16); color: var(--coral-deep);
  font-size: 11.5px; font-weight: 700; line-height: 1;
}

/* 卡片角标：自建 / 已改 */
.wc-tags { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.badge-custom { background: var(--blue-soft); color: #37687E; }
.badge-edited { background: var(--purple-soft); color: #664A82; }

/* ---------------- 词卡弹窗底部：编辑入口 ---------------- */
.wd-edit-bar {
  margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.wd-edit-note {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12.5px; color: var(--faint); line-height: 1.5;
}
.wd-edit-note .icon { width: 14px; height: 14px; flex: none; color: var(--muted); }
.wd-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wd-edit-actions .icon { width: 14px; height: 14px; }

/* ---------------- 单词表单 ---------------- */
.word-form-modal { width: min(820px, 100%); }
.word-form { padding: 33px 34px 26px; }

.wf-head h2 { font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.wf-head p { margin-top: 7px; font-size: 13.5px; color: var(--muted); line-height: 1.65; max-width: 560px; }

.wf-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px; margin-top: 22px;
}
.wf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wf-col-2 { grid-column: span 2; }
.wf-label { font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.wf-label i { font-style: normal; color: var(--coral-deep); margin-left: 2px; }
.wf-field small { font-size: 11.5px; color: var(--faint); line-height: 1.45; }

.wf-input {
  width: 100%; min-width: 0; height: 43px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); color: var(--ink);
  font-family: var(--font); font-size: 14.5px; line-height: 1.4;
  outline: none; appearance: none;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.wf-input:focus { border-color: var(--coral); background: var(--surface); }
.wf-input::placeholder { color: var(--faint); }
.wf-textarea { height: auto; min-height: 78px; padding: 11px 12px; line-height: 1.6; resize: vertical; }
select.wf-input {
  cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.wf-error { margin: 15px 0 0; min-height: 19px; font-size: 13.5px; color: var(--coral-deep); line-height: 1.5; }
.wf-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.wf-actions .btn { height: 42px; }
.wf-actions .icon { width: 15px; height: 15px; }

/* ---------------- 移除确认 ---------------- */
.confirm-modal { width: min(470px, 100%); }
.confirm-panel { padding: 36px 30px 26px; text-align: center; }
.confirm-icon {
  width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(211, 78, 67, .1); color: var(--coral-deep);
}
.confirm-icon .icon { width: 23px; height: 23px; }
.confirm-panel h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -.01em; word-break: break-word; }
.confirm-panel p { margin: 11px auto 0; max-width: 350px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 23px; flex-wrap: wrap; }
.confirm-actions .btn { height: 42px; }
.confirm-actions .icon { width: 15px; height: 15px; }

/* ---------------- 词库修改管理 ---------------- */
.word-manage-modal { width: min(720px, 100%); }
.manager-panel { padding: 33px 32px 24px; }
.manager-panel .settings-head h2 { font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: -.025em; }
.manager-panel .settings-head p { margin-top: 7px; font-size: 13.5px; color: var(--muted); line-height: 1.65; max-width: 540px; }

.mgr-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.mgr-summary span {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2);
  font-size: 12.5px; color: var(--muted);
}
.mgr-summary b { font-size: 15px; font-weight: 700; color: var(--ink); }

.mgr-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 2px; }

.mgr-section { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.mgr-section h3 {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em;
}
.mgr-section h3 .icon { width: 15px; height: 15px; color: var(--coral-deep); }
.mgr-section h3 small { font-size: 11.5px; font-weight: 500; color: var(--faint); }

.mgr-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.mgr-row:last-child { border-bottom: 0; }
.mgr-main { min-width: 0; }
.mgr-main strong { display: block; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.mgr-main small {
  display: block; margin-top: 2px; max-width: 400px;
  font-size: 12px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mgr-actions { display: flex; gap: 6px; flex: none; }
.mgr-btn {
  height: 31px; padding: 0 11px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-family: var(--font); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.mgr-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.mgr-btn.danger { color: var(--coral-deep); border-color: rgba(211, 78, 67, .22); background: rgba(211, 78, 67, .08); }
.mgr-btn.danger:hover { background: rgba(211, 78, 67, .15); }
.mgr-empty { padding: 8px 0; font-size: 12.5px; color: var(--faint); line-height: 1.6; }

/* ---------------- 批量选择 / 批量移除 ---------------- */
.pick-bar {
  position: sticky; top: 10px; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 12px; padding: 11px 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.pick-info { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.pick-info .icon { width: 15px; height: 15px; color: var(--mint-deep); }
.pick-info strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.pick-hint { color: var(--faint); font-size: 12px; }
.pick-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pick-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.pick-remove-n { font-variant-numeric: tabular-nums; }

/* 卡片上的勾选圈 */
.wc-pick {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 252, 245, .92); border: 1.5px solid rgba(24, 48, 45, .28);
  color: var(--btn-bg);
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.wc-pick .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.wc-pick.is-on { background: var(--mint); border-color: var(--mint-deep); transform: scale(1.06); }
.wc-pick.is-on .icon { color: #1F5A43; }
.word-card.is-selectable { cursor: pointer; position: relative; }
/* 勾选圈占据左上角，等级标签右移让位 */
.word-card.is-selectable .wc-level { left: 40px; }
.word-card.is-picked {
  border-color: var(--mint-deep);
  box-shadow: 0 0 0 2px rgba(78, 156, 120, .22), var(--shadow-sm);
}
.word-card.is-picked .wc-media img,
.word-card.is-picked .photo-empty { filter: saturate(.9) brightness(.97); }

/* 批量确认里的词条预览 */
.pick-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.pick-chip {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
}
.pick-chip.is-more { color: var(--faint); border-style: dashed; }

/* ---------------- 表单：配图 ---------------- */
.wf-photo { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.wf-photo-preview {
  display: flex; align-items: center; justify-content: center;
  width: 148px; height: 108px; flex: none; overflow: hidden;
  border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface-2);
}
.wf-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wf-photo-empty { text-align: center; font-size: 11.5px; line-height: 1.6; color: var(--faint); padding: 0 8px; }
.wf-photo-empty small { font-size: 10.5px; color: var(--faint); opacity: .8; }
.wf-photo-side { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.wf-photo-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.wf-photo-url { display: flex; flex-direction: column; gap: 5px; }
.wf-photo-url > span { font-size: 11.5px; color: var(--faint); }
.wf-photo-url input { font-size: 12.5px; }
.wf-photo-hint { font-size: 11px; line-height: 1.6; color: var(--faint); }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 700px) {
  .wf-grid { grid-template-columns: 1fr; gap: 13px; }
  .wf-col-2 { grid-column: span 1; }
  .word-form { padding: 27px 19px 22px; }
  .wf-head h2 { font-size: 26px; }
  .wf-actions .btn { flex: 1; }
  .manager-panel { padding: 27px 19px 20px; }
  .manager-panel .settings-head h2 { font-size: 26px; }
  .confirm-panel { padding: 31px 20px 22px; }
  .confirm-actions .btn { flex: 1; }
  .wd-edit-bar { flex-direction: column; align-items: stretch; }
  .wd-edit-actions { width: 100%; }
  .wd-edit-actions .btn { flex: 1; }
  .mgr-main small { max-width: 150px; }
  .mgr-actions { flex-direction: column; }
  .mgr-btn { height: 29px; }
  .pick-bar { position: static; padding: 11px 12px; }
  .pick-info { font-size: 12.5px; }
  .pick-actions .btn { flex: 1 1 auto; }
  .wf-photo { flex-direction: column; }
  .wf-photo-preview { width: 100%; height: 132px; }
}

