/* ============================================================
   Fly 生词本 - style.css
   由单文件 english-words.html 拆分而来 (2026-09-18)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --orange: #f97316;
    --orange-soft: #fff7ed;
    --green: #10b981;
    --green-soft: #ecfdf5;
    --red: #ef4444;
  }
  body {
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 28px 20px 60px;
    line-height: 1.6;
  }
  .wrap { max-width: 1080px; margin: 0 auto; }

  header { margin-bottom: 22px; }
  h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.3px; }
  header p { color: var(--muted); font-size: 14px; margin-top: 4px; }

  .sync-pill {
    display: inline-block; vertical-align: middle; margin-left: 10px;
    font-size: 12px; font-weight: 550; letter-spacing: 0; line-height: 1;
    padding: 5px 11px; border-radius: 999px; cursor: default;
    background: #eff6ff; color: #2563eb; transition: background .2s, color .2s;
  }
  .sync-pill.ok { background: #ecfdf5; color: #059669; }
  .sync-pill.off { background: #fef2f2; color: #dc2626; cursor: pointer; }
  .sync-pill.busy { background: #eff6ff; color: #2563eb; }
  /* 未解锁 / 密钥失效（点了会弹密钥输入框） */
  .sync-pill.locked { background: #fffbeb; color: #b45309; cursor: pointer; }

  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
  .stat {
    background: var(--card); border-radius: 14px; padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
  }
  .stat .label { font-size: 12.5px; color: var(--muted); }
  .stat .num { font-size: 26px; font-weight: 650; margin-top: 2px; }
  .stat.unknown .num { color: var(--orange); }
  .stat.known .num { color: var(--green); }
  .stat.total .num { color: var(--blue); }

  .progress-card {
    background: var(--card); border-radius: 14px; padding: 14px 18px 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06); margin-bottom: 20px;
  }
  .progress-card .top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
  .bar { height: 10px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
  .bar > div { height: 100%; width: 0; background: linear-gradient(90deg, #34d399, #10b981); border-radius: 999px; transition: width .45s ease; }

  .add-box {
    background: var(--card); border-radius: 16px; padding: 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06); margin-bottom: 22px;
  }
  .add-box h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
  .add-row { display: flex; gap: 10px; flex-wrap: wrap; }
  .add-row input {
    flex: 1 1 160px; min-width: 0; padding: 11px 13px; font-size: 14.5px;
    border: 1.5px solid var(--line); border-radius: 10px; outline: none;
    background: #fbfcfe; color: var(--text); font-family: inherit;
    transition: border-color .18s, background .18s;
  }
  .add-row input:focus { border-color: var(--blue); background: #fff; }
  .add-row input::placeholder { color: #9aa3b2; }
  .btn {
    border: none; cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 550;
    border-radius: 10px; padding: 11px 18px; transition: transform .12s, box-shadow .18s, background .18s;
  }
  .btn:active { transform: scale(.97); }
  .btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.28); }
  .btn-primary:hover { background: #1d4ed8; }
  .btn-ghost { background: #f1f3f8; color: #475467; }
  .btn-ghost:hover { background: #e7eaf1; }
  .hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
  .hint b { color: #475467; font-weight: 600; }

  .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  @media (max-width: 760px) { .panels { grid-template-columns: 1fr; } }

  .panel { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
  .panel-head { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1.5px dashed var(--line); }
  .panel-head .t { font-size: 15px; font-weight: 620; }
  .panel-head .c { margin-left: auto; font-size: 12.5px; color: var(--muted); background: #f3f5f9; padding: 2px 10px; border-radius: 999px; }
  .panel.unknown .panel-head .t { color: var(--orange); }
  .panel.known .panel-head .t { color: var(--green); }

  .empty { text-align: center; color: #a2abba; font-size: 13.5px; padding: 26px 10px; }
  .empty .sub { font-size: 12.5px; margin-top: 4px; }

  .controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
  .ctl {
    border: 1.5px solid var(--line); background: #fff; color: #374151; font-family: inherit;
    font-size: 13.5px; font-weight: 550; padding: 8px 15px; border-radius: 10px; cursor: pointer;
    transition: border-color .18s, background .18s, color .18s, transform .12s;
  }
  .ctl:hover { border-color: #cbd5e1; background: #f8fafc; }
  .ctl:active { transform: scale(.97); }
  .ctl.active { background: var(--blue-soft); border-color: #bfdbfe; color: var(--blue); }
  .ctl-hint { font-size: 12.5px; color: var(--muted); }

  .meaning-mask {
    filter: blur(6px); cursor: pointer; user-select: none;
    transition: filter .22s ease; border-radius: 4px;
  }
  .meaning-mask:hover { filter: blur(4px); }
  .meaning-mask.revealed { filter: none; user-select: auto; cursor: text; }

  .word-item {
    border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-bottom: 10px;
    transition: border-color .18s, box-shadow .18s; animation: pop .22s ease;
  }
  @keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .panel.unknown .word-item { background: var(--orange-soft); border-color: #fed7aa; }
  .panel.known .word-item { background: var(--green-soft); border-color: #a7f3d0; }
  .word-item:hover { box-shadow: 0 3px 10px rgba(16,24,40,.07); }

  .w-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .w-word { font-size: 16px; font-weight: 650; letter-spacing: .2px; }
  .w-ph { font-size: 12.5px; color: #8b94a3; font-family: "SF Mono", Consolas, monospace; }
  .w-mean { margin-top: 5px; word-break: break-word; }
  .sense { display: flex; gap: 7px; align-items: baseline; margin-top: 3px; }
  .sense .pos {
    flex: 0 0 auto; min-width: 30px; text-align: left; color: var(--blue);
    font-weight: 600; font-size: 12.5px; font-family: "SF Mono", Consolas, monospace;
  }
  .sense .def { flex: 1 1 auto; font-size: 13.5px; color: #4b5563; }
  .w-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
  .mini {
    border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 550;
    padding: 5px 11px; border-radius: 8px; transition: transform .12s, filter .18s;
  }
  .mini:active { transform: scale(.94); }
  .mini.ok { background: var(--green); color: #fff; }
  .mini.ok:hover { filter: brightness(1.06); }
  .mini.back { background: #fff; color: #475467; border: 1.5px solid var(--line); }
  .mini.back:hover { background: #f6f8fb; }
  .mini.edit { background: #fff; color: #475467; border: 1.5px solid var(--line); }
  .mini.del { background: transparent; color: var(--red); border: 1.5px solid #fecaca; }
  .mini.del:hover { background: #fef2f2; }

  .edit-row { display: flex; gap: 6px; flex-wrap: wrap; }
  .edit-row input {
    flex: 1 1 100px; min-width: 0; padding: 7px 9px; font-size: 13px;
    border: 1.5px solid #cbd5e1; border-radius: 8px; outline: none; font-family: inherit; background: #fff;
  }
  .edit-row input:focus { border-color: var(--blue); }
  .edit-row .mini { align-self: center; }

  .toast {
    position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
    background: #111827; color: #fff; font-size: 13.5px; padding: 10px 20px; border-radius: 999px;
    opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 99;
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }

  dialog {
    border: none; border-radius: 16px; padding: 20px; width: min(560px, 92vw);
    box-shadow: 0 20px 60px rgba(16,24,40,.22);
  }
  dialog::backdrop { background: rgba(15,23,42,.35); }
  dialog h3 { font-size: 16px; font-weight: 620; margin-bottom: 6px; }
  dialog p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
  dialog textarea {
    width: 100%; height: 170px; padding: 12px; font-size: 13.5px; line-height: 1.7;
    border: 1.5px solid var(--line); border-radius: 10px; outline: none; resize: vertical;
    font-family: inherit; background: #fbfcfe;
  }
  dialog textarea:focus { border-color: var(--blue); background: #fff; }
  dialog input {
    width: 100%; padding: 11px 13px; font-size: 14px; letter-spacing: .5px;
    border: 1.5px solid var(--line); border-radius: 10px; outline: none;
    font-family: inherit; background: #fbfcfe;
  }
  dialog input:focus { border-color: var(--blue); background: #fff; }
  /* 密钥解锁弹窗 */
  #dlg-unlock { width: min(430px, 92vw); }
  #dlg-unlock .unlock-hint { font-size: 12.5px; color: var(--red); min-height: 18px; margin-top: 10px; }
  #dlg-unlock .unlock-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.75; }
  #dlg-unlock .unlock-note b { color: #475467; font-weight: 600; }
  .dlg-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

  footer { text-align: center; color: #a2abba; font-size: 12.5px; margin-top: 34px; }
