/* =========================================================
   Lucky · 模块专属样式
   ========================================================= */

/* ---------- 月历网格（排班/日历共用） ---------- */
.cal { background: var(--c-surface); border-radius: var(--radius-lg); padding: 10px; box-shadow: var(--shadow-soft); }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; }
.cal-head .cal-title { font-size: 17px; font-weight: 800; margin: 0 auto; }
.cal-head .nav-btn { width: 38px; height: 38px; border-radius: var(--radius-pill); background: var(--c-surface-2); display: grid; place-items: center; font-size: 18px; }
.cal-week { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 4px; }
.cal-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--c-text-soft); padding: 4px 0; }
.cal-week span.wknd { color: var(--c-primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1.05; border-radius: var(--radius-sm);
  background: var(--c-surface-2); padding: 5px 4px; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px; min-height: 56px;
  transition: transform .12s, box-shadow var(--dur);
}
.cal-cell:active { transform: scale(.95); }
.cal-cell.empty { background: transparent; }
.cal-cell.other { opacity: .38; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--c-primary), var(--shadow-soft); }
.cal-cell.past .cal-day { color: var(--c-text-soft); }
.cal-cell.future .cal-day { color: var(--c-text); }
.cal-cell.selected { box-shadow: 0 0 0 3px var(--c-accent); }
.cal-cell.hit { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.cal-day { font-size: 13px; font-weight: 700; }
.cal-cell .lunar { font-size: 9.5px; color: var(--c-text-soft); line-height: 1; }
.cal-cell .tag-shift { font-size: 9.5px; font-weight: 700; line-height: 1.2; }
.cal-cell.bg-weekday { background: var(--c-weekday); }
.cal-cell.bg-holiday { background: var(--c-holiday); }
.cal-cell .cellsal { font-size: 9px; color: var(--c-text-soft); font-weight: 600; }
/* 角标 */
.cal-badges { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.cal-badges i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-blue { background: #6aa8ff; } .dot-gray { background: #aaa; } .dot-purple { background: #b79bff; }
.dot-orange { background: #ff9a3c; } .dot-green { background: #6fd29a; } .dot-pink { background: #ff8fb1; }
/* 悬浮气泡 */
.cal-tip { position: fixed; z-index: 70; background: var(--c-surface); border-radius: var(--radius-md); padding: 10px 12px; box-shadow: var(--shadow-pop); font-size: 12.5px; max-width: 80vw; animation: pop-in .2s; pointer-events: none; }

/* 紧凑模式 */
[data-compact="on"] .cal-cell { min-height: 42px; aspect-ratio: 1/0.78; padding: 3px; }

/* ---------- 排班月历色块 ---------- */
.shift-weekday .tag-shift { color: var(--c-accent); }
.shift-holiday .tag-shift { color: var(--c-primary); }

/* ---------- 薪资三色展示 ---------- */
.salary-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.salary-3 .col { text-align: center; border-radius: var(--radius-md); padding: 10px 4px; }
.salary-3 .col.est { background: var(--c-surface-2); }
.salary-3 .col.theo { background: var(--c-primary-soft); }
.salary-3 .col.real { background: var(--c-accent-soft); }
.salary-3 .col .v { font-size: 17px; font-weight: 800; }
.salary-3 .col.est .v { color: var(--c-text-soft); }
.salary-3 .col.theo .v { color: var(--c-primary); }
.salary-3 .col.real .v { color: var(--c-accent); }

/* ---------- 人物记录 ---------- */
.people-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px){ .people-grid { grid-template-columns: 1fr; } }
.pcard { background: var(--c-surface); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-soft); display: flex; gap: 12px; align-items: center; }
.pcard .avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(120deg,var(--c-primary-soft),var(--c-accent-soft)); display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; overflow: hidden; }
.pcard .avatar img { width: 100%; height: 100%; object-fit: cover; }
.pcard .pname { font-weight: 800; font-size: 15px; }
.pcard .prel { font-size: 12px; color: var(--c-text-soft); }
.stars { color: #ffc14d; font-size: 13px; letter-spacing: 1px; }
.rel-graph { background: var(--c-surface-2); border-radius: var(--radius-lg); padding: 18px; min-height: 220px; position: relative; overflow: hidden; }
.rel-node { position: absolute; transform: translate(-50%,-50%); background: var(--c-surface); border-radius: var(--radius-pill); padding: 6px 12px; box-shadow: var(--shadow-soft); font-size: 12px; font-weight: 700; }
.rel-node.center { background: var(--c-primary); color: #fff; }

/* ---------- 创作专区 ---------- */
.creat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.mod-tile { background: var(--c-surface); border-radius: var(--radius-lg); padding: 18px 14px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.mod-tile .mt-ico { font-size: 28px; }
.mod-tile .mt-title { font-weight: 800; }
.mod-tile .mt-sub { font-size: 11.5px; color: var(--c-text-soft); }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--c-surface-2); border-radius: var(--radius-md); margin-bottom: 8px; }
.todo-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--c-primary); display: grid; place-items: center; flex: 0 0 auto; font-size: 14px; color: #fff; }
.todo-check.done { background: var(--c-success); border-color: var(--c-success); }
.pri-high { border-left: 4px solid var(--c-danger); }
.pri-mid { border-left: 4px solid var(--c-warn); }
.pri-low { border-left: 4px solid var(--c-accent); }
.doodle-canvas { width: 100%; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-inset); touch-action: none; display: block; }
.doodle-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: var(--shadow-soft); }
.swatch.on { outline: 3px solid var(--c-primary); outline-offset: 1px; }
.editor-toolbar { display: flex; gap: 5px; flex-wrap: wrap; padding: 8px; background: var(--c-surface-2); border-radius: var(--radius-md); margin-bottom: 8px; overflow-x: auto; }
.editor-toolbar button { min-width: 34px; height: 34px; border-radius: 10px; background: var(--c-surface); box-shadow: var(--shadow-inset); font-size: 14px; font-weight: 700; }
.richeditor { min-height: 180px; border-radius: var(--radius-md); background: var(--c-surface-2); padding: 12px; outline: none; line-height: 1.6; }
/* 简易表格 */
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table td, .mini-table th { border: 1px solid var(--c-line); padding: 8px; min-width: 60px; border-radius: 6px; }
.mini-table td:focus { outline: 2px solid var(--c-primary); }

/* ---------- 计算器 ---------- */
.calc-screen { background: var(--c-surface-2); border-radius: var(--radius-md); padding: 16px; text-align: right; margin-bottom: 12px; min-height: 78px; display: flex; flex-direction: column; justify-content: center; }
.calc-expr { font-size: 14px; color: var(--c-text-soft); min-height: 18px; word-break: break-all; }
.calc-result { font-size: 32px; font-weight: 800; word-break: break-all; }
.calc-keys { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.calc-keys button { height: 56px; border-radius: var(--radius-md); background: var(--c-surface); box-shadow: var(--shadow-soft); font-size: 19px; font-weight: 700; }
.calc-keys button.op { background: var(--c-primary-soft); color: var(--c-primary); }
.calc-keys button.eq { background: linear-gradient(120deg,var(--c-primary),var(--c-accent)); color: #fff; }
.calc-keys button.fn { background: var(--c-surface-2); color: var(--c-text-soft); }
.calc-keys button:active { animation: press .2s var(--ease); }
.formula-item { padding: 12px 14px; background: var(--c-surface-2); border-radius: var(--radius-md); margin-bottom: 8px; }
.formula-item .fi-name { font-weight: 700; }
.formula-item .fi-expr { font-size: 12px; color: var(--c-text-soft); font-family: monospace; word-break: break-all; }

/* ---------- 设置 ---------- */
.theme-swatches { display: flex; gap: 12px; }
.theme-swatch { flex: 1; border-radius: var(--radius-md); padding: 14px 8px; text-align: center; font-weight: 700; font-size: 12px; box-shadow: var(--shadow-soft); border: 3px solid transparent; }
.theme-swatch.on { border-color: var(--c-primary); }
.theme-swatch .sw-bars { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.theme-swatch .sw-bars i { flex: 1; }

/* ---------- 搜索 ---------- */
.search-overlay .overlay-card { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.gsearch-input { flex: 1; padding: 12px 16px; border-radius: var(--radius-pill); background: var(--c-surface-2); border: 2px solid transparent; outline: none; }
.search-head { display: flex; gap: 8px; align-items: center; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 2px; border-bottom: 1px solid var(--c-line); }
.search-result { padding-top: 8px; }
.sr-group-title { font-size: 12px; font-weight: 700; color: var(--c-text-soft); margin: 12px 4px 6px; display:flex; align-items:center; gap:6px; }
.sr-group-title .cnt { background: var(--c-surface-2); padding: 1px 8px; border-radius: 999px; font-size: 11px; }

/* 时间线 */
.timeline { border-left: 2px solid var(--c-line); margin-left: 8px; padding-left: 16px; }
.tl-item { position: relative; padding: 8px 0; }
.tl-item::before { content:""; position: absolute; left: -23px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-primary); box-shadow: 0 0 0 3px var(--c-surface); }

/* 进度环/百分比 */
.mini-bar { height: 8px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(120deg,var(--c-primary),var(--c-accent)); border-radius: 999px; }

/* ---------- 悬浮计算器 ---------- */
.floatcalc-fab {
  position: fixed; right: 16px; bottom: 84px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px;
  background: var(--c-primary); color: #fff;
  box-shadow: 0 8px 22px rgba(255,143,177,.45); border: none;
}
.floatcalc-fab:active { animation: press .3s var(--ease); }
.floatcalc {
  position: fixed; right: 16px; bottom: 84px; z-index: 61; width: 248px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft); padding: 10px; border: 1px solid var(--c-line);
}
.fc-bar { display: flex; align-items: center; justify-content: space-between; cursor: grab; user-select: none; }
.fc-bar:active { cursor: grabbing; }
.fc-title { font-size: 13px; font-weight: 700; }
.fc-x { width: 26px; height: 26px; border-radius: 8px; background: var(--c-surface-2); font-size: 14px; color: var(--c-text-2); }
.fc-screen { background: var(--c-surface-2); border-radius: var(--radius); padding: 8px 10px; text-align: right; }
.fc-expr { font-size: 12px; color: var(--c-text-soft); min-height: 15px; word-break: break-all; }
.fc-val { font-size: 22px; font-weight: 800; color: var(--c-text); word-break: break-all; }
.fc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fc-key {
  padding: 11px 0; border-radius: var(--radius); background: var(--c-surface-2);
  font-size: 16px; font-weight: 700; color: var(--c-text);
  box-shadow: var(--shadow-inset); border: none;
}
.fc-key:active { transform: scale(.95); }
.fc-key.op { background: color-mix(in srgb, var(--c-primary) 22%, var(--c-surface-2)); color: var(--c-primary); }
.fc-key.clr { color: #e06b8a; }
.fc-key.eq { background: var(--c-primary); color: #fff; box-shadow: 0 4px 12px rgba(255,143,177,.4); }
